diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index b40c24f37f422..362ee74577dae 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -400,6 +400,7 @@ com.azure.resourcemanager:azure-resourcemanager-storagemover;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-containerservicefleet;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-voiceservices;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-graphservices;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-containerinstance-generated;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 4d9066affde57..9d4e7c31bf928 100644 --- a/pom.xml +++ b/pom.xml @@ -45,6 +45,7 @@ sdk/confluent sdk/connectedvmware sdk/consumption + sdk/containerinstance sdk/containerregistry sdk/core sdk/cosmos diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/CHANGELOG.md b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/CHANGELOG.md new file mode 100644 index 0000000000000..97560fb4efb2d --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-03-27) + +- Azure Resource Manager ContainerInstance client library for Java. This package contains Microsoft Azure SDK for ContainerInstance Management SDK. Package tag package-preview-2023-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/README.md b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/README.md new file mode 100644 index 0000000000000..a07e668b9074e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/README.md @@ -0,0 +1,105 @@ +# Azure Resource Manager ContainerInstance client library for Java + +Azure Resource Manager ContainerInstance client library for Java. + +This package contains Microsoft Azure SDK for ContainerInstance Management SDK. Package tag package-preview-2023-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-containerinstance-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-containerinstance-generated + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ContainerInstanceManager manager = ContainerInstanceManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/SAMPLE.md b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/SAMPLE.md new file mode 100644 index 0000000000000..0455f3ec2ec54 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/SAMPLE.md @@ -0,0 +1,676 @@ +# Code snippets and samples + + +## ContainerGroups + +- [CreateOrUpdate](#containergroups_createorupdate) +- [Delete](#containergroups_delete) +- [GetByResourceGroup](#containergroups_getbyresourcegroup) +- [List](#containergroups_list) +- [ListByResourceGroup](#containergroups_listbyresourcegroup) +- [Restart](#containergroups_restart) +- [Start](#containergroups_start) +- [Stop](#containergroups_stop) +- [Update](#containergroups_update) + +## Containers + +- [Attach](#containers_attach) +- [ExecuteCommand](#containers_executecommand) +- [ListLogs](#containers_listlogs) + +## Location + +- [ListCachedImages](#location_listcachedimages) +- [ListCapabilities](#location_listcapabilities) +- [ListUsage](#location_listusage) + +## Operations + +- [List](#operations_list) + +## SubnetServiceAssociationLink + +- [Delete](#subnetserviceassociationlink_delete) +### ContainerGroups_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.containerinstance.generated.models.AzureFileVolume; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIdentity; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIpAddressType; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupNetworkProtocol; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSubnetId; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerPort; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.DnsConfiguration; +import com.azure.resourcemanager.containerinstance.generated.models.DnsNameLabelReusePolicy; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.GpuResource; +import com.azure.resourcemanager.containerinstance.generated.models.GpuSku; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.LogAnalytics; +import com.azure.resourcemanager.containerinstance.generated.models.LogAnalyticsLogType; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.Port; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceRequests; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceRequirements; +import com.azure.resourcemanager.containerinstance.generated.models.UserAssignedIdentities; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import com.azure.resourcemanager.containerinstance.generated.models.VolumeMount; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ContainerGroups CreateOrUpdate. */ +public final class ContainerGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupExtensions.json + */ + /** + * Sample code: ContainerGroupCreateWithExtensions. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupCreateWithExtensions( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) throws IOException { + manager + .containerGroups() + .define("demo1") + .withRegion("eastus2") + .withExistingResourceGroup("demo") + .withContainers( + Arrays + .asList( + new Container() + .withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources( + new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0))))) + .withOsType(OperatingSystemTypes.LINUX) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress( + new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PRIVATE)) + .withSubnetIds( + Arrays + .asList( + new ContainerGroupSubnetId() + .withId( + "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-rg-vnet/subnets/test-subnet"))) + .withExtensions( + Arrays + .asList( + new DeploymentExtensionSpec() + .withName("kube-proxy") + .withExtensionType("kube-proxy") + .withVersion("1.0") + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"clusterCidr\":\"10.240.0.0/16\",\"kubeVersion\":\"v1.9.10\"}", + Object.class, + SerializerEncoding.JSON)) + .withProtectedSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"kubeConfig\":\"\"}", + Object.class, + SerializerEncoding.JSON)), + new DeploymentExtensionSpec() + .withName("vk-realtime-metrics") + .withExtensionType("realtime-metrics") + .withVersion("1.0"))) + .create(); + } + + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupEncryptionProperties.json + */ + /** + * Sample code: ContainerGroupWithEncryptionProperties. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupWithEncryptionProperties( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager + .containerGroups() + .define("demo1") + .withRegion("eastus2") + .withExistingResourceGroup("demo") + .withContainers( + Arrays + .asList( + new Container() + .withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources( + new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0))))) + .withOsType(OperatingSystemTypes.LINUX) + .withIdentity( + new ContainerGroupIdentity() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity", + new UserAssignedIdentities()))) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress( + new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PUBLIC)) + .withEncryptionProperties( + new EncryptionProperties() + .withVaultBaseUrl("https://testkeyvault.vault.azure.net") + .withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity")) + .create(); + } + + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsCreateOrUpdate.json + */ + /** + * Sample code: ContainerGroupsCreateOrUpdate. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsCreateOrUpdate( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) throws IOException { + manager + .containerGroups() + .define("demo1") + .withRegion("west us") + .withExistingResourceGroup("demo") + .withContainers( + Arrays + .asList( + new Container() + .withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources( + new ResourceRequirements() + .withRequests( + new ResourceRequests() + .withMemoryInGB(1.5) + .withCpu(1.0) + .withGpu(new GpuResource().withCount(1).withSku(GpuSku.K80)))) + .withVolumeMounts( + Arrays + .asList( + new VolumeMount() + .withName("volume1") + .withMountPath("/mnt/volume1") + .withReadOnly(false), + new VolumeMount() + .withName("volume2") + .withMountPath("/mnt/volume2") + .withReadOnly(false), + new VolumeMount() + .withName("volume3") + .withMountPath("/mnt/volume3") + .withReadOnly(true))))) + .withOsType(OperatingSystemTypes.LINUX) + .withIdentity( + new ContainerGroupIdentity() + .withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name", + new UserAssignedIdentities()))) + .withImageRegistryCredentials(Arrays.asList()) + .withProvisioningTimeoutInSeconds(600) + .withIpAddress( + new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PUBLIC) + .withDnsNameLabel("dnsnamelabel1") + .withAutoGeneratedDomainNameLabelScope(DnsNameLabelReusePolicy.UNSECURE)) + .withVolumes( + Arrays + .asList( + new Volume() + .withName("volume1") + .withAzureFile( + new AzureFileVolume() + .withShareName("shareName") + .withStorageAccountName("accountName") + .withStorageAccountKey("fakeTokenPlaceholder")), + new Volume() + .withName("volume2") + .withEmptyDir( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)), + new Volume() + .withName("volume3") + .withSecret( + mapOf("secretKey1", "SecretValue1InBase64", "secretKey2", "SecretValue2InBase64")))) + .withDiagnostics( + new ContainerGroupDiagnostics() + .withLogAnalytics( + new LogAnalytics() + .withWorkspaceId("workspaceid") + .withWorkspaceKey("fakeTokenPlaceholder") + .withLogType(LogAnalyticsLogType.CONTAINER_INSIGHTS) + .withMetadata(mapOf("test-key", "test-metadata-value")) + .withWorkspaceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace"))) + .withSubnetIds( + Arrays + .asList( + new ContainerGroupSubnetId() + .withId( + "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName')," + + " parameters('subnetName'))]"))) + .withDnsConfig( + new DnsConfiguration() + .withNameServers(Arrays.asList("1.1.1.1")) + .withSearchDomains("cluster.local svc.cluster.local") + .withOptions("ndots:2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ContainerGroups_Delete + +```java +/** Samples for ContainerGroups Delete. */ +public final class ContainerGroupsDeleteSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsDelete.json + */ + /** + * Sample code: ContainerGroupsDelete. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsDelete( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().delete("demo", "demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerGroups_GetByResourceGroup + +```java +/** Samples for ContainerGroups GetByResourceGroup. */ +public final class ContainerGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsGet_Succeeded.json + */ + /** + * Sample code: ContainerGroupsGet_Succeeded. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsGetSucceeded( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().getByResourceGroupWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsGet_Failed.json + */ + /** + * Sample code: ContainerGroupsGet_Failed. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsGetFailed( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().getByResourceGroupWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerGroups_List + +```java +/** Samples for ContainerGroups List. */ +public final class ContainerGroupsListSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsList.json + */ + /** + * Sample code: ContainerGroupsList. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsList( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerGroups_ListByResourceGroup + +```java +/** Samples for ContainerGroups ListByResourceGroup. */ +public final class ContainerGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsListByResourceGroup.json + */ + /** + * Sample code: ContainerGroupsListByResourceGroup. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsListByResourceGroup( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().listByResourceGroup("demo", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerGroups_Restart + +```java +/** Samples for ContainerGroups Restart. */ +public final class ContainerGroupsRestartSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsRestart.json + */ + /** + * Sample code: ContainerRestart. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerRestart( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().restart("demo", "demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerGroups_Start + +```java +/** Samples for ContainerGroups Start. */ +public final class ContainerGroupsStartSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsStart.json + */ + /** + * Sample code: ContainerStart. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerStart( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().start("demo", "demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerGroups_Stop + +```java +/** Samples for ContainerGroups Stop. */ +public final class ContainerGroupsStopSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsStop.json + */ + /** + * Sample code: ContainerStop. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerStop( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().stopWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerGroups_Update + +```java +import com.azure.core.management.Resource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ContainerGroups Update. */ +public final class ContainerGroupsUpdateSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsUpdate.json + */ + /** + * Sample code: ContainerGroupsUpdate. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsUpdate( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager + .containerGroups() + .updateWithResponse( + "demoResource", + "demo1", + new Resource().withTags(mapOf("tag1key", "tag1Value", "tag2key", "tag2Value")), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Containers_Attach + +```java +/** Samples for Containers Attach. */ +public final class ContainersAttachSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerAttach.json + */ + /** + * Sample code: ContainerAttach. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerAttach( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containers().attachWithResponse("demo", "demo1", "container1", com.azure.core.util.Context.NONE); + } +} +``` + +### Containers_ExecuteCommand + +```java +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecRequest; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecRequestTerminalSize; + +/** Samples for Containers ExecuteCommand. */ +public final class ContainersExecuteCommandSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerExec.json + */ + /** + * Sample code: ContainerExec. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerExec( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager + .containers() + .executeCommandWithResponse( + "demo", + "demo1", + "container1", + new ContainerExecRequest() + .withCommand("/bin/bash") + .withTerminalSize(new ContainerExecRequestTerminalSize().withRows(12).withCols(12)), + com.azure.core.util.Context.NONE); + } +} +``` + +### Containers_ListLogs + +```java +/** Samples for Containers ListLogs. */ +public final class ContainersListLogsSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerListLogs.json + */ + /** + * Sample code: ContainerListLogs. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerListLogs( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager + .containers() + .listLogsWithResponse("demo", "demo1", "container1", 10, null, com.azure.core.util.Context.NONE); + } +} +``` + +### Location_ListCachedImages + +```java +/** Samples for Location ListCachedImages. */ +public final class LocationListCachedImagesSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/CachedImagesList.json + */ + /** + * Sample code: CachedImages. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void cachedImages( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.locations().listCachedImages("westcentralus", com.azure.core.util.Context.NONE); + } +} +``` + +### Location_ListCapabilities + +```java +/** Samples for Location ListCapabilities. */ +public final class LocationListCapabilitiesSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/CapabilitiesList.json + */ + /** + * Sample code: GetCapabilities. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void getCapabilities( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.locations().listCapabilities("westus", com.azure.core.util.Context.NONE); + } +} +``` + +### Location_ListUsage + +```java +/** Samples for Location ListUsage. */ +public final class LocationListUsageSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupUsage.json + */ + /** + * Sample code: ContainerUsage. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerUsage( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.locations().listUsage("westcentralus", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/OperationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void operationsList( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SubnetServiceAssociationLink_Delete + +```java +/** Samples for SubnetServiceAssociationLink Delete. */ +public final class SubnetServiceAssociationLinkDeleteSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/SubnetServiceAssociationLinkDelete.json + */ + /** + * Sample code: SubnetServiceAssociationLinkDelete. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void subnetServiceAssociationLinkDelete( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.subnetServiceAssociationLinks().delete("demo", "demo2", "demo3", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/pom.xml b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/pom.xml new file mode 100644 index 0000000000000..81c05e11d1b79 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-containerinstance-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for ContainerInstance Management + This package contains Microsoft Azure SDK for ContainerInstance Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-preview-2023-02. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + + + + com.azure + azure-core + 1.37.0 + + + com.azure + azure-core-management + 1.10.2 + + + diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/ContainerInstanceManager.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/ContainerInstanceManager.java new file mode 100644 index 0000000000000..6adf59754c4b6 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/ContainerInstanceManager.java @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.fluent.ContainerInstanceManagementClient; +import com.azure.resourcemanager.containerinstance.generated.implementation.ContainerGroupsImpl; +import com.azure.resourcemanager.containerinstance.generated.implementation.ContainerInstanceManagementClientBuilder; +import com.azure.resourcemanager.containerinstance.generated.implementation.ContainersImpl; +import com.azure.resourcemanager.containerinstance.generated.implementation.LocationsImpl; +import com.azure.resourcemanager.containerinstance.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.containerinstance.generated.implementation.SubnetServiceAssociationLinksImpl; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroups; +import com.azure.resourcemanager.containerinstance.generated.models.Containers; +import com.azure.resourcemanager.containerinstance.generated.models.Locations; +import com.azure.resourcemanager.containerinstance.generated.models.Operations; +import com.azure.resourcemanager.containerinstance.generated.models.SubnetServiceAssociationLinks; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to ContainerInstanceManager. */ +public final class ContainerInstanceManager { + private ContainerGroups containerGroups; + + private Operations operations; + + private Locations locations; + + private Containers containers; + + private SubnetServiceAssociationLinks subnetServiceAssociationLinks; + + private final ContainerInstanceManagementClient clientObject; + + private ContainerInstanceManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ContainerInstanceManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ContainerInstance service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ContainerInstance service API instance. + */ + public static ContainerInstanceManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of ContainerInstance service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the ContainerInstance service API instance. + */ + public static ContainerInstanceManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ContainerInstanceManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create ContainerInstanceManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ContainerInstanceManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of ContainerInstance service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ContainerInstance service API instance. + */ + public ContainerInstanceManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.containerinstance.generated") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ContainerInstanceManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of ContainerGroups. It manages ContainerGroup. + * + * @return Resource collection API of ContainerGroups. + */ + public ContainerGroups containerGroups() { + if (this.containerGroups == null) { + this.containerGroups = new ContainerGroupsImpl(clientObject.getContainerGroups(), this); + } + return containerGroups; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of Locations. + * + * @return Resource collection API of Locations. + */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(clientObject.getLocations(), this); + } + return locations; + } + + /** + * Gets the resource collection API of Containers. + * + * @return Resource collection API of Containers. + */ + public Containers containers() { + if (this.containers == null) { + this.containers = new ContainersImpl(clientObject.getContainers(), this); + } + return containers; + } + + /** + * Gets the resource collection API of SubnetServiceAssociationLinks. + * + * @return Resource collection API of SubnetServiceAssociationLinks. + */ + public SubnetServiceAssociationLinks subnetServiceAssociationLinks() { + if (this.subnetServiceAssociationLinks == null) { + this.subnetServiceAssociationLinks = + new SubnetServiceAssociationLinksImpl(clientObject.getSubnetServiceAssociationLinks(), this); + } + return subnetServiceAssociationLinks; + } + + /** + * @return Wrapped service client ContainerInstanceManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public ContainerInstanceManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerGroupsClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerGroupsClient.java new file mode 100644 index 0000000000000..6a0c07b574b2b --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerGroupsClient.java @@ -0,0 +1,486 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Resource; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupInner; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in ContainerGroupsClient. */ +public interface ContainerGroupsClient { + /** + * 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. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * 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. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get a list of container groups in the specified subscription and resource group. + * + *

Get a list of container groups in a specified subscription and resource group. This operation returns + * properties of each container group including containers, image registry credentials, restart policy, IP address + * type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get a list of container groups in the specified subscription and resource group. + * + *

