diff --git a/sdk/containerinstance/mgmt-v2018_10_01/pom.xml b/sdk/containerinstance/mgmt-v2018_10_01/pom.xml index 1d3f288ec4856..02b6cd62fa73f 100644 --- a/sdk/containerinstance/mgmt-v2018_10_01/pom.xml +++ b/sdk/containerinstance/mgmt-v2018_10_01/pom.xml @@ -11,15 +11,15 @@ com.microsoft.azure azure-arm-parent - 1.2.0 - ../../parents/azure-arm-parent + 1.1.0 + ../../../pom.management.xml azure-mgmt-containerinstance 1.0.0-beta jar Microsoft Azure SDK for ContainerInstance Management This package contains Microsoft ContainerInstance Management SDK. - https://github.com/Azure/azure-libraries-for-java + https://github.com/Azure/azure-sdk-for-java The MIT License (MIT) @@ -28,8 +28,8 @@ - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git HEAD @@ -71,6 +71,8 @@ azure-arm-client-runtime test-jar test + + 1.6.5 diff --git a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/CachedImages.java b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/CachedImages.java new file mode 100644 index 0000000000000..6cc3f3178abdc --- /dev/null +++ b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/CachedImages.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The cached image and OS type. + */ +public class CachedImages { + /** + * The resource Id of the cached image. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The OS type of the cached image. + */ + @JsonProperty(value = "osType", required = true) + private String osType; + + /** + * The cached image name. + */ + @JsonProperty(value = "image", required = true) + private String image; + + /** + * Get the resource Id of the cached image. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the resource Id of the cached image. + * + * @param id the id value to set + * @return the CachedImages object itself. + */ + public CachedImages withId(String id) { + this.id = id; + return this; + } + + /** + * Get the OS type of the cached image. + * + * @return the osType value + */ + public String osType() { + return this.osType; + } + + /** + * Set the OS type of the cached image. + * + * @param osType the osType value to set + * @return the CachedImages object itself. + */ + public CachedImages withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the cached image name. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set the cached image name. + * + * @param image the image value to set + * @return the CachedImages object itself. + */ + public CachedImages withImage(String image) { + this.image = image; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Capabilities.java b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Capabilities.java new file mode 100644 index 0000000000000..7dc8a9e3e609c --- /dev/null +++ b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/Capabilities.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The regional capabilities. + */ +public class Capabilities { + /** + * The resource type that this capability describes. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * The OS type that this capability describes. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private String osType; + + /** + * The resource location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * The ip address type that this capability describes. + */ + @JsonProperty(value = "ipAddressType", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddressType; + + /** + * The GPU sku that this capability describes. + */ + @JsonProperty(value = "gpu", access = JsonProperty.Access.WRITE_ONLY) + private String gpu; + + /** + * The supported capabilities. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private CapabilitiesCapabilities capabilities; + + /** + * Get the resource type that this capability describes. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the OS type that this capability describes. + * + * @return the osType value + */ + public String osType() { + return this.osType; + } + + /** + * Get the resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Get the ip address type that this capability describes. + * + * @return the ipAddressType value + */ + public String ipAddressType() { + return this.ipAddressType; + } + + /** + * Get the GPU sku that this capability describes. + * + * @return the gpu value + */ + public String gpu() { + return this.gpu; + } + + /** + * Get the supported capabilities. + * + * @return the capabilities value + */ + public CapabilitiesCapabilities capabilities() { + return this.capabilities; + } + +} diff --git a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/CapabilitiesCapabilities.java b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/CapabilitiesCapabilities.java new file mode 100644 index 0000000000000..f03f430f6798d --- /dev/null +++ b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/CapabilitiesCapabilities.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The supported capabilities. + */ +public class CapabilitiesCapabilities { + /** + * The maximum allowed memory request in GB. + */ + @JsonProperty(value = "maxMemoryInGB", access = JsonProperty.Access.WRITE_ONLY) + private Double maxMemoryInGB; + + /** + * The maximum allowed CPU request in cores. + */ + @JsonProperty(value = "maxCpu", access = JsonProperty.Access.WRITE_ONLY) + private Double maxCpu; + + /** + * The maximum allowed GPU count. + */ + @JsonProperty(value = "maxGpuCount", access = JsonProperty.Access.WRITE_ONLY) + private Double maxGpuCount; + + /** + * Get the maximum allowed memory request in GB. + * + * @return the maxMemoryInGB value + */ + public Double maxMemoryInGB() { + return this.maxMemoryInGB; + } + + /** + * Get the maximum allowed CPU request in cores. + * + * @return the maxCpu value + */ + public Double maxCpu() { + return this.maxCpu; + } + + /** + * Get the maximum allowed GPU count. + * + * @return the maxGpuCount value + */ + public Double maxGpuCount() { + return this.maxGpuCount; + } + +} diff --git a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroup.java b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroup.java index ced6b2ed90495..5f9d6fbd264f9 100644 --- a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroup.java +++ b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroup.java @@ -114,7 +114,9 @@ interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup containers); } @@ -124,86 +126,108 @@ interface WithContainers { interface WithOsType { /** * Specifies osType. - */ + * @param osType The operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux' + * @return the next definition stage +*/ WithCreate withOsType(OperatingSystemTypes osType); } /** - * The stage of the containergroup update allowing to specify Diagnostics. + * The stage of the containergroup definition allowing to specify Diagnostics. */ interface WithDiagnostics { /** * Specifies diagnostics. + * @param diagnostics The diagnostic information for a container group + * @return the next definition stage */ WithCreate withDiagnostics(ContainerGroupDiagnostics diagnostics); } /** - * The stage of the containergroup update allowing to specify DnsConfig. + * The stage of the containergroup definition allowing to specify DnsConfig. */ interface WithDnsConfig { /** * Specifies dnsConfig. + * @param dnsConfig The DNS config information for a container group + * @return the next definition stage */ WithCreate withDnsConfig(DnsConfiguration dnsConfig); } /** - * The stage of the containergroup update allowing to specify Identity. + * The stage of the containergroup definition allowing to specify Identity. */ interface WithIdentity { /** * Specifies identity. + * @param identity The identity of the container group, if configured + * @return the next definition stage */ WithCreate withIdentity(ContainerGroupIdentity identity); } /** - * The stage of the containergroup update allowing to specify ImageRegistryCredentials. + * The stage of the containergroup definition allowing to specify ImageRegistryCredentials. */ interface WithImageRegistryCredentials { /** * Specifies imageRegistryCredentials. + * @param imageRegistryCredentials The image registry credentials by which the container group is created from + * @return the next definition stage */ WithCreate withImageRegistryCredentials(List imageRegistryCredentials); } /** - * The stage of the containergroup update allowing to specify IpAddress. + * The stage of the containergroup definition allowing to specify IpAddress. */ interface WithIpAddress { /** * Specifies ipAddress. + * @param ipAddress The IP address type of the container group + * @return the next definition stage */ WithCreate withIpAddress(IpAddress ipAddress); } /** - * The stage of the containergroup update allowing to specify NetworkProfile. + * The stage of the containergroup definition allowing to specify NetworkProfile. */ interface WithNetworkProfile { /** * Specifies networkProfile. + * @param networkProfile The network profile information for a container group + * @return the next definition stage */ WithCreate withNetworkProfile(ContainerGroupNetworkProfile networkProfile); } /** - * The stage of the containergroup update allowing to specify RestartPolicy. + * The stage of the containergroup definition allowing to specify RestartPolicy. */ interface WithRestartPolicy { /** * Specifies restartPolicy. + * @param restartPolicy Restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never' + * @return the next definition stage */ WithCreate withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); } /** - * The stage of the containergroup update allowing to specify Volumes. + * The stage of the containergroup definition allowing to specify Volumes. */ interface WithVolumes { /** * Specifies volumes. + * @param volumes The list of volumes that can be mounted by containers in this container group + * @return the next definition stage */ WithCreate withVolumes(List volumes); } diff --git a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroups.java b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroups.java index bc2d453e5aa76..b20ece515ef3c 100644 --- a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroups.java +++ b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/ContainerGroups.java @@ -45,4 +45,15 @@ public interface ContainerGroups extends SupportsCreating value; + + /** + * The URI to fetch the next page of cached images. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the list of cached images. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of cached images. + * + * @param value the value value to set + * @return the CachedImagesListResultInner object itself. + */ + public CachedImagesListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URI to fetch the next page of cached images. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URI to fetch the next page of cached images. + * + * @param nextLink the nextLink value to set + * @return the CachedImagesListResultInner object itself. + */ + public CachedImagesListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/CapabilitiesListResultInner.java b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/CapabilitiesListResultInner.java new file mode 100644 index 0000000000000..583ee76633136 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/CapabilitiesListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_10_01.Capabilities; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response containing list of capabilities. + */ +public class CapabilitiesListResultInner { + /** + * The list of capabilities. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URI to fetch the next page of capabilities. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the list of capabilities. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of capabilities. + * + * @param value the value value to set + * @return the CapabilitiesListResultInner object itself. + */ + public CapabilitiesListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URI to fetch the next page of capabilities. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URI to fetch the next page of capabilities. + * + * @param nextLink the nextLink value to set + * @return the CapabilitiesListResultInner object itself. + */ + public CapabilitiesListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupImpl.java b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupImpl.java index 928b5c74a35f6..4a9799d48e5d9 100644 --- a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupImpl.java +++ b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupImpl.java @@ -23,6 +23,7 @@ import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroupDiagnostics; import com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroupNetworkProfile; import com.microsoft.azure.management.containerinstance.v2018_10_01.DnsConfiguration; +import java.util.ArrayList; import rx.functions.Func1; class ContainerGroupImpl extends GroupableResourceCoreImpl implements ContainerGroup, ContainerGroup.Definition, ContainerGroup.Update { diff --git a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsImpl.java b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsImpl.java index fe33eecd4ccd7..30d21346316c8 100644 --- a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsImpl.java +++ b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsImpl.java @@ -137,6 +137,12 @@ public Completable stopAsync(String resourceGroupName, String containerGroupName return client.stopAsync(resourceGroupName, containerGroupName).toCompletable(); } + @Override + public Completable startAsync(String resourceGroupName, String containerGroupName) { + ContainerGroupsInner client = this.inner(); + return client.startAsync(resourceGroupName, containerGroupName).toCompletable(); + } + @Override protected ContainerGroupImpl wrapModel(ContainerGroupInner inner) { return new ContainerGroupImpl(inner.name(), inner, manager()); diff --git a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsInner.java b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsInner.java index bed713aad934e..44641dae590a8 100644 --- a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsInner.java +++ b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsInner.java @@ -107,6 +107,14 @@ interface ContainerGroupsService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/stop") Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/start") + Observable> start(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerGroups listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1058,6 +1066,167 @@ private ServiceResponse stopDelegate(Response response) thro .build(response); } + /** + * Starts all containers in a container group. + * Starts all containers in a container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String containerGroupName) { + startWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().last().body(); + } + + /** + * Starts all containers in a container group. + * Starts all containers in a container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Starts all containers in a container group. + * Starts all containers in a container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String containerGroupName) { + return startWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts all containers in a container group. + * Starts all containers in a container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.start(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Starts all containers in a container group. + * Starts all containers in a container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String containerGroupName) { + beginStartWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Starts all containers in a container group. + * Starts all containers in a container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Starts all containers in a container group. + * Starts all containers in a container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String containerGroupName) { + return beginStartWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts all containers in a container group. + * Starts all containers in a container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName 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.beginStart(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Get a list of container groups in the specified subscription. * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. diff --git a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInstanceManagementClientImpl.java b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInstanceManagementClientImpl.java index 6a9afa4fab679..c2b24ef507144 100644 --- a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInstanceManagementClientImpl.java +++ b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerInstanceManagementClientImpl.java @@ -8,15 +8,32 @@ package com.microsoft.azure.management.containerinstance.v2018_10_01.implementation; +import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CloudException; import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; /** * Initializes a new instance of the ContainerInstanceManagementClientImpl class. */ public class ContainerInstanceManagementClientImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private ContainerInstanceManagementClientService service; /** the {@link AzureClient} used for long running operations. */ private AzureClient azureClient; @@ -63,11 +80,11 @@ public String apiVersion() { return this.apiVersion; } - /** Gets or sets the preferred language for the response. */ + /** The preferred language for the response. */ private String acceptLanguage; /** - * Gets Gets or sets the preferred language for the response. + * Gets The preferred language for the response. * * @return the acceptLanguage value. */ @@ -76,7 +93,7 @@ public String acceptLanguage() { } /** - * Sets Gets or sets the preferred language for the response. + * Sets The preferred language for the response. * * @param acceptLanguage the acceptLanguage value. * @return the service client itself @@ -86,11 +103,11 @@ public ContainerInstanceManagementClientImpl withAcceptLanguage(String acceptLan return this; } - /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ private int longRunningOperationRetryTimeout; /** - * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @return the longRunningOperationRetryTimeout value. */ @@ -99,7 +116,7 @@ public int longRunningOperationRetryTimeout() { } /** - * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. * @return the service client itself @@ -109,11 +126,11 @@ public ContainerInstanceManagementClientImpl withLongRunningOperationRetryTimeou return this; } - /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ private boolean generateClientRequestId; /** - * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @return the generateClientRequestId value. */ @@ -122,7 +139,7 @@ public boolean generateClientRequestId() { } /** - * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @param generateClientRequestId the generateClientRequestId value. * @return the service client itself @@ -238,6 +255,7 @@ protected void initialize() { this.containers = new ContainersInner(restClient().retrofit(), this); this.serviceAssociationLinks = new ServiceAssociationLinksInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); + initializeService(); } /** @@ -247,6 +265,192 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "ContainerInstanceManagementClient", "2018-10-01"); + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "ContainerInstanceManagementClient", "2018-10-01"); } + + private void initializeService() { + service = restClient().retrofit().create(ContainerInstanceManagementClientService.class); + } + + /** + * The interface defining all the services for ContainerInstanceManagementClient to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerInstanceManagementClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerInstanceManagementClient listCachedImages" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/cachedImages") + Observable> listCachedImages(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_10_01.ContainerInstanceManagementClient listCapabilities" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/capabilities") + Observable> listCapabilities(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CachedImagesListResultInner object if successful. + */ + public CachedImagesListResultInner listCachedImages(String location) { + return listCachedImagesWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The identifier for the physical azure location. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listCachedImagesAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listCachedImagesWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CachedImagesListResultInner object + */ + public Observable listCachedImagesAsync(String location) { + return listCachedImagesWithServiceResponseAsync(location).map(new Func1, CachedImagesListResultInner>() { + @Override + public CachedImagesListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CachedImagesListResultInner object + */ + public Observable> listCachedImagesWithServiceResponseAsync(String location) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + return service.listCachedImages(this.subscriptionId(), location, this.apiVersion(), this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listCachedImagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listCachedImagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CapabilitiesListResultInner object if successful. + */ + public CapabilitiesListResultInner listCapabilities(String location) { + return listCapabilitiesWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The identifier for the physical azure location. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listCapabilitiesAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listCapabilitiesWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapabilitiesListResultInner object + */ + public Observable listCapabilitiesAsync(String location) { + return listCapabilitiesWithServiceResponseAsync(location).map(new Func1, CapabilitiesListResultInner>() { + @Override + public CapabilitiesListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapabilitiesListResultInner object + */ + public Observable> listCapabilitiesWithServiceResponseAsync(String location) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + return service.listCapabilities(this.subscriptionId(), location, this.apiVersion(), this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listCapabilitiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listCapabilitiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + } diff --git a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationInner.java b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationInner.java index 917f71f159c66..ddaca672719e7 100644 --- a/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationInner.java +++ b/sdk/containerinstance/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/OperationInner.java @@ -28,6 +28,12 @@ public class OperationInner { @JsonProperty(value = "display", required = true) private OperationDisplay display; + /** + * The additional properties. + */ + @JsonProperty(value = "properties") + private Object properties; + /** * The intended executor of the operation. Possible values include: 'User', * 'System'. @@ -75,6 +81,26 @@ public OperationInner withDisplay(OperationDisplay display) { return this; } + /** + * Get the additional properties. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set the additional properties. + * + * @param properties the properties value to set + * @return the OperationInner object itself. + */ + public OperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + /** * Get the intended executor of the operation. Possible values include: 'User', 'System'. *