/** * Gets the names and values of all resource tags that are defined in a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<TagDetailsInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<TagDetailsInner>>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<TagDetailsInner>>>>() { @Override public Observable<ServiceResponse<Page<TagDetailsInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<TagDetailsInner>> result = listDelegate(response); return Observable.just(new ServiceResponse<Page<TagDetailsInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); }
/** * Deletes a resource by ID. * * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} * @param apiVersion The API version to use for the operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ public Observable<ServiceResponse<Void>> deleteByIdWithServiceResponseAsync(String resourceId, String apiVersion) { if (resourceId == null) { throw new IllegalArgumentException("Parameter resourceId is required and cannot be null."); } if (apiVersion == null) { throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); } Observable<Response<ResponseBody>> observable = service.deleteById(resourceId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType()); }
/** * Initializes an instance of ResourceManagementClient client. * * @param baseUrl the base URL of the host * @param credentials the management credentials for Azure */ public ResourceManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { super(baseUrl, credentials); initialize(); }
/** * Gets all resource providers for a subscription. * ServiceResponse<PageImpl<ProviderInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<ProviderInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<ProviderInner>>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } String nextUrl = String.format("%s", nextPageLink); return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProviderInner>>>>() { @Override public Observable<ServiceResponse<Page<ProviderInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<ProviderInner>> result = listNextDelegate(response); return Observable.just(new ServiceResponse<Page<ProviderInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); }
@Override public Observable<Deployment> getByResourceGroupAsync(String groupName, String name) { return this.manager().inner().deployments().getByResourceGroupAsync(groupName, name).map(new Func1<DeploymentExtendedInner, Deployment>() { @Override public Deployment call(DeploymentExtendedInner deploymentExtendedInner) { if (deploymentExtendedInner != null) { return createFluentModel(deploymentExtendedInner); } else { return null; } } }); }
GenericResourcesImpl(ResourceManager resourceManager) { super(resourceManager.inner().resources(), resourceManager); }
private ResourceManager(RestClient restClient, String subscriptionId) { super(null, subscriptionId); super.setResourceManager(this); this.resourceManagementClient = new ResourceManagementClientImpl(restClient); this.resourceManagementClient.withSubscriptionId(subscriptionId); this.featureClient = new FeatureClientImpl(restClient); this.featureClient.withSubscriptionId(subscriptionId); this.policyClient = new PolicyClientImpl(restClient); this.policyClient.withSubscriptionId(subscriptionId); }
/** * Creates an instance of the implementation. * * @param serviceClient the inner resource management client */ ResourceGroupsImpl(final ResourceManagementClientImpl serviceClient) { this.serviceClient = serviceClient; this.client = serviceClient.resourceGroups(); }
/** * @return the resource provider management API entry point */ public Providers providers() { if (providers == null) { providers = new ProvidersImpl(resourceManagementClient.providers()); } return providers; }
@Override public DeploymentOperations deploymentOperations() { return new DeploymentOperationsImpl(this.manager().inner().deploymentOperations(), this); }
/** * Gets all the resource groups for a subscription. * ServiceResponse<PageImpl<ResourceGroupInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<ResourceGroupInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<ResourceGroupInner>>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } String nextUrl = String.format("%s", nextPageLink); return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ResourceGroupInner>>>>() { @Override public Observable<ServiceResponse<Page<ResourceGroupInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<ResourceGroupInner>> result = listNextDelegate(response); return Observable.just(new ServiceResponse<Page<ResourceGroupInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); }
@Override public Observable<Deployment> getByResourceGroupAsync(String groupName, String name) { return this.manager().inner().deployments().getByResourceGroupAsync(groupName, name).map(new Func1<DeploymentExtendedInner, Deployment>() { @Override public Deployment call(DeploymentExtendedInner deploymentExtendedInner) { if (deploymentExtendedInner != null) { return createFluentModel(deploymentExtendedInner); } else { return null; } } }); }
GenericResourcesImpl(ResourceManager resourceManager) { super(resourceManager.inner().resources(), resourceManager); }
private ResourceManager(RestClient restClient, String subscriptionId) { super(null, subscriptionId); super.setResourceManager(this); this.resourceManagementClient = new ResourceManagementClientImpl(restClient); this.resourceManagementClient.withSubscriptionId(subscriptionId); this.featureClient = new FeatureClientImpl(restClient); this.featureClient.withSubscriptionId(subscriptionId); this.policyClient = new PolicyClientImpl(restClient); this.policyClient.withSubscriptionId(subscriptionId); }
/** * Creates an instance of the implementation. * * @param serviceClient the inner resource management client */ ResourceGroupsImpl(final ResourceManagementClientImpl serviceClient) { this.serviceClient = serviceClient; this.client = serviceClient.resourceGroups(); }
/** * @return the resource provider management API entry point */ public Providers providers() { if (providers == null) { providers = new ProvidersImpl(resourceManagementClient.providers()); } return providers; }
@Override public DeploymentOperations deploymentOperations() { return new DeploymentOperationsImpl(this.manager().inner().deploymentOperations(), this); }
/** * Gets all resource providers for a subscription. * ServiceResponse<PageImpl<ProviderInner>> * @param top The number of results to return. If null is passed returns all deployments. ServiceResponse<PageImpl<ProviderInner>> * @param expand The properties to include in the results. For example, use &$expand=metadata in the query string to retrieve resource provider metadata. To include property aliases in response, use $expand=resourceTypes/aliases. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<ProviderInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<ProviderInner>>> listSinglePageAsync(final Integer top, final String expand) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.list(this.client.subscriptionId(), top, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProviderInner>>>>() { @Override public Observable<ServiceResponse<Page<ProviderInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<ProviderInner>> result = listDelegate(response); return Observable.just(new ServiceResponse<Page<ProviderInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); }
/** * Deletes a resource by ID. * * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} * @param apiVersion The API version to use for the operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ public Observable<ServiceResponse<Void>> deleteByIdWithServiceResponseAsync(String resourceId, String apiVersion) { if (resourceId == null) { throw new IllegalArgumentException("Parameter resourceId is required and cannot be null."); } if (apiVersion == null) { throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); } Observable<Response<ResponseBody>> observable = service.deleteById(resourceId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType()); }
/** * Get all the resources in a subscription. * ServiceResponse<PageImpl<GenericResourceInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<GenericResourceInner>>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } String nextUrl = String.format("%s", nextPageLink); return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<GenericResourceInner>>>>() { @Override public Observable<ServiceResponse<Page<GenericResourceInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<GenericResourceInner>> result = listNextDelegate(response); return Observable.just(new ServiceResponse<Page<GenericResourceInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); }