From eb4511aaf28399b4df3736c2921d76c7fdb531a3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 27 May 2022 01:31:22 +0000 Subject: [PATCH] CodeGen from PR 19103 in Azure/azure-rest-api-specs ACI: Correct the type of httpHeaders object->array of object (#19103) * ACI: Correct the type of httpHeaders object->array of object * Fix lint issue && prettier --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 102 + .../SAMPLE.md | 558 ++++ .../pom.xml | 55 + .../generated/ContainerInstanceManager.java | 330 +++ .../fluent/ContainerGroupsClient.java | 430 +++ .../ContainerInstanceManagementClient.java | 75 + .../generated/fluent/ContainersClient.java | 127 + .../generated/fluent/LocationsClient.java | 93 + .../generated/fluent/OperationsClient.java | 38 + .../fluent/models/CachedImagesInner.java | 85 + .../fluent/models/CapabilitiesInner.java | 114 + .../models/ContainerAttachResponseInner.java | 75 + .../models/ContainerExecResponseInner.java | 72 + .../fluent/models/ContainerGroupInner.java | 431 +++ .../models/ContainerGroupProperties.java | 433 +++ .../fluent/models/ContainerProperties.java | 283 ++ .../InitContainerPropertiesDefinition.java | 152 ++ .../generated/fluent/models/LogsInner.java | 46 + .../fluent/models/OperationInner.java | 141 + .../generated/fluent/models/UsageInner.java | 84 + .../generated/fluent/models/package-info.java | 6 + .../generated/fluent/package-info.java | 6 + .../implementation/CachedImagesImpl.java | 37 + .../implementation/CapabilitiesImpl.java | 54 + .../ContainerAttachResponseImpl.java | 37 + .../ContainerExecResponseImpl.java | 37 + .../implementation/ContainerGroupImpl.java | 339 +++ .../ContainerGroupsClientImpl.java | 2331 +++++++++++++++++ .../implementation/ContainerGroupsImpl.java | 252 ++ ...tainerInstanceManagementClientBuilder.java | 145 + ...ContainerInstanceManagementClientImpl.java | 337 +++ .../implementation/ContainersClientImpl.java | 687 +++++ .../implementation/ContainersImpl.java | 136 + .../implementation/LocationsClientImpl.java | 739 ++++++ .../implementation/LocationsImpl.java | 70 + .../generated/implementation/LogsImpl.java | 33 + .../implementation/OperationImpl.java | 47 + .../implementation/OperationsClientImpl.java | 274 ++ .../implementation/OperationsImpl.java | 46 + .../generated/implementation/UsageImpl.java | 46 + .../generated/implementation/Utils.java | 204 ++ .../implementation/package-info.java | 6 + .../AutoGeneratedDomainNameLabelScope.java | 47 + .../generated/models/AzureFileVolume.java | 139 + .../generated/models/CachedImages.java | 31 + .../models/CachedImagesListResult.java | 77 + .../generated/models/Capabilities.java | 59 + .../models/CapabilitiesCapabilities.java | 65 + .../models/CapabilitiesListResult.java | 77 + .../generated/models/Container.java | 270 ++ .../models/ContainerAttachResponse.java | 33 + .../generated/models/ContainerExec.java | 47 + .../models/ContainerExecRequest.java | 75 + .../ContainerExecRequestTerminalSize.java | 72 + .../models/ContainerExecResponse.java | 32 + .../generated/models/ContainerGroup.java | 490 ++++ .../models/ContainerGroupDiagnostics.java | 49 + .../models/ContainerGroupIdentity.java | 134 + ...erGroupIdentityUserAssignedIdentities.java | 50 + .../models/ContainerGroupIpAddressType.java | 38 + .../models/ContainerGroupListResult.java | 77 + .../models/ContainerGroupNetworkProtocol.java | 38 + .../ContainerGroupPropertiesInstanceView.java | 54 + .../models/ContainerGroupRestartPolicy.java | 41 + .../generated/models/ContainerGroupSku.java | 38 + .../models/ContainerGroupSubnetId.java | 80 + .../generated/models/ContainerGroups.java | 319 +++ .../generated/models/ContainerHttpGet.java | 128 + .../ContainerInstanceOperationsOrigin.java | 38 + .../models/ContainerNetworkProtocol.java | 38 + .../generated/models/ContainerPort.java | 72 + .../generated/models/ContainerProbe.java | 208 ++ .../ContainerPropertiesInstanceView.java | 90 + .../generated/models/ContainerState.java | 97 + .../generated/models/Containers.java | 115 + .../generated/models/DnsConfiguration.java | 107 + .../models/EncryptionProperties.java | 117 + .../generated/models/EnvironmentVariable.java | 106 + .../generated/models/Event.java | 111 + .../generated/models/GitRepoVolume.java | 113 + .../generated/models/GpuResource.java | 80 + .../generated/models/GpuSku.java | 41 + .../generated/models/HttpHeader.java | 72 + .../models/ImageRegistryCredential.java | 165 ++ .../models/InitContainerDefinition.java | 180 ++ ...ainerPropertiesDefinitionInstanceView.java | 90 + .../generated/models/IpAddress.java | 180 ++ .../generated/models/Locations.java | 82 + .../generated/models/LogAnalytics.java | 166 ++ .../generated/models/LogAnalyticsLogType.java | 38 + .../generated/models/Logs.java | 24 + .../models/OperatingSystemTypes.java | 38 + .../generated/models/Operation.java | 45 + .../generated/models/OperationDisplay.java | 124 + .../generated/models/OperationListResult.java | 77 + .../generated/models/Operations.java | 33 + .../generated/models/Port.java | 72 + .../models/ResourceIdentityType.java | 53 + .../generated/models/ResourceLimits.java | 101 + .../generated/models/ResourceRequests.java | 101 + .../models/ResourceRequirements.java | 85 + .../generated/models/Scheme.java | 38 + .../generated/models/Usage.java | 45 + .../generated/models/UsageListResult.java | 40 + .../generated/models/UsageName.java | 50 + .../generated/models/Volume.java | 166 ++ .../generated/models/VolumeMount.java | 114 + .../generated/models/package-info.java | 6 + .../generated/package-info.java | 6 + .../src/main/java/module-info.java | 19 + .../ContainerGroupsCreateOrUpdateSamples.java | 155 ++ .../ContainerGroupsDeleteSamples.java | 23 + ...tainerGroupsGetByResourceGroupSamples.java | 36 + ...ainerGroupsListByResourceGroupSamples.java | 23 + .../generated/ContainerGroupsListSamples.java | 23 + .../ContainerGroupsRestartSamples.java | 23 + .../ContainerGroupsStartSamples.java | 23 + .../generated/ContainerGroupsStopSamples.java | 23 + .../ContainerGroupsUpdateSamples.java | 43 + .../generated/ContainersAttachSamples.java | 23 + .../ContainersExecuteCommandSamples.java | 34 + .../generated/ContainersListLogsSamples.java | 23 + .../LocationListCachedImagesSamples.java | 23 + .../LocationListCapabilitiesSamples.java | 23 + .../generated/LocationListUsageSamples.java | 23 + .../generated/OperationsListSamples.java | 23 + sdk/containerinstance/ci.yml | 39 + sdk/containerinstance/pom.xml | 53 + 131 files changed, 16339 insertions(+) create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/CHANGELOG.md create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/README.md create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/SAMPLE.md create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/pom.xml create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/ContainerInstanceManager.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerGroupsClient.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerInstanceManagementClient.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainersClient.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/LocationsClient.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/OperationsClient.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CachedImagesInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CapabilitiesInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerAttachResponseInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerExecResponseInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupProperties.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerProperties.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/InitContainerPropertiesDefinition.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/LogsInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/OperationInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/UsageInner.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/package-info.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/package-info.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CachedImagesImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CapabilitiesImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerAttachResponseImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerExecResponseImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsClientImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientBuilder.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersClientImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsClientImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LogsImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsClientImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/UsageImpl.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/Utils.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/package-info.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AutoGeneratedDomainNameLabelScope.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileVolume.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImages.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImagesListResult.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Capabilities.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesCapabilities.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesListResult.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Container.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerAttachResponse.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExec.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequest.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequestTerminalSize.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecResponse.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroup.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupDiagnostics.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIdentity.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIdentityUserAssignedIdentities.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIpAddressType.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupListResult.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupNetworkProtocol.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupPropertiesInstanceView.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupRestartPolicy.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSku.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSubnetId.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroups.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerHttpGet.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerInstanceOperationsOrigin.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerNetworkProtocol.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPort.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerProbe.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPropertiesInstanceView.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerState.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Containers.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DnsConfiguration.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EncryptionProperties.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EnvironmentVariable.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Event.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GitRepoVolume.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuResource.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuSku.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/HttpHeader.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ImageRegistryCredential.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerDefinition.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerPropertiesDefinitionInstanceView.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IpAddress.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Locations.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalytics.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalyticsLogType.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Logs.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperatingSystemTypes.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Operation.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationDisplay.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationListResult.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Operations.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Port.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceIdentityType.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceLimits.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequests.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequirements.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Scheme.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Usage.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageListResult.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageName.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Volume.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/VolumeMount.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/package-info.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/package-info.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/module-info.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsCreateOrUpdateSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsDeleteSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsGetByResourceGroupSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListByResourceGroupSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsRestartSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStartSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStopSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsUpdateSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersAttachSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersExecuteCommandSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersListLogsSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCachedImagesSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCapabilitiesSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListUsageSamples.java create mode 100644 sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/OperationsListSamples.java create mode 100644 sdk/containerinstance/ci.yml create mode 100644 sdk/containerinstance/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 98c407dd3cdac..5d03dcd7a9fa3 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -344,6 +344,7 @@ com.azure.resourcemanager:azure-resourcemanager-workloads;1.0.0-beta.1;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-confidentialledger;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-dynatrace;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-deviceupdate;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.0.0 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 0c7137c6d9c79..ee6c68a1e66ec 100644 --- a/pom.xml +++ b/pom.xml @@ -869,6 +869,7 @@ sdk/confidentialledger sdk/confluent 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..33820b3f6e7a5 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-05-27) + +- Azure Resource Manager ContainerInstance client library for Java. This package contains Microsoft Azure SDK for ContainerInstance Management SDK. Package tag package-2021-10. 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..c2fec23bcda52 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/README.md @@ -0,0 +1,102 @@ +# 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-2021-10. 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] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of 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 environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by 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](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[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 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..1d088cd0d00e3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/SAMPLE.md @@ -0,0 +1,558 @@ +# 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) +### ContainerGroups_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.containerinstance.generated.models.AutoGeneratedDomainNameLabelScope; +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.ContainerGroupIdentityUserAssignedIdentities; +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.DnsConfiguration; +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.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/stable/2021-10-01/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 ContainerGroupIdentityUserAssignedIdentities()))) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress( + new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PUBLIC) + .withDnsNameLabel("dnsnamelabel1") + .withDnsNameLabelReusePolicy(AutoGeneratedDomainNameLabelScope.UNSECURE)) + .withVolumes( + Arrays + .asList( + new Volume() + .withName("volume1") + .withAzureFile( + new AzureFileVolume() + .withShareName("shareName") + .withStorageAccountName("accountName") + .withStorageAccountKey("accountKey")), + 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("workspaceKey") + .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 +import com.azure.core.util.Context; + +/** Samples for ContainerGroups Delete. */ +public final class ContainerGroupsDeleteSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", Context.NONE); + } +} +``` + +### ContainerGroups_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerGroups GetByResourceGroup. */ +public final class ContainerGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", Context.NONE); + } + + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", Context.NONE); + } +} +``` + +### ContainerGroups_List + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerGroups List. */ +public final class ContainerGroupsListSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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(Context.NONE); + } +} +``` + +### ContainerGroups_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerGroups ListByResourceGroup. */ +public final class ContainerGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", Context.NONE); + } +} +``` + +### ContainerGroups_Restart + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerGroups Restart. */ +public final class ContainerGroupsRestartSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", Context.NONE); + } +} +``` + +### ContainerGroups_Start + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerGroups Start. */ +public final class ContainerGroupsStartSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", Context.NONE); + } +} +``` + +### ContainerGroups_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerGroups Stop. */ +public final class ContainerGroupsStopSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", Context.NONE); + } +} +``` + +### ContainerGroups_Update + +```java +import com.azure.core.management.Resource; +import com.azure.core.util.Context; +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/stable/2021-10-01/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")), + 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 +import com.azure.core.util.Context; + +/** Samples for Containers Attach. */ +public final class ContainersAttachSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", Context.NONE); + } +} +``` + +### Containers_ExecuteCommand + +```java +import com.azure.core.util.Context; +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/stable/2021-10-01/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)), + Context.NONE); + } +} +``` + +### Containers_ListLogs + +```java +import com.azure.core.util.Context; + +/** Samples for Containers ListLogs. */ +public final class ContainersListLogsSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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, Context.NONE); + } +} +``` + +### Location_ListCachedImages + +```java +import com.azure.core.util.Context; + +/** Samples for Location ListCachedImages. */ +public final class LocationListCachedImagesSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", Context.NONE); + } +} +``` + +### Location_ListCapabilities + +```java +import com.azure.core.util.Context; + +/** Samples for Location ListCapabilities. */ +public final class LocationListCapabilitiesSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", Context.NONE); + } +} +``` + +### Location_ListUsage + +```java +import com.azure.core.util.Context; + +/** Samples for Location ListUsage. */ +public final class LocationListUsageSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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(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..19dbbf6ab5cfc --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/pom.xml @@ -0,0 +1,55 @@ + + 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-2021-10. + 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 + true + + + + com.azure + azure-core + 1.28.0 + + + com.azure + azure-core-management + 1.6.0 + + + 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..6262053b1505d --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/ContainerInstanceManager.java @@ -0,0 +1,330 @@ +// 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.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 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 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; + } + + /** + * @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..dfbeeed2d35ed --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerGroupsClient.java @@ -0,0 +1,430 @@ +// 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. 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. 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 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 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); + + /** + * 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); + + /** + * 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); + + /** + * 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 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 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 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); + + /** + * 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); + + /** + * 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); + + /** + * 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 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 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 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 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 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 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 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. 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); + + /** + * 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); + + /** + * 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. 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. 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. 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); + + /** + * 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); + + /** + * 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); +} 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..9a99637643991 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerInstanceManagementClient.java @@ -0,0 +1,75 @@ +// 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(); +} 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..f8f7b71bbc2d1 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainersClient.java @@ -0,0 +1,127 @@ +// 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 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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..23676bdb6fbf7 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/LocationsClient.java @@ -0,0 +1,93 @@ +// 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 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 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 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 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/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..5c9339b0a3404 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CachedImagesInner.java @@ -0,0 +1,85 @@ +// 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; + + /** + * 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..2d596264fd0eb --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CapabilitiesInner.java @@ -0,0 +1,114 @@ +// 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; + + /** + * 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..3c61f1eaa7100 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerAttachResponseInner.java @@ -0,0 +1,75 @@ +// 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; + + /** + * 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..f76adafe5bf55 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerExecResponseInner.java @@ -0,0 +1,72 @@ +// 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; + + /** + * 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..c472ab818db0e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupInner.java @@ -0,0 +1,431 @@ +// 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.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.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 identity of the container group, if configured. + */ + @JsonProperty(value = "identity") + private ContainerGroupIdentity identity; + + /* + * The container group properties + */ + @JsonProperty(value = "properties", required = true) + private ContainerGroupProperties innerProperties = new ContainerGroupProperties(); + + /* + * The zones for the container group. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * 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 ContainerGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** {@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 ContainerGroupProperties(); + } + 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 ContainerGroupProperties(); + } + this.innerProperties().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + /** + * 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 ContainerGroupProperties(); + } + 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 ContainerGroupProperties(); + } + 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 ContainerGroupProperties(); + } + 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 ContainerGroupProperties(); + } + 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 ContainerGroupProperties(); + } + 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 ContainerGroupProperties(); + } + 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 ContainerGroupProperties(); + } + 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 ContainerGroupProperties(); + } + 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 ContainerGroupProperties(); + } + 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 ContainerGroupProperties(); + } + this.innerProperties().withInitContainers(initContainers); + 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/ContainerGroupProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupProperties.java new file mode 100644 index 0000000000000..5f364363dfdd3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupProperties.java @@ -0,0 +1,433 @@ +// 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.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.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 ContainerGroupProperties { + /* + * 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; + + /* + * 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; + + /** + * 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 ContainerGroupProperties object itself. + */ + public ContainerGroupProperties 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 ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withImageRegistryCredentials( + List imageRegistryCredentials) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * 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 ContainerGroupProperties object itself. + */ + public ContainerGroupProperties 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 ContainerGroupProperties object itself. + */ + public ContainerGroupProperties 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 ContainerGroupProperties object itself. + */ + public ContainerGroupProperties 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 ContainerGroupProperties object itself. + */ + public ContainerGroupProperties 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 ContainerGroupProperties object itself. + */ + public ContainerGroupProperties 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 ContainerGroupProperties object itself. + */ + public ContainerGroupProperties 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 ContainerGroupProperties object itself. + */ + public ContainerGroupProperties 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 ContainerGroupProperties object itself. + */ + public ContainerGroupProperties 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 ContainerGroupProperties object itself. + */ + public ContainerGroupProperties 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 ContainerGroupProperties object itself. + */ + public ContainerGroupProperties withInitContainers(List initContainers) { + this.initContainers = initContainers; + 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 ContainerGroupProperties")); + } 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 ContainerGroupProperties")); + } + 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()); + } + } + + 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/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..48b6cb8765408 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerProperties.java @@ -0,0 +1,283 @@ +// 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; + + /** + * 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/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..e07813b8da75a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/InitContainerPropertiesDefinition.java @@ -0,0 +1,152 @@ +// 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; + + /** + * 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..33992fa4d821f --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/LogsInner.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.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; + + /** + * 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..3975d84431b77 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/OperationInner.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.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; + + /** + * 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..8011cf14b758d --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/UsageInner.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.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 { + /* + * 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; + + /** + * 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..8c03281f7f732 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupImpl.java @@ -0,0 +1,339 @@ +// 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.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.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 { + private ContainerGroupInner innerObject; + + private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager; + + ContainerGroupImpl( + ContainerGroupInner innerObject, + com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = 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 ContainerGroupIdentity identity() { + return this.innerModel().identity(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + 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 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + 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 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 void stop() { + serviceManager.containerGroups().stop(resourceGroupName, containerGroupName); + } + + public Response stopWithResponse(Context context) { + return serviceManager.containerGroups().stopWithResponse(resourceGroupName, containerGroupName, context); + } + + 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 withIdentity(ContainerGroupIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ContainerGroupImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public ContainerGroupImpl withImageRegistryCredentials(List imageRegistryCredentials) { + this.innerModel().withImageRegistryCredentials(imageRegistryCredentials); + 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; + } +} 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..7709cacb46b7d --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsClientImpl.java @@ -0,0 +1,2331 @@ +// 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") + private 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}) + @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. 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. 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. 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. 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. 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. 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 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 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 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 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 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 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)); + } + + /** + * 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())); + } + + /** + * 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); + } + + /** + * 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())); + } + + /** + * 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 getByResourceGroupAsync(resourceGroupName, containerGroupName).block(); + } + + /** + * 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(); + } + + /** + * 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 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 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 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 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 beginCreateOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup).getSyncPoller(); + } + + /** + * 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 beginCreateOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup, context).getSyncPoller(); + } + + /** + * 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 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 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 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(); + } + + /** + * 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())); + } + + /** + * 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); + } + + /** + * 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())); + } + + /** + * 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 updateAsync(resourceGroupName, containerGroupName, resource).block(); + } + + /** + * 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(); + } + + /** + * 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 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 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 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 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 beginDeleteAsync(resourceGroupName, containerGroupName).getSyncPoller(); + } + + /** + * 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 beginDeleteAsync(resourceGroupName, containerGroupName, context).getSyncPoller(); + } + + /** + * 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 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 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 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 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 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 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 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 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 beginRestartAsync(resourceGroupName, containerGroupName).getSyncPoller(); + } + + /** + * 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 beginRestartAsync(resourceGroupName, containerGroupName, context).getSyncPoller(); + } + + /** + * 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 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 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 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. 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. 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. 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. 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) { + stopAsync(resourceGroupName, containerGroupName).block(); + } + + /** + * 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(); + } + + /** + * 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. 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. 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. 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. 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 beginStartAsync(resourceGroupName, containerGroupName).getSyncPoller(); + } + + /** + * 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 beginStartAsync(resourceGroupName, containerGroupName, context).getSyncPoller(); + } + + /** + * 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. 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. 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. 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(); + } + + /** + * 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())); + } + + /** + * 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); + } + + /** + * 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())); + } + + /** + * 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 getOutboundNetworkDependenciesEndpointsAsync(resourceGroupName, containerGroupName).block(); + } + + /** + * 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 the next page of items. + * + * @param nextLink 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 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 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 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..c62c394d525fa --- /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 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 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 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 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 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 void stop(String resourceGroupName, String containerGroupName) { + this.serviceClient().stop(resourceGroupName, containerGroupName); + } + + public Response stopWithResponse(String resourceGroupName, String containerGroupName, Context context) { + return this.serviceClient().stopWithResponse(resourceGroupName, containerGroupName, context); + } + + 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 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 Response> getOutboundNetworkDependenciesEndpointsWithResponse( + String resourceGroupName, String containerGroupName, Context context) { + return this + .serviceClient() + .getOutboundNetworkDependenciesEndpointsWithResponse(resourceGroupName, containerGroupName, context); + } + + 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..ae751f4cb0dbb --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientBuilder.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.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() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + ContainerInstanceManagementClientImpl client = + new ContainerInstanceManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + 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..0a3cd145babda --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientImpl.java @@ -0,0 +1,337 @@ +// 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 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; + } + + /** + * 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 = "2021-10-01"; + this.containerGroups = new ContainerGroupsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.locations = new LocationsClientImpl(this); + this.containers = new ContainersClientImpl(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..d5c104b0f44b4 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersClientImpl.java @@ -0,0 +1,687 @@ +// 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") + private 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 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 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 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 on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listLogsAsync( + String resourceGroupName, String containerGroupName, String containerName, Integer tail, Boolean timestamps) { + return listLogsWithResponseAsync(resourceGroupName, containerGroupName, containerName, tail, timestamps) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 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 listLogsAsync(resourceGroupName, containerGroupName, containerName, tail, timestamps).block(); + } + + /** + * 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(); + } + + /** + * 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 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 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 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 executeCommandAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).block(); + } + + /** + * 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(); + } + + /** + * 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 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 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 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 attachAsync(resourceGroupName, containerGroupName, containerName).block(); + } + + /** + * 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(); + } +} 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..3d651d598860e --- /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 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 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 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 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 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; + } + } + + 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; + } + } + + 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..58ae7ecc107f2 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/LocationsClientImpl.java @@ -0,0 +1,739 @@ +// 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") + private 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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..e13b940184dc8 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/OperationsClientImpl.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.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") + private 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 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 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/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..9250222dc1cec --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/UsageImpl.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.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 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/AutoGeneratedDomainNameLabelScope.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AutoGeneratedDomainNameLabelScope.java new file mode 100644 index 0000000000000..564e6930f2f27 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AutoGeneratedDomainNameLabelScope.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; + +/** Defines values for AutoGeneratedDomainNameLabelScope. */ +public final class AutoGeneratedDomainNameLabelScope extends ExpandableStringEnum { + /** Static value Unsecure for AutoGeneratedDomainNameLabelScope. */ + public static final AutoGeneratedDomainNameLabelScope UNSECURE = fromString("Unsecure"); + + /** Static value TenantReuse for AutoGeneratedDomainNameLabelScope. */ + public static final AutoGeneratedDomainNameLabelScope TENANT_REUSE = fromString("TenantReuse"); + + /** Static value SubscriptionReuse for AutoGeneratedDomainNameLabelScope. */ + public static final AutoGeneratedDomainNameLabelScope SUBSCRIPTION_REUSE = fromString("SubscriptionReuse"); + + /** Static value ResourceGroupReuse for AutoGeneratedDomainNameLabelScope. */ + public static final AutoGeneratedDomainNameLabelScope RESOURCE_GROUP_REUSE = fromString("ResourceGroupReuse"); + + /** Static value Noreuse for AutoGeneratedDomainNameLabelScope. */ + public static final AutoGeneratedDomainNameLabelScope NOREUSE = fromString("Noreuse"); + + /** + * Creates or finds a AutoGeneratedDomainNameLabelScope from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoGeneratedDomainNameLabelScope. + */ + @JsonCreator + public static AutoGeneratedDomainNameLabelScope fromString(String name) { + return fromString(name, AutoGeneratedDomainNameLabelScope.class); + } + + /** + * Gets known AutoGeneratedDomainNameLabelScope values. + * + * @return known AutoGeneratedDomainNameLabelScope values. + */ + public static Collection values() { + return values(AutoGeneratedDomainNameLabelScope.class); + } +} 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..e138aa6e54968 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/AzureFileVolume.java @@ -0,0 +1,139 @@ +// 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; + + /** + * 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..2de99668e6730 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CachedImagesListResult.java @@ -0,0 +1,77 @@ +// 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; + + /** + * 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..a1469f0250221 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesCapabilities.java @@ -0,0 +1,65 @@ +// 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; + + /** + * 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..c1b5b30c19ede --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/CapabilitiesListResult.java @@ -0,0 +1,77 @@ +// 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; + + /** + * 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..29717d3137e1c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Container.java @@ -0,0 +1,270 @@ +// 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(); + + /** + * 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..2286f96e54086 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExec.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.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; + + /** + * 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..01c59d863a35a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequest.java @@ -0,0 +1,75 @@ +// 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; + + /** + * 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..283ab9d8ec2f3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerExecRequestTerminalSize.java @@ -0,0 +1,72 @@ +// 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; + + /** + * 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..a952aba140cfe --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroup.java @@ -0,0 +1,490 @@ +// 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 identity property: The identity of the container group, if configured. + * + * @return the identity value. + */ + ContainerGroupIdentity identity(); + + /** + * Gets the zones property: The zones for the container group. + * + * @return the zones value. + */ + List zones(); + + /** + * 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 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 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 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.WithIdentity, + DefinitionStages.WithZones, + DefinitionStages.WithImageRegistryCredentials, + DefinitionStages.WithRestartPolicy, + DefinitionStages.WithIpAddress, + DefinitionStages.WithVolumes, + DefinitionStages.WithDiagnostics, + DefinitionStages.WithSubnetIds, + DefinitionStages.WithDnsConfig, + DefinitionStages.WithSku, + DefinitionStages.WithEncryptionProperties, + DefinitionStages.WithInitContainers { + /** + * 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 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 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 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 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); + } + } + /** + * 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 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 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. 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(); + + /** + * 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); + + /** + * 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. 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..156249308179b --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupDiagnostics.java @@ -0,0 +1,49 @@ +// 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; + + /** + * 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..38295937d5323 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIdentity.java @@ -0,0 +1,134 @@ +// 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 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. The + * user identity dictionary key references will be ARM resource ids in the + * form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * 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. The + * user identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: 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}'. + * + * @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/ContainerGroupIdentityUserAssignedIdentities.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIdentityUserAssignedIdentities.java new file mode 100644 index 0000000000000..4757bd434dfd3 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIdentityUserAssignedIdentities.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.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ContainerGroupIdentityUserAssignedIdentities model. */ +@Immutable +public final class ContainerGroupIdentityUserAssignedIdentities { + /* + * 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; + + /** + * 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/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..f35a38fb65fd5 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupIpAddressType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContainerGroupIpAddressType. */ +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 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..3837fc6859204 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupListResult.java @@ -0,0 +1,77 @@ +// 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; + + /** + * 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..91c146349ef80 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupNetworkProtocol.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContainerGroupNetworkProtocol. */ +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 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/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..8a9da9418db77 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupPropertiesInstanceView.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; +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; + + /** + * 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..d4d7751e736b5 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupRestartPolicy.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.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContainerGroupRestartPolicy. */ +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 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..525bce070a981 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSku.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContainerGroupSku. */ +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 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..a50c335dac004 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroupSubnetId.java @@ -0,0 +1,80 @@ +// 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; + + /** + * 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..9fb4cb6fdf894 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerGroups.java @@ -0,0 +1,319 @@ +// 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. 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. 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 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 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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 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 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 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. 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); + + /** + * 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); + + /** + * 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. 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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 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 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..98148ad0f3ae8 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerHttpGet.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; +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; + + /** + * 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..4e157ae0d3b45 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerInstanceOperationsOrigin.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContainerInstanceOperationsOrigin. */ +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 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..2e9652733bf80 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerNetworkProtocol.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContainerNetworkProtocol. */ +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 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..19717d43dac29 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPort.java @@ -0,0 +1,72 @@ +// 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; + + /** + * 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..5e68f6b1bc467 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerProbe.java @@ -0,0 +1,208 @@ +// 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; + + /** + * 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..ab5add27813c2 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerPropertiesInstanceView.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.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; + + /** + * 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..391efc6b8c6b2 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ContainerState.java @@ -0,0 +1,97 @@ +// 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; + + /** + * 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..6f2b4a1bf649a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Containers.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.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 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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..484eb0bb18905 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/DnsConfiguration.java @@ -0,0 +1,107 @@ +// 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; + + /** + * 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/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..4d212361d4274 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EncryptionProperties.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 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; + + /** + * 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; + } + + /** + * 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..c36ff80a81baf --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/EnvironmentVariable.java @@ -0,0 +1,106 @@ +// 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; + + /** + * 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..ac0afa8ebcc24 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Event.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.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; + + /** + * 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..32a21895aac51 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GitRepoVolume.java @@ -0,0 +1,113 @@ +// 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; + + /** + * 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..bd54121edf3df --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuResource.java @@ -0,0 +1,80 @@ +// 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; + + /** + * 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..a5a86a254704c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/GpuSku.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.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GpuSku. */ +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 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..3f9c649a6f8c6 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/HttpHeader.java @@ -0,0 +1,72 @@ +// 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; + + /** + * 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..f935bb8f1acb0 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ImageRegistryCredential.java @@ -0,0 +1,165 @@ +// 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", required = true) + 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; + + /** + * 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")); + } + if (username() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property username 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..0e155421e0266 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerDefinition.java @@ -0,0 +1,180 @@ +// 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(); + + /** + * 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..ad60b4674726a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/InitContainerPropertiesDefinitionInstanceView.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.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; + + /** + * 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..caf653a4bda0c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/IpAddress.java @@ -0,0 +1,180 @@ +// 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. + */ + @JsonProperty(value = "dnsNameLabelReusePolicy") + private AutoGeneratedDomainNameLabelScope dnsNameLabelReusePolicy; + + /* + * The FQDN for the IP. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /** + * 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 dnsNameLabelReusePolicy property: The value representing the security enum. + * + * @return the dnsNameLabelReusePolicy value. + */ + public AutoGeneratedDomainNameLabelScope dnsNameLabelReusePolicy() { + return this.dnsNameLabelReusePolicy; + } + + /** + * Set the dnsNameLabelReusePolicy property: The value representing the security enum. + * + * @param dnsNameLabelReusePolicy the dnsNameLabelReusePolicy value to set. + * @return the IpAddress object itself. + */ + public IpAddress withDnsNameLabelReusePolicy(AutoGeneratedDomainNameLabelScope dnsNameLabelReusePolicy) { + this.dnsNameLabelReusePolicy = dnsNameLabelReusePolicy; + 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/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..b11a347f2a1cd --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Locations.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.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 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 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 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 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..c3c46397cfc10 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalytics.java @@ -0,0 +1,166 @@ +// 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; + + /** + * 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..79c0b2fe0c191 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/LogAnalyticsLogType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LogAnalyticsLogType. */ +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 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..a0a74944b02c8 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperatingSystemTypes.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperatingSystemTypes. */ +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 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..9f8730c3f6dd8 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationDisplay.java @@ -0,0 +1,124 @@ +// 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; + + /** + * 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..a6c67ee8271f0 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/OperationListResult.java @@ -0,0 +1,77 @@ +// 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; + + /** + * 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..5917b4c19776b --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Port.java @@ -0,0 +1,72 @@ +// 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; + + /** + * 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..a4ef0078a3f0c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceIdentityType.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceIdentityType. */ +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) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @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..5e6b78bf9f777 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceLimits.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.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; + + /** + * 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..687311cded686 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequests.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.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; + + /** + * 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..222d0e2952576 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/ResourceRequirements.java @@ -0,0 +1,85 @@ +// 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; + + /** + * 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..35a74e112231e --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Scheme.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for 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 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/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..a4eaabc30b89f --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Usage.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.UsageInner; + +/** An immutable client-side representation of Usage. */ +public interface Usage { + /** + * 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..85e9bd55ac09f --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageListResult.java @@ -0,0 +1,40 @@ +// 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; + + /** + * 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..20ab43075e52c --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/UsageName.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.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; + + /** + * 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/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..f7e11aaef0579 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/Volume.java @@ -0,0 +1,166 @@ +// 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; + + /** + * 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..03c33ed91b4cb --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/models/VolumeMount.java @@ -0,0 +1,114 @@ +// 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; + + /** + * 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..0d1a5d0f6b0bd --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsCreateOrUpdateSamples.java @@ -0,0 +1,155 @@ +// 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.AutoGeneratedDomainNameLabelScope; +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.ContainerGroupIdentityUserAssignedIdentities; +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.DnsConfiguration; +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.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/stable/2021-10-01/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 ContainerGroupIdentityUserAssignedIdentities()))) + .withImageRegistryCredentials(Arrays.asList()) + .withIpAddress( + new IpAddress() + .withPorts(Arrays.asList(new Port().withProtocol(ContainerGroupNetworkProtocol.TCP).withPort(80))) + .withType(ContainerGroupIpAddressType.PUBLIC) + .withDnsNameLabel("dnsnamelabel1") + .withDnsNameLabelReusePolicy(AutoGeneratedDomainNameLabelScope.UNSECURE)) + .withVolumes( + Arrays + .asList( + new Volume() + .withName("volume1") + .withAzureFile( + new AzureFileVolume() + .withShareName("shareName") + .withStorageAccountName("accountName") + .withStorageAccountKey("accountKey")), + 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("workspaceKey") + .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..18d5141d6367d --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ContainerGroups Delete. */ +public final class ContainerGroupsDeleteSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", 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..1712a36c47737 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsGetByResourceGroupSamples.java @@ -0,0 +1,36 @@ +// 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.util.Context; + +/** Samples for ContainerGroups GetByResourceGroup. */ +public final class ContainerGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", Context.NONE); + } + + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", 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..74e6a7d56b0ae --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ContainerGroups ListByResourceGroup. */ +public final class ContainerGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", 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..a3626a839c3dd --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ContainerGroups List. */ +public final class ContainerGroupsListSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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(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..28f46a8733a09 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsRestartSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ContainerGroups Restart. */ +public final class ContainerGroupsRestartSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", 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..8af2c88f34730 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStartSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ContainerGroups Start. */ +public final class ContainerGroupsStartSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", 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..c078e4a24a267 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsStopSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ContainerGroups Stop. */ +public final class ContainerGroupsStopSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", 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..7b3201eccddce --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainerGroupsUpdateSamples.java @@ -0,0 +1,43 @@ +// 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 com.azure.core.util.Context; +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/stable/2021-10-01/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")), + 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..89dcba38979b7 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersAttachSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Containers Attach. */ +public final class ContainersAttachSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", 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..98bebc5fefbde --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/ContainersExecuteCommandSamples.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; + +import com.azure.core.util.Context; +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/stable/2021-10-01/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)), + 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..9085fa59bfb02 --- /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; + +import com.azure.core.util.Context; + +/** Samples for Containers ListLogs. */ +public final class ContainersListLogsSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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, 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..96664b1cdb192 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCachedImagesSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Location ListCachedImages. */ +public final class LocationListCachedImagesSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", 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..902e38e298fb5 --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListCapabilitiesSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Location ListCapabilities. */ +public final class LocationListCapabilitiesSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", 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..74f155abc043a --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/LocationListUsageSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Location ListUsage. */ +public final class LocationListUsageSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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", 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..9d4bf748906cd --- /dev/null +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/samples/java/com/azure/resourcemanager/containerinstance/generated/generated/OperationsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/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(Context.NONE); + } +} diff --git a/sdk/containerinstance/ci.yml b/sdk/containerinstance/ci.yml new file mode 100644 index 0000000000000..47b76c40f9f26 --- /dev/null +++ b/sdk/containerinstance/ci.yml @@ -0,0 +1,39 @@ +# 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 + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: containerinstance + Artifacts: + - name: azure-resourcemanager-containerinstance-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagercontainerinstancegenerated diff --git a/sdk/containerinstance/pom.xml b/sdk/containerinstance/pom.xml new file mode 100644 index 0000000000000..a8db6f6fa05f2 --- /dev/null +++ b/sdk/containerinstance/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-containerinstance-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-containerinstance-generated + + + +