/** * 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); } /**
Response response = chain.proceed(chain.request()); if (!response.isSuccessful()) { String content = errorBody(response.body()); AzureJacksonAdapter jacksonAdapter = new AzureJacksonAdapter(); CloudError cloudError = jacksonAdapter.deserialize(content, CloudError.class); matcher = pattern.matcher(cloudError.message()); matcher.find(); Provider provider = registerProvider(matcher.group(1), resourceManager); while (provider.registrationState().equalsIgnoreCase("Unregistered") || provider.registrationState().equalsIgnoreCase("Registering")) {
/** * 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); } /**
Response response = chain.proceed(chain.request()); if (!response.isSuccessful()) { String content = errorBody(response.body()); AzureJacksonAdapter jacksonAdapter = new AzureJacksonAdapter(); CloudError cloudError = jacksonAdapter.deserialize(content, CloudError.class); matcher = pattern.matcher(cloudError.message()); matcher.find(); Provider provider = registerProvider(matcher.group(1), resourceManager); while (provider.registrationState().equalsIgnoreCase("Unregistered") || provider.registrationState().equalsIgnoreCase("Registering")) {
/** * 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()) .withInterceptor(new ProviderRegistrationInterceptor(credentials)) .build(), subscriptionId); } /**
/** * 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()) .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 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 ResourceManager that exposes resource management API entry points. * * @param credentials the credentials to use * @return the ResourceManager instance */ public static ResourceManager.Authenticated authenticate(AzureTokenCredentials credentials) { return new AuthenticatedImpl(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()); }
/** * 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 CDN Manager that exposes CDN manager management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID * @return the CDN Manager */ public static CdnManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new CdnManager(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 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 CDN Manager that exposes CDN manager management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID * @return the CDN Manager */ public static CdnManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new CdnManager(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 CosmosDBManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { return new CosmosDBManager(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); }