Get a list of container groups in a specified subscription and resource group. This operation returns + * properties of each container group including containers, image registry credentials, restart policy, IP address + * type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the properties of the specified container group. + * + *

Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String containerGroupName, Context context); + + /** + * Get the properties of the specified container group. + * + *

Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName); + + /** + * Create or update container groups. + * + *

Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerGroupInner> beginCreateOrUpdate( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup); + + /** + * Create or update container groups. + * + *

Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerGroupInner> beginCreateOrUpdate( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, Context context); + + /** + * Create or update container groups. + * + *

Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerGroupInner createOrUpdate( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup); + + /** + * Create or update container groups. + * + *

Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerGroupInner createOrUpdate( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, Context context); + + /** + * Update container groups. + * + *

Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String containerGroupName, Resource resource, Context context); + + /** + * Update container groups. + * + *

Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerGroupInner update(String resourceGroupName, String containerGroupName, Resource resource); + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerGroupInner> beginDelete( + String resourceGroupName, String containerGroupName); + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerGroupInner> beginDelete( + String resourceGroupName, String containerGroupName, Context context); + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerGroupInner delete(String resourceGroupName, String containerGroupName); + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerGroupInner delete(String resourceGroupName, String containerGroupName, Context context); + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart(String resourceGroupName, String containerGroupName); + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart( + String resourceGroupName, String containerGroupName, Context context); + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String containerGroupName); + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String containerGroupName, Context context); + + /** + * Stops all containers in a container group. + * + *

Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response stopWithResponse(String resourceGroupName, String containerGroupName, Context context); + + /** + * Stops all containers in a container group. + * + *

Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String containerGroupName); + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceGroupName, String containerGroupName); + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceGroupName, String containerGroupName, Context context); + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String containerGroupName); + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String containerGroupName, Context context); + + /** + * Get all network dependencies for container group. + * + *

Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network dependencies for this container group to allow complete control of network setting and + * configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> getOutboundNetworkDependenciesEndpointsWithResponse( + String resourceGroupName, String containerGroupName, Context context); + + /** + * Get all network dependencies for container group. + * + *

Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network dependencies for this container group to allow complete control of network setting and + * configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List getOutboundNetworkDependenciesEndpoints(String resourceGroupName, String containerGroupName); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerInstanceManagementClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerInstanceManagementClient.java new file mode 100644 index 0000000000000..c5b4c468cd63f --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerInstanceManagementClient.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ContainerInstanceManagementClient class. */ +public interface ContainerInstanceManagementClient { + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the ContainerGroupsClient object to access its operations. + * + * @return the ContainerGroupsClient object. + */ + ContainerGroupsClient getContainerGroups(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the LocationsClient object to access its operations. + * + * @return the LocationsClient object. + */ + LocationsClient getLocations(); + + /** + * Gets the ContainersClient object to access its operations. + * + * @return the ContainersClient object. + */ + ContainersClient getContainers(); + + /** + * Gets the SubnetServiceAssociationLinksClient object to access its operations. + * + * @return the SubnetServiceAssociationLinksClient object. + */ + SubnetServiceAssociationLinksClient getSubnetServiceAssociationLinks(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainersClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainersClient.java new file mode 100644 index 0000000000000..755131ca1e6c7 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainersClient.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerAttachResponseInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerExecResponseInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.LogsInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecRequest; + +/** An instance of this class provides access to all the operations defined in ContainersClient. */ +public interface ContainersClient { + /** + * Get the logs for a specified container instance. + * + *

Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all + * available logs are shown up to 4mb. + * @param timestamps If true, adds a timestamp at the beginning of every line of log output. If not provided, + * defaults to false. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listLogsWithResponse( + String resourceGroupName, + String containerGroupName, + String containerName, + Integer tail, + Boolean timestamps, + Context context); + + /** + * Get the logs for a specified container instance. + * + *

Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsInner listLogs(String resourceGroupName, String containerGroupName, String containerName); + + /** + * Executes a command in a specific container instance. + * + *

Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the container exec command along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response executeCommandWithResponse( + String resourceGroupName, + String containerGroupName, + String containerName, + ContainerExecRequest containerExecRequest, + Context context); + + /** + * Executes a command in a specific container instance. + * + *

Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the container exec command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerExecResponseInner executeCommand( + String resourceGroupName, + String containerGroupName, + String containerName, + ContainerExecRequest containerExecRequest); + + /** + * Attach to the output of a specific container instance. + * + *

Attach to the output stream of a specific container instance in a specified resource group and container + * group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response attachWithResponse( + String resourceGroupName, String containerGroupName, String containerName, Context context); + + /** + * Attach to the output of a specific container instance. + * + *

Attach to the output stream of a specific container instance in a specified resource group and container + * group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAttachResponseInner attach(String resourceGroupName, String containerGroupName, String containerName); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/LocationsClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/LocationsClient.java new file mode 100644 index 0000000000000..b921f3085d5f5 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/LocationsClient.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CachedImagesInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CapabilitiesInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.UsageInner; + +/** An instance of this class provides access to all the operations defined in LocationsClient. */ +public interface LocationsClient { + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listUsage(String location); + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listUsage(String location, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCachedImages(String location); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCachedImages(String location, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCapabilities(String location); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCapabilities(String location, Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/OperationsClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/OperationsClient.java new file mode 100644 index 0000000000000..6679f6629088e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/OperationsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * List the operations for Azure Container Instance service. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for Azure Container Instance service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/SubnetServiceAssociationLinksClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/SubnetServiceAssociationLinksClient.java new file mode 100644 index 0000000000000..23ea6c89de798 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/SubnetServiceAssociationLinksClient.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; + +/** An instance of this class provides access to all the operations defined in SubnetServiceAssociationLinksClient. */ +public interface SubnetServiceAssociationLinksClient { + /** + * Delete container group virtual network association links. + * + *

Delete container group virtual network association links. The operation does not delete other resources + * provided by the user. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Delete container group virtual network association links. + * + *

Delete container group virtual network association links. The operation does not delete other resources + * provided by the user. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context); + + /** + * Delete container group virtual network association links. + * + *

Delete container group virtual network association links. The operation does not delete other resources + * provided by the user. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Delete container group virtual network association links. + * + *

Delete container group virtual network association links. The operation does not delete other resources + * provided by the user. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String virtualNetworkName, String subnetName, Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CachedImagesInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CachedImagesInner.java new file mode 100644 index 0000000000000..99018cd3ea517 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CachedImagesInner.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The cached image and OS type. */ +@Fluent +public final class CachedImagesInner { + /* + * 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; + + /** Creates an instance of CachedImagesInner class. */ + public CachedImagesInner() { + } + + /** + * Get the osType property: The OS type of the cached image. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The OS type of the cached image. + * + * @param osType the osType value to set. + * @return the CachedImagesInner object itself. + */ + public CachedImagesInner withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the image property: The cached image name. + * + * @return the image value. + */ + public String image() { + return this.image; + } + + /** + * Set the image property: The cached image name. + * + * @param image the image value to set. + * @return the CachedImagesInner object itself. + */ + public CachedImagesInner withImage(String image) { + this.image = image; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property osType in model CachedImagesInner")); + } + if (image() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property image in model CachedImagesInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CachedImagesInner.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CapabilitiesInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CapabilitiesInner.java new file mode 100644 index 0000000000000..7517f8e4bfbaa --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CapabilitiesInner.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.containerinstance.generated.models.CapabilitiesCapabilities; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The regional capabilities. */ +@Immutable +public final class CapabilitiesInner { + /* + * 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; + + /** Creates an instance of CapabilitiesInner class. */ + public CapabilitiesInner() { + } + + /** + * Get the resourceType property: The resource type that this capability describes. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the osType property: The OS type that this capability describes. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Get the location property: The resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the ipAddressType property: The ip address type that this capability describes. + * + * @return the ipAddressType value. + */ + public String ipAddressType() { + return this.ipAddressType; + } + + /** + * Get the gpu property: The GPU sku that this capability describes. + * + * @return the gpu value. + */ + public String gpu() { + return this.gpu; + } + + /** + * Get the capabilities property: The supported capabilities. + * + * @return the capabilities value. + */ + public CapabilitiesCapabilities capabilities() { + return this.capabilities; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capabilities() != null) { + capabilities().validate(); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerAttachResponseInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerAttachResponseInner.java new file mode 100644 index 0000000000000..2e79007f22a99 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerAttachResponseInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The information for the output stream from container attach. */ +@Fluent +public final class ContainerAttachResponseInner { + /* + * The uri for the output stream from the attach. + */ + @JsonProperty(value = "webSocketUri") + private String webSocketUri; + + /* + * The password to the output stream from the attach. Send as an Authorization header value when connecting to the + * websocketUri. + */ + @JsonProperty(value = "password") + private String password; + + /** Creates an instance of ContainerAttachResponseInner class. */ + public ContainerAttachResponseInner() { + } + + /** + * Get the webSocketUri property: The uri for the output stream from the attach. + * + * @return the webSocketUri value. + */ + public String webSocketUri() { + return this.webSocketUri; + } + + /** + * Set the webSocketUri property: The uri for the output stream from the attach. + * + * @param webSocketUri the webSocketUri value to set. + * @return the ContainerAttachResponseInner object itself. + */ + public ContainerAttachResponseInner withWebSocketUri(String webSocketUri) { + this.webSocketUri = webSocketUri; + return this; + } + + /** + * Get the password property: The password to the output stream from the attach. Send as an Authorization header + * value when connecting to the websocketUri. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password to the output stream from the attach. Send as an Authorization header + * value when connecting to the websocketUri. + * + * @param password the password value to set. + * @return the ContainerAttachResponseInner object itself. + */ + public ContainerAttachResponseInner withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerExecResponseInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerExecResponseInner.java new file mode 100644 index 0000000000000..34da4e1a98388 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerExecResponseInner.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The information for the container exec command. */ +@Fluent +public final class ContainerExecResponseInner { + /* + * The uri for the exec websocket. + */ + @JsonProperty(value = "webSocketUri") + private String webSocketUri; + + /* + * The password to start the exec command. + */ + @JsonProperty(value = "password") + private String password; + + /** Creates an instance of ContainerExecResponseInner class. */ + public ContainerExecResponseInner() { + } + + /** + * Get the webSocketUri property: The uri for the exec websocket. + * + * @return the webSocketUri value. + */ + public String webSocketUri() { + return this.webSocketUri; + } + + /** + * Set the webSocketUri property: The uri for the exec websocket. + * + * @param webSocketUri the webSocketUri value to set. + * @return the ContainerExecResponseInner object itself. + */ + public ContainerExecResponseInner withWebSocketUri(String webSocketUri) { + this.webSocketUri = webSocketUri; + return this; + } + + /** + * Get the password property: The password to start the exec command. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password to start the exec command. + * + * @param password the password value to set. + * @return the ContainerExecResponseInner object itself. + */ + public ContainerExecResponseInner withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupInner.java new file mode 100644 index 0000000000000..30fb1ccbb3667 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupInner.java @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIdentity; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPropertiesInstanceView; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSubnetId; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.DnsConfiguration; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.containerinstance.generated.models.InitContainerDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.IsCustomProvisioningTimeout; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A container group. */ +@Fluent +public final class ContainerGroupInner extends Resource { + /* + * The zones for the container group. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The identity of the container group, if configured. + */ + @JsonProperty(value = "identity") + private ContainerGroupIdentity identity; + + /* + * The container group properties + */ + @JsonProperty(value = "properties", required = true) + private ContainerGroupPropertiesProperties innerProperties = new ContainerGroupPropertiesProperties(); + + /** Creates an instance of ContainerGroupInner class. */ + public ContainerGroupInner() { + } + + /** + * Get the zones property: The zones for the container group. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The zones for the container group. + * + * @param zones the zones value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the identity property: The identity of the container group, if configured. + * + * @return the identity value. + */ + public ContainerGroupIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the container group, if configured. + * + * @param identity the identity value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withIdentity(ContainerGroupIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The container group properties. + * + * @return the innerProperties value. + */ + private ContainerGroupPropertiesProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ContainerGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ContainerGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the container group. This only appears in the + * response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the containers property: The containers within the container group. + * + * @return the containers value. + */ + public List containers() { + return this.innerProperties() == null ? null : this.innerProperties().containers(); + } + + /** + * Set the containers property: The containers within the container group. + * + * @param containers the containers value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withContainers(List containers) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withContainers(containers); + return this; + } + + /** + * Get the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @return the imageRegistryCredentials value. + */ + public List imageRegistryCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().imageRegistryCredentials(); + } + + /** + * Set the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withImageRegistryCredentials(List imageRegistryCredentials) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + /** + * Get the provisioningTimeoutInSeconds property: Time in seconds in which a container group deployment would + * timeout and fail. The allowed maximum value is 1800 seconds. If value is not provided, property is given maximum + * value by default. + * + * @return the provisioningTimeoutInSeconds value. + */ + public Integer provisioningTimeoutInSeconds() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningTimeoutInSeconds(); + } + + /** + * Set the provisioningTimeoutInSeconds property: Time in seconds in which a container group deployment would + * timeout and fail. The allowed maximum value is 1800 seconds. If value is not provided, property is given maximum + * value by default. + * + * @param provisioningTimeoutInSeconds the provisioningTimeoutInSeconds value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withProvisioningTimeoutInSeconds(Integer provisioningTimeoutInSeconds) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withProvisioningTimeoutInSeconds(provisioningTimeoutInSeconds); + return this; + } + + /** + * Get the isCustomProvisioningTimeout property: Flag indicating whether a custom value was provided for the + * provisioningTimeoutInSeconds property. + * + * @return the isCustomProvisioningTimeout value. + */ + public IsCustomProvisioningTimeout isCustomProvisioningTimeout() { + return this.innerProperties() == null ? null : this.innerProperties().isCustomProvisioningTimeout(); + } + + /** + * Get the restartPolicy property: Restart policy for all containers within the container group. - `Always` Always + * restart - `OnFailure` Restart on failure - `Never` Never restart. + * + * @return the restartPolicy value. + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().restartPolicy(); + } + + /** + * Set the restartPolicy property: Restart policy for all containers within the container group. - `Always` Always + * restart - `OnFailure` Restart on failure - `Never` Never restart. + * + * @param restartPolicy the restartPolicy value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withRestartPolicy(restartPolicy); + return this; + } + + /** + * Get the ipAddress property: The IP address type of the container group. + * + * @return the ipAddress value. + */ + public IpAddress ipAddress() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddress(); + } + + /** + * Set the ipAddress property: The IP address type of the container group. + * + * @param ipAddress the ipAddress value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withIpAddress(IpAddress ipAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withIpAddress(ipAddress); + return this; + } + + /** + * Get the osType property: The operating system type required by the containers in the container group. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: The operating system type required by the containers in the container group. + * + * @param osType the osType value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withOsType(OperatingSystemTypes osType) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value. + */ + public List volumes() { + return this.innerProperties() == null ? null : this.innerProperties().volumes(); + } + + /** + * Set the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withVolumes(List volumes) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withVolumes(volumes); + return this; + } + + /** + * Get the instanceView property: The instance view of the container group. Only valid in response. + * + * @return the instanceView value. + */ + public ContainerGroupPropertiesInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Get the diagnostics property: The diagnostic information for a container group. + * + * @return the diagnostics value. + */ + public ContainerGroupDiagnostics diagnostics() { + return this.innerProperties() == null ? null : this.innerProperties().diagnostics(); + } + + /** + * Set the diagnostics property: The diagnostic information for a container group. + * + * @param diagnostics the diagnostics value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withDiagnostics(ContainerGroupDiagnostics diagnostics) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withDiagnostics(diagnostics); + return this; + } + + /** + * Get the subnetIds property: The subnet resource IDs for a container group. + * + * @return the subnetIds value. + */ + public List subnetIds() { + return this.innerProperties() == null ? null : this.innerProperties().subnetIds(); + } + + /** + * Set the subnetIds property: The subnet resource IDs for a container group. + * + * @param subnetIds the subnetIds value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withSubnetIds(List subnetIds) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withSubnetIds(subnetIds); + return this; + } + + /** + * Get the dnsConfig property: The DNS config information for a container group. + * + * @return the dnsConfig value. + */ + public DnsConfiguration dnsConfig() { + return this.innerProperties() == null ? null : this.innerProperties().dnsConfig(); + } + + /** + * Set the dnsConfig property: The DNS config information for a container group. + * + * @param dnsConfig the dnsConfig value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withDnsConfig(DnsConfiguration dnsConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withDnsConfig(dnsConfig); + return this; + } + + /** + * Get the sku property: The SKU for a container group. + * + * @return the sku value. + */ + public ContainerGroupSku sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: The SKU for a container group. + * + * @param sku the sku value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withSku(ContainerGroupSku sku) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the encryptionProperties property: The encryption properties for a container group. + * + * @return the encryptionProperties value. + */ + public EncryptionProperties encryptionProperties() { + return this.innerProperties() == null ? null : this.innerProperties().encryptionProperties(); + } + + /** + * Set the encryptionProperties property: The encryption properties for a container group. + * + * @param encryptionProperties the encryptionProperties value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withEncryptionProperties(EncryptionProperties encryptionProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withEncryptionProperties(encryptionProperties); + return this; + } + + /** + * Get the initContainers property: The init containers for a container group. + * + * @return the initContainers value. + */ + public List initContainers() { + return this.innerProperties() == null ? null : this.innerProperties().initContainers(); + } + + /** + * Set the initContainers property: The init containers for a container group. + * + * @param initContainers the initContainers value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withInitContainers(List initContainers) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withInitContainers(initContainers); + return this; + } + + /** + * Get the extensions property: extensions used by virtual kubelet. + * + * @return the extensions value. + */ + public List extensions() { + return this.innerProperties() == null ? null : this.innerProperties().extensions(); + } + + /** + * Set the extensions property: extensions used by virtual kubelet. + * + * @param extensions the extensions value to set. + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withExtensions(List extensions) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withExtensions(extensions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ContainerGroupInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerGroupInner.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupPropertiesProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupPropertiesProperties.java new file mode 100644 index 0000000000000..0180f038b2157 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupPropertiesProperties.java @@ -0,0 +1,512 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPropertiesInstanceView; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSubnetId; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.DnsConfiguration; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.containerinstance.generated.models.InitContainerDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.IsCustomProvisioningTimeout; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The container group properties. */ +@Fluent +public final class ContainerGroupPropertiesProperties { + /* + * The provisioning state of the container group. This only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The containers within the container group. + */ + @JsonProperty(value = "containers", required = true) + private List containers; + + /* + * The image registry credentials by which the container group is created from. + */ + @JsonProperty(value = "imageRegistryCredentials") + private List imageRegistryCredentials; + + /* + * Time in seconds in which a container group deployment would timeout and fail. The allowed maximum value is 1800 + * seconds. If value is not provided, property is given maximum value by default. + */ + @JsonProperty(value = "provisioningTimeoutInSeconds") + private Integer provisioningTimeoutInSeconds; + + /* + * Flag indicating whether a custom value was provided for the provisioningTimeoutInSeconds property + */ + @JsonProperty(value = "isCustomProvisioningTimeout", access = JsonProperty.Access.WRITE_ONLY) + private IsCustomProvisioningTimeout isCustomProvisioningTimeout; + + /* + * Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + * + */ + @JsonProperty(value = "restartPolicy") + private ContainerGroupRestartPolicy restartPolicy; + + /* + * The IP address type of the container group. + */ + @JsonProperty(value = "ipAddress") + private IpAddress ipAddress; + + /* + * The operating system type required by the containers in the container group. + */ + @JsonProperty(value = "osType", required = true) + private OperatingSystemTypes osType; + + /* + * The list of volumes that can be mounted by containers in this container group. + */ + @JsonProperty(value = "volumes") + private List volumes; + + /* + * The instance view of the container group. Only valid in response. + */ + @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerGroupPropertiesInstanceView instanceView; + + /* + * The diagnostic information for a container group. + */ + @JsonProperty(value = "diagnostics") + private ContainerGroupDiagnostics diagnostics; + + /* + * The subnet resource IDs for a container group. + */ + @JsonProperty(value = "subnetIds") + private List subnetIds; + + /* + * The DNS config information for a container group. + */ + @JsonProperty(value = "dnsConfig") + private DnsConfiguration dnsConfig; + + /* + * The SKU for a container group. + */ + @JsonProperty(value = "sku") + private ContainerGroupSku sku; + + /* + * The encryption properties for a container group. + */ + @JsonProperty(value = "encryptionProperties") + private EncryptionProperties encryptionProperties; + + /* + * The init containers for a container group. + */ + @JsonProperty(value = "initContainers") + private List initContainers; + + /* + * extensions used by virtual kubelet + */ + @JsonProperty(value = "extensions") + private List extensions; + + /** Creates an instance of ContainerGroupPropertiesProperties class. */ + public ContainerGroupPropertiesProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the container group. This only appears in the + * response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the containers property: The containers within the container group. + * + * @return the containers value. + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers property: The containers within the container group. + * + * @param containers the containers value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @return the imageRegistryCredentials value. + */ + public List imageRegistryCredentials() { + return this.imageRegistryCredentials; + } + + /** + * Set the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withImageRegistryCredentials( + List imageRegistryCredentials) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * Get the provisioningTimeoutInSeconds property: Time in seconds in which a container group deployment would + * timeout and fail. The allowed maximum value is 1800 seconds. If value is not provided, property is given maximum + * value by default. + * + * @return the provisioningTimeoutInSeconds value. + */ + public Integer provisioningTimeoutInSeconds() { + return this.provisioningTimeoutInSeconds; + } + + /** + * Set the provisioningTimeoutInSeconds property: Time in seconds in which a container group deployment would + * timeout and fail. The allowed maximum value is 1800 seconds. If value is not provided, property is given maximum + * value by default. + * + * @param provisioningTimeoutInSeconds the provisioningTimeoutInSeconds value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withProvisioningTimeoutInSeconds(Integer provisioningTimeoutInSeconds) { + this.provisioningTimeoutInSeconds = provisioningTimeoutInSeconds; + return this; + } + + /** + * Get the isCustomProvisioningTimeout property: Flag indicating whether a custom value was provided for the + * provisioningTimeoutInSeconds property. + * + * @return the isCustomProvisioningTimeout value. + */ + public IsCustomProvisioningTimeout isCustomProvisioningTimeout() { + return this.isCustomProvisioningTimeout; + } + + /** + * Get the restartPolicy property: Restart policy for all containers within the container group. - `Always` Always + * restart - `OnFailure` Restart on failure - `Never` Never restart. + * + * @return the restartPolicy value. + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.restartPolicy; + } + + /** + * Set the restartPolicy property: Restart policy for all containers within the container group. - `Always` Always + * restart - `OnFailure` Restart on failure - `Never` Never restart. + * + * @param restartPolicy the restartPolicy value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.restartPolicy = restartPolicy; + return this; + } + + /** + * Get the ipAddress property: The IP address type of the container group. + * + * @return the ipAddress value. + */ + public IpAddress ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The IP address type of the container group. + * + * @param ipAddress the ipAddress value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withIpAddress(IpAddress ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the osType property: The operating system type required by the containers in the container group. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: The operating system type required by the containers in the container group. + * + * @param osType the osType value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value. + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + + /** + * Get the instanceView property: The instance view of the container group. Only valid in response. + * + * @return the instanceView value. + */ + public ContainerGroupPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the diagnostics property: The diagnostic information for a container group. + * + * @return the diagnostics value. + */ + public ContainerGroupDiagnostics diagnostics() { + return this.diagnostics; + } + + /** + * Set the diagnostics property: The diagnostic information for a container group. + * + * @param diagnostics the diagnostics value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withDiagnostics(ContainerGroupDiagnostics diagnostics) { + this.diagnostics = diagnostics; + return this; + } + + /** + * Get the subnetIds property: The subnet resource IDs for a container group. + * + * @return the subnetIds value. + */ + public List subnetIds() { + return this.subnetIds; + } + + /** + * Set the subnetIds property: The subnet resource IDs for a container group. + * + * @param subnetIds the subnetIds value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withSubnetIds(List subnetIds) { + this.subnetIds = subnetIds; + return this; + } + + /** + * Get the dnsConfig property: The DNS config information for a container group. + * + * @return the dnsConfig value. + */ + public DnsConfiguration dnsConfig() { + return this.dnsConfig; + } + + /** + * Set the dnsConfig property: The DNS config information for a container group. + * + * @param dnsConfig the dnsConfig value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withDnsConfig(DnsConfiguration dnsConfig) { + this.dnsConfig = dnsConfig; + return this; + } + + /** + * Get the sku property: The SKU for a container group. + * + * @return the sku value. + */ + public ContainerGroupSku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU for a container group. + * + * @param sku the sku value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withSku(ContainerGroupSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the encryptionProperties property: The encryption properties for a container group. + * + * @return the encryptionProperties value. + */ + public EncryptionProperties encryptionProperties() { + return this.encryptionProperties; + } + + /** + * Set the encryptionProperties property: The encryption properties for a container group. + * + * @param encryptionProperties the encryptionProperties value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withEncryptionProperties(EncryptionProperties encryptionProperties) { + this.encryptionProperties = encryptionProperties; + return this; + } + + /** + * Get the initContainers property: The init containers for a container group. + * + * @return the initContainers value. + */ + public List initContainers() { + return this.initContainers; + } + + /** + * Set the initContainers property: The init containers for a container group. + * + * @param initContainers the initContainers value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withInitContainers(List initContainers) { + this.initContainers = initContainers; + return this; + } + + /** + * Get the extensions property: extensions used by virtual kubelet. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: extensions used by virtual kubelet. + * + * @param extensions the extensions value to set. + * @return the ContainerGroupPropertiesProperties object itself. + */ + public ContainerGroupPropertiesProperties withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (containers() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property containers in model ContainerGroupPropertiesProperties")); + } else { + containers().forEach(e -> e.validate()); + } + if (imageRegistryCredentials() != null) { + imageRegistryCredentials().forEach(e -> e.validate()); + } + if (ipAddress() != null) { + ipAddress().validate(); + } + if (osType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property osType in model ContainerGroupPropertiesProperties")); + } + if (volumes() != null) { + volumes().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + if (diagnostics() != null) { + diagnostics().validate(); + } + if (subnetIds() != null) { + subnetIds().forEach(e -> e.validate()); + } + if (dnsConfig() != null) { + dnsConfig().validate(); + } + if (encryptionProperties() != null) { + encryptionProperties().validate(); + } + if (initContainers() != null) { + initContainers().forEach(e -> e.validate()); + } + if (extensions() != null) { + extensions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerGroupPropertiesProperties.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerProperties.java new file mode 100644 index 0000000000000..3aa6b0e53d1bb --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerProperties.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerPort; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerProbe; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerPropertiesInstanceView; +import com.azure.resourcemanager.containerinstance.generated.models.EnvironmentVariable; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceRequirements; +import com.azure.resourcemanager.containerinstance.generated.models.VolumeMount; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The container instance properties. */ +@Fluent +public final class ContainerProperties { + /* + * The name of the image used to create the container instance. + */ + @JsonProperty(value = "image", required = true) + private String image; + + /* + * The commands to execute within the container instance in exec form. + */ + @JsonProperty(value = "command") + private List command; + + /* + * The exposed ports on the container instance. + */ + @JsonProperty(value = "ports") + private List ports; + + /* + * The environment variables to set in the container instance. + */ + @JsonProperty(value = "environmentVariables") + private List environmentVariables; + + /* + * The instance view of the container instance. Only valid in response. + */ + @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerPropertiesInstanceView instanceView; + + /* + * The resource requirements of the container instance. + */ + @JsonProperty(value = "resources", required = true) + private ResourceRequirements resources; + + /* + * The volume mounts available to the container instance. + */ + @JsonProperty(value = "volumeMounts") + private List volumeMounts; + + /* + * The liveness probe. + */ + @JsonProperty(value = "livenessProbe") + private ContainerProbe livenessProbe; + + /* + * The readiness probe. + */ + @JsonProperty(value = "readinessProbe") + private ContainerProbe readinessProbe; + + /** Creates an instance of ContainerProperties class. */ + public ContainerProperties() { + } + + /** + * Get the image property: The name of the image used to create the container instance. + * + * @return the image value. + */ + public String image() { + return this.image; + } + + /** + * Set the image property: The name of the image used to create the container instance. + * + * @param image the image value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the command property: The commands to execute within the container instance in exec form. + * + * @return the command value. + */ + public List command() { + return this.command; + } + + /** + * Set the command property: The commands to execute within the container instance in exec form. + * + * @param command the command value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the ports property: The exposed ports on the container instance. + * + * @return the ports value. + */ + public List ports() { + return this.ports; + } + + /** + * Set the ports property: The exposed ports on the container instance. + * + * @param ports the ports value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the environmentVariables property: The environment variables to set in the container instance. + * + * @return the environmentVariables value. + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: The environment variables to set in the container instance. + * + * @param environmentVariables the environmentVariables value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instanceView property: The instance view of the container instance. Only valid in response. + * + * @return the instanceView value. + */ + public ContainerPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the resources property: The resource requirements of the container instance. + * + * @return the resources value. + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set the resources property: The resource requirements of the container instance. + * + * @param resources the resources value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volumeMounts property: The volume mounts available to the container instance. + * + * @return the volumeMounts value. + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set the volumeMounts property: The volume mounts available to the container instance. + * + * @param volumeMounts the volumeMounts value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withVolumeMounts(List volumeMounts) { + this.volumeMounts = volumeMounts; + return this; + } + + /** + * Get the livenessProbe property: The liveness probe. + * + * @return the livenessProbe value. + */ + public ContainerProbe livenessProbe() { + return this.livenessProbe; + } + + /** + * Set the livenessProbe property: The liveness probe. + * + * @param livenessProbe the livenessProbe value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withLivenessProbe(ContainerProbe livenessProbe) { + this.livenessProbe = livenessProbe; + return this; + } + + /** + * Get the readinessProbe property: The readiness probe. + * + * @return the readinessProbe value. + */ + public ContainerProbe readinessProbe() { + return this.readinessProbe; + } + + /** + * Set the readinessProbe property: The readiness probe. + * + * @param readinessProbe the readinessProbe value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withReadinessProbe(ContainerProbe readinessProbe) { + this.readinessProbe = readinessProbe; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (image() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property image in model ContainerProperties")); + } + if (ports() != null) { + ports().forEach(e -> e.validate()); + } + if (environmentVariables() != null) { + environmentVariables().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + if (resources() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property resources in model ContainerProperties")); + } else { + resources().validate(); + } + if (volumeMounts() != null) { + volumeMounts().forEach(e -> e.validate()); + } + if (livenessProbe() != null) { + livenessProbe().validate(); + } + if (readinessProbe() != null) { + readinessProbe().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerProperties.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/DeploymentExtensionSpecProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/DeploymentExtensionSpecProperties.java new file mode 100644 index 0000000000000..87fc47a8c6892 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/DeploymentExtensionSpecProperties.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Extension specific properties. */ +@Fluent +public final class DeploymentExtensionSpecProperties { + /* + * Type of extension to be added. + */ + @JsonProperty(value = "extensionType", required = true) + private String extensionType; + + /* + * Version of the extension being used. + */ + @JsonProperty(value = "version", required = true) + private String version; + + /* + * Settings for the extension. + */ + @JsonProperty(value = "settings") + private Object settings; + + /* + * Protected settings for the extension. + */ + @JsonProperty(value = "protectedSettings") + private Object protectedSettings; + + /** Creates an instance of DeploymentExtensionSpecProperties class. */ + public DeploymentExtensionSpecProperties() { + } + + /** + * Get the extensionType property: Type of extension to be added. + * + * @return the extensionType value. + */ + public String extensionType() { + return this.extensionType; + } + + /** + * Set the extensionType property: Type of extension to be added. + * + * @param extensionType the extensionType value to set. + * @return the DeploymentExtensionSpecProperties object itself. + */ + public DeploymentExtensionSpecProperties withExtensionType(String extensionType) { + this.extensionType = extensionType; + return this; + } + + /** + * Get the version property: Version of the extension being used. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the extension being used. + * + * @param version the version value to set. + * @return the DeploymentExtensionSpecProperties object itself. + */ + public DeploymentExtensionSpecProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the settings property: Settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Settings for the extension. + * + * @param settings the settings value to set. + * @return the DeploymentExtensionSpecProperties object itself. + */ + public DeploymentExtensionSpecProperties withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: Protected settings for the extension. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: Protected settings for the extension. + * + * @param protectedSettings the protectedSettings value to set. + * @return the DeploymentExtensionSpecProperties object itself. + */ + public DeploymentExtensionSpecProperties withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensionType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property extensionType in model DeploymentExtensionSpecProperties")); + } + if (version() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property version in model DeploymentExtensionSpecProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeploymentExtensionSpecProperties.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/InitContainerPropertiesDefinition.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/InitContainerPropertiesDefinition.java new file mode 100644 index 0000000000000..fd12184b8ec0a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/InitContainerPropertiesDefinition.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerinstance.generated.models.EnvironmentVariable; +import com.azure.resourcemanager.containerinstance.generated.models.InitContainerPropertiesDefinitionInstanceView; +import com.azure.resourcemanager.containerinstance.generated.models.VolumeMount; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The init container definition properties. */ +@Fluent +public final class InitContainerPropertiesDefinition { + /* + * The image of the init container. + */ + @JsonProperty(value = "image") + private String image; + + /* + * The command to execute within the init container in exec form. + */ + @JsonProperty(value = "command") + private List command; + + /* + * The environment variables to set in the init container. + */ + @JsonProperty(value = "environmentVariables") + private List environmentVariables; + + /* + * The instance view of the init container. Only valid in response. + */ + @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) + private InitContainerPropertiesDefinitionInstanceView instanceView; + + /* + * The volume mounts available to the init container. + */ + @JsonProperty(value = "volumeMounts") + private List volumeMounts; + + /** Creates an instance of InitContainerPropertiesDefinition class. */ + public InitContainerPropertiesDefinition() { + } + + /** + * Get the image property: The image of the init container. + * + * @return the image value. + */ + public String image() { + return this.image; + } + + /** + * Set the image property: The image of the init container. + * + * @param image the image value to set. + * @return the InitContainerPropertiesDefinition object itself. + */ + public InitContainerPropertiesDefinition withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the command property: The command to execute within the init container in exec form. + * + * @return the command value. + */ + public List command() { + return this.command; + } + + /** + * Set the command property: The command to execute within the init container in exec form. + * + * @param command the command value to set. + * @return the InitContainerPropertiesDefinition object itself. + */ + public InitContainerPropertiesDefinition withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the environmentVariables property: The environment variables to set in the init container. + * + * @return the environmentVariables value. + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: The environment variables to set in the init container. + * + * @param environmentVariables the environmentVariables value to set. + * @return the InitContainerPropertiesDefinition object itself. + */ + public InitContainerPropertiesDefinition withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instanceView property: The instance view of the init container. Only valid in response. + * + * @return the instanceView value. + */ + public InitContainerPropertiesDefinitionInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the volumeMounts property: The volume mounts available to the init container. + * + * @return the volumeMounts value. + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set the volumeMounts property: The volume mounts available to the init container. + * + * @param volumeMounts the volumeMounts value to set. + * @return the InitContainerPropertiesDefinition object itself. + */ + public InitContainerPropertiesDefinition withVolumeMounts(List volumeMounts) { + this.volumeMounts = volumeMounts; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (environmentVariables() != null) { + environmentVariables().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + if (volumeMounts() != null) { + volumeMounts().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/LogsInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/LogsInner.java new file mode 100644 index 0000000000000..8d3542b7042b9 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/LogsInner.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The logs. */ +@Fluent +public final class LogsInner { + /* + * The content of the log. + */ + @JsonProperty(value = "content") + private String content; + + /** Creates an instance of LogsInner class. */ + public LogsInner() { + } + + /** + * Get the content property: The content of the log. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: The content of the log. + * + * @param content the content value to set. + * @return the LogsInner object itself. + */ + public LogsInner withContent(String content) { + this.content = content; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/OperationInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..1b74911f49ca2 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/OperationInner.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerInstanceOperationsOrigin; +import com.azure.resourcemanager.containerinstance.generated.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An operation for Azure Container Instance service. */ +@Fluent +public final class OperationInner { + /* + * The name of the operation. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The display information of the operation. + */ + @JsonProperty(value = "display", required = true) + private OperationDisplay display; + + /* + * The additional properties. + */ + @JsonProperty(value = "properties") + private Object properties; + + /* + * The intended executor of the operation. + */ + @JsonProperty(value = "origin") + private ContainerInstanceOperationsOrigin origin; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the operation. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: The display information of the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The display information of the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the properties property: The additional properties. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: 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 origin property: The intended executor of the operation. + * + * @return the origin value. + */ + public ContainerInstanceOperationsOrigin origin() { + return this.origin; + } + + /** + * Set the origin property: The intended executor of the operation. + * + * @param origin the origin value to set. + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(ContainerInstanceOperationsOrigin origin) { + this.origin = origin; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model OperationInner")); + } + if (display() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property display in model OperationInner")); + } else { + display().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationInner.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/UsageInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/UsageInner.java new file mode 100644 index 0000000000000..c70a45416171f --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/UsageInner.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.containerinstance.generated.models.UsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A single usage result. */ +@Immutable +public final class UsageInner { + /* + * Id of the usage result + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Unit of the usage result + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /* + * The current usage of the resource + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentValue; + + /* + * The maximum permitted usage of the resource. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Integer limit; + + /* + * The name object of the resource + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private UsageName name; + + /** Creates an instance of UsageInner class. */ + public UsageInner() { + } + + /** + * Get the id property: Id of the usage result. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the unit property: Unit of the usage result. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Get the currentValue property: The current usage of the resource. + * + * @return the currentValue value. + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get the limit property: The maximum permitted usage of the resource. + * + * @return the limit value. + */ + public Integer limit() { + return this.limit; + } + + /** + * Get the name property: The name object of the resource. + * + * @return the name value. + */ + public UsageName name() { + return this.name; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/package-info.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..bb018aa296a5f --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for ContainerInstanceManagementClient. null. */ +package com.azure.resourcemanager.containerinstance.generated.fluent.models; diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/package-info.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/package-info.java new file mode 100644 index 0000000000000..57d35f85a8953 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for ContainerInstanceManagementClient. null. */ +package com.azure.resourcemanager.containerinstance.generated.fluent; diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CachedImagesImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CachedImagesImpl.java new file mode 100644 index 0000000000000..0c571d4df632a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CachedImagesImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CachedImagesInner; +import com.azure.resourcemanager.containerinstance.generated.models.CachedImages; + +public final class CachedImagesImpl implements CachedImages { + private CachedImagesInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + CachedImagesImpl( + CachedImagesInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String osType() { + return this.innerModel().osType(); + } + + public String image() { + return this.innerModel().image(); + } + + public CachedImagesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CapabilitiesImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CapabilitiesImpl.java new file mode 100644 index 0000000000000..fe9402098c093 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CapabilitiesImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CapabilitiesInner; +import com.azure.resourcemanager.containerinstance.generated.models.Capabilities; +import com.azure.resourcemanager.containerinstance.generated.models.CapabilitiesCapabilities; + +public final class CapabilitiesImpl implements Capabilities { + private CapabilitiesInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + CapabilitiesImpl( + CapabilitiesInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public String osType() { + return this.innerModel().osType(); + } + + public String location() { + return this.innerModel().location(); + } + + public String ipAddressType() { + return this.innerModel().ipAddressType(); + } + + public String gpu() { + return this.innerModel().gpu(); + } + + public CapabilitiesCapabilities capabilities() { + return this.innerModel().capabilities(); + } + + public CapabilitiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerAttachResponseImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerAttachResponseImpl.java new file mode 100644 index 0000000000000..8ed6def34bc83 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerAttachResponseImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerAttachResponseInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerAttachResponse; + +public final class ContainerAttachResponseImpl implements ContainerAttachResponse { + private ContainerAttachResponseInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + ContainerAttachResponseImpl( + ContainerAttachResponseInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String webSocketUri() { + return this.innerModel().webSocketUri(); + } + + public String password() { + return this.innerModel().password(); + } + + public ContainerAttachResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerExecResponseImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerExecResponseImpl.java new file mode 100644 index 0000000000000..7a8f27caf6751 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerExecResponseImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerExecResponseInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecResponse; + +public final class ContainerExecResponseImpl implements ContainerExecResponse { + private ContainerExecResponseInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + ContainerExecResponseImpl( + ContainerExecResponseInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String webSocketUri() { + return this.innerModel().webSocketUri(); + } + + public String password() { + return this.innerModel().password(); + } + + public ContainerExecResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupImpl.java new file mode 100644 index 0000000000000..8eebd955b4a3c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupImpl.java @@ -0,0 +1,396 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupInner; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroup; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIdentity; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPropertiesInstanceView; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSubnetId; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.DnsConfiguration; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.containerinstance.generated.models.InitContainerDefinition; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.IsCustomProvisioningTimeout; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ContainerGroupImpl implements ContainerGroup, ContainerGroup.Definition, ContainerGroup.Update { + private ContainerGroupInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContainerGroupIdentity identity() { + return this.innerModel().identity(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public List containers() { + List inner = this.innerModel().containers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List imageRegistryCredentials() { + List inner = this.innerModel().imageRegistryCredentials(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Integer provisioningTimeoutInSeconds() { + return this.innerModel().provisioningTimeoutInSeconds(); + } + + public IsCustomProvisioningTimeout isCustomProvisioningTimeout() { + return this.innerModel().isCustomProvisioningTimeout(); + } + + public ContainerGroupRestartPolicy restartPolicy() { + return this.innerModel().restartPolicy(); + } + + public IpAddress ipAddress() { + return this.innerModel().ipAddress(); + } + + public OperatingSystemTypes osType() { + return this.innerModel().osType(); + } + + public List volumes() { + List inner = this.innerModel().volumes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContainerGroupPropertiesInstanceView instanceView() { + return this.innerModel().instanceView(); + } + + public ContainerGroupDiagnostics diagnostics() { + return this.innerModel().diagnostics(); + } + + public List subnetIds() { + List inner = this.innerModel().subnetIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DnsConfiguration dnsConfig() { + return this.innerModel().dnsConfig(); + } + + public ContainerGroupSku sku() { + return this.innerModel().sku(); + } + + public EncryptionProperties encryptionProperties() { + return this.innerModel().encryptionProperties(); + } + + public List initContainers() { + List inner = this.innerModel().initContainers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List extensions() { + List inner = this.innerModel().extensions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ContainerGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String containerGroupName; + + public ContainerGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ContainerGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerGroups() + .createOrUpdate(resourceGroupName, containerGroupName, this.innerModel(), Context.NONE); + return this; + } + + public ContainerGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerGroups() + .createOrUpdate(resourceGroupName, containerGroupName, this.innerModel(), context); + return this; + } + + ContainerGroupImpl( + String name, com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = new ContainerGroupInner(); + this.serviceManager = serviceManager; + this.containerGroupName = name; + } + + public ContainerGroupImpl update() { + return this; + } + + public ContainerGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerGroups() + .createOrUpdate(resourceGroupName, containerGroupName, this.innerModel(), Context.NONE); + return this; + } + + public ContainerGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerGroups() + .createOrUpdate(resourceGroupName, containerGroupName, this.innerModel(), context); + return this; + } + + ContainerGroupImpl( + ContainerGroupInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.containerGroupName = Utils.getValueFromIdByName(innerObject.id(), "containerGroups"); + } + + public ContainerGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerGroups() + .getByResourceGroupWithResponse(resourceGroupName, containerGroupName, Context.NONE) + .getValue(); + return this; + } + + public ContainerGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerGroups() + .getByResourceGroupWithResponse(resourceGroupName, containerGroupName, context) + .getValue(); + return this; + } + + public void restart() { + serviceManager.containerGroups().restart(resourceGroupName, containerGroupName); + } + + public void restart(Context context) { + serviceManager.containerGroups().restart(resourceGroupName, containerGroupName, context); + } + + public Response stopWithResponse(Context context) { + return serviceManager.containerGroups().stopWithResponse(resourceGroupName, containerGroupName, context); + } + + public void stop() { + serviceManager.containerGroups().stop(resourceGroupName, containerGroupName); + } + + public void start() { + serviceManager.containerGroups().start(resourceGroupName, containerGroupName); + } + + public void start(Context context) { + serviceManager.containerGroups().start(resourceGroupName, containerGroupName, context); + } + + public ContainerGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ContainerGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ContainerGroupImpl withContainers(List containers) { + this.innerModel().withContainers(containers); + return this; + } + + public ContainerGroupImpl withOsType(OperatingSystemTypes osType) { + this.innerModel().withOsType(osType); + return this; + } + + public ContainerGroupImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public ContainerGroupImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public ContainerGroupImpl withIdentity(ContainerGroupIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ContainerGroupImpl withImageRegistryCredentials(List imageRegistryCredentials) { + this.innerModel().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + public ContainerGroupImpl withProvisioningTimeoutInSeconds(Integer provisioningTimeoutInSeconds) { + this.innerModel().withProvisioningTimeoutInSeconds(provisioningTimeoutInSeconds); + return this; + } + + public ContainerGroupImpl withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.innerModel().withRestartPolicy(restartPolicy); + return this; + } + + public ContainerGroupImpl withIpAddress(IpAddress ipAddress) { + this.innerModel().withIpAddress(ipAddress); + return this; + } + + public ContainerGroupImpl withVolumes(List volumes) { + this.innerModel().withVolumes(volumes); + return this; + } + + public ContainerGroupImpl withDiagnostics(ContainerGroupDiagnostics diagnostics) { + this.innerModel().withDiagnostics(diagnostics); + return this; + } + + public ContainerGroupImpl withSubnetIds(List subnetIds) { + this.innerModel().withSubnetIds(subnetIds); + return this; + } + + public ContainerGroupImpl withDnsConfig(DnsConfiguration dnsConfig) { + this.innerModel().withDnsConfig(dnsConfig); + return this; + } + + public ContainerGroupImpl withSku(ContainerGroupSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ContainerGroupImpl withEncryptionProperties(EncryptionProperties encryptionProperties) { + this.innerModel().withEncryptionProperties(encryptionProperties); + return this; + } + + public ContainerGroupImpl withInitContainers(List initContainers) { + this.innerModel().withInitContainers(initContainers); + return this; + } + + public ContainerGroupImpl withExtensions(List extensions) { + this.innerModel().withExtensions(extensions); + return this; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsClientImpl.java new file mode 100644 index 0000000000000..a21228052ae5c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsClientImpl.java @@ -0,0 +1,2473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.Resource; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerinstance.generated.fluent.ContainerGroupsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupListResult; +import java.nio.ByteBuffer; +import java.util.List; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ContainerGroupsClient. */ +public final class ContainerGroupsClientImpl implements ContainerGroupsClient { + /** The proxy service used to perform REST calls. */ + private final ContainerGroupsService service; + + /** The service client containing this operation class. */ + private final ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerGroupsClientImpl(ContainerInstanceManagementClientImpl client) { + this.service = + RestProxy.create(ContainerGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerInstanceManagementClientContainerGroups to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerInstanceMan") + public interface ContainerGroupsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, + @BodyParam("application/json") ContainerGroupInner containerGroup, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, + @BodyParam("application/json") Resource resource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/restart") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/stop") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> stop( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/start") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/outboundNetworkDependenciesEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getOutboundNetworkDependenciesEndpoints( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * 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. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * + *

Get a list of container groups in a specified subscription and resource group. This operation returns + * properties of each container group including containers, image registry credentials, restart policy, IP address + * type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * + *

Get a list of container groups in a specified subscription and resource group. This operation returns + * properties of each container group including containers, image registry credentials, restart policy, IP address + * type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * + *

Get a list of container groups in a specified subscription and resource group. This operation returns + * properties of each container group including containers, image registry credentials, restart policy, IP address + * type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * + *

Get a list of container groups in a specified subscription and resource group. This operation returns + * properties of each container group including containers, image registry credentials, restart policy, IP address + * type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * + *

Get a list of container groups in a specified subscription and resource group. This operation returns + * properties of each container group including containers, image registry credentials, restart policy, IP address + * type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * + *

Get a list of container groups in a specified subscription and resource group. This operation returns + * properties of each container group including containers, image registry credentials, restart policy, IP address + * type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the properties of the specified container group. + * + *

Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String containerGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of the specified container group. + * + *

Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String containerGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + accept, + context); + } + + /** + * Get the properties of the specified container group. + * + *

Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, containerGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the properties of the specified container group. + * + *

Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String containerGroupName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, containerGroupName, context).block(); + } + + /** + * Get the properties of the specified container group. + * + *

Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithResponse(resourceGroupName, containerGroupName, Context.NONE).getValue(); + } + + /** + * Create or update container groups. + * + *

Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (containerGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter containerGroup is required and cannot be null.")); + } else { + containerGroup.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + containerGroup, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update container groups. + * + *

Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (containerGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter containerGroup is required and cannot be null.")); + } else { + containerGroup.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + containerGroup, + accept, + context); + } + + /** + * Create or update container groups. + * + *

Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerGroupInner> beginCreateOrUpdateAsync( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, containerGroupName, containerGroup); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ContainerGroupInner.class, + ContainerGroupInner.class, + this.client.getContext()); + } + + /** + * Create or update container groups. + * + *

Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerGroupInner> beginCreateOrUpdateAsync( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, containerGroupName, containerGroup, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ContainerGroupInner.class, ContainerGroupInner.class, context); + } + + /** + * Create or update container groups. + * + *

Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerGroupInner> beginCreateOrUpdate( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return this.beginCreateOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup).getSyncPoller(); + } + + /** + * Create or update container groups. + * + *

Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerGroupInner> beginCreateOrUpdate( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup, context) + .getSyncPoller(); + } + + /** + * Create or update container groups. + * + *

Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return beginCreateOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container groups. + * + *

Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container groups. + * + *

Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerGroupInner createOrUpdate( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup).block(); + } + + /** + * Create or update container groups. + * + *

Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerGroupInner createOrUpdate( + String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, Context context) { + return createOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup, context).block(); + } + + /** + * Update container groups. + * + *

Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String containerGroupName, Resource resource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + resource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update container groups. + * + *

Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String containerGroupName, Resource resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + resource, + accept, + context); + } + + /** + * Update container groups. + * + *

Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String containerGroupName, Resource resource) { + return updateWithResponseAsync(resourceGroupName, containerGroupName, resource) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update container groups. + * + *

Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String containerGroupName, Resource resource, Context context) { + return updateWithResponseAsync(resourceGroupName, containerGroupName, resource, context).block(); + } + + /** + * Update container groups. + * + *

Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerGroupInner update(String resourceGroupName, String containerGroupName, Resource resource) { + return updateWithResponse(resourceGroupName, containerGroupName, resource, Context.NONE).getValue(); + } + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String containerGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String containerGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + accept, + context); + } + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerGroupInner> beginDeleteAsync( + String resourceGroupName, String containerGroupName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerGroupName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ContainerGroupInner.class, + ContainerGroupInner.class, + this.client.getContext()); + } + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerGroupInner> beginDeleteAsync( + String resourceGroupName, String containerGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerGroupName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ContainerGroupInner.class, ContainerGroupInner.class, context); + } + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerGroupInner> beginDelete( + String resourceGroupName, String containerGroupName) { + return this.beginDeleteAsync(resourceGroupName, containerGroupName).getSyncPoller(); + } + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerGroupInner> beginDelete( + String resourceGroupName, String containerGroupName, Context context) { + return this.beginDeleteAsync(resourceGroupName, containerGroupName, context).getSyncPoller(); + } + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String containerGroupName) { + return beginDeleteAsync(resourceGroupName, containerGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String containerGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, containerGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerGroupInner delete(String resourceGroupName, String containerGroupName) { + return deleteAsync(resourceGroupName, containerGroupName).block(); + } + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerGroupInner delete(String resourceGroupName, String containerGroupName, Context context) { + return deleteAsync(resourceGroupName, containerGroupName, context).block(); + } + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String containerGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String containerGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + accept, + context); + } + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String containerGroupName) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, containerGroupName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String containerGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(resourceGroupName, containerGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart(String resourceGroupName, String containerGroupName) { + return this.beginRestartAsync(resourceGroupName, containerGroupName).getSyncPoller(); + } + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String containerGroupName, Context context) { + return this.beginRestartAsync(resourceGroupName, containerGroupName, context).getSyncPoller(); + } + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String containerGroupName) { + return beginRestartAsync(resourceGroupName, containerGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String containerGroupName, Context context) { + return beginRestartAsync(resourceGroupName, containerGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String containerGroupName) { + restartAsync(resourceGroupName, containerGroupName).block(); + } + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String containerGroupName, Context context) { + restartAsync(resourceGroupName, containerGroupName, context).block(); + } + + /** + * Stops all containers in a container group. + * + *

Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> stopWithResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops all containers in a container group. + * + *

Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> stopWithResponseAsync( + String resourceGroupName, String containerGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + accept, + context); + } + + /** + * Stops all containers in a container group. + * + *

Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String containerGroupName) { + return stopWithResponseAsync(resourceGroupName, containerGroupName).flatMap(ignored -> Mono.empty()); + } + + /** + * Stops all containers in a container group. + * + *

Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopWithResponse(String resourceGroupName, String containerGroupName, Context context) { + return stopWithResponseAsync(resourceGroupName, containerGroupName, context).block(); + } + + /** + * Stops all containers in a container group. + * + *

Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String containerGroupName) { + stopWithResponse(resourceGroupName, containerGroupName, Context.NONE); + } + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String containerGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String containerGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + accept, + context); + } + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String containerGroupName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, containerGroupName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String containerGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceGroupName, containerGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String containerGroupName) { + return this.beginStartAsync(resourceGroupName, containerGroupName).getSyncPoller(); + } + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String resourceGroupName, String containerGroupName, Context context) { + return this.beginStartAsync(resourceGroupName, containerGroupName, context).getSyncPoller(); + } + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String containerGroupName) { + return beginStartAsync(resourceGroupName, containerGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String containerGroupName, Context context) { + return beginStartAsync(resourceGroupName, containerGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String containerGroupName) { + startAsync(resourceGroupName, containerGroupName).block(); + } + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String containerGroupName, Context context) { + startAsync(resourceGroupName, containerGroupName, context).block(); + } + + /** + * Get all network dependencies for container group. + * + *

Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network dependencies for this container group to allow complete control of network setting and + * configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getOutboundNetworkDependenciesEndpointsWithResponseAsync( + String resourceGroupName, String containerGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getOutboundNetworkDependenciesEndpoints( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all network dependencies for container group. + * + *

Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network dependencies for this container group to allow complete control of network setting and + * configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getOutboundNetworkDependenciesEndpointsWithResponseAsync( + String resourceGroupName, String containerGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getOutboundNetworkDependenciesEndpoints( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + accept, + context); + } + + /** + * Get all network dependencies for container group. + * + *

Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network dependencies for this container group to allow complete control of network setting and + * configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOutboundNetworkDependenciesEndpointsAsync( + String resourceGroupName, String containerGroupName) { + return getOutboundNetworkDependenciesEndpointsWithResponseAsync(resourceGroupName, containerGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get all network dependencies for container group. + * + *

Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network dependencies for this container group to allow complete control of network setting and + * configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> getOutboundNetworkDependenciesEndpointsWithResponse( + String resourceGroupName, String containerGroupName, Context context) { + return getOutboundNetworkDependenciesEndpointsWithResponseAsync(resourceGroupName, containerGroupName, context) + .block(); + } + + /** + * Get all network dependencies for container group. + * + *

Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network dependencies for this container group to allow complete control of network setting and + * configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List getOutboundNetworkDependenciesEndpoints(String resourceGroupName, String containerGroupName) { + return getOutboundNetworkDependenciesEndpointsWithResponse(resourceGroupName, containerGroupName, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container group list response that contains the container group properties along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container group list response that contains the container group properties along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container group list response that contains the container group properties along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container group list response that contains the container group properties along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsImpl.java new file mode 100644 index 0000000000000..1f8f63f017958 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsImpl.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.management.Resource; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.fluent.ContainerGroupsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroup; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroups; +import java.util.Collections; +import java.util.List; + +public final class ContainerGroupsImpl implements ContainerGroups { + private static final ClientLogger LOGGER = new ClientLogger(ContainerGroupsImpl.class); + + private final ContainerGroupsClient innerClient; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + public ContainerGroupsImpl( + ContainerGroupsClient innerClient, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ContainerGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ContainerGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ContainerGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ContainerGroupImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String containerGroupName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, containerGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContainerGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerGroup getByResourceGroup(String resourceGroupName, String containerGroupName) { + ContainerGroupInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, containerGroupName); + if (inner != null) { + return new ContainerGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String resourceGroupName, String containerGroupName, Resource resource, Context context) { + Response inner = + this.serviceClient().updateWithResponse(resourceGroupName, containerGroupName, resource, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContainerGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerGroup update(String resourceGroupName, String containerGroupName, Resource resource) { + ContainerGroupInner inner = this.serviceClient().update(resourceGroupName, containerGroupName, resource); + if (inner != null) { + return new ContainerGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public ContainerGroup deleteByResourceGroup(String resourceGroupName, String containerGroupName) { + ContainerGroupInner inner = this.serviceClient().delete(resourceGroupName, containerGroupName); + if (inner != null) { + return new ContainerGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public ContainerGroup delete(String resourceGroupName, String containerGroupName, Context context) { + ContainerGroupInner inner = this.serviceClient().delete(resourceGroupName, containerGroupName, context); + if (inner != null) { + return new ContainerGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void restart(String resourceGroupName, String containerGroupName) { + this.serviceClient().restart(resourceGroupName, containerGroupName); + } + + public void restart(String resourceGroupName, String containerGroupName, Context context) { + this.serviceClient().restart(resourceGroupName, containerGroupName, context); + } + + public Response stopWithResponse(String resourceGroupName, String containerGroupName, Context context) { + return this.serviceClient().stopWithResponse(resourceGroupName, containerGroupName, context); + } + + public void stop(String resourceGroupName, String containerGroupName) { + this.serviceClient().stop(resourceGroupName, containerGroupName); + } + + public void start(String resourceGroupName, String containerGroupName) { + this.serviceClient().start(resourceGroupName, containerGroupName); + } + + public void start(String resourceGroupName, String containerGroupName, Context context) { + this.serviceClient().start(resourceGroupName, containerGroupName, context); + } + + public Response> getOutboundNetworkDependenciesEndpointsWithResponse( + String resourceGroupName, String containerGroupName, Context context) { + return this + .serviceClient() + .getOutboundNetworkDependenciesEndpointsWithResponse(resourceGroupName, containerGroupName, context); + } + + public List getOutboundNetworkDependenciesEndpoints(String resourceGroupName, String containerGroupName) { + List inner = + this.serviceClient().getOutboundNetworkDependenciesEndpoints(resourceGroupName, containerGroupName); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContainerGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerGroupName = Utils.getValueFromIdByName(id, "containerGroups"); + if (containerGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'containerGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, containerGroupName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerGroupName = Utils.getValueFromIdByName(id, "containerGroups"); + if (containerGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'containerGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, containerGroupName, context); + } + + public ContainerGroup deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerGroupName = Utils.getValueFromIdByName(id, "containerGroups"); + if (containerGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'containerGroups'.", id))); + } + return this.delete(resourceGroupName, containerGroupName, Context.NONE); + } + + public ContainerGroup deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerGroupName = Utils.getValueFromIdByName(id, "containerGroups"); + if (containerGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'containerGroups'.", id))); + } + return this.delete(resourceGroupName, containerGroupName, context); + } + + private ContainerGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } + + public ContainerGroupImpl define(String name) { + return new ContainerGroupImpl(name, this.manager()); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientBuilder.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientBuilder.java new file mode 100644 index 0000000000000..6e7c816221a34 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the ContainerInstanceManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {ContainerInstanceManagementClientImpl.class}) +public final class ContainerInstanceManagementClientBuilder { + /* + * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + */ + private String subscriptionId; + + /** + * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the ContainerInstanceManagementClientBuilder. + */ + public ContainerInstanceManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ContainerInstanceManagementClientBuilder. + */ + public ContainerInstanceManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the ContainerInstanceManagementClientBuilder. + */ + public ContainerInstanceManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ContainerInstanceManagementClientBuilder. + */ + public ContainerInstanceManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ContainerInstanceManagementClientBuilder. + */ + public ContainerInstanceManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ContainerInstanceManagementClientBuilder. + */ + public ContainerInstanceManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ContainerInstanceManagementClientImpl with the provided parameters. + * + * @return an instance of ContainerInstanceManagementClientImpl. + */ + public ContainerInstanceManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + ContainerInstanceManagementClientImpl client = + new ContainerInstanceManagementClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientImpl.java new file mode 100644 index 0000000000000..4c3af2f408b47 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientImpl.java @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.containerinstance.generated.fluent.ContainerGroupsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.ContainerInstanceManagementClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.ContainersClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.LocationsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.SubnetServiceAssociationLinksClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the ContainerInstanceManagementClientImpl type. */ +@ServiceClient(builder = ContainerInstanceManagementClientBuilder.class) +public final class ContainerInstanceManagementClientImpl implements ContainerInstanceManagementClient { + /** + * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The ContainerGroupsClient object to access its operations. */ + private final ContainerGroupsClient containerGroups; + + /** + * Gets the ContainerGroupsClient object to access its operations. + * + * @return the ContainerGroupsClient object. + */ + public ContainerGroupsClient getContainerGroups() { + return this.containerGroups; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The LocationsClient object to access its operations. */ + private final LocationsClient locations; + + /** + * Gets the LocationsClient object to access its operations. + * + * @return the LocationsClient object. + */ + public LocationsClient getLocations() { + return this.locations; + } + + /** The ContainersClient object to access its operations. */ + private final ContainersClient containers; + + /** + * Gets the ContainersClient object to access its operations. + * + * @return the ContainersClient object. + */ + public ContainersClient getContainers() { + return this.containers; + } + + /** The SubnetServiceAssociationLinksClient object to access its operations. */ + private final SubnetServiceAssociationLinksClient subnetServiceAssociationLinks; + + /** + * Gets the SubnetServiceAssociationLinksClient object to access its operations. + * + * @return the SubnetServiceAssociationLinksClient object. + */ + public SubnetServiceAssociationLinksClient getSubnetServiceAssociationLinks() { + return this.subnetServiceAssociationLinks; + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + ContainerInstanceManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2023-02-01-preview"; + this.containerGroups = new ContainerGroupsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.locations = new LocationsClientImpl(this); + this.containers = new ContainersClientImpl(this); + this.subnetServiceAssociationLinks = new SubnetServiceAssociationLinksClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerInstanceManagementClientImpl.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersClientImpl.java new file mode 100644 index 0000000000000..ee36b9d6ff46c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersClientImpl.java @@ -0,0 +1,700 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.containerinstance.generated.fluent.ContainersClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerAttachResponseInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerExecResponseInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.LogsInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ContainersClient. */ +public final class ContainersClientImpl implements ContainersClient { + /** The proxy service used to perform REST calls. */ + private final ContainersService service; + + /** The service client containing this operation class. */ + private final ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainersClientImpl(ContainerInstanceManagementClientImpl client) { + this.service = + RestProxy.create(ContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerInstanceManagementClientContainers to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerInstanceMan") + public interface ContainersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listLogs( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, + @PathParam("containerName") String containerName, + @QueryParam("tail") Integer tail, + @QueryParam("timestamps") Boolean timestamps, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> executeCommand( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, + @PathParam("containerName") String containerName, + @BodyParam("application/json") ContainerExecRequest containerExecRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/attach") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> attach( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerGroupName") String containerGroupName, + @PathParam("containerName") String containerName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the logs for a specified container instance. + * + *

Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all + * available logs are shown up to 4mb. + * @param timestamps If true, adds a timestamp at the beginning of every line of log output. If not provided, + * defaults to false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLogsWithResponseAsync( + String resourceGroupName, String containerGroupName, String containerName, Integer tail, Boolean timestamps) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listLogs( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + containerName, + tail, + timestamps, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the logs for a specified container instance. + * + *

Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all + * available logs are shown up to 4mb. + * @param timestamps If true, adds a timestamp at the beginning of every line of log output. If not provided, + * defaults to false. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLogsWithResponseAsync( + String resourceGroupName, + String containerGroupName, + String containerName, + Integer tail, + Boolean timestamps, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listLogs( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + containerName, + tail, + timestamps, + accept, + context); + } + + /** + * Get the logs for a specified container instance. + * + *

Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listLogsAsync(String resourceGroupName, String containerGroupName, String containerName) { + final Integer tail = null; + final Boolean timestamps = null; + return listLogsWithResponseAsync(resourceGroupName, containerGroupName, containerName, tail, timestamps) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the logs for a specified container instance. + * + *

Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all + * available logs are shown up to 4mb. + * @param timestamps If true, adds a timestamp at the beginning of every line of log output. If not provided, + * defaults to false. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listLogsWithResponse( + String resourceGroupName, + String containerGroupName, + String containerName, + Integer tail, + Boolean timestamps, + Context context) { + return listLogsWithResponseAsync( + resourceGroupName, containerGroupName, containerName, tail, timestamps, context) + .block(); + } + + /** + * Get the logs for a specified container instance. + * + *

Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsInner listLogs(String resourceGroupName, String containerGroupName, String containerName) { + final Integer tail = null; + final Boolean timestamps = null; + return listLogsWithResponse( + resourceGroupName, containerGroupName, containerName, tail, timestamps, Context.NONE) + .getValue(); + } + + /** + * Executes a command in a specific container instance. + * + *

Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the container exec command along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> executeCommandWithResponseAsync( + String resourceGroupName, + String containerGroupName, + String containerName, + ContainerExecRequest containerExecRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (containerExecRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerExecRequest is required and cannot be null.")); + } else { + containerExecRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .executeCommand( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + containerName, + containerExecRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Executes a command in a specific container instance. + * + *

Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the container exec command along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> executeCommandWithResponseAsync( + String resourceGroupName, + String containerGroupName, + String containerName, + ContainerExecRequest containerExecRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (containerExecRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerExecRequest is required and cannot be null.")); + } else { + containerExecRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .executeCommand( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + containerName, + containerExecRequest, + accept, + context); + } + + /** + * Executes a command in a specific container instance. + * + *

Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the container exec command on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono executeCommandAsync( + String resourceGroupName, + String containerGroupName, + String containerName, + ContainerExecRequest containerExecRequest) { + return executeCommandWithResponseAsync( + resourceGroupName, containerGroupName, containerName, containerExecRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Executes a command in a specific container instance. + * + *

Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the container exec command along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response executeCommandWithResponse( + String resourceGroupName, + String containerGroupName, + String containerName, + ContainerExecRequest containerExecRequest, + Context context) { + return executeCommandWithResponseAsync( + resourceGroupName, containerGroupName, containerName, containerExecRequest, context) + .block(); + } + + /** + * Executes a command in a specific container instance. + * + *

Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the container exec command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerExecResponseInner executeCommand( + String resourceGroupName, + String containerGroupName, + String containerName, + ContainerExecRequest containerExecRequest) { + return executeCommandWithResponse( + resourceGroupName, containerGroupName, containerName, containerExecRequest, Context.NONE) + .getValue(); + } + + /** + * Attach to the output of a specific container instance. + * + *

Attach to the output stream of a specific container instance in a specified resource group and container + * group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> attachWithResponseAsync( + String resourceGroupName, String containerGroupName, String containerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .attach( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + containerName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Attach to the output of a specific container instance. + * + *

Attach to the output stream of a specific container instance in a specified resource group and container + * group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> attachWithResponseAsync( + String resourceGroupName, String containerGroupName, String containerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .attach( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + containerGroupName, + containerName, + accept, + context); + } + + /** + * Attach to the output of a specific container instance. + * + *

Attach to the output stream of a specific container instance in a specified resource group and container + * group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono attachAsync( + String resourceGroupName, String containerGroupName, String containerName) { + return attachWithResponseAsync(resourceGroupName, containerGroupName, containerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Attach to the output of a specific container instance. + * + *

Attach to the output stream of a specific container instance in a specified resource group and container + * group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response attachWithResponse( + String resourceGroupName, String containerGroupName, String containerName, Context context) { + return attachWithResponseAsync(resourceGroupName, containerGroupName, containerName, context).block(); + } + + /** + * Attach to the output of a specific container instance. + * + *

Attach to the output stream of a specific container instance in a specified resource group and container + * group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAttachResponseInner attach( + String resourceGroupName, String containerGroupName, String containerName) { + return attachWithResponse(resourceGroupName, containerGroupName, containerName, Context.NONE).getValue(); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersImpl.java new file mode 100644 index 0000000000000..4d57e87c7e3a3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersImpl.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.fluent.ContainersClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerAttachResponseInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerExecResponseInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.LogsInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerAttachResponse; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecRequest; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecResponse; +import com.azure.resourcemanager.containerinstance.generated.models.Containers; +import com.azure.resourcemanager.containerinstance.generated.models.Logs; + +public final class ContainersImpl implements Containers { + private static final ClientLogger LOGGER = new ClientLogger(ContainersImpl.class); + + private final ContainersClient innerClient; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + public ContainersImpl( + ContainersClient innerClient, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listLogsWithResponse( + String resourceGroupName, + String containerGroupName, + String containerName, + Integer tail, + Boolean timestamps, + Context context) { + Response inner = + this + .serviceClient() + .listLogsWithResponse(resourceGroupName, containerGroupName, containerName, tail, timestamps, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LogsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Logs listLogs(String resourceGroupName, String containerGroupName, String containerName) { + LogsInner inner = this.serviceClient().listLogs(resourceGroupName, containerGroupName, containerName); + if (inner != null) { + return new LogsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response executeCommandWithResponse( + String resourceGroupName, + String containerGroupName, + String containerName, + ContainerExecRequest containerExecRequest, + Context context) { + Response inner = + this + .serviceClient() + .executeCommandWithResponse( + resourceGroupName, containerGroupName, containerName, containerExecRequest, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContainerExecResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerExecResponse executeCommand( + String resourceGroupName, + String containerGroupName, + String containerName, + ContainerExecRequest containerExecRequest) { + ContainerExecResponseInner inner = + this + .serviceClient() + .executeCommand(resourceGroupName, containerGroupName, containerName, containerExecRequest); + if (inner != null) { + return new ContainerExecResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response attachWithResponse( + String resourceGroupName, String containerGroupName, String containerName, Context context) { + Response inner = + this.serviceClient().attachWithResponse(resourceGroupName, containerGroupName, containerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContainerAttachResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerAttachResponse attach(String resourceGroupName, String containerGroupName, String containerName) { + ContainerAttachResponseInner inner = + this.serviceClient().attach(resourceGroupName, containerGroupName, containerName); + if (inner != null) { + return new ContainerAttachResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private ContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsClientImpl.java new file mode 100644 index 0000000000000..80b9183dd3142 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsClientImpl.java @@ -0,0 +1,767 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.containerinstance.generated.fluent.LocationsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CachedImagesInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CapabilitiesInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.containerinstance.generated.models.CachedImagesListResult; +import com.azure.resourcemanager.containerinstance.generated.models.CapabilitiesListResult; +import com.azure.resourcemanager.containerinstance.generated.models.UsageListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LocationsClient. */ +public final class LocationsClientImpl implements LocationsClient { + /** The proxy service used to perform REST calls. */ + private final LocationsService service; + + /** The service client containing this operation class. */ + private final ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of LocationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LocationsClientImpl(ContainerInstanceManagementClientImpl client) { + this.service = + RestProxy.create(LocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerInstanceManagementClientLocations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerInstanceMan") + public interface LocationsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listUsage( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/cachedImages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCachedImages( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/capabilities") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCapabilities( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCachedImagesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCapabilitiesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsageSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listUsage( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsageSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listUsage( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listUsageAsync(String location) { + return new PagedFlux<>(() -> listUsageSinglePageAsync(location)); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listUsageAsync(String location, Context context) { + return new PagedFlux<>(() -> listUsageSinglePageAsync(location, context)); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUsage(String location) { + return new PagedIterable<>(listUsageAsync(location)); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUsage(String location, Context context) { + return new PagedIterable<>(listUsageAsync(location, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCachedImagesSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listCachedImages( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCachedImagesSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCachedImages( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCachedImagesAsync(String location) { + return new PagedFlux<>( + () -> listCachedImagesSinglePageAsync(location), nextLink -> listCachedImagesNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCachedImagesAsync(String location, Context context) { + return new PagedFlux<>( + () -> listCachedImagesSinglePageAsync(location, context), + nextLink -> listCachedImagesNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCachedImages(String location) { + return new PagedIterable<>(listCachedImagesAsync(location)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCachedImages(String location, Context context) { + return new PagedIterable<>(listCachedImagesAsync(location, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCapabilitiesSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listCapabilities( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCapabilitiesSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCapabilities( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCapabilitiesAsync(String location) { + return new PagedFlux<>( + () -> listCapabilitiesSinglePageAsync(location), nextLink -> listCapabilitiesNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCapabilitiesAsync(String location, Context context) { + return new PagedFlux<>( + () -> listCapabilitiesSinglePageAsync(location, context), + nextLink -> listCapabilitiesNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCapabilities(String location) { + return new PagedIterable<>(listCapabilitiesAsync(location)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCapabilities(String location, Context context) { + return new PagedIterable<>(listCapabilitiesAsync(location, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response containing cached images along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCachedImagesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listCachedImagesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response containing cached images along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCachedImagesNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCachedImagesNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response containing list of capabilities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCapabilitiesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listCapabilitiesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response containing list of capabilities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCapabilitiesNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCapabilitiesNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsImpl.java new file mode 100644 index 0000000000000..27741c437b36a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.fluent.LocationsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CachedImagesInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CapabilitiesInner; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.containerinstance.generated.models.CachedImages; +import com.azure.resourcemanager.containerinstance.generated.models.Capabilities; +import com.azure.resourcemanager.containerinstance.generated.models.Locations; +import com.azure.resourcemanager.containerinstance.generated.models.Usage; + +public final class LocationsImpl implements Locations { + private static final ClientLogger LOGGER = new ClientLogger(LocationsImpl.class); + + private final LocationsClient innerClient; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + public LocationsImpl( + LocationsClient innerClient, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listUsage(String location) { + PagedIterable inner = this.serviceClient().listUsage(location); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listUsage(String location, Context context) { + PagedIterable inner = this.serviceClient().listUsage(location, context); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listCachedImages(String location) { + PagedIterable inner = this.serviceClient().listCachedImages(location); + return Utils.mapPage(inner, inner1 -> new CachedImagesImpl(inner1, this.manager())); + } + + public PagedIterable listCachedImages(String location, Context context) { + PagedIterable inner = this.serviceClient().listCachedImages(location, context); + return Utils.mapPage(inner, inner1 -> new CachedImagesImpl(inner1, this.manager())); + } + + public PagedIterable listCapabilities(String location) { + PagedIterable inner = this.serviceClient().listCapabilities(location); + return Utils.mapPage(inner, inner1 -> new CapabilitiesImpl(inner1, this.manager())); + } + + public PagedIterable listCapabilities(String location, Context context) { + PagedIterable inner = this.serviceClient().listCapabilities(location, context); + return Utils.mapPage(inner, inner1 -> new CapabilitiesImpl(inner1, this.manager())); + } + + private LocationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LogsImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LogsImpl.java new file mode 100644 index 0000000000000..dd52a2b203b6e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LogsImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.LogsInner; +import com.azure.resourcemanager.containerinstance.generated.models.Logs; + +public final class LogsImpl implements Logs { + private LogsInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + LogsImpl( + LogsInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String content() { + return this.innerModel().content(); + } + + public LogsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationImpl.java new file mode 100644 index 0000000000000..27b836beebeae --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerInstanceOperationsOrigin; +import com.azure.resourcemanager.containerinstance.generated.models.Operation; +import com.azure.resourcemanager.containerinstance.generated.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + OperationImpl( + OperationInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public ContainerInstanceOperationsOrigin origin() { + return this.innerModel().origin(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..9eb0057c88606 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.containerinstance.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.containerinstance.generated.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ContainerInstanceManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerInstanceManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerInstanceMan") + public interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ContainerInstance/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..a73233e433bb9 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.containerinstance.generated.models.Operation; +import com.azure.resourcemanager.containerinstance.generated.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/SubnetServiceAssociationLinksClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/SubnetServiceAssociationLinksClientImpl.java new file mode 100644 index 0000000000000..738d2f969f8d3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/SubnetServiceAssociationLinksClientImpl.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerinstance.generated.fluent.SubnetServiceAssociationLinksClient; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SubnetServiceAssociationLinksClient. */ +public final class SubnetServiceAssociationLinksClientImpl implements SubnetServiceAssociationLinksClient { + /** The proxy service used to perform REST calls. */ + private final SubnetServiceAssociationLinksService service; + + /** The service client containing this operation class. */ + private final ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of SubnetServiceAssociationLinksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SubnetServiceAssociationLinksClientImpl(ContainerInstanceManagementClientImpl client) { + this.service = + RestProxy + .create( + SubnetServiceAssociationLinksService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerInstanceManagementClientSubnetServiceAssociationLinks to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerInstanceMan") + public interface SubnetServiceAssociationLinksService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/providers/Microsoft.ContainerInstance/serviceAssociationLinks/default") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("subnetName") String subnetName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Delete container group virtual network association links. + * + *

Delete container group virtual network association links. The operation does not delete other resources + * provided by the user. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String virtualNetworkName, String subnetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + virtualNetworkName, + subnetName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete container group virtual network association links. + * + *

Delete container group virtual network association links. The operation does not delete other resources + * provided by the user. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (subnetName == null) { + return Mono.error(new IllegalArgumentException("Parameter subnetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + virtualNetworkName, + subnetName, + accept, + context); + } + + /** + * Delete container group virtual network association links. + * + *

Delete container group virtual network association links. The operation does not delete other resources + * provided by the user. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String virtualNetworkName, String subnetName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete container group virtual network association links. + * + *

Delete container group virtual network association links. The operation does not delete other resources + * provided by the user. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete container group virtual network association links. + * + *

Delete container group virtual network association links. The operation does not delete other resources + * provided by the user. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkName, String subnetName) { + return this.beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName).getSyncPoller(); + } + + /** + * Delete container group virtual network association links. + * + *

Delete container group virtual network association links. The operation does not delete other resources + * provided by the user. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + return this.beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName, context).getSyncPoller(); + } + + /** + * Delete container group virtual network association links. + * + *

Delete container group virtual network association links. The operation does not delete other resources + * provided by the user. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container group virtual network association links. + * + *

Delete container group virtual network association links. The operation does not delete other resources + * provided by the user. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container group virtual network association links. + * + *

Delete container group virtual network association links. The operation does not delete other resources + * provided by the user. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String virtualNetworkName, String subnetName) { + deleteAsync(resourceGroupName, virtualNetworkName, subnetName).block(); + } + + /** + * Delete container group virtual network association links. + * + *

Delete container group virtual network association links. The operation does not delete other resources + * provided by the user. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + deleteAsync(resourceGroupName, virtualNetworkName, subnetName, context).block(); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/SubnetServiceAssociationLinksImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/SubnetServiceAssociationLinksImpl.java new file mode 100644 index 0000000000000..0fc79be10f118 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/SubnetServiceAssociationLinksImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.fluent.SubnetServiceAssociationLinksClient; +import com.azure.resourcemanager.containerinstance.generated.models.SubnetServiceAssociationLinks; + +public final class SubnetServiceAssociationLinksImpl implements SubnetServiceAssociationLinks { + private static final ClientLogger LOGGER = new ClientLogger(SubnetServiceAssociationLinksImpl.class); + + private final SubnetServiceAssociationLinksClient innerClient; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + public SubnetServiceAssociationLinksImpl( + SubnetServiceAssociationLinksClient innerClient, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String virtualNetworkName, String subnetName) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName, subnetName); + } + + public void delete(String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName, subnetName, context); + } + + private SubnetServiceAssociationLinksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/UsageImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/UsageImpl.java new file mode 100644 index 0000000000000..abecbf26097f4 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/UsageImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.containerinstance.generated.models.Usage; +import com.azure.resourcemanager.containerinstance.generated.models.UsageName; + +public final class UsageImpl implements Usage { + private UsageInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + UsageImpl( + UsageInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String unit() { + return this.innerModel().unit(); + } + + public Integer currentValue() { + return this.innerModel().currentValue(); + } + + public Integer limit() { + return this.innerModel().limit(); + } + + public UsageName name() { + return this.innerModel().name(); + } + + public UsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/Utils.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/Utils.java new file mode 100644 index 0000000000000..fc8968e35a022 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/package-info.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/package-info.java new file mode 100644 index 0000000000000..ea9a6b504df3e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for ContainerInstanceManagementClient. null. */ +package com.azure.resourcemanager.containerinstance.generated.implementation; diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileVolume.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileVolume.java new file mode 100644 index 0000000000000..9956077e1e652 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileVolume.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the Azure File volume. Azure File shares are mounted as volumes. */ +@Fluent +public final class AzureFileVolume { + /* + * The name of the Azure File share to be mounted as a volume. + */ + @JsonProperty(value = "shareName", required = true) + private String shareName; + + /* + * The flag indicating whether the Azure File shared mounted as a volume is read-only. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /* + * The name of the storage account that contains the Azure File share. + */ + @JsonProperty(value = "storageAccountName", required = true) + private String storageAccountName; + + /* + * The storage account access key used to access the Azure File share. + */ + @JsonProperty(value = "storageAccountKey") + private String storageAccountKey; + + /** Creates an instance of AzureFileVolume class. */ + public AzureFileVolume() { + } + + /** + * Get the shareName property: The name of the Azure File share to be mounted as a volume. + * + * @return the shareName value. + */ + public String shareName() { + return this.shareName; + } + + /** + * Set the shareName property: The name of the Azure File share to be mounted as a volume. + * + * @param shareName the shareName value to set. + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withShareName(String shareName) { + this.shareName = shareName; + return this; + } + + /** + * Get the readOnly property: The flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @return the readOnly value. + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the readOnly property: The flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @param readOnly the readOnly value to set. + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the storageAccountName property: The name of the storage account that contains the Azure File share. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the storageAccountName property: The name of the storage account that contains the Azure File share. + * + * @param storageAccountName the storageAccountName value to set. + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storageAccountKey property: The storage account access key used to access the Azure File share. + * + * @return the storageAccountKey value. + */ + public String storageAccountKey() { + return this.storageAccountKey; + } + + /** + * Set the storageAccountKey property: The storage account access key used to access the Azure File share. + * + * @param storageAccountKey the storageAccountKey value to set. + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountKey(String storageAccountKey) { + this.storageAccountKey = storageAccountKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (shareName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property shareName in model AzureFileVolume")); + } + if (storageAccountName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageAccountName in model AzureFileVolume")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureFileVolume.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImages.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImages.java new file mode 100644 index 0000000000000..6d314eceeb9a4 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImages.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CachedImagesInner; + +/** An immutable client-side representation of CachedImages. */ +public interface CachedImages { + /** + * Gets the osType property: The OS type of the cached image. + * + * @return the osType value. + */ + String osType(); + + /** + * Gets the image property: The cached image name. + * + * @return the image value. + */ + String image(); + + /** + * Gets the inner com.azure.resourcemanager.containerinstance.generated.fluent.models.CachedImagesInner object. + * + * @return the inner object. + */ + CachedImagesInner innerModel(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImagesListResult.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImagesListResult.java new file mode 100644 index 0000000000000..c0491ad9bc013 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImagesListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CachedImagesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response containing cached images. */ +@Fluent +public final class CachedImagesListResult { + /* + * The list of cached images. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI to fetch the next page of cached images. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of CachedImagesListResult class. */ + public CachedImagesListResult() { + } + + /** + * Get the value property: The list of cached images. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of cached images. + * + * @param value the value value to set. + * @return the CachedImagesListResult object itself. + */ + public CachedImagesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of cached images. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of cached images. + * + * @param nextLink the nextLink value to set. + * @return the CachedImagesListResult object itself. + */ + public CachedImagesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Capabilities.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Capabilities.java new file mode 100644 index 0000000000000..675fa2181e340 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Capabilities.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CapabilitiesInner; + +/** An immutable client-side representation of Capabilities. */ +public interface Capabilities { + /** + * Gets the resourceType property: The resource type that this capability describes. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the osType property: The OS type that this capability describes. + * + * @return the osType value. + */ + String osType(); + + /** + * Gets the location property: The resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the ipAddressType property: The ip address type that this capability describes. + * + * @return the ipAddressType value. + */ + String ipAddressType(); + + /** + * Gets the gpu property: The GPU sku that this capability describes. + * + * @return the gpu value. + */ + String gpu(); + + /** + * Gets the capabilities property: The supported capabilities. + * + * @return the capabilities value. + */ + CapabilitiesCapabilities capabilities(); + + /** + * Gets the inner com.azure.resourcemanager.containerinstance.generated.fluent.models.CapabilitiesInner object. + * + * @return the inner object. + */ + CapabilitiesInner innerModel(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesCapabilities.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesCapabilities.java new file mode 100644 index 0000000000000..65f53e163c42f --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesCapabilities.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The supported capabilities. */ +@Immutable +public final class CapabilitiesCapabilities { + /* + * The maximum allowed memory request in GB. + */ + @JsonProperty(value = "maxMemoryInGB", access = JsonProperty.Access.WRITE_ONLY) + private Float maxMemoryInGB; + + /* + * The maximum allowed CPU request in cores. + */ + @JsonProperty(value = "maxCpu", access = JsonProperty.Access.WRITE_ONLY) + private Float maxCpu; + + /* + * The maximum allowed GPU count. + */ + @JsonProperty(value = "maxGpuCount", access = JsonProperty.Access.WRITE_ONLY) + private Float maxGpuCount; + + /** Creates an instance of CapabilitiesCapabilities class. */ + public CapabilitiesCapabilities() { + } + + /** + * Get the maxMemoryInGB property: The maximum allowed memory request in GB. + * + * @return the maxMemoryInGB value. + */ + public Float maxMemoryInGB() { + return this.maxMemoryInGB; + } + + /** + * Get the maxCpu property: The maximum allowed CPU request in cores. + * + * @return the maxCpu value. + */ + public Float maxCpu() { + return this.maxCpu; + } + + /** + * Get the maxGpuCount property: The maximum allowed GPU count. + * + * @return the maxGpuCount value. + */ + public Float maxGpuCount() { + return this.maxGpuCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesListResult.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesListResult.java new file mode 100644 index 0000000000000..8524a893d14c8 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.CapabilitiesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response containing list of capabilities. */ +@Fluent +public final class CapabilitiesListResult { + /* + * 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; + + /** Creates an instance of CapabilitiesListResult class. */ + public CapabilitiesListResult() { + } + + /** + * Get the value property: The list of capabilities. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of capabilities. + * + * @param value the value value to set. + * @return the CapabilitiesListResult object itself. + */ + public CapabilitiesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of capabilities. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of capabilities. + * + * @param nextLink the nextLink value to set. + * @return the CapabilitiesListResult object itself. + */ + public CapabilitiesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Container.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Container.java new file mode 100644 index 0000000000000..6b0f20facbb83 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Container.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A container instance. */ +@Fluent +public final class Container { + /* + * The user-provided name of the container instance. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The properties of the container instance. + */ + @JsonProperty(value = "properties", required = true) + private ContainerProperties innerProperties = new ContainerProperties(); + + /** Creates an instance of Container class. */ + public Container() { + } + + /** + * Get the name property: The user-provided name of the container instance. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The user-provided name of the container instance. + * + * @param name the name value to set. + * @return the Container object itself. + */ + public Container withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: The properties of the container instance. + * + * @return the innerProperties value. + */ + private ContainerProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the image property: The name of the image used to create the container instance. + * + * @return the image value. + */ + public String image() { + return this.innerProperties() == null ? null : this.innerProperties().image(); + } + + /** + * Set the image property: The name of the image used to create the container instance. + * + * @param image the image value to set. + * @return the Container object itself. + */ + public Container withImage(String image) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withImage(image); + return this; + } + + /** + * Get the command property: The commands to execute within the container instance in exec form. + * + * @return the command value. + */ + public List command() { + return this.innerProperties() == null ? null : this.innerProperties().command(); + } + + /** + * Set the command property: The commands to execute within the container instance in exec form. + * + * @param command the command value to set. + * @return the Container object itself. + */ + public Container withCommand(List command) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withCommand(command); + return this; + } + + /** + * Get the ports property: The exposed ports on the container instance. + * + * @return the ports value. + */ + public List ports() { + return this.innerProperties() == null ? null : this.innerProperties().ports(); + } + + /** + * Set the ports property: The exposed ports on the container instance. + * + * @param ports the ports value to set. + * @return the Container object itself. + */ + public Container withPorts(List ports) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withPorts(ports); + return this; + } + + /** + * Get the environmentVariables property: The environment variables to set in the container instance. + * + * @return the environmentVariables value. + */ + public List environmentVariables() { + return this.innerProperties() == null ? null : this.innerProperties().environmentVariables(); + } + + /** + * Set the environmentVariables property: The environment variables to set in the container instance. + * + * @param environmentVariables the environmentVariables value to set. + * @return the Container object itself. + */ + public Container withEnvironmentVariables(List environmentVariables) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withEnvironmentVariables(environmentVariables); + return this; + } + + /** + * Get the instanceView property: The instance view of the container instance. Only valid in response. + * + * @return the instanceView value. + */ + public ContainerPropertiesInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Get the resources property: The resource requirements of the container instance. + * + * @return the resources value. + */ + public ResourceRequirements resources() { + return this.innerProperties() == null ? null : this.innerProperties().resources(); + } + + /** + * Set the resources property: The resource requirements of the container instance. + * + * @param resources the resources value to set. + * @return the Container object itself. + */ + public Container withResources(ResourceRequirements resources) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withResources(resources); + return this; + } + + /** + * Get the volumeMounts property: The volume mounts available to the container instance. + * + * @return the volumeMounts value. + */ + public List volumeMounts() { + return this.innerProperties() == null ? null : this.innerProperties().volumeMounts(); + } + + /** + * Set the volumeMounts property: The volume mounts available to the container instance. + * + * @param volumeMounts the volumeMounts value to set. + * @return the Container object itself. + */ + public Container withVolumeMounts(List volumeMounts) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withVolumeMounts(volumeMounts); + return this; + } + + /** + * Get the livenessProbe property: The liveness probe. + * + * @return the livenessProbe value. + */ + public ContainerProbe livenessProbe() { + return this.innerProperties() == null ? null : this.innerProperties().livenessProbe(); + } + + /** + * Set the livenessProbe property: The liveness probe. + * + * @param livenessProbe the livenessProbe value to set. + * @return the Container object itself. + */ + public Container withLivenessProbe(ContainerProbe livenessProbe) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withLivenessProbe(livenessProbe); + return this; + } + + /** + * Get the readinessProbe property: The readiness probe. + * + * @return the readinessProbe value. + */ + public ContainerProbe readinessProbe() { + return this.innerProperties() == null ? null : this.innerProperties().readinessProbe(); + } + + /** + * Set the readinessProbe property: The readiness probe. + * + * @param readinessProbe the readinessProbe value to set. + * @return the Container object itself. + */ + public Container withReadinessProbe(ContainerProbe readinessProbe) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withReadinessProbe(readinessProbe); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Container")); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model Container")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Container.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerAttachResponse.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerAttachResponse.java new file mode 100644 index 0000000000000..72d9d05c200b9 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerAttachResponse.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerAttachResponseInner; + +/** An immutable client-side representation of ContainerAttachResponse. */ +public interface ContainerAttachResponse { + /** + * Gets the webSocketUri property: The uri for the output stream from the attach. + * + * @return the webSocketUri value. + */ + String webSocketUri(); + + /** + * Gets the password property: The password to the output stream from the attach. Send as an Authorization header + * value when connecting to the websocketUri. + * + * @return the password value. + */ + String password(); + + /** + * Gets the inner com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerAttachResponseInner + * object. + * + * @return the inner object. + */ + ContainerAttachResponseInner innerModel(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExec.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExec.java new file mode 100644 index 0000000000000..88a3de5749fd7 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExec.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The container execution command, for liveness or readiness probe. */ +@Fluent +public final class ContainerExec { + /* + * The commands to execute within the container. + */ + @JsonProperty(value = "command") + private List command; + + /** Creates an instance of ContainerExec class. */ + public ContainerExec() { + } + + /** + * Get the command property: The commands to execute within the container. + * + * @return the command value. + */ + public List command() { + return this.command; + } + + /** + * Set the command property: The commands to execute within the container. + * + * @param command the command value to set. + * @return the ContainerExec object itself. + */ + public ContainerExec withCommand(List command) { + this.command = command; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequest.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequest.java new file mode 100644 index 0000000000000..321d41caead71 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequest.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The container exec request. */ +@Fluent +public final class ContainerExecRequest { + /* + * The command to be executed. + */ + @JsonProperty(value = "command") + private String command; + + /* + * The size of the terminal. + */ + @JsonProperty(value = "terminalSize") + private ContainerExecRequestTerminalSize terminalSize; + + /** Creates an instance of ContainerExecRequest class. */ + public ContainerExecRequest() { + } + + /** + * Get the command property: The command to be executed. + * + * @return the command value. + */ + public String command() { + return this.command; + } + + /** + * Set the command property: The command to be executed. + * + * @param command the command value to set. + * @return the ContainerExecRequest object itself. + */ + public ContainerExecRequest withCommand(String command) { + this.command = command; + return this; + } + + /** + * Get the terminalSize property: The size of the terminal. + * + * @return the terminalSize value. + */ + public ContainerExecRequestTerminalSize terminalSize() { + return this.terminalSize; + } + + /** + * Set the terminalSize property: The size of the terminal. + * + * @param terminalSize the terminalSize value to set. + * @return the ContainerExecRequest object itself. + */ + public ContainerExecRequest withTerminalSize(ContainerExecRequestTerminalSize terminalSize) { + this.terminalSize = terminalSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (terminalSize() != null) { + terminalSize().validate(); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequestTerminalSize.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequestTerminalSize.java new file mode 100644 index 0000000000000..44e38ce77414f --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequestTerminalSize.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The size of the terminal. */ +@Fluent +public final class ContainerExecRequestTerminalSize { + /* + * The row size of the terminal + */ + @JsonProperty(value = "rows") + private Integer rows; + + /* + * The column size of the terminal + */ + @JsonProperty(value = "cols") + private Integer cols; + + /** Creates an instance of ContainerExecRequestTerminalSize class. */ + public ContainerExecRequestTerminalSize() { + } + + /** + * Get the rows property: The row size of the terminal. + * + * @return the rows value. + */ + public Integer rows() { + return this.rows; + } + + /** + * Set the rows property: The row size of the terminal. + * + * @param rows the rows value to set. + * @return the ContainerExecRequestTerminalSize object itself. + */ + public ContainerExecRequestTerminalSize withRows(Integer rows) { + this.rows = rows; + return this; + } + + /** + * Get the cols property: The column size of the terminal. + * + * @return the cols value. + */ + public Integer cols() { + return this.cols; + } + + /** + * Set the cols property: The column size of the terminal. + * + * @param cols the cols value to set. + * @return the ContainerExecRequestTerminalSize object itself. + */ + public ContainerExecRequestTerminalSize withCols(Integer cols) { + this.cols = cols; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecResponse.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecResponse.java new file mode 100644 index 0000000000000..4cd131ea9be74 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecResponse.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerExecResponseInner; + +/** An immutable client-side representation of ContainerExecResponse. */ +public interface ContainerExecResponse { + /** + * Gets the webSocketUri property: The uri for the exec websocket. + * + * @return the webSocketUri value. + */ + String webSocketUri(); + + /** + * Gets the password property: The password to start the exec command. + * + * @return the password value. + */ + String password(); + + /** + * Gets the inner com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerExecResponseInner + * object. + * + * @return the inner object. + */ + ContainerExecResponseInner innerModel(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroup.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroup.java new file mode 100644 index 0000000000000..179957cb1660d --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroup.java @@ -0,0 +1,783 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ContainerGroup. */ +public interface ContainerGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the zones property: The zones for the container group. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the identity property: The identity of the container group, if configured. + * + * @return the identity value. + */ + ContainerGroupIdentity identity(); + + /** + * Gets the provisioningState property: The provisioning state of the container group. This only appears in the + * response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the containers property: The containers within the container group. + * + * @return the containers value. + */ + List containers(); + + /** + * Gets the imageRegistryCredentials property: The image registry credentials by which the container group is + * created from. + * + * @return the imageRegistryCredentials value. + */ + List imageRegistryCredentials(); + + /** + * Gets the provisioningTimeoutInSeconds property: Time in seconds in which a container group deployment would + * timeout and fail. The allowed maximum value is 1800 seconds. If value is not provided, property is given maximum + * value by default. + * + * @return the provisioningTimeoutInSeconds value. + */ + Integer provisioningTimeoutInSeconds(); + + /** + * Gets the isCustomProvisioningTimeout property: Flag indicating whether a custom value was provided for the + * provisioningTimeoutInSeconds property. + * + * @return the isCustomProvisioningTimeout value. + */ + IsCustomProvisioningTimeout isCustomProvisioningTimeout(); + + /** + * Gets the restartPolicy property: Restart policy for all containers within the container group. - `Always` Always + * restart - `OnFailure` Restart on failure - `Never` Never restart. + * + * @return the restartPolicy value. + */ + ContainerGroupRestartPolicy restartPolicy(); + + /** + * Gets the ipAddress property: The IP address type of the container group. + * + * @return the ipAddress value. + */ + IpAddress ipAddress(); + + /** + * Gets the osType property: The operating system type required by the containers in the container group. + * + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * Gets the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value. + */ + List volumes(); + + /** + * Gets the instanceView property: The instance view of the container group. Only valid in response. + * + * @return the instanceView value. + */ + ContainerGroupPropertiesInstanceView instanceView(); + + /** + * Gets the diagnostics property: The diagnostic information for a container group. + * + * @return the diagnostics value. + */ + ContainerGroupDiagnostics diagnostics(); + + /** + * Gets the subnetIds property: The subnet resource IDs for a container group. + * + * @return the subnetIds value. + */ + List subnetIds(); + + /** + * Gets the dnsConfig property: The DNS config information for a container group. + * + * @return the dnsConfig value. + */ + DnsConfiguration dnsConfig(); + + /** + * Gets the sku property: The SKU for a container group. + * + * @return the sku value. + */ + ContainerGroupSku sku(); + + /** + * Gets the encryptionProperties property: The encryption properties for a container group. + * + * @return the encryptionProperties value. + */ + EncryptionProperties encryptionProperties(); + + /** + * Gets the initContainers property: The init containers for a container group. + * + * @return the initContainers value. + */ + List initContainers(); + + /** + * Gets the extensions property: extensions used by virtual kubelet. + * + * @return the extensions value. + */ + List extensions(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupInner object. + * + * @return the inner object. + */ + ContainerGroupInner innerModel(); + + /** The entirety of the ContainerGroup definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithContainers, + DefinitionStages.WithOsType, + DefinitionStages.WithCreate { + } + /** The ContainerGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the ContainerGroup definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ContainerGroup definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the ContainerGroup definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithContainers withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the ContainerGroup definition allowing to specify containers. */ + interface WithContainers { + /** + * Specifies the containers property: The containers within the container group.. + * + * @param containers The containers within the container group. + * @return the next definition stage. + */ + WithOsType withContainers(List containers); + } + /** The stage of the ContainerGroup definition allowing to specify osType. */ + interface WithOsType { + /** + * Specifies the osType property: The operating system type required by the containers in the container + * group.. + * + * @param osType The operating system type required by the containers in the container group. + * @return the next definition stage. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + /** + * The stage of the ContainerGroup definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithZones, + DefinitionStages.WithIdentity, + DefinitionStages.WithImageRegistryCredentials, + DefinitionStages.WithProvisioningTimeoutInSeconds, + DefinitionStages.WithRestartPolicy, + DefinitionStages.WithIpAddress, + DefinitionStages.WithVolumes, + DefinitionStages.WithDiagnostics, + DefinitionStages.WithSubnetIds, + DefinitionStages.WithDnsConfig, + DefinitionStages.WithSku, + DefinitionStages.WithEncryptionProperties, + DefinitionStages.WithInitContainers, + DefinitionStages.WithExtensions { + /** + * Executes the create request. + * + * @return the created resource. + */ + ContainerGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ContainerGroup create(Context context); + } + /** The stage of the ContainerGroup definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the ContainerGroup definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: The zones for the container group.. + * + * @param zones The zones for the container group. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the ContainerGroup definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the container group, if configured.. + * + * @param identity The identity of the container group, if configured. + * @return the next definition stage. + */ + WithCreate withIdentity(ContainerGroupIdentity identity); + } + /** The stage of the ContainerGroup definition allowing to specify imageRegistryCredentials. */ + interface WithImageRegistryCredentials { + /** + * Specifies the imageRegistryCredentials property: The image registry credentials by which the container + * group is created from.. + * + * @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 definition allowing to specify provisioningTimeoutInSeconds. */ + interface WithProvisioningTimeoutInSeconds { + /** + * Specifies the provisioningTimeoutInSeconds property: Time in seconds in which a container group + * deployment would timeout and fail. The allowed maximum value is 1800 seconds. If value is not provided, + * property is given maximum value by default.. + * + * @param provisioningTimeoutInSeconds Time in seconds in which a container group deployment would timeout + * and fail. The allowed maximum value is 1800 seconds. If value is not provided, property is given + * maximum value by default. + * @return the next definition stage. + */ + WithCreate withProvisioningTimeoutInSeconds(Integer provisioningTimeoutInSeconds); + } + /** The stage of the ContainerGroup definition allowing to specify restartPolicy. */ + interface WithRestartPolicy { + /** + * Specifies the restartPolicy property: Restart policy for all containers within the container group. - + * `Always` Always restart - `OnFailure` Restart on failure - `Never` Never restart . + * + * @param restartPolicy Restart policy for all containers within the container group. - `Always` Always + * restart - `OnFailure` Restart on failure - `Never` Never restart. + * @return the next definition stage. + */ + WithCreate withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + /** The stage of the ContainerGroup definition allowing to specify ipAddress. */ + interface WithIpAddress { + /** + * Specifies the ipAddress property: The IP address type of the container group.. + * + * @param ipAddress The IP address type of the container group. + * @return the next definition stage. + */ + WithCreate withIpAddress(IpAddress ipAddress); + } + /** The stage of the ContainerGroup definition allowing to specify volumes. */ + interface WithVolumes { + /** + * Specifies the volumes property: The list of volumes that can be mounted by containers in this container + * group.. + * + * @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); + } + /** The stage of the ContainerGroup definition allowing to specify diagnostics. */ + interface WithDiagnostics { + /** + * Specifies the diagnostics property: The diagnostic information for a container group.. + * + * @param diagnostics The diagnostic information for a container group. + * @return the next definition stage. + */ + WithCreate withDiagnostics(ContainerGroupDiagnostics diagnostics); + } + /** The stage of the ContainerGroup definition allowing to specify subnetIds. */ + interface WithSubnetIds { + /** + * Specifies the subnetIds property: The subnet resource IDs for a container group.. + * + * @param subnetIds The subnet resource IDs for a container group. + * @return the next definition stage. + */ + WithCreate withSubnetIds(List subnetIds); + } + /** The stage of the ContainerGroup definition allowing to specify dnsConfig. */ + interface WithDnsConfig { + /** + * Specifies the dnsConfig property: The DNS config information for a container group.. + * + * @param dnsConfig The DNS config information for a container group. + * @return the next definition stage. + */ + WithCreate withDnsConfig(DnsConfiguration dnsConfig); + } + /** The stage of the ContainerGroup definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU for a container group.. + * + * @param sku The SKU for a container group. + * @return the next definition stage. + */ + WithCreate withSku(ContainerGroupSku sku); + } + /** The stage of the ContainerGroup definition allowing to specify encryptionProperties. */ + interface WithEncryptionProperties { + /** + * Specifies the encryptionProperties property: The encryption properties for a container group.. + * + * @param encryptionProperties The encryption properties for a container group. + * @return the next definition stage. + */ + WithCreate withEncryptionProperties(EncryptionProperties encryptionProperties); + } + /** The stage of the ContainerGroup definition allowing to specify initContainers. */ + interface WithInitContainers { + /** + * Specifies the initContainers property: The init containers for a container group.. + * + * @param initContainers The init containers for a container group. + * @return the next definition stage. + */ + WithCreate withInitContainers(List initContainers); + } + /** The stage of the ContainerGroup definition allowing to specify extensions. */ + interface WithExtensions { + /** + * Specifies the extensions property: extensions used by virtual kubelet. + * + * @param extensions extensions used by virtual kubelet. + * @return the next definition stage. + */ + WithCreate withExtensions(List extensions); + } + } + /** + * Begins update for the ContainerGroup resource. + * + * @return the stage of resource update. + */ + ContainerGroup.Update update(); + + /** The template for ContainerGroup update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithZones, + UpdateStages.WithIdentity, + UpdateStages.WithContainers, + UpdateStages.WithImageRegistryCredentials, + UpdateStages.WithProvisioningTimeoutInSeconds, + UpdateStages.WithRestartPolicy, + UpdateStages.WithIpAddress, + UpdateStages.WithOsType, + UpdateStages.WithVolumes, + UpdateStages.WithDiagnostics, + UpdateStages.WithSubnetIds, + UpdateStages.WithDnsConfig, + UpdateStages.WithSku, + UpdateStages.WithEncryptionProperties, + UpdateStages.WithInitContainers, + UpdateStages.WithExtensions { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ContainerGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ContainerGroup apply(Context context); + } + /** The ContainerGroup update stages. */ + interface UpdateStages { + /** The stage of the ContainerGroup update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ContainerGroup update allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: The zones for the container group.. + * + * @param zones The zones for the container group. + * @return the next definition stage. + */ + Update withZones(List zones); + } + /** The stage of the ContainerGroup update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the container group, if configured.. + * + * @param identity The identity of the container group, if configured. + * @return the next definition stage. + */ + Update withIdentity(ContainerGroupIdentity identity); + } + /** The stage of the ContainerGroup update allowing to specify containers. */ + interface WithContainers { + /** + * Specifies the containers property: The containers within the container group.. + * + * @param containers The containers within the container group. + * @return the next definition stage. + */ + Update withContainers(List containers); + } + /** The stage of the ContainerGroup update allowing to specify imageRegistryCredentials. */ + interface WithImageRegistryCredentials { + /** + * Specifies the imageRegistryCredentials property: The image registry credentials by which the container + * group is created from.. + * + * @param imageRegistryCredentials The image registry credentials by which the container group is created + * from. + * @return the next definition stage. + */ + Update withImageRegistryCredentials(List imageRegistryCredentials); + } + /** The stage of the ContainerGroup update allowing to specify provisioningTimeoutInSeconds. */ + interface WithProvisioningTimeoutInSeconds { + /** + * Specifies the provisioningTimeoutInSeconds property: Time in seconds in which a container group + * deployment would timeout and fail. The allowed maximum value is 1800 seconds. If value is not provided, + * property is given maximum value by default.. + * + * @param provisioningTimeoutInSeconds Time in seconds in which a container group deployment would timeout + * and fail. The allowed maximum value is 1800 seconds. If value is not provided, property is given + * maximum value by default. + * @return the next definition stage. + */ + Update withProvisioningTimeoutInSeconds(Integer provisioningTimeoutInSeconds); + } + /** The stage of the ContainerGroup update allowing to specify restartPolicy. */ + interface WithRestartPolicy { + /** + * Specifies the restartPolicy property: Restart policy for all containers within the container group. - + * `Always` Always restart - `OnFailure` Restart on failure - `Never` Never restart . + * + * @param restartPolicy Restart policy for all containers within the container group. - `Always` Always + * restart - `OnFailure` Restart on failure - `Never` Never restart. + * @return the next definition stage. + */ + Update withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + /** The stage of the ContainerGroup update allowing to specify ipAddress. */ + interface WithIpAddress { + /** + * Specifies the ipAddress property: The IP address type of the container group.. + * + * @param ipAddress The IP address type of the container group. + * @return the next definition stage. + */ + Update withIpAddress(IpAddress ipAddress); + } + /** The stage of the ContainerGroup update allowing to specify osType. */ + interface WithOsType { + /** + * Specifies the osType property: The operating system type required by the containers in the container + * group.. + * + * @param osType The operating system type required by the containers in the container group. + * @return the next definition stage. + */ + Update withOsType(OperatingSystemTypes osType); + } + /** The stage of the ContainerGroup update allowing to specify volumes. */ + interface WithVolumes { + /** + * Specifies the volumes property: The list of volumes that can be mounted by containers in this container + * group.. + * + * @param volumes The list of volumes that can be mounted by containers in this container group. + * @return the next definition stage. + */ + Update withVolumes(List volumes); + } + /** The stage of the ContainerGroup update allowing to specify diagnostics. */ + interface WithDiagnostics { + /** + * Specifies the diagnostics property: The diagnostic information for a container group.. + * + * @param diagnostics The diagnostic information for a container group. + * @return the next definition stage. + */ + Update withDiagnostics(ContainerGroupDiagnostics diagnostics); + } + /** The stage of the ContainerGroup update allowing to specify subnetIds. */ + interface WithSubnetIds { + /** + * Specifies the subnetIds property: The subnet resource IDs for a container group.. + * + * @param subnetIds The subnet resource IDs for a container group. + * @return the next definition stage. + */ + Update withSubnetIds(List subnetIds); + } + /** The stage of the ContainerGroup update allowing to specify dnsConfig. */ + interface WithDnsConfig { + /** + * Specifies the dnsConfig property: The DNS config information for a container group.. + * + * @param dnsConfig The DNS config information for a container group. + * @return the next definition stage. + */ + Update withDnsConfig(DnsConfiguration dnsConfig); + } + /** The stage of the ContainerGroup update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU for a container group.. + * + * @param sku The SKU for a container group. + * @return the next definition stage. + */ + Update withSku(ContainerGroupSku sku); + } + /** The stage of the ContainerGroup update allowing to specify encryptionProperties. */ + interface WithEncryptionProperties { + /** + * Specifies the encryptionProperties property: The encryption properties for a container group.. + * + * @param encryptionProperties The encryption properties for a container group. + * @return the next definition stage. + */ + Update withEncryptionProperties(EncryptionProperties encryptionProperties); + } + /** The stage of the ContainerGroup update allowing to specify initContainers. */ + interface WithInitContainers { + /** + * Specifies the initContainers property: The init containers for a container group.. + * + * @param initContainers The init containers for a container group. + * @return the next definition stage. + */ + Update withInitContainers(List initContainers); + } + /** The stage of the ContainerGroup update allowing to specify extensions. */ + interface WithExtensions { + /** + * Specifies the extensions property: extensions used by virtual kubelet. + * + * @param extensions extensions used by virtual kubelet. + * @return the next definition stage. + */ + Update withExtensions(List extensions); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ContainerGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ContainerGroup refresh(Context context); + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(); + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(Context context); + + /** + * Stops all containers in a container group. + * + *

Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response stopWithResponse(Context context); + + /** + * Stops all containers in a container group. + * + *

Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(); + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(); + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupDiagnostics.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupDiagnostics.java new file mode 100644 index 0000000000000..247ce7d8471a6 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupDiagnostics.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container group diagnostic information. */ +@Fluent +public final class ContainerGroupDiagnostics { + /* + * Container group log analytics information. + */ + @JsonProperty(value = "logAnalytics") + private LogAnalytics logAnalytics; + + /** Creates an instance of ContainerGroupDiagnostics class. */ + public ContainerGroupDiagnostics() { + } + + /** + * Get the logAnalytics property: Container group log analytics information. + * + * @return the logAnalytics value. + */ + public LogAnalytics logAnalytics() { + return this.logAnalytics; + } + + /** + * Set the logAnalytics property: Container group log analytics information. + * + * @param logAnalytics the logAnalytics value to set. + * @return the ContainerGroupDiagnostics object itself. + */ + public ContainerGroupDiagnostics withLogAnalytics(LogAnalytics logAnalytics) { + this.logAnalytics = logAnalytics; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logAnalytics() != null) { + logAnalytics().validate(); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIdentity.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIdentity.java new file mode 100644 index 0000000000000..cce229a3e66bf --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIdentity.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Identity for the container group. */ +@Fluent +public final class ContainerGroupIdentity { + /* + * The principal id of the container group identity. This property will only be provided for a system assigned + * identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant id associated with the container group. This property will only be provided for a system assigned + * identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The type of identity used for the container group. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities + * from the container group. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /* + * The list of user identities associated with the container group. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** Creates an instance of ContainerGroupIdentity class. */ + public ContainerGroupIdentity() { + } + + /** + * Get the principalId property: The principal id of the container group identity. This property will only be + * provided for a system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant id associated with the container group. This property will only be provided + * for a system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of identity used for the container group. The type 'SystemAssigned, UserAssigned' + * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove + * any identities from the container group. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of identity used for the container group. The type 'SystemAssigned, UserAssigned' + * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove + * any identities from the container group. + * + * @param type the type value to set. + * @return the ContainerGroupIdentity object itself. + */ + public ContainerGroupIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the container group. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the container group. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ContainerGroupIdentity object itself. + */ + public ContainerGroupIdentity withUserAssignedIdentities( + Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIpAddressType.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIpAddressType.java new file mode 100644 index 0000000000000..1e55a44c0e11b --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIpAddressType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Specifies if the IP is exposed to the public internet or private VNET. */ +public final class ContainerGroupIpAddressType extends ExpandableStringEnum { + /** Static value Public for ContainerGroupIpAddressType. */ + public static final ContainerGroupIpAddressType PUBLIC = fromString("Public"); + + /** Static value Private for ContainerGroupIpAddressType. */ + public static final ContainerGroupIpAddressType PRIVATE = fromString("Private"); + + /** + * Creates a new instance of ContainerGroupIpAddressType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerGroupIpAddressType() { + } + + /** + * Creates or finds a ContainerGroupIpAddressType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerGroupIpAddressType. + */ + @JsonCreator + public static ContainerGroupIpAddressType fromString(String name) { + return fromString(name, ContainerGroupIpAddressType.class); + } + + /** + * Gets known ContainerGroupIpAddressType values. + * + * @return known ContainerGroupIpAddressType values. + */ + public static Collection values() { + return values(ContainerGroupIpAddressType.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupListResult.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupListResult.java new file mode 100644 index 0000000000000..92c46d4755c9b --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The container group list response that contains the container group properties. */ +@Fluent +public final class ContainerGroupListResult { + /* + * The list of container groups. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI to fetch the next page of container groups. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ContainerGroupListResult class. */ + public ContainerGroupListResult() { + } + + /** + * Get the value property: The list of container groups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of container groups. + * + * @param value the value value to set. + * @return the ContainerGroupListResult object itself. + */ + public ContainerGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of container groups. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of container groups. + * + * @param nextLink the nextLink value to set. + * @return the ContainerGroupListResult object itself. + */ + public ContainerGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupNetworkProtocol.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupNetworkProtocol.java new file mode 100644 index 0000000000000..89b07eeebf6c4 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupNetworkProtocol.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The protocol associated with the port. */ +public final class ContainerGroupNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for ContainerGroupNetworkProtocol. */ + public static final ContainerGroupNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for ContainerGroupNetworkProtocol. */ + public static final ContainerGroupNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates a new instance of ContainerGroupNetworkProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerGroupNetworkProtocol() { + } + + /** + * Creates or finds a ContainerGroupNetworkProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerGroupNetworkProtocol. + */ + @JsonCreator + public static ContainerGroupNetworkProtocol fromString(String name) { + return fromString(name, ContainerGroupNetworkProtocol.class); + } + + /** + * Gets known ContainerGroupNetworkProtocol values. + * + * @return known ContainerGroupNetworkProtocol values. + */ + public static Collection values() { + return values(ContainerGroupNetworkProtocol.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProperties.java new file mode 100644 index 0000000000000..b1fd6b69dd0dd --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupProperties.java @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupPropertiesProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The container group properties. */ +@Fluent +public class ContainerGroupProperties { + /* + * The identity of the container group, if configured. + */ + @JsonProperty(value = "identity") + private ContainerGroupIdentity identity; + + /* + * The container group properties + */ + @JsonProperty(value = "properties", required = true) + private ContainerGroupPropertiesProperties innerProperties = new ContainerGroupPropertiesProperties(); + + /** Creates an instance of ContainerGroupProperties class. */ + public ContainerGroupProperties() { + } + + /** + * Get the identity property: The identity of the container group, if configured. + * + * @return the identity value. + */ + public ContainerGroupIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the container group, if configured. + * + * @param identity the identity value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withIdentity(ContainerGroupIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The container group properties. + * + * @return the innerProperties value. + */ + private ContainerGroupPropertiesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the provisioningState property: The provisioning state of the container group. This only appears in the + * response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the containers property: The containers within the container group. + * + * @return the containers value. + */ + public List containers() { + return this.innerProperties() == null ? null : this.innerProperties().containers(); + } + + /** + * Set the containers property: The containers within the container group. + * + * @param containers the containers value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withContainers(List containers) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withContainers(containers); + return this; + } + + /** + * Get the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @return the imageRegistryCredentials value. + */ + public List imageRegistryCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().imageRegistryCredentials(); + } + + /** + * Set the imageRegistryCredentials property: The image registry credentials by which the container group is created + * from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withImageRegistryCredentials( + List imageRegistryCredentials) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + /** + * Get the provisioningTimeoutInSeconds property: Time in seconds in which a container group deployment would + * timeout and fail. The allowed maximum value is 1800 seconds. If value is not provided, property is given maximum + * value by default. + * + * @return the provisioningTimeoutInSeconds value. + */ + public Integer provisioningTimeoutInSeconds() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningTimeoutInSeconds(); + } + + /** + * Set the provisioningTimeoutInSeconds property: Time in seconds in which a container group deployment would + * timeout and fail. The allowed maximum value is 1800 seconds. If value is not provided, property is given maximum + * value by default. + * + * @param provisioningTimeoutInSeconds the provisioningTimeoutInSeconds value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withProvisioningTimeoutInSeconds(Integer provisioningTimeoutInSeconds) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withProvisioningTimeoutInSeconds(provisioningTimeoutInSeconds); + return this; + } + + /** + * Get the isCustomProvisioningTimeout property: Flag indicating whether a custom value was provided for the + * provisioningTimeoutInSeconds property. + * + * @return the isCustomProvisioningTimeout value. + */ + public IsCustomProvisioningTimeout isCustomProvisioningTimeout() { + return this.innerProperties() == null ? null : this.innerProperties().isCustomProvisioningTimeout(); + } + + /** + * Get the restartPolicy property: Restart policy for all containers within the container group. - `Always` Always + * restart - `OnFailure` Restart on failure - `Never` Never restart. + * + * @return the restartPolicy value. + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().restartPolicy(); + } + + /** + * Set the restartPolicy property: Restart policy for all containers within the container group. - `Always` Always + * restart - `OnFailure` Restart on failure - `Never` Never restart. + * + * @param restartPolicy the restartPolicy value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withRestartPolicy(restartPolicy); + return this; + } + + /** + * Get the ipAddress property: The IP address type of the container group. + * + * @return the ipAddress value. + */ + public IpAddress ipAddress() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddress(); + } + + /** + * Set the ipAddress property: The IP address type of the container group. + * + * @param ipAddress the ipAddress value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withIpAddress(IpAddress ipAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withIpAddress(ipAddress); + return this; + } + + /** + * Get the osType property: The operating system type required by the containers in the container group. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: The operating system type required by the containers in the container group. + * + * @param osType the osType value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withOsType(OperatingSystemTypes osType) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value. + */ + public List volumes() { + return this.innerProperties() == null ? null : this.innerProperties().volumes(); + } + + /** + * Set the volumes property: The list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withVolumes(List volumes) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withVolumes(volumes); + return this; + } + + /** + * Get the instanceView property: The instance view of the container group. Only valid in response. + * + * @return the instanceView value. + */ + public ContainerGroupPropertiesInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Get the diagnostics property: The diagnostic information for a container group. + * + * @return the diagnostics value. + */ + public ContainerGroupDiagnostics diagnostics() { + return this.innerProperties() == null ? null : this.innerProperties().diagnostics(); + } + + /** + * Set the diagnostics property: The diagnostic information for a container group. + * + * @param diagnostics the diagnostics value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withDiagnostics(ContainerGroupDiagnostics diagnostics) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withDiagnostics(diagnostics); + return this; + } + + /** + * Get the subnetIds property: The subnet resource IDs for a container group. + * + * @return the subnetIds value. + */ + public List subnetIds() { + return this.innerProperties() == null ? null : this.innerProperties().subnetIds(); + } + + /** + * Set the subnetIds property: The subnet resource IDs for a container group. + * + * @param subnetIds the subnetIds value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withSubnetIds(List subnetIds) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withSubnetIds(subnetIds); + return this; + } + + /** + * Get the dnsConfig property: The DNS config information for a container group. + * + * @return the dnsConfig value. + */ + public DnsConfiguration dnsConfig() { + return this.innerProperties() == null ? null : this.innerProperties().dnsConfig(); + } + + /** + * Set the dnsConfig property: The DNS config information for a container group. + * + * @param dnsConfig the dnsConfig value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withDnsConfig(DnsConfiguration dnsConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withDnsConfig(dnsConfig); + return this; + } + + /** + * Get the sku property: The SKU for a container group. + * + * @return the sku value. + */ + public ContainerGroupSku sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: The SKU for a container group. + * + * @param sku the sku value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withSku(ContainerGroupSku sku) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the encryptionProperties property: The encryption properties for a container group. + * + * @return the encryptionProperties value. + */ + public EncryptionProperties encryptionProperties() { + return this.innerProperties() == null ? null : this.innerProperties().encryptionProperties(); + } + + /** + * Set the encryptionProperties property: The encryption properties for a container group. + * + * @param encryptionProperties the encryptionProperties value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withEncryptionProperties(EncryptionProperties encryptionProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withEncryptionProperties(encryptionProperties); + return this; + } + + /** + * Get the initContainers property: The init containers for a container group. + * + * @return the initContainers value. + */ + public List initContainers() { + return this.innerProperties() == null ? null : this.innerProperties().initContainers(); + } + + /** + * Set the initContainers property: The init containers for a container group. + * + * @param initContainers the initContainers value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withInitContainers(List initContainers) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withInitContainers(initContainers); + return this; + } + + /** + * Get the extensions property: extensions used by virtual kubelet. + * + * @return the extensions value. + */ + public List extensions() { + return this.innerProperties() == null ? null : this.innerProperties().extensions(); + } + + /** + * Set the extensions property: extensions used by virtual kubelet. + * + * @param extensions the extensions value to set. + * @return the ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withExtensions(List extensions) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerGroupPropertiesProperties(); + } + this.innerProperties().withExtensions(extensions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ContainerGroupProperties")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerGroupProperties.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupPropertiesInstanceView.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupPropertiesInstanceView.java new file mode 100644 index 0000000000000..113c6f0a61fb1 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupPropertiesInstanceView.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of the container group. Only valid in response. */ +@Immutable +public final class ContainerGroupPropertiesInstanceView { + /* + * The events of this container group. + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /* + * The state of the container group. Only valid in response. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** Creates an instance of ContainerGroupPropertiesInstanceView class. */ + public ContainerGroupPropertiesInstanceView() { + } + + /** + * Get the events property: The events of this container group. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Get the state property: The state of the container group. Only valid in response. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (events() != null) { + events().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupRestartPolicy.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupRestartPolicy.java new file mode 100644 index 0000000000000..1ead2b6801157 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupRestartPolicy.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Restart policy for all containers within the container group. - `Always` Always restart - `OnFailure` Restart on + * failure - `Never` Never restart. + */ +public final class ContainerGroupRestartPolicy extends ExpandableStringEnum { + /** Static value Always for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy ALWAYS = fromString("Always"); + + /** Static value OnFailure for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy ON_FAILURE = fromString("OnFailure"); + + /** Static value Never for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy NEVER = fromString("Never"); + + /** + * Creates a new instance of ContainerGroupRestartPolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerGroupRestartPolicy() { + } + + /** + * Creates or finds a ContainerGroupRestartPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerGroupRestartPolicy. + */ + @JsonCreator + public static ContainerGroupRestartPolicy fromString(String name) { + return fromString(name, ContainerGroupRestartPolicy.class); + } + + /** + * Gets known ContainerGroupRestartPolicy values. + * + * @return known ContainerGroupRestartPolicy values. + */ + public static Collection values() { + return values(ContainerGroupRestartPolicy.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSku.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSku.java new file mode 100644 index 0000000000000..660f97c438312 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSku.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The container group SKU. */ +public final class ContainerGroupSku extends ExpandableStringEnum { + /** Static value Standard for ContainerGroupSku. */ + public static final ContainerGroupSku STANDARD = fromString("Standard"); + + /** Static value Dedicated for ContainerGroupSku. */ + public static final ContainerGroupSku DEDICATED = fromString("Dedicated"); + + /** + * Creates a new instance of ContainerGroupSku value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerGroupSku() { + } + + /** + * Creates or finds a ContainerGroupSku from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerGroupSku. + */ + @JsonCreator + public static ContainerGroupSku fromString(String name) { + return fromString(name, ContainerGroupSku.class); + } + + /** + * Gets known ContainerGroupSku values. + * + * @return known ContainerGroupSku values. + */ + public static Collection values() { + return values(ContainerGroupSku.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSubnetId.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSubnetId.java new file mode 100644 index 0000000000000..832da65e27a37 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSubnetId.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container group subnet information. */ +@Fluent +public final class ContainerGroupSubnetId { + /* + * Resource ID of virtual network and subnet. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /* + * Friendly name for the subnet. + */ + @JsonProperty(value = "name") + private String name; + + /** Creates an instance of ContainerGroupSubnetId class. */ + public ContainerGroupSubnetId() { + } + + /** + * Get the id property: Resource ID of virtual network and subnet. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID of virtual network and subnet. + * + * @param id the id value to set. + * @return the ContainerGroupSubnetId object itself. + */ + public ContainerGroupSubnetId withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Friendly name for the subnet. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Friendly name for the subnet. + * + * @param name the name value to set. + * @return the ContainerGroupSubnetId object itself. + */ + public ContainerGroupSubnetId withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model ContainerGroupSubnetId")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerGroupSubnetId.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroups.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroups.java new file mode 100644 index 0000000000000..1676582e4edb2 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroups.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Resource; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of ContainerGroups. */ +public interface ContainerGroups { + /** + * 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. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * 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. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get a list of container groups in the specified subscription and resource group. + * + *

Get a list of container groups in a specified subscription and resource group. This operation returns + * properties of each container group including containers, image registry credentials, restart policy, IP address + * type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get a list of container groups in the specified subscription and resource group. + * + *

Get a list of container groups in a specified subscription and resource group. This operation returns + * properties of each container group including containers, image registry credentials, restart policy, IP address + * type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container groups in a specified subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the properties of the specified container group. + * + *

Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group along + * with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String containerGroupName, Context context); + + /** + * Get the properties of the specified container group. + * + *

Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group. + */ + ContainerGroup getByResourceGroup(String resourceGroupName, String containerGroupName); + + /** + * Update container groups. + * + *

Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group along with {@link Response}. + */ + Response updateWithResponse( + String resourceGroupName, String containerGroupName, Resource resource, Context context); + + /** + * Update container groups. + * + *

Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + ContainerGroup update(String resourceGroupName, String containerGroupName, Resource resource); + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + ContainerGroup deleteByResourceGroup(String resourceGroupName, String containerGroupName); + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + ContainerGroup delete(String resourceGroupName, String containerGroupName, Context context); + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String containerGroupName); + + /** + * Restarts all containers in a container group. + * + *

Restarts all containers in a container group in place. If container image has updates, new image will be + * downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String containerGroupName, Context context); + + /** + * Stops all containers in a container group. + * + *

Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response stopWithResponse(String resourceGroupName, String containerGroupName, Context context); + + /** + * Stops all containers in a container group. + * + *

Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String containerGroupName); + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String containerGroupName); + + /** + * Starts all containers in a container group. + * + *

Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String containerGroupName, Context context); + + /** + * Get all network dependencies for container group. + * + *

Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network dependencies for this container group to allow complete control of network setting and + * configuration along with {@link Response}. + */ + Response> getOutboundNetworkDependenciesEndpointsWithResponse( + String resourceGroupName, String containerGroupName, Context context); + + /** + * Get all network dependencies for container group. + * + *

Gets all the network dependencies for this container group to allow complete control of network setting and + * configuration. For container groups, this will always be an empty list. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network dependencies for this container group to allow complete control of network setting and + * configuration. + */ + List getOutboundNetworkDependenciesEndpoints(String resourceGroupName, String containerGroupName); + + /** + * Get the properties of the specified container group. + * + *

Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group along + * with {@link Response}. + */ + ContainerGroup getById(String id); + + /** + * Get the properties of the specified container group. + * + *

Gets the properties of the specified container group in the specified subscription and resource group. The + * operation returns the properties of each container group including containers, image registry credentials, + * restart policy, IP address type, OS type, state, and volumes. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container group in the specified subscription and resource group along + * with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + ContainerGroup deleteById(String id); + + /** + * Delete the specified container group. + * + *

Delete the specified container group in the specified subscription and resource group. The operation does not + * delete other resources provided by the user, such as volumes. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container group. + */ + ContainerGroup deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ContainerGroup resource. + * + * @param name resource name. + * @return the first stage of the new ContainerGroup definition. + */ + ContainerGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerHttpGet.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerHttpGet.java new file mode 100644 index 0000000000000..544729b7b34ec --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerHttpGet.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The container Http Get settings, for liveness or readiness probe. */ +@Fluent +public final class ContainerHttpGet { + /* + * The path to probe. + */ + @JsonProperty(value = "path") + private String path; + + /* + * The port number to probe. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /* + * The scheme. + */ + @JsonProperty(value = "scheme") + private Scheme scheme; + + /* + * The HTTP headers. + */ + @JsonProperty(value = "httpHeaders") + private List httpHeaders; + + /** Creates an instance of ContainerHttpGet class. */ + public ContainerHttpGet() { + } + + /** + * Get the path property: The path to probe. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path to probe. + * + * @param path the path value to set. + * @return the ContainerHttpGet object itself. + */ + public ContainerHttpGet withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the port property: The port number to probe. + * + * @return the port value. + */ + public int port() { + return this.port; + } + + /** + * Set the port property: The port number to probe. + * + * @param port the port value to set. + * @return the ContainerHttpGet object itself. + */ + public ContainerHttpGet withPort(int port) { + this.port = port; + return this; + } + + /** + * Get the scheme property: The scheme. + * + * @return the scheme value. + */ + public Scheme scheme() { + return this.scheme; + } + + /** + * Set the scheme property: The scheme. + * + * @param scheme the scheme value to set. + * @return the ContainerHttpGet object itself. + */ + public ContainerHttpGet withScheme(Scheme scheme) { + this.scheme = scheme; + return this; + } + + /** + * Get the httpHeaders property: The HTTP headers. + * + * @return the httpHeaders value. + */ + public List httpHeaders() { + return this.httpHeaders; + } + + /** + * Set the httpHeaders property: The HTTP headers. + * + * @param httpHeaders the httpHeaders value to set. + * @return the ContainerHttpGet object itself. + */ + public ContainerHttpGet withHttpHeaders(List httpHeaders) { + this.httpHeaders = httpHeaders; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (httpHeaders() != null) { + httpHeaders().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerInstanceOperationsOrigin.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerInstanceOperationsOrigin.java new file mode 100644 index 0000000000000..54b1c9bfa2659 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerInstanceOperationsOrigin.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The intended executor of the operation. */ +public final class ContainerInstanceOperationsOrigin extends ExpandableStringEnum { + /** Static value User for ContainerInstanceOperationsOrigin. */ + public static final ContainerInstanceOperationsOrigin USER = fromString("User"); + + /** Static value System for ContainerInstanceOperationsOrigin. */ + public static final ContainerInstanceOperationsOrigin SYSTEM = fromString("System"); + + /** + * Creates a new instance of ContainerInstanceOperationsOrigin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerInstanceOperationsOrigin() { + } + + /** + * Creates or finds a ContainerInstanceOperationsOrigin from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerInstanceOperationsOrigin. + */ + @JsonCreator + public static ContainerInstanceOperationsOrigin fromString(String name) { + return fromString(name, ContainerInstanceOperationsOrigin.class); + } + + /** + * Gets known ContainerInstanceOperationsOrigin values. + * + * @return known ContainerInstanceOperationsOrigin values. + */ + public static Collection values() { + return values(ContainerInstanceOperationsOrigin.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerNetworkProtocol.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerNetworkProtocol.java new file mode 100644 index 0000000000000..d22fe6620186a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerNetworkProtocol.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The protocol associated with the port. */ +public final class ContainerNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for ContainerNetworkProtocol. */ + public static final ContainerNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for ContainerNetworkProtocol. */ + public static final ContainerNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates a new instance of ContainerNetworkProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerNetworkProtocol() { + } + + /** + * Creates or finds a ContainerNetworkProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerNetworkProtocol. + */ + @JsonCreator + public static ContainerNetworkProtocol fromString(String name) { + return fromString(name, ContainerNetworkProtocol.class); + } + + /** + * Gets known ContainerNetworkProtocol values. + * + * @return known ContainerNetworkProtocol values. + */ + public static Collection values() { + return values(ContainerNetworkProtocol.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPort.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPort.java new file mode 100644 index 0000000000000..611d000d5f7c8 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPort.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The port exposed on the container instance. */ +@Fluent +public final class ContainerPort { + /* + * The protocol associated with the port. + */ + @JsonProperty(value = "protocol") + private ContainerNetworkProtocol protocol; + + /* + * The port number exposed within the container group. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** Creates an instance of ContainerPort class. */ + public ContainerPort() { + } + + /** + * Get the protocol property: The protocol associated with the port. + * + * @return the protocol value. + */ + public ContainerNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol associated with the port. + * + * @param protocol the protocol value to set. + * @return the ContainerPort object itself. + */ + public ContainerPort withProtocol(ContainerNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port property: The port number exposed within the container group. + * + * @return the port value. + */ + public int port() { + return this.port; + } + + /** + * Set the port property: The port number exposed within the container group. + * + * @param port the port value to set. + * @return the ContainerPort object itself. + */ + public ContainerPort withPort(int port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerProbe.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerProbe.java new file mode 100644 index 0000000000000..2772e7d6856dc --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerProbe.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The container probe, for liveness or readiness. */ +@Fluent +public final class ContainerProbe { + /* + * The execution command to probe + */ + @JsonProperty(value = "exec") + private ContainerExec exec; + + /* + * The Http Get settings to probe + */ + @JsonProperty(value = "httpGet") + private ContainerHttpGet httpGet; + + /* + * The initial delay seconds. + */ + @JsonProperty(value = "initialDelaySeconds") + private Integer initialDelaySeconds; + + /* + * The period seconds. + */ + @JsonProperty(value = "periodSeconds") + private Integer periodSeconds; + + /* + * The failure threshold. + */ + @JsonProperty(value = "failureThreshold") + private Integer failureThreshold; + + /* + * The success threshold. + */ + @JsonProperty(value = "successThreshold") + private Integer successThreshold; + + /* + * The timeout seconds. + */ + @JsonProperty(value = "timeoutSeconds") + private Integer timeoutSeconds; + + /** Creates an instance of ContainerProbe class. */ + public ContainerProbe() { + } + + /** + * Get the exec property: The execution command to probe. + * + * @return the exec value. + */ + public ContainerExec exec() { + return this.exec; + } + + /** + * Set the exec property: The execution command to probe. + * + * @param exec the exec value to set. + * @return the ContainerProbe object itself. + */ + public ContainerProbe withExec(ContainerExec exec) { + this.exec = exec; + return this; + } + + /** + * Get the httpGet property: The Http Get settings to probe. + * + * @return the httpGet value. + */ + public ContainerHttpGet httpGet() { + return this.httpGet; + } + + /** + * Set the httpGet property: The Http Get settings to probe. + * + * @param httpGet the httpGet value to set. + * @return the ContainerProbe object itself. + */ + public ContainerProbe withHttpGet(ContainerHttpGet httpGet) { + this.httpGet = httpGet; + return this; + } + + /** + * Get the initialDelaySeconds property: The initial delay seconds. + * + * @return the initialDelaySeconds value. + */ + public Integer initialDelaySeconds() { + return this.initialDelaySeconds; + } + + /** + * Set the initialDelaySeconds property: The initial delay seconds. + * + * @param initialDelaySeconds the initialDelaySeconds value to set. + * @return the ContainerProbe object itself. + */ + public ContainerProbe withInitialDelaySeconds(Integer initialDelaySeconds) { + this.initialDelaySeconds = initialDelaySeconds; + return this; + } + + /** + * Get the periodSeconds property: The period seconds. + * + * @return the periodSeconds value. + */ + public Integer periodSeconds() { + return this.periodSeconds; + } + + /** + * Set the periodSeconds property: The period seconds. + * + * @param periodSeconds the periodSeconds value to set. + * @return the ContainerProbe object itself. + */ + public ContainerProbe withPeriodSeconds(Integer periodSeconds) { + this.periodSeconds = periodSeconds; + return this; + } + + /** + * Get the failureThreshold property: The failure threshold. + * + * @return the failureThreshold value. + */ + public Integer failureThreshold() { + return this.failureThreshold; + } + + /** + * Set the failureThreshold property: The failure threshold. + * + * @param failureThreshold the failureThreshold value to set. + * @return the ContainerProbe object itself. + */ + public ContainerProbe withFailureThreshold(Integer failureThreshold) { + this.failureThreshold = failureThreshold; + return this; + } + + /** + * Get the successThreshold property: The success threshold. + * + * @return the successThreshold value. + */ + public Integer successThreshold() { + return this.successThreshold; + } + + /** + * Set the successThreshold property: The success threshold. + * + * @param successThreshold the successThreshold value to set. + * @return the ContainerProbe object itself. + */ + public ContainerProbe withSuccessThreshold(Integer successThreshold) { + this.successThreshold = successThreshold; + return this; + } + + /** + * Get the timeoutSeconds property: The timeout seconds. + * + * @return the timeoutSeconds value. + */ + public Integer timeoutSeconds() { + return this.timeoutSeconds; + } + + /** + * Set the timeoutSeconds property: The timeout seconds. + * + * @param timeoutSeconds the timeoutSeconds value to set. + * @return the ContainerProbe object itself. + */ + public ContainerProbe withTimeoutSeconds(Integer timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (exec() != null) { + exec().validate(); + } + if (httpGet() != null) { + httpGet().validate(); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPropertiesInstanceView.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPropertiesInstanceView.java new file mode 100644 index 0000000000000..076fa68d8bc35 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPropertiesInstanceView.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of the container instance. Only valid in response. */ +@Immutable +public final class ContainerPropertiesInstanceView { + /* + * The number of times that the container instance has been restarted. + */ + @JsonProperty(value = "restartCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer restartCount; + + /* + * Current container instance state. + */ + @JsonProperty(value = "currentState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState currentState; + + /* + * Previous container instance state. + */ + @JsonProperty(value = "previousState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState previousState; + + /* + * The events of the container instance. + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /** Creates an instance of ContainerPropertiesInstanceView class. */ + public ContainerPropertiesInstanceView() { + } + + /** + * Get the restartCount property: The number of times that the container instance has been restarted. + * + * @return the restartCount value. + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Get the currentState property: Current container instance state. + * + * @return the currentState value. + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Get the previousState property: Previous container instance state. + * + * @return the previousState value. + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Get the events property: The events of the container instance. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (currentState() != null) { + currentState().validate(); + } + if (previousState() != null) { + previousState().validate(); + } + if (events() != null) { + events().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerState.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerState.java new file mode 100644 index 0000000000000..5a69417599726 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerState.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The container instance state. */ +@Immutable +public final class ContainerState { + /* + * The state of the container instance. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /* + * The date-time when the container instance state started. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The container instance exit codes correspond to those from the `docker run` command. + */ + @JsonProperty(value = "exitCode", access = JsonProperty.Access.WRITE_ONLY) + private Integer exitCode; + + /* + * The date-time when the container instance state finished. + */ + @JsonProperty(value = "finishTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime finishTime; + + /* + * The human-readable status of the container instance state. + */ + @JsonProperty(value = "detailStatus", access = JsonProperty.Access.WRITE_ONLY) + private String detailStatus; + + /** Creates an instance of ContainerState class. */ + public ContainerState() { + } + + /** + * Get the state property: The state of the container instance. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Get the startTime property: The date-time when the container instance state started. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the exitCode property: The container instance exit codes correspond to those from the `docker run` command. + * + * @return the exitCode value. + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Get the finishTime property: The date-time when the container instance state finished. + * + * @return the finishTime value. + */ + public OffsetDateTime finishTime() { + return this.finishTime; + } + + /** + * Get the detailStatus property: The human-readable status of the container instance state. + * + * @return the detailStatus value. + */ + public String detailStatus() { + return this.detailStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Containers.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Containers.java new file mode 100644 index 0000000000000..3484997276de3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Containers.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Containers. */ +public interface Containers { + /** + * Get the logs for a specified container instance. + * + *

Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all + * available logs are shown up to 4mb. + * @param timestamps If true, adds a timestamp at the beginning of every line of log output. If not provided, + * defaults to false. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group along with + * {@link Response}. + */ + Response listLogsWithResponse( + String resourceGroupName, + String containerGroupName, + String containerName, + Integer tail, + Boolean timestamps, + Context context); + + /** + * Get the logs for a specified container instance. + * + *

Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the logs for a specified container instance in a specified resource group and container group. + */ + Logs listLogs(String resourceGroupName, String containerGroupName, String containerName); + + /** + * Executes a command in a specific container instance. + * + *

Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the container exec command along with {@link Response}. + */ + Response executeCommandWithResponse( + String resourceGroupName, + String containerGroupName, + String containerName, + ContainerExecRequest containerExecRequest, + Context context); + + /** + * Executes a command in a specific container instance. + * + *

Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the container exec command. + */ + ContainerExecResponse executeCommand( + String resourceGroupName, + String containerGroupName, + String containerName, + ContainerExecRequest containerExecRequest); + + /** + * Attach to the output of a specific container instance. + * + *

Attach to the output stream of a specific container instance in a specified resource group and container + * group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach along with {@link Response}. + */ + Response attachWithResponse( + String resourceGroupName, String containerGroupName, String containerName, Context context); + + /** + * Attach to the output of a specific container instance. + * + *

Attach to the output stream of a specific container instance in a specified resource group and container + * group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the information for the output stream from container attach. + */ + ContainerAttachResponse attach(String resourceGroupName, String containerGroupName, String containerName); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DeploymentExtensionSpec.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DeploymentExtensionSpec.java new file mode 100644 index 0000000000000..84b59dadf7800 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DeploymentExtensionSpec.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.DeploymentExtensionSpecProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Extension sidecars to be added to the deployment. */ +@Fluent +public final class DeploymentExtensionSpec { + /* + * Name of the extension. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Extension specific properties + */ + @JsonProperty(value = "properties") + private DeploymentExtensionSpecProperties innerProperties; + + /** Creates an instance of DeploymentExtensionSpec class. */ + public DeploymentExtensionSpec() { + } + + /** + * Get the name property: Name of the extension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the extension. + * + * @param name the name value to set. + * @return the DeploymentExtensionSpec object itself. + */ + public DeploymentExtensionSpec withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: Extension specific properties. + * + * @return the innerProperties value. + */ + private DeploymentExtensionSpecProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the extensionType property: Type of extension to be added. + * + * @return the extensionType value. + */ + public String extensionType() { + return this.innerProperties() == null ? null : this.innerProperties().extensionType(); + } + + /** + * Set the extensionType property: Type of extension to be added. + * + * @param extensionType the extensionType value to set. + * @return the DeploymentExtensionSpec object itself. + */ + public DeploymentExtensionSpec withExtensionType(String extensionType) { + if (this.innerProperties() == null) { + this.innerProperties = new DeploymentExtensionSpecProperties(); + } + this.innerProperties().withExtensionType(extensionType); + return this; + } + + /** + * Get the version property: Version of the extension being used. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: Version of the extension being used. + * + * @param version the version value to set. + * @return the DeploymentExtensionSpec object itself. + */ + public DeploymentExtensionSpec withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new DeploymentExtensionSpecProperties(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the settings property: Settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.innerProperties() == null ? null : this.innerProperties().settings(); + } + + /** + * Set the settings property: Settings for the extension. + * + * @param settings the settings value to set. + * @return the DeploymentExtensionSpec object itself. + */ + public DeploymentExtensionSpec withSettings(Object settings) { + if (this.innerProperties() == null) { + this.innerProperties = new DeploymentExtensionSpecProperties(); + } + this.innerProperties().withSettings(settings); + return this; + } + + /** + * Get the protectedSettings property: Protected settings for the extension. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); + } + + /** + * Set the protectedSettings property: Protected settings for the extension. + * + * @param protectedSettings the protectedSettings value to set. + * @return the DeploymentExtensionSpec object itself. + */ + public DeploymentExtensionSpec withProtectedSettings(Object protectedSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new DeploymentExtensionSpecProperties(); + } + this.innerProperties().withProtectedSettings(protectedSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model DeploymentExtensionSpec")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeploymentExtensionSpec.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DnsConfiguration.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DnsConfiguration.java new file mode 100644 index 0000000000000..7680165944ea2 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DnsConfiguration.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** DNS configuration for the container group. */ +@Fluent +public final class DnsConfiguration { + /* + * The DNS servers for the container group. + */ + @JsonProperty(value = "nameServers", required = true) + private List nameServers; + + /* + * The DNS search domains for hostname lookup in the container group. + */ + @JsonProperty(value = "searchDomains") + private String searchDomains; + + /* + * The DNS options for the container group. + */ + @JsonProperty(value = "options") + private String options; + + /** Creates an instance of DnsConfiguration class. */ + public DnsConfiguration() { + } + + /** + * Get the nameServers property: The DNS servers for the container group. + * + * @return the nameServers value. + */ + public List nameServers() { + return this.nameServers; + } + + /** + * Set the nameServers property: The DNS servers for the container group. + * + * @param nameServers the nameServers value to set. + * @return the DnsConfiguration object itself. + */ + public DnsConfiguration withNameServers(List nameServers) { + this.nameServers = nameServers; + return this; + } + + /** + * Get the searchDomains property: The DNS search domains for hostname lookup in the container group. + * + * @return the searchDomains value. + */ + public String searchDomains() { + return this.searchDomains; + } + + /** + * Set the searchDomains property: The DNS search domains for hostname lookup in the container group. + * + * @param searchDomains the searchDomains value to set. + * @return the DnsConfiguration object itself. + */ + public DnsConfiguration withSearchDomains(String searchDomains) { + this.searchDomains = searchDomains; + return this; + } + + /** + * Get the options property: The DNS options for the container group. + * + * @return the options value. + */ + public String options() { + return this.options; + } + + /** + * Set the options property: The DNS options for the container group. + * + * @param options the options value to set. + * @return the DnsConfiguration object itself. + */ + public DnsConfiguration withOptions(String options) { + this.options = options; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nameServers() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property nameServers in model DnsConfiguration")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DnsConfiguration.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DnsNameLabelReusePolicy.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DnsNameLabelReusePolicy.java new file mode 100644 index 0000000000000..c23dc4a178db1 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DnsNameLabelReusePolicy.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The value representing the security enum. The 'Unsecure' value is the default value if not selected and means the + * object's domain name label is not secured against subdomain takeover. The 'TenantReuse' value is the default value if + * selected and means the object's domain name label can be reused within the same tenant. The 'SubscriptionReuse' value + * means the object's domain name label can be reused within the same subscription. The 'ResourceGroupReuse' value means + * the object's domain name label can be reused within the same resource group. The 'NoReuse' value means the object's + * domain name label cannot be reused within the same resource group, subscription, or tenant. + */ +public final class DnsNameLabelReusePolicy extends ExpandableStringEnum { + /** Static value Unsecure for DnsNameLabelReusePolicy. */ + public static final DnsNameLabelReusePolicy UNSECURE = fromString("Unsecure"); + + /** Static value TenantReuse for DnsNameLabelReusePolicy. */ + public static final DnsNameLabelReusePolicy TENANT_REUSE = fromString("TenantReuse"); + + /** Static value SubscriptionReuse for DnsNameLabelReusePolicy. */ + public static final DnsNameLabelReusePolicy SUBSCRIPTION_REUSE = fromString("SubscriptionReuse"); + + /** Static value ResourceGroupReuse for DnsNameLabelReusePolicy. */ + public static final DnsNameLabelReusePolicy RESOURCE_GROUP_REUSE = fromString("ResourceGroupReuse"); + + /** Static value Noreuse for DnsNameLabelReusePolicy. */ + public static final DnsNameLabelReusePolicy NOREUSE = fromString("Noreuse"); + + /** + * Creates a new instance of DnsNameLabelReusePolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DnsNameLabelReusePolicy() { + } + + /** + * Creates or finds a DnsNameLabelReusePolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding DnsNameLabelReusePolicy. + */ + @JsonCreator + public static DnsNameLabelReusePolicy fromString(String name) { + return fromString(name, DnsNameLabelReusePolicy.class); + } + + /** + * Gets known DnsNameLabelReusePolicy values. + * + * @return known DnsNameLabelReusePolicy values. + */ + public static Collection values() { + return values(DnsNameLabelReusePolicy.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EncryptionProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EncryptionProperties.java new file mode 100644 index 0000000000000..06777fbe5a13f --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EncryptionProperties.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The container group encryption properties. */ +@Fluent +public final class EncryptionProperties { + /* + * The keyvault base url. + */ + @JsonProperty(value = "vaultBaseUrl", required = true) + private String vaultBaseUrl; + + /* + * The encryption key name. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /* + * The encryption key version. + */ + @JsonProperty(value = "keyVersion", required = true) + private String keyVersion; + + /* + * The keyvault managed identity. + */ + @JsonProperty(value = "identity") + private String identity; + + /** Creates an instance of EncryptionProperties class. */ + public EncryptionProperties() { + } + + /** + * Get the vaultBaseUrl property: The keyvault base url. + * + * @return the vaultBaseUrl value. + */ + public String vaultBaseUrl() { + return this.vaultBaseUrl; + } + + /** + * Set the vaultBaseUrl property: The keyvault base url. + * + * @param vaultBaseUrl the vaultBaseUrl value to set. + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties withVaultBaseUrl(String vaultBaseUrl) { + this.vaultBaseUrl = vaultBaseUrl; + return this; + } + + /** + * Get the keyName property: The encryption key name. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: The encryption key name. + * + * @param keyName the keyName value to set. + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the keyVersion property: The encryption key version. + * + * @return the keyVersion value. + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the keyVersion property: The encryption key version. + * + * @param keyVersion the keyVersion value to set. + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Get the identity property: The keyvault managed identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The keyvault managed identity. + * + * @param identity the identity value to set. + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties withIdentity(String identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vaultBaseUrl() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vaultBaseUrl in model EncryptionProperties")); + } + if (keyName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property keyName in model EncryptionProperties")); + } + if (keyVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property keyVersion in model EncryptionProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EncryptionProperties.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EnvironmentVariable.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EnvironmentVariable.java new file mode 100644 index 0000000000000..c83832d9a994a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EnvironmentVariable.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The environment variable to set within the container instance. */ +@Fluent +public final class EnvironmentVariable { + /* + * The name of the environment variable. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The value of the environment variable. + */ + @JsonProperty(value = "value") + private String value; + + /* + * The value of the secure environment variable. + */ + @JsonProperty(value = "secureValue") + private String secureValue; + + /** Creates an instance of EnvironmentVariable class. */ + public EnvironmentVariable() { + } + + /** + * Get the name property: The name of the environment variable. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the environment variable. + * + * @param name the name value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value of the environment variable. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the environment variable. + * + * @param value the value value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the secureValue property: The value of the secure environment variable. + * + * @return the secureValue value. + */ + public String secureValue() { + return this.secureValue; + } + + /** + * Set the secureValue property: The value of the secure environment variable. + * + * @param secureValue the secureValue value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withSecureValue(String secureValue) { + this.secureValue = secureValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model EnvironmentVariable")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EnvironmentVariable.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Event.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Event.java new file mode 100644 index 0000000000000..999c62e930ca4 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Event.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** A container group or container instance event. */ +@Immutable +public final class Event { + /* + * The count of the event. + */ + @JsonProperty(value = "count", access = JsonProperty.Access.WRITE_ONLY) + private Integer count; + + /* + * The date-time of the earliest logged event. + */ + @JsonProperty(value = "firstTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime firstTimestamp; + + /* + * The date-time of the latest logged event. + */ + @JsonProperty(value = "lastTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastTimestamp; + + /* + * The event name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The event message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * The event type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** Creates an instance of Event class. */ + public Event() { + } + + /** + * Get the count property: The count of the event. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Get the firstTimestamp property: The date-time of the earliest logged event. + * + * @return the firstTimestamp value. + */ + public OffsetDateTime firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Get the lastTimestamp property: The date-time of the latest logged event. + * + * @return the lastTimestamp value. + */ + public OffsetDateTime lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Get the name property: The event name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the message property: The event message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the type property: The event type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GitRepoVolume.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GitRepoVolume.java new file mode 100644 index 0000000000000..ff03039b984a8 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GitRepoVolume.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents a volume that is populated with the contents of a git repository. */ +@Fluent +public final class GitRepoVolume { + /* + * Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be + * the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory + * with the given name. + */ + @JsonProperty(value = "directory") + private String directory; + + /* + * Repository URL + */ + @JsonProperty(value = "repository", required = true) + private String repository; + + /* + * Commit hash for the specified revision. + */ + @JsonProperty(value = "revision") + private String revision; + + /** Creates an instance of GitRepoVolume class. */ + public GitRepoVolume() { + } + + /** + * Get the directory property: Target directory name. Must not contain or start with '..'. If '.' is supplied, the + * volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository + * in the subdirectory with the given name. + * + * @return the directory value. + */ + public String directory() { + return this.directory; + } + + /** + * Set the directory property: Target directory name. Must not contain or start with '..'. If '.' is supplied, the + * volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository + * in the subdirectory with the given name. + * + * @param directory the directory value to set. + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withDirectory(String directory) { + this.directory = directory; + return this; + } + + /** + * Get the repository property: Repository URL. + * + * @return the repository value. + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository property: Repository URL. + * + * @param repository the repository value to set. + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get the revision property: Commit hash for the specified revision. + * + * @return the revision value. + */ + public String revision() { + return this.revision; + } + + /** + * Set the revision property: Commit hash for the specified revision. + * + * @param revision the revision value to set. + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withRevision(String revision) { + this.revision = revision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (repository() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property repository in model GitRepoVolume")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GitRepoVolume.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuResource.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuResource.java new file mode 100644 index 0000000000000..d1743875dc62d --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuResource.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The GPU resource. */ +@Fluent +public final class GpuResource { + /* + * The count of the GPU resource. + */ + @JsonProperty(value = "count", required = true) + private int count; + + /* + * The SKU of the GPU resource. + */ + @JsonProperty(value = "sku", required = true) + private GpuSku sku; + + /** Creates an instance of GpuResource class. */ + public GpuResource() { + } + + /** + * Get the count property: The count of the GPU resource. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * Set the count property: The count of the GPU resource. + * + * @param count the count value to set. + * @return the GpuResource object itself. + */ + public GpuResource withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the sku property: The SKU of the GPU resource. + * + * @return the sku value. + */ + public GpuSku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the GPU resource. + * + * @param sku the sku value to set. + * @return the GpuResource object itself. + */ + public GpuResource withSku(GpuSku sku) { + this.sku = sku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model GpuResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GpuResource.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuSku.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuSku.java new file mode 100644 index 0000000000000..02b796107e12a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuSku.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The SKU of the GPU resource. */ +public final class GpuSku extends ExpandableStringEnum { + /** Static value K80 for GpuSku. */ + public static final GpuSku K80 = fromString("K80"); + + /** Static value P100 for GpuSku. */ + public static final GpuSku P100 = fromString("P100"); + + /** Static value V100 for GpuSku. */ + public static final GpuSku V100 = fromString("V100"); + + /** + * Creates a new instance of GpuSku value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GpuSku() { + } + + /** + * Creates or finds a GpuSku from its string representation. + * + * @param name a name to look for. + * @return the corresponding GpuSku. + */ + @JsonCreator + public static GpuSku fromString(String name) { + return fromString(name, GpuSku.class); + } + + /** + * Gets known GpuSku values. + * + * @return known GpuSku values. + */ + public static Collection values() { + return values(GpuSku.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/HttpHeader.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/HttpHeader.java new file mode 100644 index 0000000000000..df620c5e8eefe --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/HttpHeader.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The HTTP header. */ +@Fluent +public final class HttpHeader { + /* + * The header name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The header value. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of HttpHeader class. */ + public HttpHeader() { + } + + /** + * Get the name property: The header name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The header name. + * + * @param name the name value to set. + * @return the HttpHeader object itself. + */ + public HttpHeader withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The header value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The header value. + * + * @param value the value value to set. + * @return the HttpHeader object itself. + */ + public HttpHeader withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ImageRegistryCredential.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ImageRegistryCredential.java new file mode 100644 index 0000000000000..23ddf78ba1287 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ImageRegistryCredential.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Image registry credential. */ +@Fluent +public final class ImageRegistryCredential { + /* + * The Docker image registry server without a protocol such as "http" and "https". + */ + @JsonProperty(value = "server", required = true) + private String server; + + /* + * The username for the private registry. + */ + @JsonProperty(value = "username") + private String username; + + /* + * The password for the private registry. + */ + @JsonProperty(value = "password") + private String password; + + /* + * The identity for the private registry. + */ + @JsonProperty(value = "identity") + private String identity; + + /* + * The identity URL for the private registry. + */ + @JsonProperty(value = "identityUrl") + private String identityUrl; + + /** Creates an instance of ImageRegistryCredential class. */ + public ImageRegistryCredential() { + } + + /** + * Get the server property: The Docker image registry server without a protocol such as "http" and "https". + * + * @return the server value. + */ + public String server() { + return this.server; + } + + /** + * Set the server property: The Docker image registry server without a protocol such as "http" and "https". + * + * @param server the server value to set. + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the username property: The username for the private registry. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The username for the private registry. + * + * @param username the username value to set. + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password for the private registry. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password for the private registry. + * + * @param password the password value to set. + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the identity property: The identity for the private registry. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The identity for the private registry. + * + * @param identity the identity value to set. + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withIdentity(String identity) { + this.identity = identity; + return this; + } + + /** + * Get the identityUrl property: The identity URL for the private registry. + * + * @return the identityUrl value. + */ + public String identityUrl() { + return this.identityUrl; + } + + /** + * Set the identityUrl property: The identity URL for the private registry. + * + * @param identityUrl the identityUrl value to set. + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withIdentityUrl(String identityUrl) { + this.identityUrl = identityUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (server() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property server in model ImageRegistryCredential")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImageRegistryCredential.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerDefinition.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerDefinition.java new file mode 100644 index 0000000000000..c16dd08e77005 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerDefinition.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.InitContainerPropertiesDefinition; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The init container definition. */ +@Fluent +public final class InitContainerDefinition { + /* + * The name for the init container. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The properties for the init container. + */ + @JsonProperty(value = "properties", required = true) + private InitContainerPropertiesDefinition innerProperties = new InitContainerPropertiesDefinition(); + + /** Creates an instance of InitContainerDefinition class. */ + public InitContainerDefinition() { + } + + /** + * Get the name property: The name for the init container. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name for the init container. + * + * @param name the name value to set. + * @return the InitContainerDefinition object itself. + */ + public InitContainerDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: The properties for the init container. + * + * @return the innerProperties value. + */ + private InitContainerPropertiesDefinition innerProperties() { + return this.innerProperties; + } + + /** + * Get the image property: The image of the init container. + * + * @return the image value. + */ + public String image() { + return this.innerProperties() == null ? null : this.innerProperties().image(); + } + + /** + * Set the image property: The image of the init container. + * + * @param image the image value to set. + * @return the InitContainerDefinition object itself. + */ + public InitContainerDefinition withImage(String image) { + if (this.innerProperties() == null) { + this.innerProperties = new InitContainerPropertiesDefinition(); + } + this.innerProperties().withImage(image); + return this; + } + + /** + * Get the command property: The command to execute within the init container in exec form. + * + * @return the command value. + */ + public List command() { + return this.innerProperties() == null ? null : this.innerProperties().command(); + } + + /** + * Set the command property: The command to execute within the init container in exec form. + * + * @param command the command value to set. + * @return the InitContainerDefinition object itself. + */ + public InitContainerDefinition withCommand(List command) { + if (this.innerProperties() == null) { + this.innerProperties = new InitContainerPropertiesDefinition(); + } + this.innerProperties().withCommand(command); + return this; + } + + /** + * Get the environmentVariables property: The environment variables to set in the init container. + * + * @return the environmentVariables value. + */ + public List environmentVariables() { + return this.innerProperties() == null ? null : this.innerProperties().environmentVariables(); + } + + /** + * Set the environmentVariables property: The environment variables to set in the init container. + * + * @param environmentVariables the environmentVariables value to set. + * @return the InitContainerDefinition object itself. + */ + public InitContainerDefinition withEnvironmentVariables(List environmentVariables) { + if (this.innerProperties() == null) { + this.innerProperties = new InitContainerPropertiesDefinition(); + } + this.innerProperties().withEnvironmentVariables(environmentVariables); + return this; + } + + /** + * Get the instanceView property: The instance view of the init container. Only valid in response. + * + * @return the instanceView value. + */ + public InitContainerPropertiesDefinitionInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Get the volumeMounts property: The volume mounts available to the init container. + * + * @return the volumeMounts value. + */ + public List volumeMounts() { + return this.innerProperties() == null ? null : this.innerProperties().volumeMounts(); + } + + /** + * Set the volumeMounts property: The volume mounts available to the init container. + * + * @param volumeMounts the volumeMounts value to set. + * @return the InitContainerDefinition object itself. + */ + public InitContainerDefinition withVolumeMounts(List volumeMounts) { + if (this.innerProperties() == null) { + this.innerProperties = new InitContainerPropertiesDefinition(); + } + this.innerProperties().withVolumeMounts(volumeMounts); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model InitContainerDefinition")); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model InitContainerDefinition")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InitContainerDefinition.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerPropertiesDefinitionInstanceView.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerPropertiesDefinitionInstanceView.java new file mode 100644 index 0000000000000..f5b115ce33943 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerPropertiesDefinitionInstanceView.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of the init container. Only valid in response. */ +@Immutable +public final class InitContainerPropertiesDefinitionInstanceView { + /* + * The number of times that the init container has been restarted. + */ + @JsonProperty(value = "restartCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer restartCount; + + /* + * The current state of the init container. + */ + @JsonProperty(value = "currentState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState currentState; + + /* + * The previous state of the init container. + */ + @JsonProperty(value = "previousState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState previousState; + + /* + * The events of the init container. + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /** Creates an instance of InitContainerPropertiesDefinitionInstanceView class. */ + public InitContainerPropertiesDefinitionInstanceView() { + } + + /** + * Get the restartCount property: The number of times that the init container has been restarted. + * + * @return the restartCount value. + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Get the currentState property: The current state of the init container. + * + * @return the currentState value. + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Get the previousState property: The previous state of the init container. + * + * @return the previousState value. + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Get the events property: The events of the init container. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (currentState() != null) { + currentState().validate(); + } + if (previousState() != null) { + previousState().validate(); + } + if (events() != null) { + events().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IpAddress.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IpAddress.java new file mode 100644 index 0000000000000..027a91e602821 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IpAddress.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** IP address for the container group. */ +@Fluent +public final class IpAddress { + /* + * The list of ports exposed on the container group. + */ + @JsonProperty(value = "ports", required = true) + private List ports; + + /* + * Specifies if the IP is exposed to the public internet or private VNET. + */ + @JsonProperty(value = "type", required = true) + private ContainerGroupIpAddressType type; + + /* + * The IP exposed to the public internet. + */ + @JsonProperty(value = "ip") + private String ip; + + /* + * The Dns name label for the IP. + */ + @JsonProperty(value = "dnsNameLabel") + private String dnsNameLabel; + + /* + * The value representing the security enum. The 'Unsecure' value is the default value if not selected and means + * the object's domain name label is not secured against subdomain takeover. The 'TenantReuse' value is the default + * value if selected and means the object's domain name label can be reused within the same tenant. The + * 'SubscriptionReuse' value means the object's domain name label can be reused within the same subscription. The + * 'ResourceGroupReuse' value means the object's domain name label can be reused within the same resource group. + * The 'NoReuse' value means the object's domain name label cannot be reused within the same resource group, + * subscription, or tenant. + */ + @JsonProperty(value = "autoGeneratedDomainNameLabelScope") + private DnsNameLabelReusePolicy autoGeneratedDomainNameLabelScope; + + /* + * The FQDN for the IP. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /** Creates an instance of IpAddress class. */ + public IpAddress() { + } + + /** + * Get the ports property: The list of ports exposed on the container group. + * + * @return the ports value. + */ + public List ports() { + return this.ports; + } + + /** + * Set the ports property: The list of ports exposed on the container group. + * + * @param ports the ports value to set. + * @return the IpAddress object itself. + */ + public IpAddress withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the type property: Specifies if the IP is exposed to the public internet or private VNET. + * + * @return the type value. + */ + public ContainerGroupIpAddressType type() { + return this.type; + } + + /** + * Set the type property: Specifies if the IP is exposed to the public internet or private VNET. + * + * @param type the type value to set. + * @return the IpAddress object itself. + */ + public IpAddress withType(ContainerGroupIpAddressType type) { + this.type = type; + return this; + } + + /** + * Get the ip property: The IP exposed to the public internet. + * + * @return the ip value. + */ + public String ip() { + return this.ip; + } + + /** + * Set the ip property: The IP exposed to the public internet. + * + * @param ip the ip value to set. + * @return the IpAddress object itself. + */ + public IpAddress withIp(String ip) { + this.ip = ip; + return this; + } + + /** + * Get the dnsNameLabel property: The Dns name label for the IP. + * + * @return the dnsNameLabel value. + */ + public String dnsNameLabel() { + return this.dnsNameLabel; + } + + /** + * Set the dnsNameLabel property: The Dns name label for the IP. + * + * @param dnsNameLabel the dnsNameLabel value to set. + * @return the IpAddress object itself. + */ + public IpAddress withDnsNameLabel(String dnsNameLabel) { + this.dnsNameLabel = dnsNameLabel; + return this; + } + + /** + * Get the autoGeneratedDomainNameLabelScope property: The value representing the security enum. The 'Unsecure' + * value is the default value if not selected and means the object's domain name label is not secured against + * subdomain takeover. The 'TenantReuse' value is the default value if selected and means the object's domain name + * label can be reused within the same tenant. The 'SubscriptionReuse' value means the object's domain name label + * can be reused within the same subscription. The 'ResourceGroupReuse' value means the object's domain name label + * can be reused within the same resource group. The 'NoReuse' value means the object's domain name label cannot be + * reused within the same resource group, subscription, or tenant. + * + * @return the autoGeneratedDomainNameLabelScope value. + */ + public DnsNameLabelReusePolicy autoGeneratedDomainNameLabelScope() { + return this.autoGeneratedDomainNameLabelScope; + } + + /** + * Set the autoGeneratedDomainNameLabelScope property: The value representing the security enum. The 'Unsecure' + * value is the default value if not selected and means the object's domain name label is not secured against + * subdomain takeover. The 'TenantReuse' value is the default value if selected and means the object's domain name + * label can be reused within the same tenant. The 'SubscriptionReuse' value means the object's domain name label + * can be reused within the same subscription. The 'ResourceGroupReuse' value means the object's domain name label + * can be reused within the same resource group. The 'NoReuse' value means the object's domain name label cannot be + * reused within the same resource group, subscription, or tenant. + * + * @param autoGeneratedDomainNameLabelScope the autoGeneratedDomainNameLabelScope value to set. + * @return the IpAddress object itself. + */ + public IpAddress withAutoGeneratedDomainNameLabelScope(DnsNameLabelReusePolicy autoGeneratedDomainNameLabelScope) { + this.autoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; + return this; + } + + /** + * Get the fqdn property: The FQDN for the IP. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ports() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property ports in model IpAddress")); + } else { + ports().forEach(e -> e.validate()); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property type in model IpAddress")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpAddress.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IsCustomProvisioningTimeout.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IsCustomProvisioningTimeout.java new file mode 100644 index 0000000000000..d8567955043f5 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IsCustomProvisioningTimeout.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Flag indicating whether a custom value was provided for the provisioningTimeoutInSeconds property. */ +public final class IsCustomProvisioningTimeout extends ExpandableStringEnum { + /** Static value True for IsCustomProvisioningTimeout. */ + public static final IsCustomProvisioningTimeout TRUE = fromString("True"); + + /** Static value False for IsCustomProvisioningTimeout. */ + public static final IsCustomProvisioningTimeout FALSE = fromString("False"); + + /** + * Creates a new instance of IsCustomProvisioningTimeout value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IsCustomProvisioningTimeout() { + } + + /** + * Creates or finds a IsCustomProvisioningTimeout from its string representation. + * + * @param name a name to look for. + * @return the corresponding IsCustomProvisioningTimeout. + */ + @JsonCreator + public static IsCustomProvisioningTimeout fromString(String name) { + return fromString(name, IsCustomProvisioningTimeout.class); + } + + /** + * Gets known IsCustomProvisioningTimeout values. + * + * @return known IsCustomProvisioningTimeout values. + */ + public static Collection values() { + return values(IsCustomProvisioningTimeout.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Locations.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Locations.java new file mode 100644 index 0000000000000..202cc5edaaf63 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Locations.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Locations. */ +public interface Locations { + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable listUsage(String location); + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the usage for a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable listUsage(String location, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listCachedImages(String location); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cached images on specific OS type for a subscription in a region as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listCachedImages(String location, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedIterable}. + */ + PagedIterable listCapabilities(String location); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedIterable}. + */ + PagedIterable listCapabilities(String location, Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalytics.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalytics.java new file mode 100644 index 0000000000000..81af5939ec148 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalytics.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Container group log analytics information. */ +@Fluent +public final class LogAnalytics { + /* + * The workspace id for log analytics + */ + @JsonProperty(value = "workspaceId", required = true) + private String workspaceId; + + /* + * The workspace key for log analytics + */ + @JsonProperty(value = "workspaceKey", required = true) + private String workspaceKey; + + /* + * The log type to be used. + */ + @JsonProperty(value = "logType") + private LogAnalyticsLogType logType; + + /* + * Metadata for log analytics. + */ + @JsonProperty(value = "metadata") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map metadata; + + /* + * The workspace resource id for log analytics + */ + @JsonProperty(value = "workspaceResourceId") + private String workspaceResourceId; + + /** Creates an instance of LogAnalytics class. */ + public LogAnalytics() { + } + + /** + * Get the workspaceId property: The workspace id for log analytics. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspaceId property: The workspace id for log analytics. + * + * @param workspaceId the workspaceId value to set. + * @return the LogAnalytics object itself. + */ + public LogAnalytics withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the workspaceKey property: The workspace key for log analytics. + * + * @return the workspaceKey value. + */ + public String workspaceKey() { + return this.workspaceKey; + } + + /** + * Set the workspaceKey property: The workspace key for log analytics. + * + * @param workspaceKey the workspaceKey value to set. + * @return the LogAnalytics object itself. + */ + public LogAnalytics withWorkspaceKey(String workspaceKey) { + this.workspaceKey = workspaceKey; + return this; + } + + /** + * Get the logType property: The log type to be used. + * + * @return the logType value. + */ + public LogAnalyticsLogType logType() { + return this.logType; + } + + /** + * Set the logType property: The log type to be used. + * + * @param logType the logType value to set. + * @return the LogAnalytics object itself. + */ + public LogAnalytics withLogType(LogAnalyticsLogType logType) { + this.logType = logType; + return this; + } + + /** + * Get the metadata property: Metadata for log analytics. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Metadata for log analytics. + * + * @param metadata the metadata value to set. + * @return the LogAnalytics object itself. + */ + public LogAnalytics withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the workspaceResourceId property: The workspace resource id for log analytics. + * + * @return the workspaceResourceId value. + */ + public String workspaceResourceId() { + return this.workspaceResourceId; + } + + /** + * Set the workspaceResourceId property: The workspace resource id for log analytics. + * + * @param workspaceResourceId the workspaceResourceId value to set. + * @return the LogAnalytics object itself. + */ + public LogAnalytics withWorkspaceResourceId(String workspaceResourceId) { + this.workspaceResourceId = workspaceResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (workspaceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property workspaceId in model LogAnalytics")); + } + if (workspaceKey() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property workspaceKey in model LogAnalytics")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LogAnalytics.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalyticsLogType.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalyticsLogType.java new file mode 100644 index 0000000000000..d9dadf9e445eb --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalyticsLogType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The log type to be used. */ +public final class LogAnalyticsLogType extends ExpandableStringEnum { + /** Static value ContainerInsights for LogAnalyticsLogType. */ + public static final LogAnalyticsLogType CONTAINER_INSIGHTS = fromString("ContainerInsights"); + + /** Static value ContainerInstanceLogs for LogAnalyticsLogType. */ + public static final LogAnalyticsLogType CONTAINER_INSTANCE_LOGS = fromString("ContainerInstanceLogs"); + + /** + * Creates a new instance of LogAnalyticsLogType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogAnalyticsLogType() { + } + + /** + * Creates or finds a LogAnalyticsLogType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogAnalyticsLogType. + */ + @JsonCreator + public static LogAnalyticsLogType fromString(String name) { + return fromString(name, LogAnalyticsLogType.class); + } + + /** + * Gets known LogAnalyticsLogType values. + * + * @return known LogAnalyticsLogType values. + */ + public static Collection values() { + return values(LogAnalyticsLogType.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Logs.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Logs.java new file mode 100644 index 0000000000000..58bc5210e197c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Logs.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.LogsInner; + +/** An immutable client-side representation of Logs. */ +public interface Logs { + /** + * Gets the content property: The content of the log. + * + * @return the content value. + */ + String content(); + + /** + * Gets the inner com.azure.resourcemanager.containerinstance.generated.fluent.models.LogsInner object. + * + * @return the inner object. + */ + LogsInner innerModel(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperatingSystemTypes.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperatingSystemTypes.java new file mode 100644 index 0000000000000..c971836d46015 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperatingSystemTypes.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The operating system type required by the containers in the container group. */ +public final class OperatingSystemTypes extends ExpandableStringEnum { + /** Static value Windows for OperatingSystemTypes. */ + public static final OperatingSystemTypes WINDOWS = fromString("Windows"); + + /** Static value Linux for OperatingSystemTypes. */ + public static final OperatingSystemTypes LINUX = fromString("Linux"); + + /** + * Creates a new instance of OperatingSystemTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperatingSystemTypes() { + } + + /** + * Creates or finds a OperatingSystemTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperatingSystemTypes. + */ + @JsonCreator + public static OperatingSystemTypes fromString(String name) { + return fromString(name, OperatingSystemTypes.class); + } + + /** + * Gets known OperatingSystemTypes values. + * + * @return known OperatingSystemTypes values. + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Operation.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Operation.java new file mode 100644 index 0000000000000..3b78ce6c0dd92 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Operation.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The display information of the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the properties property: The additional properties. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the origin property: The intended executor of the operation. + * + * @return the origin value. + */ + ContainerInstanceOperationsOrigin origin(); + + /** + * Gets the inner com.azure.resourcemanager.containerinstance.generated.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationDisplay.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationDisplay.java new file mode 100644 index 0000000000000..6ecf9a7ce2db7 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The display information of the operation. */ +@Fluent +public final class OperationDisplay { + /* + * The name of the provider of the operation. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * The name of the resource type of the operation. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * The friendly name of the operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * The description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + + /** + * Get the provider property: The name of the provider of the operation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: The name of the provider of the operation. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: The name of the resource type of the operation. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The name of the resource type of the operation. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: The friendly name of the operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The friendly name of the operation. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: The description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationListResult.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationListResult.java new file mode 100644 index 0000000000000..718b5fd718ed1 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The operation list response that contains all operations for Azure Container Instance service. */ +@Fluent +public final class OperationListResult { + /* + * The list of operations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI to fetch the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * Get the value property: The list of operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of operations. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Operations.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Operations.java new file mode 100644 index 0000000000000..d3415f88ca0e6 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Operations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * List the operations for Azure Container Instance service. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the operations for Azure Container Instance service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation list response that contains all operations for Azure Container Instance service as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Port.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Port.java new file mode 100644 index 0000000000000..8224317d857f8 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Port.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The port exposed on the container group. */ +@Fluent +public final class Port { + /* + * The protocol associated with the port. + */ + @JsonProperty(value = "protocol") + private ContainerGroupNetworkProtocol protocol; + + /* + * The port number. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** Creates an instance of Port class. */ + public Port() { + } + + /** + * Get the protocol property: The protocol associated with the port. + * + * @return the protocol value. + */ + public ContainerGroupNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol associated with the port. + * + * @param protocol the protocol value to set. + * @return the Port object itself. + */ + public Port withProtocol(ContainerGroupNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port property: The port number. + * + * @return the port value. + */ + public int port() { + return this.port; + } + + /** + * Set the port property: The port number. + * + * @param port the port value to set. + * @return the Port object itself. + */ + public Port withPort(int port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceIdentityType.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceIdentityType.java new file mode 100644 index 0000000000000..3f398b57810de --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceIdentityType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The type of identity used for the container group. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from + * the container group. + */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + if (value == null) { + return null; + } + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceLimits.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceLimits.java new file mode 100644 index 0000000000000..cc99dae11da7e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceLimits.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource limits. */ +@Fluent +public final class ResourceLimits { + /* + * The memory limit in GB of this container instance. + */ + @JsonProperty(value = "memoryInGB") + private Double memoryInGB; + + /* + * The CPU limit of this container instance. + */ + @JsonProperty(value = "cpu") + private Double cpu; + + /* + * The GPU limit of this container instance. + */ + @JsonProperty(value = "gpu") + private GpuResource gpu; + + /** Creates an instance of ResourceLimits class. */ + public ResourceLimits() { + } + + /** + * Get the memoryInGB property: The memory limit in GB of this container instance. + * + * @return the memoryInGB value. + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memoryInGB property: The memory limit in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set. + * @return the ResourceLimits object itself. + */ + public ResourceLimits withMemoryInGB(Double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the cpu property: The CPU limit of this container instance. + * + * @return the cpu value. + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set the cpu property: The CPU limit of this container instance. + * + * @param cpu the cpu value to set. + * @return the ResourceLimits object itself. + */ + public ResourceLimits withCpu(Double cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the gpu property: The GPU limit of this container instance. + * + * @return the gpu value. + */ + public GpuResource gpu() { + return this.gpu; + } + + /** + * Set the gpu property: The GPU limit of this container instance. + * + * @param gpu the gpu value to set. + * @return the ResourceLimits object itself. + */ + public ResourceLimits withGpu(GpuResource gpu) { + this.gpu = gpu; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (gpu() != null) { + gpu().validate(); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequests.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequests.java new file mode 100644 index 0000000000000..ffcda5e7a158e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequests.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource requests. */ +@Fluent +public final class ResourceRequests { + /* + * The memory request in GB of this container instance. + */ + @JsonProperty(value = "memoryInGB", required = true) + private double memoryInGB; + + /* + * The CPU request of this container instance. + */ + @JsonProperty(value = "cpu", required = true) + private double cpu; + + /* + * The GPU request of this container instance. + */ + @JsonProperty(value = "gpu") + private GpuResource gpu; + + /** Creates an instance of ResourceRequests class. */ + public ResourceRequests() { + } + + /** + * Get the memoryInGB property: The memory request in GB of this container instance. + * + * @return the memoryInGB value. + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memoryInGB property: The memory request in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set. + * @return the ResourceRequests object itself. + */ + public ResourceRequests withMemoryInGB(double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the cpu property: The CPU request of this container instance. + * + * @return the cpu value. + */ + public double cpu() { + return this.cpu; + } + + /** + * Set the cpu property: The CPU request of this container instance. + * + * @param cpu the cpu value to set. + * @return the ResourceRequests object itself. + */ + public ResourceRequests withCpu(double cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the gpu property: The GPU request of this container instance. + * + * @return the gpu value. + */ + public GpuResource gpu() { + return this.gpu; + } + + /** + * Set the gpu property: The GPU request of this container instance. + * + * @param gpu the gpu value to set. + * @return the ResourceRequests object itself. + */ + public ResourceRequests withGpu(GpuResource gpu) { + this.gpu = gpu; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (gpu() != null) { + gpu().validate(); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequirements.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequirements.java new file mode 100644 index 0000000000000..f82eb3a15593f --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequirements.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource requirements. */ +@Fluent +public final class ResourceRequirements { + /* + * The resource requests of this container instance. + */ + @JsonProperty(value = "requests", required = true) + private ResourceRequests requests; + + /* + * The resource limits of this container instance. + */ + @JsonProperty(value = "limits") + private ResourceLimits limits; + + /** Creates an instance of ResourceRequirements class. */ + public ResourceRequirements() { + } + + /** + * Get the requests property: The resource requests of this container instance. + * + * @return the requests value. + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set the requests property: The resource requests of this container instance. + * + * @param requests the requests value to set. + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withRequests(ResourceRequests requests) { + this.requests = requests; + return this; + } + + /** + * Get the limits property: The resource limits of this container instance. + * + * @return the limits value. + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set the limits property: The resource limits of this container instance. + * + * @param limits the limits value to set. + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withLimits(ResourceLimits limits) { + this.limits = limits; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (requests() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property requests in model ResourceRequirements")); + } else { + requests().validate(); + } + if (limits() != null) { + limits().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceRequirements.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Scheme.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Scheme.java new file mode 100644 index 0000000000000..857f51b3e0283 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Scheme.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The scheme. */ +public final class Scheme extends ExpandableStringEnum { + /** Static value http for Scheme. */ + public static final Scheme HTTP = fromString("http"); + + /** Static value https for Scheme. */ + public static final Scheme HTTPS = fromString("https"); + + /** + * Creates a new instance of Scheme value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Scheme() { + } + + /** + * Creates or finds a Scheme from its string representation. + * + * @param name a name to look for. + * @return the corresponding Scheme. + */ + @JsonCreator + public static Scheme fromString(String name) { + return fromString(name, Scheme.class); + } + + /** + * Gets known Scheme values. + * + * @return known Scheme values. + */ + public static Collection values() { + return values(Scheme.class); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SubnetServiceAssociationLinks.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SubnetServiceAssociationLinks.java new file mode 100644 index 0000000000000..92b55857dbd89 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/SubnetServiceAssociationLinks.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.util.Context; + +/** Resource collection API of SubnetServiceAssociationLinks. */ +public interface SubnetServiceAssociationLinks { + /** + * Delete container group virtual network association links. + * + *

Delete container group virtual network association links. The operation does not delete other resources + * provided by the user. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Delete container group virtual network association links. + * + *

Delete container group virtual network association links. The operation does not delete other resources + * provided by the user. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualNetworkName, String subnetName, Context context); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Usage.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Usage.java new file mode 100644 index 0000000000000..1ca31d65f45d9 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Usage.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.resourcemanager.containerinstance.generated.fluent.models.UsageInner; + +/** An immutable client-side representation of Usage. */ +public interface Usage { + /** + * Gets the id property: Id of the usage result. + * + * @return the id value. + */ + String id(); + + /** + * Gets the unit property: Unit of the usage result. + * + * @return the unit value. + */ + String unit(); + + /** + * Gets the currentValue property: The current usage of the resource. + * + * @return the currentValue value. + */ + Integer currentValue(); + + /** + * Gets the limit property: The maximum permitted usage of the resource. + * + * @return the limit value. + */ + Integer limit(); + + /** + * Gets the name property: The name object of the resource. + * + * @return the name value. + */ + UsageName name(); + + /** + * Gets the inner com.azure.resourcemanager.containerinstance.generated.fluent.models.UsageInner object. + * + * @return the inner object. + */ + UsageInner innerModel(); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageListResult.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageListResult.java new file mode 100644 index 0000000000000..0b47e5aee449c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageListResult.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.containerinstance.generated.fluent.models.UsageInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response containing the usage data. */ +@Immutable +public final class UsageListResult { + /* + * The usage data. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** Creates an instance of UsageListResult class. */ + public UsageListResult() { + } + + /** + * Get the value property: The usage data. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageName.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageName.java new file mode 100644 index 0000000000000..808bb470f90aa --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageName.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The name object of the resource. */ +@Immutable +public final class UsageName { + /* + * The name of the resource + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /* + * The localized name of the resource + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** Creates an instance of UsageName class. */ + public UsageName() { + } + + /** + * Get the value property: The name of the resource. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Get the localizedValue property: The localized name of the resource. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UserAssignedIdentities.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UserAssignedIdentities.java new file mode 100644 index 0000000000000..f82c83bb5580e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UserAssignedIdentities.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of user identities associated with the container group. The user identity dictionary key references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ +@Immutable +public final class UserAssignedIdentities { + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** Creates an instance of UserAssignedIdentities class. */ + public UserAssignedIdentities() { + } + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Volume.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Volume.java new file mode 100644 index 0000000000000..5b696c85587e0 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Volume.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The properties of the volume. */ +@Fluent +public final class Volume { + /* + * The name of the volume. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The Azure File volume. + */ + @JsonProperty(value = "azureFile") + private AzureFileVolume azureFile; + + /* + * The empty directory volume. + */ + @JsonProperty(value = "emptyDir") + private Object emptyDir; + + /* + * The secret volume. + */ + @JsonProperty(value = "secret") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map secret; + + /* + * The git repo volume. + */ + @JsonProperty(value = "gitRepo") + private GitRepoVolume gitRepo; + + /** Creates an instance of Volume class. */ + public Volume() { + } + + /** + * Get the name property: The name of the volume. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the volume. + * + * @param name the name value to set. + * @return the Volume object itself. + */ + public Volume withName(String name) { + this.name = name; + return this; + } + + /** + * Get the azureFile property: The Azure File volume. + * + * @return the azureFile value. + */ + public AzureFileVolume azureFile() { + return this.azureFile; + } + + /** + * Set the azureFile property: The Azure File volume. + * + * @param azureFile the azureFile value to set. + * @return the Volume object itself. + */ + public Volume withAzureFile(AzureFileVolume azureFile) { + this.azureFile = azureFile; + return this; + } + + /** + * Get the emptyDir property: The empty directory volume. + * + * @return the emptyDir value. + */ + public Object emptyDir() { + return this.emptyDir; + } + + /** + * Set the emptyDir property: The empty directory volume. + * + * @param emptyDir the emptyDir value to set. + * @return the Volume object itself. + */ + public Volume withEmptyDir(Object emptyDir) { + this.emptyDir = emptyDir; + return this; + } + + /** + * Get the secret property: The secret volume. + * + * @return the secret value. + */ + public Map secret() { + return this.secret; + } + + /** + * Set the secret property: The secret volume. + * + * @param secret the secret value to set. + * @return the Volume object itself. + */ + public Volume withSecret(Map secret) { + this.secret = secret; + return this; + } + + /** + * Get the gitRepo property: The git repo volume. + * + * @return the gitRepo value. + */ + public GitRepoVolume gitRepo() { + return this.gitRepo; + } + + /** + * Set the gitRepo property: The git repo volume. + * + * @param gitRepo the gitRepo value to set. + * @return the Volume object itself. + */ + public Volume withGitRepo(GitRepoVolume gitRepo) { + this.gitRepo = gitRepo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Volume")); + } + if (azureFile() != null) { + azureFile().validate(); + } + if (gitRepo() != null) { + gitRepo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Volume.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/VolumeMount.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/VolumeMount.java new file mode 100644 index 0000000000000..98e7f8cd58790 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/VolumeMount.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the volume mount. */ +@Fluent +public final class VolumeMount { + /* + * The name of the volume mount. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The path within the container where the volume should be mounted. Must not contain colon (:). + */ + @JsonProperty(value = "mountPath", required = true) + private String mountPath; + + /* + * The flag indicating whether the volume mount is read-only. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** Creates an instance of VolumeMount class. */ + public VolumeMount() { + } + + /** + * Get the name property: The name of the volume mount. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the volume mount. + * + * @param name the name value to set. + * @return the VolumeMount object itself. + */ + public VolumeMount withName(String name) { + this.name = name; + return this; + } + + /** + * Get the mountPath property: The path within the container where the volume should be mounted. Must not contain + * colon (:). + * + * @return the mountPath value. + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the mountPath property: The path within the container where the volume should be mounted. Must not contain + * colon (:). + * + * @param mountPath the mountPath value to set. + * @return the VolumeMount object itself. + */ + public VolumeMount withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Get the readOnly property: The flag indicating whether the volume mount is read-only. + * + * @return the readOnly value. + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the readOnly property: The flag indicating whether the volume mount is read-only. + * + * @param readOnly the readOnly value to set. + * @return the VolumeMount object itself. + */ + public VolumeMount withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model VolumeMount")); + } + if (mountPath() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property mountPath in model VolumeMount")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VolumeMount.class); +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/package-info.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/package-info.java new file mode 100644 index 0000000000000..4cb26dff50f5c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for ContainerInstanceManagementClient. null. */ +package com.azure.resourcemanager.containerinstance.generated.models; diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/package-info.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/package-info.java new file mode 100644 index 0000000000000..7a10670545f05 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for ContainerInstanceManagementClient. null. */ +package com.azure.resourcemanager.containerinstance.generated; diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/module-info.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..d165496ebf5be --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.containerinstance.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.containerinstance.generated; + exports com.azure.resourcemanager.containerinstance.generated.fluent; + exports com.azure.resourcemanager.containerinstance.generated.fluent.models; + exports com.azure.resourcemanager.containerinstance.generated.models; + + opens com.azure.resourcemanager.containerinstance.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.containerinstance.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsCreateOrUpdateSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..08b7839fcb78a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsCreateOrUpdateSamples.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.containerinstance.generated.models.AzureFileVolume; +import com.azure.resourcemanager.containerinstance.generated.models.Container; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIdentity; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIpAddressType; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupNetworkProtocol; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSubnetId; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerPort; +import com.azure.resourcemanager.containerinstance.generated.models.DeploymentExtensionSpec; +import com.azure.resourcemanager.containerinstance.generated.models.DnsConfiguration; +import com.azure.resourcemanager.containerinstance.generated.models.DnsNameLabelReusePolicy; +import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties; +import com.azure.resourcemanager.containerinstance.generated.models.GpuResource; +import com.azure.resourcemanager.containerinstance.generated.models.GpuSku; +import com.azure.resourcemanager.containerinstance.generated.models.IpAddress; +import com.azure.resourcemanager.containerinstance.generated.models.LogAnalytics; +import com.azure.resourcemanager.containerinstance.generated.models.LogAnalyticsLogType; +import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.containerinstance.generated.models.Port; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceRequests; +import com.azure.resourcemanager.containerinstance.generated.models.ResourceRequirements; +import com.azure.resourcemanager.containerinstance.generated.models.UserAssignedIdentities; +import com.azure.resourcemanager.containerinstance.generated.models.Volume; +import com.azure.resourcemanager.containerinstance.generated.models.VolumeMount; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ContainerGroups CreateOrUpdate. */ +public final class ContainerGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupExtensions.json + */ + /** + * Sample code: ContainerGroupCreateWithExtensions. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupCreateWithExtensions( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) throws IOException { + manager + .containerGroups() + .define("demo1") + .withRegion("eastus2") + .withExistingResourceGroup("demo") + .withContainers( + Arrays + .asList( + new Container() + .withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources( + new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0))))) + .withOsType(OperatingSystemTypes.LINUX) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress( + new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PRIVATE)) + .withSubnetIds( + Arrays + .asList( + new ContainerGroupSubnetId() + .withId( + "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-rg-vnet/subnets/test-subnet"))) + .withExtensions( + Arrays + .asList( + new DeploymentExtensionSpec() + .withName("kube-proxy") + .withExtensionType("kube-proxy") + .withVersion("1.0") + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"clusterCidr\":\"10.240.0.0/16\",\"kubeVersion\":\"v1.9.10\"}", + Object.class, + SerializerEncoding.JSON)) + .withProtectedSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"kubeConfig\":\"\"}", + Object.class, + SerializerEncoding.JSON)), + new DeploymentExtensionSpec() + .withName("vk-realtime-metrics") + .withExtensionType("realtime-metrics") + .withVersion("1.0"))) + .create(); + } + + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupEncryptionProperties.json + */ + /** + * Sample code: ContainerGroupWithEncryptionProperties. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupWithEncryptionProperties( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager + .containerGroups() + .define("demo1") + .withRegion("eastus2") + .withExistingResourceGroup("demo") + .withContainers( + Arrays + .asList( + new Container() + .withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources( + new ResourceRequirements() + .withRequests(new ResourceRequests().withMemoryInGB(1.5).withCpu(1.0))))) + .withOsType(OperatingSystemTypes.LINUX) + .withIdentity( + new ContainerGroupIdentity() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity", + new UserAssignedIdentities()))) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress( + new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PUBLIC)) + .withEncryptionProperties( + new EncryptionProperties() + .withVaultBaseUrl("https://testkeyvault.vault.azure.net") + .withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity")) + .create(); + } + + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsCreateOrUpdate.json + */ + /** + * Sample code: ContainerGroupsCreateOrUpdate. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsCreateOrUpdate( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) throws IOException { + manager + .containerGroups() + .define("demo1") + .withRegion("west us") + .withExistingResourceGroup("demo") + .withContainers( + Arrays + .asList( + new Container() + .withName("demo1") + .withImage("nginx") + .withCommand(Arrays.asList()) + .withPorts(Arrays.asList(new ContainerPort().withPort(80))) + .withEnvironmentVariables(Arrays.asList()) + .withResources( + new ResourceRequirements() + .withRequests( + new ResourceRequests() + .withMemoryInGB(1.5) + .withCpu(1.0) + .withGpu(new GpuResource().withCount(1).withSku(GpuSku.K80)))) + .withVolumeMounts( + Arrays + .asList( + new VolumeMount() + .withName("volume1") + .withMountPath("/mnt/volume1") + .withReadOnly(false), + new VolumeMount() + .withName("volume2") + .withMountPath("/mnt/volume2") + .withReadOnly(false), + new VolumeMount() + .withName("volume3") + .withMountPath("/mnt/volume3") + .withReadOnly(true))))) + .withOsType(OperatingSystemTypes.LINUX) + .withIdentity( + new ContainerGroupIdentity() + .withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name", + new UserAssignedIdentities()))) + .withImageRegistryCredentials(Arrays.asList()) + .withProvisioningTimeoutInSeconds(600) + .withIpAddress( + new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PUBLIC) + .withDnsNameLabel("dnsnamelabel1") + .withAutoGeneratedDomainNameLabelScope(DnsNameLabelReusePolicy.UNSECURE)) + .withVolumes( + Arrays + .asList( + new Volume() + .withName("volume1") + .withAzureFile( + new AzureFileVolume() + .withShareName("shareName") + .withStorageAccountName("accountName") + .withStorageAccountKey("fakeTokenPlaceholder")), + new Volume() + .withName("volume2") + .withEmptyDir( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)), + new Volume() + .withName("volume3") + .withSecret( + mapOf("secretKey1", "SecretValue1InBase64", "secretKey2", "SecretValue2InBase64")))) + .withDiagnostics( + new ContainerGroupDiagnostics() + .withLogAnalytics( + new LogAnalytics() + .withWorkspaceId("workspaceid") + .withWorkspaceKey("fakeTokenPlaceholder") + .withLogType(LogAnalyticsLogType.CONTAINER_INSIGHTS) + .withMetadata(mapOf("test-key", "test-metadata-value")) + .withWorkspaceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace"))) + .withSubnetIds( + Arrays + .asList( + new ContainerGroupSubnetId() + .withId( + "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName')," + + " parameters('subnetName'))]"))) + .withDnsConfig( + new DnsConfiguration() + .withNameServers(Arrays.asList("1.1.1.1")) + .withSearchDomains("cluster.local svc.cluster.local") + .withOptions("ndots:2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsDeleteSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsDeleteSamples.java new file mode 100644 index 0000000000000..20b40d251e2a6 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +/** Samples for ContainerGroups Delete. */ +public final class ContainerGroupsDeleteSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsDelete.json + */ + /** + * Sample code: ContainerGroupsDelete. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsDelete( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().delete("demo", "demo1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsGetByResourceGroupSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..81ad26c1598e2 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsGetByResourceGroupSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +/** Samples for ContainerGroups GetByResourceGroup. */ +public final class ContainerGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsGet_Succeeded.json + */ + /** + * Sample code: ContainerGroupsGet_Succeeded. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsGetSucceeded( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().getByResourceGroupWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsGet_Failed.json + */ + /** + * Sample code: ContainerGroupsGet_Failed. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsGetFailed( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().getByResourceGroupWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListByResourceGroupSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..c377321340708 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +/** Samples for ContainerGroups ListByResourceGroup. */ +public final class ContainerGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsListByResourceGroup.json + */ + /** + * Sample code: ContainerGroupsListByResourceGroup. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsListByResourceGroup( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().listByResourceGroup("demo", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListSamples.java new file mode 100644 index 0000000000000..3dea471d3ffc8 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +/** Samples for ContainerGroups List. */ +public final class ContainerGroupsListSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsList.json + */ + /** + * Sample code: ContainerGroupsList. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsList( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsRestartSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsRestartSamples.java new file mode 100644 index 0000000000000..ee5d20faaa95a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsRestartSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +/** Samples for ContainerGroups Restart. */ +public final class ContainerGroupsRestartSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsRestart.json + */ + /** + * Sample code: ContainerRestart. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerRestart( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().restart("demo", "demo1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStartSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStartSamples.java new file mode 100644 index 0000000000000..f7c13c5b35e75 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStartSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +/** Samples for ContainerGroups Start. */ +public final class ContainerGroupsStartSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsStart.json + */ + /** + * Sample code: ContainerStart. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerStart( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().start("demo", "demo1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStopSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStopSamples.java new file mode 100644 index 0000000000000..3f9907acd6064 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStopSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +/** Samples for ContainerGroups Stop. */ +public final class ContainerGroupsStopSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsStop.json + */ + /** + * Sample code: ContainerStop. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerStop( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containerGroups().stopWithResponse("demo", "demo1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsUpdateSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsUpdateSamples.java new file mode 100644 index 0000000000000..aad5e3f9ba478 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +import com.azure.core.management.Resource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ContainerGroups Update. */ +public final class ContainerGroupsUpdateSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupsUpdate.json + */ + /** + * Sample code: ContainerGroupsUpdate. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerGroupsUpdate( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager + .containerGroups() + .updateWithResponse( + "demoResource", + "demo1", + new Resource().withTags(mapOf("tag1key", "tag1Value", "tag2key", "tag2Value")), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersAttachSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersAttachSamples.java new file mode 100644 index 0000000000000..cee1d4183f32f --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersAttachSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +/** Samples for Containers Attach. */ +public final class ContainersAttachSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerAttach.json + */ + /** + * Sample code: ContainerAttach. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerAttach( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.containers().attachWithResponse("demo", "demo1", "container1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersExecuteCommandSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersExecuteCommandSamples.java new file mode 100644 index 0000000000000..d9f5cd2e4aad7 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersExecuteCommandSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecRequest; +import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecRequestTerminalSize; + +/** Samples for Containers ExecuteCommand. */ +public final class ContainersExecuteCommandSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerExec.json + */ + /** + * Sample code: ContainerExec. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerExec( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager + .containers() + .executeCommandWithResponse( + "demo", + "demo1", + "container1", + new ContainerExecRequest() + .withCommand("/bin/bash") + .withTerminalSize(new ContainerExecRequestTerminalSize().withRows(12).withCols(12)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersListLogsSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersListLogsSamples.java new file mode 100644 index 0000000000000..c91f200146254 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersListLogsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +/** Samples for Containers ListLogs. */ +public final class ContainersListLogsSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerListLogs.json + */ + /** + * Sample code: ContainerListLogs. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerListLogs( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager + .containers() + .listLogsWithResponse("demo", "demo1", "container1", 10, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCachedImagesSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCachedImagesSamples.java new file mode 100644 index 0000000000000..128c97ff9a73d --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCachedImagesSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +/** Samples for Location ListCachedImages. */ +public final class LocationListCachedImagesSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/CachedImagesList.json + */ + /** + * Sample code: CachedImages. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void cachedImages( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.locations().listCachedImages("westcentralus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCapabilitiesSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCapabilitiesSamples.java new file mode 100644 index 0000000000000..9062388b9ef75 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCapabilitiesSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +/** Samples for Location ListCapabilities. */ +public final class LocationListCapabilitiesSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/CapabilitiesList.json + */ + /** + * Sample code: GetCapabilities. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void getCapabilities( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.locations().listCapabilities("westus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListUsageSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListUsageSamples.java new file mode 100644 index 0000000000000..6a75b79d012ab --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListUsageSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +/** Samples for Location ListUsage. */ +public final class LocationListUsageSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/ContainerGroupUsage.json + */ + /** + * Sample code: ContainerUsage. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void containerUsage( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.locations().listUsage("westcentralus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/OperationsListSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..aeac6b6705ce6 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/OperationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/OperationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void operationsList( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/SubnetServiceAssociationLinkDeleteSamples.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/SubnetServiceAssociationLinkDeleteSamples.java new file mode 100644 index 0000000000000..5f3a9a587c4f7 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/SubnetServiceAssociationLinkDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerinstance.generated.generated; + +/** Samples for SubnetServiceAssociationLink Delete. */ +public final class SubnetServiceAssociationLinkDeleteSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2023-02-01-preview/examples/SubnetServiceAssociationLinkDelete.json + */ + /** + * Sample code: SubnetServiceAssociationLinkDelete. + * + * @param manager Entry point to ContainerInstanceManager. + */ + public static void subnetServiceAssociationLinkDelete( + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager) { + manager.subnetServiceAssociationLinks().delete("demo", "demo2", "demo3", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerinstance/ci.yml b/sdk/containerinstance/ci.yml new file mode 100644 index 0000000000000..8cedf0686871c --- /dev/null +++ b/sdk/containerinstance/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/containerinstance/ci.yml + - sdk/containerinstance/azure-resourcemanager-containerinstance-generated/ + exclude: + - sdk/containerinstance/pom.xml + - sdk/containerinstance/azure-resourcemanager-containerinstance-generated/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerinstance/ci.yml + - sdk/containerinstance/azure-resourcemanager-containerinstance-generated/ + exclude: + - sdk/containerinstance/pom.xml + - sdk/containerinstance/azure-resourcemanager-containerinstance-generated/pom.xml + +parameters: + - name: release_azureresourcemanagercontainerinstancegenerated + displayName: azure-resourcemanager-containerinstance-generated + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: containerinstance + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-containerinstance-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagercontainerinstancegenerated + releaseInBatch: ${{ parameters.release_azureresourcemanagercontainerinstancegenerated }} diff --git a/sdk/containerinstance/pom.xml b/sdk/containerinstance/pom.xml new file mode 100644 index 0000000000000..dcfd797bafabc --- /dev/null +++ b/sdk/containerinstance/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-containerinstance-service + pom + 1.0.0 + + + azure-resourcemanager-containerinstance-generated + +