@Bean @ConditionalOnMissingBean public Azure azure(AzureProperties azureProperties) throws IOException { CredentialsProvider credentialsProvider = new DefaultCredentialsProvider(azureProperties); ApplicationTokenCredentials credentials = credentialsProvider.getCredentials(); TelemetryCollector.getInstance().setSubscription(credentials.defaultSubscriptionId()); RestClient restClient = 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()).withUserAgent(SPRING_CLOUD_USER_AGENT) .build(); return Azure.authenticate(restClient, credentials.domain()).withDefaultSubscription(); }
@Bean @ConditionalOnMissingBean public Azure azure(AzureProperties azureProperties) throws IOException { CredentialsProvider credentialsProvider = new DefaultCredentialsProvider(azureProperties); ApplicationTokenCredentials credentials = credentialsProvider.getCredentials(); TelemetryCollector.getInstance().setSubscription(credentials.defaultSubscriptionId()); RestClient restClient = 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()).withUserAgent(SPRING_CLOUD_USER_AGENT) .build(); return Azure.authenticate(restClient, credentials.domain()).withDefaultSubscription(); }
/** * 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 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 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 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 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 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 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 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 Manager that exposes resource management API entry points. * * @param credentials the credentials to use * @return the Manager */ public static Manager authenticate(AzureTokenCredentials credentials) { return new Manager(new RestClient.Builder() .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) .withCredentials(credentials) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) .build()); } /**
/** * 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 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 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 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); } /**
/** * Initializes a new instance of the ServiceClient class. * * @param baseUrl the service base uri * @param clientBuilder the http client builder * @param restBuilder the retrofit rest client builder */ protected ServiceClient(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { this(new RestClient.Builder(clientBuilder, restBuilder) .withBaseUrl(baseUrl) .withResponseBuilderFactory(new ServiceResponseBuilder.Factory()) .withSerializerAdapter(new JacksonAdapter()) .build()); }
/** * Create a new builder for a new Rest Client with the same configurations on this one. * @return a RestClient builder */ public RestClient.Builder newBuilder() { return new Builder(this); }
protected AzureConfigurableCoreImpl() { this.restClientBuilder = new RestClient.Builder() .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()); }
protected AzureConfigurableImpl() { this.restClientBuilder = new RestClient.Builder() .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()); }
protected AzureConfigurableImpl() { this.restClientBuilder = new RestClient.Builder() .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()); }