protected RestClient buildRestClient(AzureTokenCredentials credentials, AzureEnvironment.Endpoint endpoint) { RestClient client = restClientBuilder .withBaseUrl(credentials.environment(), endpoint) .withCredentials(credentials) .withInterceptor(new ResourceManagerThrottlingInterceptor()) .build(); if (client.httpClient().proxy() != null) { credentials.withProxy(client.httpClient().proxy()); } return client; }
private GraphRbacManager(RestClient restClient, String tenantId) { String graphEndpoint = AzureEnvironment.AZURE.graphEndpoint(); if (restClient.credentials() instanceof AzureTokenCredentials) { graphEndpoint = ((AzureTokenCredentials) restClient.credentials()).environment().graphEndpoint(); } this.graphRbacManagementClient = new GraphRbacManagementClientImpl( restClient.newBuilder().withBaseUrl(graphEndpoint).build()).withTenantID(tenantId); this.authorizationManagementClient = new AuthorizationManagementClientImpl(restClient); this.tenantId = tenantId; }
protected RestClient buildRestClient(AzureTokenCredentials credentials, AzureEnvironment.Endpoint endpoint) { RestClient client = restClientBuilder .withBaseUrl(credentials.environment(), endpoint) .withCredentials(credentials) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .withInterceptor(new ResourceManagerThrottlingInterceptor()) .build(); if (client.httpClient().proxy() != null) { credentials.withProxy(client.httpClient().proxy()); } return client; }
protected RestClient buildRestClient(AzureTokenCredentials credentials, AzureEnvironment.Endpoint endpoint) { RestClient client = restClientBuilder .withBaseUrl(credentials.environment(), endpoint) .withCredentials(credentials) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .withInterceptor(new ResourceManagerThrottlingInterceptor()) .build(); if (client.httpClient().proxy() != null) { credentials.withProxy(client.httpClient().proxy()); } return client; }
/** * Creates an instance of AuthorizationManager that exposes Authorization resource management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID * @return the AuthorizationManager */ public static AuthorizationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new AuthorizationManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .build(), subscriptionId); } /**
/** * Creates an instance of LocksManager that exposes Authorization resource management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID * @return the LocksManager */ public static LocksManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new LocksManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .build(), subscriptionId); } /**
/** * Creates an instance of ResourcesManager that exposes Resources resource management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID * @return the ResourcesManager */ public static ResourcesManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new ResourcesManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .build(), subscriptionId); } /**
/** * Creates an instance of AppServiceManager that exposes Web resource management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID * @return the AppServiceManager */ public static AppServiceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new AppServiceManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .build(), subscriptionId); } /**
/** * Creates an instance of BatchAIManager that exposes BatchAI resource management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID * @return the BatchAIManager */ public static BatchAIManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new BatchAIManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .build(), subscriptionId); } /**
/** * Creates an instance of MonitorManager that exposes Monitor API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID * @return the MonitorManager */ public static MonitorManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new MonitorManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .build(), subscriptionId); } /**
/** * Creates an instance of MSIManager that exposes Managed Service Identity (MSI) resource management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID * @return the MSIManager */ public static MSIManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new MSIManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .withInterceptor(new ResourceManagerThrottlingInterceptor()) .build(), subscriptionId); }
/** * Creates an instance of TrafficManager that exposes traffic manager management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID * @return the TrafficManager */ public static TrafficManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new TrafficManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .withInterceptor(new ResourceManagerThrottlingInterceptor()) .build(), subscriptionId); }
/** * Creates an instance of NetworkManager that exposes network resource management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID * @return the NetworkManager */ public static NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new NetworkManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .withInterceptor(new ResourceManagerThrottlingInterceptor()) .build(), subscriptionId); }
/** * Creates an instance of ComputeManager that exposes Compute resource management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription * @return the ComputeManager */ public static ComputeManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new ComputeManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .withInterceptor(new ResourceManagerThrottlingInterceptor()) .build(), subscriptionId); }
/** * Creates an instance of DnsZoneManager that exposes DNS zone management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID * @return the DnsZoneManager */ public static DnsZoneManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new DnsZoneManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .withInterceptor(new ResourceManagerThrottlingInterceptor()) .build(), subscriptionId); }
/** * Creates an instance of ContainerRegistryManager that exposes Registry resource management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription * @return the SearchServiceManager */ public static SearchServiceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new SearchServiceManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .withInterceptor(new ResourceManagerThrottlingInterceptor()) .build(), subscriptionId); }
/** * Creates an instance of ServiceBusManager that exposes servicebus management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID * @return the ServiceBusManager */ public static ServiceBusManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new ServiceBusManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .withInterceptor(new ResourceManagerThrottlingInterceptor()) .build(), subscriptionId); }
/** * Creates an instance of ContainerInstanceManager that exposes resource management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription * @return the ContainerInstanceManager */ public static ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new ContainerInstanceManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .withInterceptor(new ResourceManagerThrottlingInterceptor()) .build(), subscriptionId); }
/** * Creates an instance of ServiceBusManager that exposes servicebus management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID * @return the ServiceBusManager */ public static ServiceBusManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new ServiceBusManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .withInterceptor(new ResourceManagerThrottlingInterceptor()) .build(), subscriptionId); }
/** * Creates an instance of KeyVaultManager that exposes KeyVault resource management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID * @return the KeyVaultManager */ public static KeyVaultManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new KeyVaultManager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .withInterceptor(new ResourceManagerThrottlingInterceptor()) .build(), credentials.domain(), subscriptionId); }