From fff2444420a2e34be5963dbee84c193bbc1c15e4 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 31 Jul 2018 21:49:06 +0000 Subject: [PATCH] Generated from 130558caf04982e77015ceb76133473847b3f061 Fix errors in container group update example --- .../v2017_08_01_preview/pom.xml | 133 +++ .../v2017_08_01_preview/AzureFileVolume.java | 123 ++ .../v2017_08_01_preview/Container.java | 217 ++++ .../v2017_08_01_preview/ContainerEvent.java | 148 +++ .../v2017_08_01_preview/ContainerGroup.java | 209 ++++ .../ContainerGroupNetworkProtocol.java | 41 + .../v2017_08_01_preview/ContainerGroups.java | 25 + .../v2017_08_01_preview/ContainerLogs.java | 29 + .../v2017_08_01_preview/ContainerPort.java | 43 + .../ContainerPropertiesInstanceView.java | 122 ++ .../ContainerRestartPolicy.java | 38 + .../v2017_08_01_preview/ContainerState.java | 149 +++ .../EnvironmentVariable.java | 69 ++ .../ImageRegistryCredential.java | 96 ++ .../v2017_08_01_preview/IpAddress.java | 104 ++ .../v2017_08_01_preview/Logs.java | 25 + .../OperatingSystemTypes.java | 41 + .../v2017_08_01_preview/Port.java | 70 ++ .../v2017_08_01_preview/ResourceLimits.java | 69 ++ .../v2017_08_01_preview/ResourceRequests.java | 69 ++ .../ResourceRequirements.java | 69 ++ .../v2017_08_01_preview/Volume.java | 69 ++ .../v2017_08_01_preview/VolumeMount.java | 96 ++ .../implementation/ContainerGroupImpl.java | 129 +++ .../implementation/ContainerGroupInner.java | 220 ++++ .../implementation/ContainerGroupsImpl.java | 138 +++ .../implementation/ContainerGroupsInner.java | 841 ++++++++++++++ ...ContainerInstanceManagementClientImpl.java | 210 ++++ .../ContainerInstanceManager.java | 111 ++ .../implementation/ContainerLogsImpl.java | 42 + .../implementation/ContainerLogsInner.java | 252 ++++ .../implementation/IdParsingUtils.java | 57 + .../implementation/LogsImpl.java | 31 + .../implementation/LogsInner.java | 43 + .../implementation/PageImpl.java | 75 ++ .../implementation/package-info.java | 10 + .../v2017_08_01_preview/package-info.java | 10 + .../v2017_10_01_preview/pom.xml | 133 +++ .../v2017_10_01_preview/AzureFileVolume.java | 123 ++ .../v2017_10_01_preview/Container.java | 217 ++++ .../v2017_10_01_preview/ContainerGroup.java | 209 ++++ .../ContainerGroupNetworkProtocol.java | 41 + .../ContainerGroupPropertiesInstanceView.java | 48 + .../ContainerGroupRestartPolicy.java | 44 + .../v2017_10_01_preview/ContainerGroups.java | 25 + .../ContainerInstanceOperationsOrigin.java | 41 + .../v2017_10_01_preview/ContainerLogs.java | 29 + .../ContainerNetworkProtocol.java | 41 + .../v2017_10_01_preview/ContainerPort.java | 70 ++ .../ContainerPropertiesInstanceView.java | 78 ++ .../v2017_10_01_preview/ContainerState.java | 149 +++ .../EnvironmentVariable.java | 69 ++ .../v2017_10_01_preview/Event.java | 174 +++ .../ImageRegistryCredential.java | 96 ++ .../v2017_10_01_preview/IpAddress.java | 104 ++ .../v2017_10_01_preview/Logs.java | 25 + .../OperatingSystemTypes.java | 41 + .../v2017_10_01_preview/OperationDisplay.java | 121 ++ .../OperationListResult.java | 27 + .../v2017_10_01_preview/Operations.java | 27 + .../v2017_10_01_preview/Port.java | 70 ++ .../v2017_10_01_preview/ResourceLimits.java | 69 ++ .../v2017_10_01_preview/ResourceRequests.java | 69 ++ .../ResourceRequirements.java | 69 ++ .../v2017_10_01_preview/Volume.java | 95 ++ .../v2017_10_01_preview/VolumeMount.java | 96 ++ .../implementation/ContainerGroupImpl.java | 130 +++ .../implementation/ContainerGroupInner.java | 230 ++++ .../implementation/ContainerGroupsImpl.java | 138 +++ .../implementation/ContainerGroupsInner.java | 841 ++++++++++++++ ...ContainerInstanceManagementClientImpl.java | 224 ++++ .../ContainerInstanceManager.java | 123 ++ .../implementation/ContainerLogsImpl.java | 42 + .../implementation/ContainerLogsInner.java | 252 ++++ .../implementation/IdParsingUtils.java | 57 + .../implementation/LogsImpl.java | 31 + .../implementation/LogsInner.java | 43 + .../implementation/OperationInner.java | 98 ++ .../OperationListResultImpl.java | 32 + .../OperationListResultInner.java | 45 + .../implementation/OperationsImpl.java | 42 + .../implementation/OperationsInner.java | 128 ++ .../implementation/PageImpl.java | 75 ++ .../implementation/package-info.java | 10 + .../v2017_10_01_preview/package-info.java | 10 + .../v2017_12_01_preview/pom.xml | 133 +++ .../v2017_12_01_preview/AzureFileVolume.java | 123 ++ .../v2017_12_01_preview/Container.java | 217 ++++ .../v2017_12_01_preview/ContainerGroup.java | 209 ++++ .../ContainerGroupNetworkProtocol.java | 41 + .../ContainerGroupPropertiesInstanceView.java | 48 + .../ContainerGroupRestartPolicy.java | 44 + .../ContainerGroupUsages.java | 26 + .../v2017_12_01_preview/ContainerGroups.java | 25 + .../ContainerInstanceOperationsOrigin.java | 41 + .../v2017_12_01_preview/ContainerLogs.java | 29 + .../ContainerNetworkProtocol.java | 41 + .../v2017_12_01_preview/ContainerPort.java | 70 ++ .../ContainerPropertiesInstanceView.java | 78 ++ .../v2017_12_01_preview/ContainerState.java | 149 +++ .../EnvironmentVariable.java | 69 ++ .../v2017_12_01_preview/Event.java | 174 +++ .../v2017_12_01_preview/GitRepoVolume.java | 98 ++ .../ImageRegistryCredential.java | 96 ++ .../v2017_12_01_preview/IpAddress.java | 104 ++ .../v2017_12_01_preview/Logs.java | 25 + .../OperatingSystemTypes.java | 41 + .../v2017_12_01_preview/OperationDisplay.java | 121 ++ .../OperationListResult.java | 32 + .../v2017_12_01_preview/Operations.java | 27 + .../v2017_12_01_preview/Port.java | 70 ++ .../v2017_12_01_preview/ResourceLimits.java | 69 ++ .../v2017_12_01_preview/ResourceRequests.java | 69 ++ .../ResourceRequirements.java | 69 ++ .../v2017_12_01_preview/Usage.java | 77 ++ .../v2017_12_01_preview/UsageListResult.java | 26 + .../v2017_12_01_preview/UsageName.java | 47 + .../v2017_12_01_preview/Volume.java | 148 +++ .../v2017_12_01_preview/VolumeMount.java | 96 ++ .../implementation/ContainerGroupImpl.java | 130 +++ .../implementation/ContainerGroupInner.java | 230 ++++ .../ContainerGroupUsagesImpl.java | 42 + .../ContainerGroupUsagesInner.java | 139 +++ .../implementation/ContainerGroupsImpl.java | 138 +++ .../implementation/ContainerGroupsInner.java | 841 ++++++++++++++ ...ContainerInstanceManagementClientImpl.java | 238 ++++ .../ContainerInstanceManager.java | 135 +++ .../implementation/ContainerLogsImpl.java | 42 + .../implementation/ContainerLogsInner.java | 252 ++++ .../implementation/IdParsingUtils.java | 57 + .../implementation/LogsImpl.java | 31 + .../implementation/LogsInner.java | 43 + .../implementation/OperationInner.java | 98 ++ .../OperationListResultImpl.java | 37 + .../OperationListResultInner.java | 71 ++ .../implementation/OperationsImpl.java | 42 + .../implementation/OperationsInner.java | 128 ++ .../implementation/PageImpl.java | 75 ++ .../implementation/UsageListResultImpl.java | 33 + .../implementation/UsageListResultInner.java | 34 + .../implementation/package-info.java | 10 + .../v2017_12_01_preview/package-info.java | 10 + .../v2018_02_01_preview/pom.xml | 133 +++ .../v2018_02_01_preview/AzureFileVolume.java | 123 ++ .../v2018_02_01_preview/Container.java | 217 ++++ .../ContainerExecRequest.java | 69 ++ .../ContainerExecRequestTerminalSize.java | 69 ++ .../ContainerExecResponse.java | 30 + .../v2018_02_01_preview/ContainerGroup.java | 169 +++ .../ContainerGroupNetworkProtocol.java | 41 + .../ContainerGroupPropertiesInstanceView.java | 48 + .../ContainerGroupRestartPolicy.java | 44 + .../ContainerGroupUsages.java | 26 + .../v2018_02_01_preview/ContainerGroups.java | 25 + .../ContainerInstanceOperationsOrigin.java | 41 + .../v2018_02_01_preview/ContainerLogs.java | 31 + .../ContainerNetworkProtocol.java | 41 + .../v2018_02_01_preview/ContainerPort.java | 70 ++ .../ContainerPropertiesInstanceView.java | 78 ++ .../v2018_02_01_preview/ContainerState.java | 149 +++ .../EnvironmentVariable.java | 69 ++ .../v2018_02_01_preview/Event.java | 174 +++ .../v2018_02_01_preview/GitRepoVolume.java | 98 ++ .../ImageRegistryCredential.java | 96 ++ .../v2018_02_01_preview/IpAddress.java | 145 +++ .../v2018_02_01_preview/Logs.java | 25 + .../OperatingSystemTypes.java | 41 + .../v2018_02_01_preview/OperationDisplay.java | 121 ++ .../OperationListResult.java | 32 + .../v2018_02_01_preview/Operations.java | 27 + .../v2018_02_01_preview/Port.java | 70 ++ .../v2018_02_01_preview/ResourceLimits.java | 69 ++ .../v2018_02_01_preview/ResourceRequests.java | 69 ++ .../ResourceRequirements.java | 69 ++ .../v2018_02_01_preview/StartContainers.java | 32 + .../v2018_02_01_preview/Usage.java | 77 ++ .../v2018_02_01_preview/UsageListResult.java | 26 + .../v2018_02_01_preview/UsageName.java | 47 + .../v2018_02_01_preview/Volume.java | 148 +++ .../v2018_02_01_preview/VolumeMount.java | 96 ++ .../ContainerExecResponseImpl.java | 36 + .../ContainerExecResponseInner.java | 69 ++ .../implementation/ContainerGroupImpl.java | 151 +++ .../implementation/ContainerGroupInner.java | 232 ++++ .../ContainerGroupUsagesImpl.java | 42 + .../ContainerGroupUsagesInner.java | 139 +++ .../implementation/ContainerGroupsImpl.java | 138 +++ .../implementation/ContainerGroupsInner.java | 1030 +++++++++++++++++ ...ContainerInstanceManagementClientImpl.java | 252 ++++ .../ContainerInstanceManager.java | 147 +++ .../implementation/ContainerLogsImpl.java | 42 + .../implementation/ContainerLogsInner.java | 252 ++++ .../implementation/IdParsingUtils.java | 57 + .../implementation/LogsImpl.java | 31 + .../implementation/LogsInner.java | 43 + .../implementation/OperationInner.java | 98 ++ .../OperationListResultImpl.java | 37 + .../OperationListResultInner.java | 71 ++ .../implementation/OperationsImpl.java | 42 + .../implementation/OperationsInner.java | 128 ++ .../implementation/PageImpl.java | 75 ++ .../implementation/StartContainersImpl.java | 43 + .../implementation/StartContainersInner.java | 168 +++ .../implementation/UsageListResultImpl.java | 33 + .../implementation/UsageListResultInner.java | 34 + .../implementation/package-info.java | 10 + .../v2018_02_01_preview/package-info.java | 10 + .../resource-manager/v2018_04_01/pom.xml | 133 +++ .../v2018_04_01/AzureFileVolume.java | 123 ++ .../v2018_04_01/Container.java | 217 ++++ .../v2018_04_01/ContainerExecRequest.java | 69 ++ .../ContainerExecRequestTerminalSize.java | 69 ++ .../v2018_04_01/ContainerExecResponse.java | 30 + .../v2018_04_01/ContainerGroup.java | 169 +++ .../ContainerGroupNetworkProtocol.java | 41 + .../ContainerGroupPropertiesInstanceView.java | 48 + .../ContainerGroupRestartPolicy.java | 44 + .../v2018_04_01/ContainerGroupUsages.java | 26 + .../v2018_04_01/ContainerGroups.java | 25 + .../ContainerInstanceOperationsOrigin.java | 41 + .../v2018_04_01/ContainerLogs.java | 31 + .../v2018_04_01/ContainerNetworkProtocol.java | 41 + .../v2018_04_01/ContainerPort.java | 70 ++ .../ContainerPropertiesInstanceView.java | 78 ++ .../v2018_04_01/ContainerState.java | 94 ++ .../v2018_04_01/EnvironmentVariable.java | 69 ++ .../containerinstance/v2018_04_01/Event.java | 108 ++ .../v2018_04_01/GitRepoVolume.java | 98 ++ .../v2018_04_01/ImageRegistryCredential.java | 96 ++ .../v2018_04_01/IpAddress.java | 145 +++ .../containerinstance/v2018_04_01/Logs.java | 25 + .../v2018_04_01/OperatingSystemTypes.java | 41 + .../v2018_04_01/OperationDisplay.java | 77 ++ .../v2018_04_01/OperationListResult.java | 32 + .../v2018_04_01/Operations.java | 27 + .../containerinstance/v2018_04_01/Port.java | 70 ++ .../v2018_04_01/ResourceLimits.java | 69 ++ .../v2018_04_01/ResourceRequests.java | 69 ++ .../v2018_04_01/ResourceRequirements.java | 69 ++ .../v2018_04_01/StartContainers.java | 32 + .../containerinstance/v2018_04_01/Usage.java | 77 ++ .../v2018_04_01/UsageListResult.java | 26 + .../v2018_04_01/UsageName.java | 47 + .../containerinstance/v2018_04_01/Volume.java | 148 +++ .../v2018_04_01/VolumeMount.java | 96 ++ .../ContainerExecResponseImpl.java | 36 + .../ContainerExecResponseInner.java | 47 + .../implementation/ContainerGroupImpl.java | 151 +++ .../implementation/ContainerGroupInner.java | 232 ++++ .../ContainerGroupUsagesImpl.java | 42 + .../ContainerGroupUsagesInner.java | 139 +++ .../implementation/ContainerGroupsImpl.java | 138 +++ .../implementation/ContainerGroupsInner.java | 1030 +++++++++++++++++ ...ContainerInstanceManagementClientImpl.java | 252 ++++ .../ContainerInstanceManager.java | 147 +++ .../implementation/ContainerLogsImpl.java | 42 + .../implementation/ContainerLogsInner.java | 252 ++++ .../implementation/IdParsingUtils.java | 57 + .../v2018_04_01/implementation/LogsImpl.java | 31 + .../v2018_04_01/implementation/LogsInner.java | 32 + .../implementation/OperationInner.java | 76 ++ .../OperationListResultImpl.java | 37 + .../OperationListResultInner.java | 71 ++ .../implementation/OperationsImpl.java | 42 + .../implementation/OperationsInner.java | 128 ++ .../v2018_04_01/implementation/PageImpl.java | 75 ++ .../implementation/StartContainersImpl.java | 43 + .../implementation/StartContainersInner.java | 168 +++ .../implementation/UsageListResultImpl.java | 33 + .../implementation/UsageListResultInner.java | 34 + .../implementation/package-info.java | 10 + .../v2018_04_01/package-info.java | 10 + 272 files changed, 27232 insertions(+) create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/pom.xml create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/AzureFileVolume.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Container.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerEvent.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroup.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroupNetworkProtocol.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroups.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerLogs.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerPort.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerPropertiesInstanceView.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerRestartPolicy.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerState.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/EnvironmentVariable.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ImageRegistryCredential.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/IpAddress.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Logs.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/OperatingSystemTypes.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Port.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceLimits.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceRequests.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceRequirements.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Volume.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/VolumeMount.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupImpl.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupInner.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupsImpl.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupsInner.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerInstanceManagementClientImpl.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerInstanceManager.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerLogsImpl.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerLogsInner.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/IdParsingUtils.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/LogsImpl.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/LogsInner.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/PageImpl.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/package-info.java create mode 100644 containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/package-info.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/pom.xml create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/AzureFileVolume.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Container.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroup.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupNetworkProtocol.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupPropertiesInstanceView.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupRestartPolicy.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroups.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerInstanceOperationsOrigin.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerLogs.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerNetworkProtocol.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerPort.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerPropertiesInstanceView.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerState.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/EnvironmentVariable.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Event.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ImageRegistryCredential.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/IpAddress.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Logs.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperatingSystemTypes.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperationDisplay.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperationListResult.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Operations.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Port.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceLimits.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceRequests.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceRequirements.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Volume.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/VolumeMount.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupImpl.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupInner.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupsImpl.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupsInner.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerInstanceManagementClientImpl.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerInstanceManager.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerLogsImpl.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerLogsInner.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/IdParsingUtils.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/LogsImpl.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/LogsInner.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationInner.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationListResultImpl.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationListResultInner.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationsImpl.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationsInner.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/PageImpl.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/package-info.java create mode 100644 containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/package-info.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/pom.xml create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/AzureFileVolume.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Container.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroup.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupNetworkProtocol.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupPropertiesInstanceView.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupRestartPolicy.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupUsages.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroups.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerInstanceOperationsOrigin.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerLogs.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerNetworkProtocol.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerPort.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerPropertiesInstanceView.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerState.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/EnvironmentVariable.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Event.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/GitRepoVolume.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ImageRegistryCredential.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/IpAddress.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Logs.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperatingSystemTypes.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperationDisplay.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperationListResult.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Operations.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Port.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceLimits.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceRequests.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceRequirements.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Usage.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/UsageListResult.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/UsageName.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Volume.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/VolumeMount.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupImpl.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupInner.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupUsagesImpl.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupUsagesInner.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupsImpl.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupsInner.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerInstanceManagementClientImpl.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerInstanceManager.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerLogsImpl.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerLogsInner.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/IdParsingUtils.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/LogsImpl.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/LogsInner.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationInner.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationListResultImpl.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationListResultInner.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationsImpl.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationsInner.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/PageImpl.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/UsageListResultImpl.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/UsageListResultInner.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/package-info.java create mode 100644 containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/package-info.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/pom.xml create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/AzureFileVolume.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Container.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecRequest.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecRequestTerminalSize.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecResponse.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroup.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupNetworkProtocol.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupPropertiesInstanceView.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupRestartPolicy.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupUsages.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroups.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerInstanceOperationsOrigin.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerLogs.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerNetworkProtocol.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerPort.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerPropertiesInstanceView.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerState.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/EnvironmentVariable.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Event.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/GitRepoVolume.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ImageRegistryCredential.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/IpAddress.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Logs.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperatingSystemTypes.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperationDisplay.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperationListResult.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Operations.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Port.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceLimits.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceRequests.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceRequirements.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/StartContainers.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Usage.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/UsageListResult.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/UsageName.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Volume.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/VolumeMount.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerExecResponseImpl.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerExecResponseInner.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupImpl.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupInner.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupUsagesImpl.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupUsagesInner.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsImpl.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsInner.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerInstanceManagementClientImpl.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerInstanceManager.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerLogsImpl.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerLogsInner.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/IdParsingUtils.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/LogsImpl.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/LogsInner.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationInner.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationListResultImpl.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationListResultInner.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationsImpl.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationsInner.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/PageImpl.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/StartContainersImpl.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/StartContainersInner.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/UsageListResultImpl.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/UsageListResultInner.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/package-info.java create mode 100644 containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/package-info.java create mode 100644 containerinstance/resource-manager/v2018_04_01/pom.xml create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/AzureFileVolume.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Container.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecRequest.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecRequestTerminalSize.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecResponse.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroup.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupNetworkProtocol.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupPropertiesInstanceView.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupRestartPolicy.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupUsages.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroups.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerInstanceOperationsOrigin.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerLogs.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerNetworkProtocol.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerPort.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerPropertiesInstanceView.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerState.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/EnvironmentVariable.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Event.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/GitRepoVolume.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ImageRegistryCredential.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/IpAddress.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Logs.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperatingSystemTypes.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperationDisplay.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperationListResult.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Operations.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Port.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceLimits.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceRequests.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceRequirements.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/StartContainers.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Usage.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/UsageListResult.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/UsageName.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Volume.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/VolumeMount.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerExecResponseImpl.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerExecResponseInner.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupImpl.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupInner.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupUsagesImpl.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupUsagesInner.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupsImpl.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupsInner.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerInstanceManagementClientImpl.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerInstanceManager.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerLogsImpl.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerLogsInner.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/IdParsingUtils.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/LogsImpl.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/LogsInner.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationInner.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationListResultImpl.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationListResultInner.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationsImpl.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationsInner.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/PageImpl.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/StartContainersImpl.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/StartContainersInner.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/UsageListResultImpl.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/UsageListResultInner.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/package-info.java create mode 100644 containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/package-info.java diff --git a/containerinstance/resource-manager/v2017_08_01_preview/pom.xml b/containerinstance/resource-manager/v2017_08_01_preview/pom.xml new file mode 100644 index 0000000000000..ab3cc5dc0b185 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.containerinstance.v2017_08_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-containerinstance + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerInstance Management + This package contains Microsoft ContainerInstance Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/AzureFileVolume.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/AzureFileVolume.java new file mode 100644 index 0000000000000..42236a533fb18 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/AzureFileVolume.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Azure File volume. Azure File shares are mounted as + * volumes. + */ +public 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 name of the Azure File share to be mounted as a volume. + * + * @return the shareName value + */ + public String shareName() { + return this.shareName; + } + + /** + * Set 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 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 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 name of the storage account that contains the Azure File share. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set 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 storage account access key used to access the Azure File share. + * + * @return the storageAccountKey value + */ + public String storageAccountKey() { + return this.storageAccountKey; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Container.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Container.java new file mode 100644 index 0000000000000..a776c562bd5e7 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Container.java @@ -0,0 +1,217 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A container instance. + */ +@JsonFlatten +public class Container { + /** + * The user-provided name of the container instance. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The name of the image used to create the container instance. + */ + @JsonProperty(value = "properties.image", required = true) + private String image; + + /** + * The commands to execute within the container instance in exec form. + */ + @JsonProperty(value = "properties.command") + private List command; + + /** + * The exposed ports on the container instance. + */ + @JsonProperty(value = "properties.ports") + private List ports; + + /** + * The environment variables to set in the container instance. + */ + @JsonProperty(value = "properties.environmentVariables") + private List environmentVariables; + + /** + * The instance view of the container instance. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerPropertiesInstanceView instanceView; + + /** + * The resource requirements of the container instance. + */ + @JsonProperty(value = "properties.resources", required = true) + private ResourceRequirements resources; + + /** + * The volume mounts available to the container instance. + */ + @JsonProperty(value = "properties.volumeMounts") + private List volumeMounts; + + /** + * Get the user-provided name of the container instance. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 name of the image used to create the container instance. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set 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) { + this.image = image; + return this; + } + + /** + * Get the commands to execute within the container instance in exec form. + * + * @return the command value + */ + public List command() { + return this.command; + } + + /** + * Set 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) { + this.command = command; + return this; + } + + /** + * Get the exposed ports on the container instance. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the exposed ports on the container instance. + * + * @param ports the ports value to set + * @return the Container object itself. + */ + public Container withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the environment variables to set in the container instance. + * + * @return the environmentVariables value + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set 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) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instance view of the container instance. Only valid in response. + * + * @return the instanceView value + */ + public ContainerPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the resource requirements of the container instance. + * + * @return the resources value + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set the resource requirements of the container instance. + * + * @param resources the resources value to set + * @return the Container object itself. + */ + public Container withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volume mounts available to the container instance. + * + * @return the volumeMounts value + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set 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) { + this.volumeMounts = volumeMounts; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerEvent.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerEvent.java new file mode 100644 index 0000000000000..af2d41ac699f4 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerEvent.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container instance event. + */ +public class ContainerEvent { + /** + * The count of the event. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * The date-time of the earliest logged event. + */ + @JsonProperty(value = "firstTimestamp") + private DateTime firstTimestamp; + + /** + * The date-time of the latest logged event. + */ + @JsonProperty(value = "lastTimestamp") + private DateTime lastTimestamp; + + /** + * The event message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The event type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the count of the event. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the count of the event. + * + * @param count the count value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the date-time of the earliest logged event. + * + * @return the firstTimestamp value + */ + public DateTime firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Set the date-time of the earliest logged event. + * + * @param firstTimestamp the firstTimestamp value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withFirstTimestamp(DateTime firstTimestamp) { + this.firstTimestamp = firstTimestamp; + return this; + } + + /** + * Get the date-time of the latest logged event. + * + * @return the lastTimestamp value + */ + public DateTime lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Set the date-time of the latest logged event. + * + * @param lastTimestamp the lastTimestamp value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withLastTimestamp(DateTime lastTimestamp) { + this.lastTimestamp = lastTimestamp; + return this; + } + + /** + * Get the event message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the event message. + * + * @param message the message value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the event type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the event type. + * + * @param type the type value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withType(String type) { + this.type = type; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroup.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroup.java new file mode 100644 index 0000000000000..1bee667287392 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroup.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation.ContainerInstanceManager; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation.ContainerGroupInner; + +/** + * Type representing ContainerGroup. + */ +public interface ContainerGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the containers value. + */ + List containers(); + + /** + * @return the imageRegistryCredentials value. + */ + List imageRegistryCredentials(); + + /** + * @return the ipAddress value. + */ + IpAddress ipAddress(); + + /** + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the restartPolicy value. + */ + ContainerRestartPolicy restartPolicy(); + + /** + * @return the state value. + */ + String state(); + + /** + * @return the volumes value. + */ + List volumes(); + + /** + * The entirety of the ContainerGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithContainers, DefinitionStages.WithOsType, DefinitionStages.WithCreate { + } + + /** + * Grouping of ContainerGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ContainerGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ContainerGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the containergroup definition allowing to specify Containers. + */ + interface WithContainers { + /** + * Specifies containers. + */ + WithOsType withContainers(List containers); + } + + /** + * The stage of the containergroup definition allowing to specify OsType. + */ + interface WithOsType { + /** + * Specifies osType. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + + /** + * The stage of the containergroup update allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + WithCreate withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + WithCreate withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup update allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + WithCreate withRestartPolicy(ContainerRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup update allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + WithCreate withVolumes(List volumes); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithImageRegistryCredentials, DefinitionStages.WithIpAddress, DefinitionStages.WithRestartPolicy, DefinitionStages.WithVolumes { + } + } + /** + * The template for a ContainerGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithImageRegistryCredentials, UpdateStages.WithIpAddress, UpdateStages.WithRestartPolicy, UpdateStages.WithVolumes { + } + + /** + * Grouping of ContainerGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the containergroup {0} allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + Update withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup {0} allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + Update withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup {0} allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + Update withRestartPolicy(ContainerRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup {0} allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + Update withVolumes(List volumes); + } + + } +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroupNetworkProtocol.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroupNetworkProtocol.java new file mode 100644 index 0000000000000..67078f97ff501 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroupNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerGroupNetworkProtocol values + */ + public static Collection values() { + return values(ContainerGroupNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroups.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroups.java new file mode 100644 index 0000000000000..9bbab9aa734b2 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation.ContainerGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerGroups. + */ +public interface ContainerGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerLogs.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerLogs.java new file mode 100644 index 0000000000000..d2f2b62861748 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerLogs.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import rx.Observable; + +/** + * Type representing ContainerLogs. + */ +public interface ContainerLogs { + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String containerName, String containerGroupName); + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerPort.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerPort.java new file mode 100644 index 0000000000000..018e5761143b9 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerPort.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container instance. + */ +public class ContainerPort { + /** + * The port number exposed within the container group. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the port number exposed within the container group. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerPropertiesInstanceView.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerPropertiesInstanceView.java new file mode 100644 index 0000000000000..2b14eb0052223 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerPropertiesInstanceView.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container instance. Only valid in response. + */ +public class ContainerPropertiesInstanceView { + /** + * The number of times that the container instance has been restarted. + */ + @JsonProperty(value = "restartCount") + private Integer restartCount; + + /** + * Current container instance state. + */ + @JsonProperty(value = "currentState") + private ContainerState currentState; + + /** + * Previous container instance state. + */ + @JsonProperty(value = "previousState") + private ContainerState previousState; + + /** + * The events of the container instance. + */ + @JsonProperty(value = "events") + private List events; + + /** + * Get the number of times that the container instance has been restarted. + * + * @return the restartCount value + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Set the number of times that the container instance has been restarted. + * + * @param restartCount the restartCount value to set + * @return the ContainerPropertiesInstanceView object itself. + */ + public ContainerPropertiesInstanceView withRestartCount(Integer restartCount) { + this.restartCount = restartCount; + return this; + } + + /** + * Get current container instance state. + * + * @return the currentState value + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Set current container instance state. + * + * @param currentState the currentState value to set + * @return the ContainerPropertiesInstanceView object itself. + */ + public ContainerPropertiesInstanceView withCurrentState(ContainerState currentState) { + this.currentState = currentState; + return this; + } + + /** + * Get previous container instance state. + * + * @return the previousState value + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Set previous container instance state. + * + * @param previousState the previousState value to set + * @return the ContainerPropertiesInstanceView object itself. + */ + public ContainerPropertiesInstanceView withPreviousState(ContainerState previousState) { + this.previousState = previousState; + return this; + } + + /** + * Get the events of the container instance. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Set the events of the container instance. + * + * @param events the events value to set + * @return the ContainerPropertiesInstanceView object itself. + */ + public ContainerPropertiesInstanceView withEvents(List events) { + this.events = events; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerRestartPolicy.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerRestartPolicy.java new file mode 100644 index 0000000000000..3d48083481699 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerRestartPolicy.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerRestartPolicy. + */ +public final class ContainerRestartPolicy extends ExpandableStringEnum { + /** Static value always for ContainerRestartPolicy. */ + public static final ContainerRestartPolicy ALWAYS = fromString("always"); + + /** + * Creates or finds a ContainerRestartPolicy from its string representation. + * @param name a name to look for + * @return the corresponding ContainerRestartPolicy + */ + @JsonCreator + public static ContainerRestartPolicy fromString(String name) { + return fromString(name, ContainerRestartPolicy.class); + } + + /** + * @return known ContainerRestartPolicy values + */ + public static Collection values() { + return values(ContainerRestartPolicy.class); + } +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerState.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerState.java new file mode 100644 index 0000000000000..a1d08bb7ebe14 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ContainerState.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container instance state. + */ +public class ContainerState { + /** + * The state of the container instance. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The date-time when the container instance state started. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The container instance exit codes correspond to those from the `docker + * run` command. + */ + @JsonProperty(value = "exitCode") + private Integer exitCode; + + /** + * The date-time when the container instance state finished. + */ + @JsonProperty(value = "finishTime") + private DateTime finishTime; + + /** + * The human-readable status of the container instance state. + */ + @JsonProperty(value = "detailStatus") + private String detailStatus; + + /** + * Get the state of the container instance. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state of the container instance. + * + * @param state the state value to set + * @return the ContainerState object itself. + */ + public ContainerState withState(String state) { + this.state = state; + return this; + } + + /** + * Get the date-time when the container instance state started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the date-time when the container instance state started. + * + * @param startTime the startTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the container instance exit codes correspond to those from the `docker run` command. + * + * @return the exitCode value + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Set the container instance exit codes correspond to those from the `docker run` command. + * + * @param exitCode the exitCode value to set + * @return the ContainerState object itself. + */ + public ContainerState withExitCode(Integer exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get the date-time when the container instance state finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the date-time when the container instance state finished. + * + * @param finishTime the finishTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the human-readable status of the container instance state. + * + * @return the detailStatus value + */ + public String detailStatus() { + return this.detailStatus; + } + + /** + * Set the human-readable status of the container instance state. + * + * @param detailStatus the detailStatus value to set + * @return the ContainerState object itself. + */ + public ContainerState withDetailStatus(String detailStatus) { + this.detailStatus = detailStatus; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/EnvironmentVariable.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/EnvironmentVariable.java new file mode 100644 index 0000000000000..337b732a0f77c --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/EnvironmentVariable.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The environment variable to set within the container instance. + */ +public 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", required = true) + private String value; + + /** + * Get the name of the environment variable. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 of the environment variable. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ImageRegistryCredential.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ImageRegistryCredential.java new file mode 100644 index 0000000000000..f00d7f725ee6a --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ImageRegistryCredential.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Image registry credential. + */ +public 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; + + /** + * Get 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 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 for the private registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set 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 for the private registry. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/IpAddress.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/IpAddress.java new file mode 100644 index 0000000000000..dbe15e035531f --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/IpAddress.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP address for the container group. + */ +public 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. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * The IP exposed to the public internet. + */ + @JsonProperty(value = "ip") + private String ip; + + /** + * Creates an instance of IpAddress class. + * @param ports the list of ports exposed on the container group. + */ + public IpAddress() { + type = "Public"; + } + + /** + * Get the list of ports exposed on the container group. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set 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 specifies if the IP is exposed to the public internet. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies if the IP is exposed to the public internet. + * + * @param type the type value to set + * @return the IpAddress object itself. + */ + public IpAddress withType(String type) { + this.type = type; + return this; + } + + /** + * Get the IP exposed to the public internet. + * + * @return the ip value + */ + public String ip() { + return this.ip; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Logs.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Logs.java new file mode 100644 index 0000000000000..5bc30ba21bdd7 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Logs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation.LogsInner; + +/** + * Type representing Logs. + */ +public interface Logs extends HasInner, HasManager { + /** + * @return the content value. + */ + String content(); + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/OperatingSystemTypes.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/OperatingSystemTypes.java new file mode 100644 index 0000000000000..4f8aa7cc873d0 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/OperatingSystemTypes.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known OperatingSystemTypes values + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Port.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Port.java new file mode 100644 index 0000000000000..56698eb99cdc0 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Port.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container group. + */ +public class Port { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerGroupNetworkProtocol protocol; + + /** + * The port number. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerGroupNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @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 number. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceLimits.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceLimits.java new file mode 100644 index 0000000000000..4c6902b9d1bda --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceLimits.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource limits. + */ +public 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; + + /** + * Get the memory limit in GB of this container instance. + * + * @return the memoryInGB value + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set 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 limit of this container instance. + * + * @return the cpu value + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceRequests.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceRequests.java new file mode 100644 index 0000000000000..30688d55d101a --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceRequests.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requests. + */ +public 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; + + /** + * Get the memory request in GB of this container instance. + * + * @return the memoryInGB value + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set 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 request of this container instance. + * + * @return the cpu value + */ + public double cpu() { + return this.cpu; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceRequirements.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceRequirements.java new file mode 100644 index 0000000000000..995ea36943d79 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/ResourceRequirements.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requirements. + */ +public 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 resource requests of this container instance. + * + * @return the requests value + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set 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 resource limits of this container instance. + * + * @return the limits value + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Volume.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Volume.java new file mode 100644 index 0000000000000..f5c80a019a6f0 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/Volume.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume. + */ +public class Volume { + /** + * The name of the volume. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The name of the Azure File volume. + */ + @JsonProperty(value = "azureFile", required = true) + private AzureFileVolume azureFile; + + /** + * Get the name of the volume. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 name of the Azure File volume. + * + * @return the azureFile value + */ + public AzureFileVolume azureFile() { + return this.azureFile; + } + + /** + * Set the name of 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/VolumeMount.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/VolumeMount.java new file mode 100644 index 0000000000000..008fcd7feface --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/VolumeMount.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume mount. + */ +public 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 of the volume mount. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 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 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 flag indicating whether the volume mount is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupImpl.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupImpl.java new file mode 100644 index 0000000000000..d48214facdd2b --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupImpl.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroup; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.Container; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.IpAddress; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.Volume; + +class ContainerGroupImpl extends GroupableResourceCoreImpl implements ContainerGroup, ContainerGroup.Definition, ContainerGroup.Update { + ContainerGroupImpl(String name, ContainerGroupInner inner, ContainerInstanceManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List containers() { + return this.inner().containers(); + } + + @Override + public List imageRegistryCredentials() { + return this.inner().imageRegistryCredentials(); + } + + @Override + public IpAddress ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public OperatingSystemTypes osType() { + return this.inner().osType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ContainerRestartPolicy restartPolicy() { + return this.inner().restartPolicy(); + } + + @Override + public String state() { + return this.inner().state(); + } + + @Override + public List volumes() { + return this.inner().volumes(); + } + + @Override + public ContainerGroupImpl withContainers(List containers) { + this.inner().withContainers(containers); + return this; + } + + @Override + public ContainerGroupImpl withOsType(OperatingSystemTypes osType) { + this.inner().withOsType(osType); + return this; + } + + @Override + public ContainerGroupImpl withImageRegistryCredentials(List imageRegistryCredentials) { + this.inner().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + @Override + public ContainerGroupImpl withIpAddress(IpAddress ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public ContainerGroupImpl withRestartPolicy(ContainerRestartPolicy restartPolicy) { + this.inner().withRestartPolicy(restartPolicy); + return this; + } + + @Override + public ContainerGroupImpl withVolumes(List volumes) { + this.inner().withVolumes(volumes); + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupInner.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupInner.java new file mode 100644 index 0000000000000..a5e022eb42ae0 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupInner.java @@ -0,0 +1,220 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.Container; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.IpAddress; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.Volume; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A container group. + */ +@JsonFlatten +public class ContainerGroupInner extends Resource { + /** + * The provisioning state of the container group. This only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The containers within the container group. + */ + @JsonProperty(value = "properties.containers", required = true) + private List containers; + + /** + * The image registry credentials by which the container group is created + * from. + */ + @JsonProperty(value = "properties.imageRegistryCredentials") + private List imageRegistryCredentials; + + /** + * Restart policy for all containers within the container group. Currently + * the only available option is `always`. Possible values include: + * 'always'. + */ + @JsonProperty(value = "properties.restartPolicy") + private ContainerRestartPolicy restartPolicy; + + /** + * The IP address type of the container group. + */ + @JsonProperty(value = "properties.ipAddress") + private IpAddress ipAddress; + + /** + * The operating system type required by the containers in the container + * group. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.osType", required = true) + private OperatingSystemTypes osType; + + /** + * The current state of the container group. This is only valid for the + * response. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * The list of volumes that can be mounted by containers in this container + * group. + */ + @JsonProperty(value = "properties.volumes") + private List volumes; + + /** + * Get 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 within the container group. + * + * @return the containers value + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers within the container group. + * + * @param containers the containers value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the image registry credentials by which the container group is created from. + * + * @return the imageRegistryCredentials value + */ + public List imageRegistryCredentials() { + return this.imageRegistryCredentials; + } + + /** + * Set 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) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * Get restart policy for all containers within the container group. Currently the only available option is `always`. Possible values include: 'always'. + * + * @return the restartPolicy value + */ + public ContainerRestartPolicy restartPolicy() { + return this.restartPolicy; + } + + /** + * Set restart policy for all containers within the container group. Currently the only available option is `always`. Possible values include: 'always'. + * + * @param restartPolicy the restartPolicy value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withRestartPolicy(ContainerRestartPolicy restartPolicy) { + this.restartPolicy = restartPolicy; + return this; + } + + /** + * Get the IP address type of the container group. + * + * @return the ipAddress value + */ + public IpAddress ipAddress() { + return this.ipAddress; + } + + /** + * Set 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) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the current state of the container group. This is only valid for the response. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Get 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 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) { + this.volumes = volumes; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupsImpl.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupsImpl.java new file mode 100644 index 0000000000000..a9aef34583c1e --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ContainerGroupsImpl extends GroupableResourcesCoreImpl implements ContainerGroups { + protected ContainerGroupsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ContainerGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ContainerGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ContainerGroupImpl wrapModel(ContainerGroupInner inner) { + return new ContainerGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ContainerGroupImpl wrapModel(String name) { + return new ContainerGroupImpl(name, new ContainerGroupInner(), this.manager()); + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupsInner.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupsInner.java new file mode 100644 index 0000000000000..a2f8b0fb76aba --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerGroupsInner.java @@ -0,0 +1,841 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroups. + */ +public class ContainerGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group to contain the container group to be created or updated. + * @param containerGroupName The name of the container group to be created or updated. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().single().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group to contain the container group to be created or updated. + * @param containerGroupName The name of the container group to be created or updated. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group to contain the container group to be created or updated. + * @param containerGroupName The name of the container group to be created or updated. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group to contain the container group to be created or updated. + * @param containerGroupName The name of the container group to be created or updated. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param containerGroupName The name of the container group to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner delete(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param containerGroupName The name of the container group to be deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param containerGroupName The name of the container group to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable deleteAsync(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group that contains the container group. + * @param containerGroupName The name of the container group to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerInstanceManagementClientImpl.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerInstanceManagementClientImpl.java new file mode 100644 index 0000000000000..e5a092b1a4858 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerInstanceManagementClientImpl.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerInstanceManagementClientImpl class. + */ +public class ContainerInstanceManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private 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 subscriptionId() { + return this.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 service client itself + */ + public ContainerInstanceManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ContainerGroupsInner object to access its operations. + */ + private ContainerGroupsInner containerGroups; + + /** + * Gets the ContainerGroupsInner object to access its operations. + * @return the ContainerGroupsInner object. + */ + public ContainerGroupsInner containerGroups() { + return this.containerGroups; + } + + /** + * The ContainerLogsInner object to access its operations. + */ + private ContainerLogsInner containerLogs; + + /** + * Gets the ContainerLogsInner object to access its operations. + * @return the ContainerLogsInner object. + */ + public ContainerLogsInner containerLogs() { + return this.containerLogs; + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerInstanceManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-08-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.containerGroups = new ContainerGroupsInner(restClient().retrofit(), this); + this.containerLogs = new ContainerLogsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ContainerInstanceManagementClient", "2017-08-01-preview"); + } +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerInstanceManager.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerInstanceManager.java new file mode 100644 index 0000000000000..b91dc25645556 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerInstanceManager.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerLogs; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerInstance resource management. + */ +public final class ContainerInstanceManager extends ManagerCore { + private ContainerGroups containerGroups; + private ContainerLogs containerLogs; + /** + * Get a Configurable instance that can be used to create ContainerInstanceManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerInstanceManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerInstanceManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerInstanceManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerInstance management API entry points that work across subscriptions + */ + ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ContainerGroups. + */ + public ContainerGroups containerGroups() { + if (this.containerGroups == null) { + this.containerGroups = new ContainerGroupsImpl(this); + } + return this.containerGroups; + } + + /** + * @return Entry point to manage ContainerLogs. + */ + public ContainerLogs containerLogs() { + if (this.containerLogs == null) { + this.containerLogs = new ContainerLogsImpl(this); + } + return this.containerLogs; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerInstanceManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerInstanceManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerInstanceManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerLogsImpl.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerLogsImpl.java new file mode 100644 index 0000000000000..4f1d3edd87461 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerLogsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerLogs; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.Logs; + +class ContainerLogsImpl extends WrapperImpl implements ContainerLogs { + private final ContainerInstanceManager manager; + + ContainerLogsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerLogs()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String resourceGroupName, String containerName, String containerGroupName) { + ContainerLogsInner client = this.inner(); + return client.listAsync(resourceGroupName, containerName, containerGroupName) + .map(new Func1() { + @Override + public Logs call(LogsInner inner) { + return new LogsImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerLogsInner.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerLogsInner.java new file mode 100644 index 0000000000000..21b8269c82eb7 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/ContainerLogsInner.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerLogs. + */ +public class ContainerLogsInner { + /** The Retrofit service to perform REST calls. */ + private ContainerLogsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerLogsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerLogsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerLogsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerLogs to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerLogsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_08_01_preview.ContainerLogs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerName") String containerName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Query("tail") Integer tail, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerName, String containerGroupName) { + return listWithServiceResponseAsync(resourceGroupName, containerName, containerGroupName).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerName, containerGroupName), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerName, String containerGroupName) { + return listWithServiceResponseAsync(resourceGroupName, containerName, containerGroupName).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer tail = null; + return service.list(this.client.subscriptionId(), resourceGroupName, containerName, containerGroupName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerName, String containerGroupName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerName, containerGroupName, tail).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerName, String containerGroupName, Integer tail, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerName, containerGroupName, tail), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerName, String containerGroupName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerName, containerGroupName, tail).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group that contains the container instance. + * @param containerName The name of the container instance. + * @param containerGroupName The name of the container group the container instance belongs to. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerName, String containerGroupName, Integer tail) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, containerName, containerGroupName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/IdParsingUtils.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..ef6980c904b53 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/LogsImpl.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/LogsImpl.java new file mode 100644 index 0000000000000..a0123d89d1a85 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/LogsImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2017_08_01_preview.Logs; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LogsImpl extends WrapperImpl implements Logs { + private final ContainerInstanceManager manager; + LogsImpl(LogsInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String content() { + return this.inner().content(); + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/LogsInner.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/LogsInner.java new file mode 100644 index 0000000000000..58f79046578f5 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/LogsInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The logs. + */ +public class LogsInner { + /** + * The content of the log. + */ + @JsonProperty(value = "content") + private String content; + + /** + * Get the content of the log. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/PageImpl.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..29530cdff6f64 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/package-info.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..e40b44ef4daaa --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview.implementation; diff --git a/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/package-info.java b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/package-info.java new file mode 100644 index 0000000000000..977248458c0e2 --- /dev/null +++ b/containerinstance/resource-manager/v2017_08_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_08_01_preview/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2017_08_01_preview; diff --git a/containerinstance/resource-manager/v2017_10_01_preview/pom.xml b/containerinstance/resource-manager/v2017_10_01_preview/pom.xml new file mode 100644 index 0000000000000..31b1b4897ef4a --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.containerinstance.v2017_10_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-containerinstance + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerInstance Management + This package contains Microsoft ContainerInstance Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/AzureFileVolume.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/AzureFileVolume.java new file mode 100644 index 0000000000000..c73db93bbbd3a --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/AzureFileVolume.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Azure File volume. Azure File shares are mounted as + * volumes. + */ +public 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 name of the Azure File share to be mounted as a volume. + * + * @return the shareName value + */ + public String shareName() { + return this.shareName; + } + + /** + * Set 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 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 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 name of the storage account that contains the Azure File share. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set 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 storage account access key used to access the Azure File share. + * + * @return the storageAccountKey value + */ + public String storageAccountKey() { + return this.storageAccountKey; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Container.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Container.java new file mode 100644 index 0000000000000..7c2c4687e4258 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Container.java @@ -0,0 +1,217 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A container instance. + */ +@JsonFlatten +public class Container { + /** + * The user-provided name of the container instance. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The name of the image used to create the container instance. + */ + @JsonProperty(value = "properties.image", required = true) + private String image; + + /** + * The commands to execute within the container instance in exec form. + */ + @JsonProperty(value = "properties.command") + private List command; + + /** + * The exposed ports on the container instance. + */ + @JsonProperty(value = "properties.ports") + private List ports; + + /** + * The environment variables to set in the container instance. + */ + @JsonProperty(value = "properties.environmentVariables") + private List environmentVariables; + + /** + * The instance view of the container instance. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerPropertiesInstanceView instanceView; + + /** + * The resource requirements of the container instance. + */ + @JsonProperty(value = "properties.resources", required = true) + private ResourceRequirements resources; + + /** + * The volume mounts available to the container instance. + */ + @JsonProperty(value = "properties.volumeMounts") + private List volumeMounts; + + /** + * Get the user-provided name of the container instance. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 name of the image used to create the container instance. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set 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) { + this.image = image; + return this; + } + + /** + * Get the commands to execute within the container instance in exec form. + * + * @return the command value + */ + public List command() { + return this.command; + } + + /** + * Set 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) { + this.command = command; + return this; + } + + /** + * Get the exposed ports on the container instance. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the exposed ports on the container instance. + * + * @param ports the ports value to set + * @return the Container object itself. + */ + public Container withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the environment variables to set in the container instance. + * + * @return the environmentVariables value + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set 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) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instance view of the container instance. Only valid in response. + * + * @return the instanceView value + */ + public ContainerPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the resource requirements of the container instance. + * + * @return the resources value + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set the resource requirements of the container instance. + * + * @param resources the resources value to set + * @return the Container object itself. + */ + public Container withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volume mounts available to the container instance. + * + * @return the volumeMounts value + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set 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) { + this.volumeMounts = volumeMounts; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroup.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroup.java new file mode 100644 index 0000000000000..93ac80d140e2f --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroup.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.ContainerInstanceManager; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.ContainerGroupInner; + +/** + * Type representing ContainerGroup. + */ +public interface ContainerGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the containers value. + */ + List containers(); + + /** + * @return the imageRegistryCredentials value. + */ + List imageRegistryCredentials(); + + /** + * @return the instanceView value. + */ + ContainerGroupPropertiesInstanceView instanceView(); + + /** + * @return the ipAddress value. + */ + IpAddress ipAddress(); + + /** + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the restartPolicy value. + */ + ContainerGroupRestartPolicy restartPolicy(); + + /** + * @return the volumes value. + */ + List volumes(); + + /** + * The entirety of the ContainerGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithContainers, DefinitionStages.WithOsType, DefinitionStages.WithCreate { + } + + /** + * Grouping of ContainerGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ContainerGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ContainerGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the containergroup definition allowing to specify Containers. + */ + interface WithContainers { + /** + * Specifies containers. + */ + WithOsType withContainers(List containers); + } + + /** + * The stage of the containergroup definition allowing to specify OsType. + */ + interface WithOsType { + /** + * Specifies osType. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + + /** + * The stage of the containergroup update allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + WithCreate withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + WithCreate withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup update allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + WithCreate withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup update allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + WithCreate withVolumes(List volumes); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithImageRegistryCredentials, DefinitionStages.WithIpAddress, DefinitionStages.WithRestartPolicy, DefinitionStages.WithVolumes { + } + } + /** + * The template for a ContainerGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithImageRegistryCredentials, UpdateStages.WithIpAddress, UpdateStages.WithRestartPolicy, UpdateStages.WithVolumes { + } + + /** + * Grouping of ContainerGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the containergroup {0} allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + Update withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup {0} allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + Update withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup {0} allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + Update withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup {0} allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + Update withVolumes(List volumes); + } + + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupNetworkProtocol.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupNetworkProtocol.java new file mode 100644 index 0000000000000..f19829239054b --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerGroupNetworkProtocol values + */ + public static Collection values() { + return values(ContainerGroupNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupPropertiesInstanceView.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupPropertiesInstanceView.java new file mode 100644 index 0000000000000..c0522fba621ff --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupPropertiesInstanceView.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container group. Only valid in response. + */ +public 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 of this container group. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Get the state of the container group. Only valid in response. + * + * @return the state value + */ + public String state() { + return this.state; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupRestartPolicy.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupRestartPolicy.java new file mode 100644 index 0000000000000..a0918edf2e733 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroupRestartPolicy.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerGroupRestartPolicy values + */ + public static Collection values() { + return values(ContainerGroupRestartPolicy.class); + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroups.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroups.java new file mode 100644 index 0000000000000..6096d2a2aab6d --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.ContainerGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerGroups. + */ +public interface ContainerGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerInstanceOperationsOrigin.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerInstanceOperationsOrigin.java new file mode 100644 index 0000000000000..97fb0fbe6f5d4 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerInstanceOperationsOrigin.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerInstanceOperationsOrigin values + */ + public static Collection values() { + return values(ContainerInstanceOperationsOrigin.class); + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerLogs.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerLogs.java new file mode 100644 index 0000000000000..2f8437409ae57 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerLogs.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import rx.Observable; + +/** + * Type representing ContainerLogs. + */ +public interface ContainerLogs { + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String containerGroupName, String containerName); + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerNetworkProtocol.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerNetworkProtocol.java new file mode 100644 index 0000000000000..ba95784fdfe57 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerNetworkProtocol values + */ + public static Collection values() { + return values(ContainerNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerPort.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerPort.java new file mode 100644 index 0000000000000..f0576e1a71df2 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerPort.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container instance. + */ +public class ContainerPort { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @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 associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @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 number exposed within the container group. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerPropertiesInstanceView.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerPropertiesInstanceView.java new file mode 100644 index 0000000000000..39f4f0bff3f53 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerPropertiesInstanceView.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container instance. Only valid in response. + */ +public 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 number of times that the container instance has been restarted. + * + * @return the restartCount value + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Get current container instance state. + * + * @return the currentState value + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Get previous container instance state. + * + * @return the previousState value + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Get the events of the container instance. + * + * @return the events value + */ + public List events() { + return this.events; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerState.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerState.java new file mode 100644 index 0000000000000..924d5a8ec1fab --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ContainerState.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container instance state. + */ +public class ContainerState { + /** + * The state of the container instance. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The date-time when the container instance state started. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The container instance exit codes correspond to those from the `docker + * run` command. + */ + @JsonProperty(value = "exitCode") + private Integer exitCode; + + /** + * The date-time when the container instance state finished. + */ + @JsonProperty(value = "finishTime") + private DateTime finishTime; + + /** + * The human-readable status of the container instance state. + */ + @JsonProperty(value = "detailStatus") + private String detailStatus; + + /** + * Get the state of the container instance. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state of the container instance. + * + * @param state the state value to set + * @return the ContainerState object itself. + */ + public ContainerState withState(String state) { + this.state = state; + return this; + } + + /** + * Get the date-time when the container instance state started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the date-time when the container instance state started. + * + * @param startTime the startTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the container instance exit codes correspond to those from the `docker run` command. + * + * @return the exitCode value + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Set the container instance exit codes correspond to those from the `docker run` command. + * + * @param exitCode the exitCode value to set + * @return the ContainerState object itself. + */ + public ContainerState withExitCode(Integer exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get the date-time when the container instance state finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the date-time when the container instance state finished. + * + * @param finishTime the finishTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the human-readable status of the container instance state. + * + * @return the detailStatus value + */ + public String detailStatus() { + return this.detailStatus; + } + + /** + * Set the human-readable status of the container instance state. + * + * @param detailStatus the detailStatus value to set + * @return the ContainerState object itself. + */ + public ContainerState withDetailStatus(String detailStatus) { + this.detailStatus = detailStatus; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/EnvironmentVariable.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/EnvironmentVariable.java new file mode 100644 index 0000000000000..b013d12b4414d --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/EnvironmentVariable.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The environment variable to set within the container instance. + */ +public 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", required = true) + private String value; + + /** + * Get the name of the environment variable. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 of the environment variable. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Event.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Event.java new file mode 100644 index 0000000000000..55d3e6a6a7af6 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Event.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container group or container instance event. + */ +public class Event { + /** + * The count of the event. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * The date-time of the earliest logged event. + */ + @JsonProperty(value = "firstTimestamp") + private DateTime firstTimestamp; + + /** + * The date-time of the latest logged event. + */ + @JsonProperty(value = "lastTimestamp") + private DateTime lastTimestamp; + + /** + * The event name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The event message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The event type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the count of the event. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the count of the event. + * + * @param count the count value to set + * @return the Event object itself. + */ + public Event withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the date-time of the earliest logged event. + * + * @return the firstTimestamp value + */ + public DateTime firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Set the date-time of the earliest logged event. + * + * @param firstTimestamp the firstTimestamp value to set + * @return the Event object itself. + */ + public Event withFirstTimestamp(DateTime firstTimestamp) { + this.firstTimestamp = firstTimestamp; + return this; + } + + /** + * Get the date-time of the latest logged event. + * + * @return the lastTimestamp value + */ + public DateTime lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Set the date-time of the latest logged event. + * + * @param lastTimestamp the lastTimestamp value to set + * @return the Event object itself. + */ + public Event withLastTimestamp(DateTime lastTimestamp) { + this.lastTimestamp = lastTimestamp; + return this; + } + + /** + * Get the event name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the event name. + * + * @param name the name value to set + * @return the Event object itself. + */ + public Event withName(String name) { + this.name = name; + return this; + } + + /** + * Get the event message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the event message. + * + * @param message the message value to set + * @return the Event object itself. + */ + public Event withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the event type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the event type. + * + * @param type the type value to set + * @return the Event object itself. + */ + public Event withType(String type) { + this.type = type; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ImageRegistryCredential.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ImageRegistryCredential.java new file mode 100644 index 0000000000000..65095268da989 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ImageRegistryCredential.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Image registry credential. + */ +public 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; + + /** + * Get 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 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 for the private registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set 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 for the private registry. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/IpAddress.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/IpAddress.java new file mode 100644 index 0000000000000..2c1149416b88f --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/IpAddress.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP address for the container group. + */ +public 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. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * The IP exposed to the public internet. + */ + @JsonProperty(value = "ip") + private String ip; + + /** + * Creates an instance of IpAddress class. + * @param ports the list of ports exposed on the container group. + */ + public IpAddress() { + type = "Public"; + } + + /** + * Get the list of ports exposed on the container group. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set 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 specifies if the IP is exposed to the public internet. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies if the IP is exposed to the public internet. + * + * @param type the type value to set + * @return the IpAddress object itself. + */ + public IpAddress withType(String type) { + this.type = type; + return this; + } + + /** + * Get the IP exposed to the public internet. + * + * @return the ip value + */ + public String ip() { + return this.ip; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Logs.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Logs.java new file mode 100644 index 0000000000000..de7c362b3e68e --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Logs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.LogsInner; + +/** + * Type representing Logs. + */ +public interface Logs extends HasInner, HasManager { + /** + * @return the content value. + */ + String content(); + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperatingSystemTypes.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperatingSystemTypes.java new file mode 100644 index 0000000000000..e8b34824b6181 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperatingSystemTypes.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known OperatingSystemTypes values + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperationDisplay.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperationDisplay.java new file mode 100644 index 0000000000000..ffb578f73bd22 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information of the operation. + */ +public 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 name of the provider of the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set 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 name of the resource type of the operation. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set 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 friendly name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set 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 of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperationListResult.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperationListResult.java new file mode 100644 index 0000000000000..9530b3ea2ff57 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/OperationListResult.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.OperationListResultInner; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.OperationInner; +import java.util.List; + +/** + * Type representing OperationListResult. + */ +public interface OperationListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Operations.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Operations.java new file mode 100644 index 0000000000000..c7eb36ee82c8b --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Port.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Port.java new file mode 100644 index 0000000000000..bc779b28c0fd0 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Port.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container group. + */ +public class Port { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerGroupNetworkProtocol protocol; + + /** + * The port number. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerGroupNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @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 number. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceLimits.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceLimits.java new file mode 100644 index 0000000000000..b7572e568f628 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceLimits.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource limits. + */ +public 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; + + /** + * Get the memory limit in GB of this container instance. + * + * @return the memoryInGB value + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set 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 limit of this container instance. + * + * @return the cpu value + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceRequests.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceRequests.java new file mode 100644 index 0000000000000..f119c37ef50f2 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceRequests.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requests. + */ +public 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; + + /** + * Get the memory request in GB of this container instance. + * + * @return the memoryInGB value + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set 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 request of this container instance. + * + * @return the cpu value + */ + public double cpu() { + return this.cpu; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceRequirements.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceRequirements.java new file mode 100644 index 0000000000000..d5ed003da37f2 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/ResourceRequirements.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requirements. + */ +public 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 resource requests of this container instance. + * + * @return the requests value + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set 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 resource limits of this container instance. + * + * @return the limits value + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Volume.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Volume.java new file mode 100644 index 0000000000000..2a3f6a312725c --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/Volume.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume. + */ +public class Volume { + /** + * The name of the volume. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The name of the Azure File volume. + */ + @JsonProperty(value = "azureFile") + private AzureFileVolume azureFile; + + /** + * The empty directory volume. + */ + @JsonProperty(value = "emptyDir") + private Object emptyDir; + + /** + * Get the name of the volume. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 name of the Azure File volume. + * + * @return the azureFile value + */ + public AzureFileVolume azureFile() { + return this.azureFile; + } + + /** + * Set the name of 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 empty directory volume. + * + * @return the emptyDir value + */ + public Object emptyDir() { + return this.emptyDir; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/VolumeMount.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/VolumeMount.java new file mode 100644 index 0000000000000..6c267dd42c3b2 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/VolumeMount.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume mount. + */ +public 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 of the volume mount. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 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 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 flag indicating whether the volume mount is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupImpl.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupImpl.java new file mode 100644 index 0000000000000..a1ac6df6bb5c5 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupImpl.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroup; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Container; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.IpAddress; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Volume; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroupPropertiesInstanceView; + +class ContainerGroupImpl extends GroupableResourceCoreImpl implements ContainerGroup, ContainerGroup.Definition, ContainerGroup.Update { + ContainerGroupImpl(String name, ContainerGroupInner inner, ContainerInstanceManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List containers() { + return this.inner().containers(); + } + + @Override + public List imageRegistryCredentials() { + return this.inner().imageRegistryCredentials(); + } + + @Override + public ContainerGroupPropertiesInstanceView instanceView() { + return this.inner().instanceView(); + } + + @Override + public IpAddress ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public OperatingSystemTypes osType() { + return this.inner().osType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ContainerGroupRestartPolicy restartPolicy() { + return this.inner().restartPolicy(); + } + + @Override + public List volumes() { + return this.inner().volumes(); + } + + @Override + public ContainerGroupImpl withContainers(List containers) { + this.inner().withContainers(containers); + return this; + } + + @Override + public ContainerGroupImpl withOsType(OperatingSystemTypes osType) { + this.inner().withOsType(osType); + return this; + } + + @Override + public ContainerGroupImpl withImageRegistryCredentials(List imageRegistryCredentials) { + this.inner().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + @Override + public ContainerGroupImpl withIpAddress(IpAddress ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public ContainerGroupImpl withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.inner().withRestartPolicy(restartPolicy); + return this; + } + + @Override + public ContainerGroupImpl withVolumes(List volumes) { + this.inner().withVolumes(volumes); + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupInner.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupInner.java new file mode 100644 index 0000000000000..72e83a5ed94b8 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupInner.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Container; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.IpAddress; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Volume; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroupPropertiesInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A container group. + */ +@JsonFlatten +public class ContainerGroupInner extends Resource { + /** + * The provisioning state of the container group. This only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The containers within the container group. + */ + @JsonProperty(value = "properties.containers", required = true) + private List containers; + + /** + * The image registry credentials by which the container group is created + * from. + */ + @JsonProperty(value = "properties.imageRegistryCredentials") + private List imageRegistryCredentials; + + /** + * Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + * . Possible values include: 'Always', 'OnFailure', 'Never'. + */ + @JsonProperty(value = "properties.restartPolicy") + private ContainerGroupRestartPolicy restartPolicy; + + /** + * The IP address type of the container group. + */ + @JsonProperty(value = "properties.ipAddress") + private IpAddress ipAddress; + + /** + * The operating system type required by the containers in the container + * group. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.osType", required = true) + private OperatingSystemTypes osType; + + /** + * The list of volumes that can be mounted by containers in this container + * group. + */ + @JsonProperty(value = "properties.volumes") + private List volumes; + + /** + * The instance view of the container group. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerGroupPropertiesInstanceView instanceView; + + /** + * Get 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 within the container group. + * + * @return the containers value + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers within the container group. + * + * @param containers the containers value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the image registry credentials by which the container group is created from. + * + * @return the imageRegistryCredentials value + */ + public List imageRegistryCredentials() { + return this.imageRegistryCredentials; + } + + /** + * Set 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) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * Get restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @return the restartPolicy value + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.restartPolicy; + } + + /** + * Set restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @param restartPolicy the restartPolicy value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.restartPolicy = restartPolicy; + return this; + } + + /** + * Get the IP address type of the container group. + * + * @return the ipAddress value + */ + public IpAddress ipAddress() { + return this.ipAddress; + } + + /** + * Set 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) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get 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 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) { + this.volumes = volumes; + return this; + } + + /** + * Get the instance view of the container group. Only valid in response. + * + * @return the instanceView value + */ + public ContainerGroupPropertiesInstanceView instanceView() { + return this.instanceView; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupsImpl.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupsImpl.java new file mode 100644 index 0000000000000..b0a4dbc51d185 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ContainerGroupsImpl extends GroupableResourcesCoreImpl implements ContainerGroups { + protected ContainerGroupsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ContainerGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ContainerGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ContainerGroupImpl wrapModel(ContainerGroupInner inner) { + return new ContainerGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ContainerGroupImpl wrapModel(String name) { + return new ContainerGroupImpl(name, new ContainerGroupInner(), this.manager()); + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupsInner.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupsInner.java new file mode 100644 index 0000000000000..dc73b3528eb90 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerGroupsInner.java @@ -0,0 +1,841 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroups. + */ +public class ContainerGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().single().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner delete(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable deleteAsync(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerInstanceManagementClientImpl.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerInstanceManagementClientImpl.java new file mode 100644 index 0000000000000..c0b017d9437ef --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerInstanceManagementClientImpl.java @@ -0,0 +1,224 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerInstanceManagementClientImpl class. + */ +public class ContainerInstanceManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private 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 subscriptionId() { + return this.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 service client itself + */ + public ContainerInstanceManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ContainerGroupsInner object to access its operations. + */ + private ContainerGroupsInner containerGroups; + + /** + * Gets the ContainerGroupsInner object to access its operations. + * @return the ContainerGroupsInner object. + */ + public ContainerGroupsInner containerGroups() { + return this.containerGroups; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The ContainerLogsInner object to access its operations. + */ + private ContainerLogsInner containerLogs; + + /** + * Gets the ContainerLogsInner object to access its operations. + * @return the ContainerLogsInner object. + */ + public ContainerLogsInner containerLogs() { + return this.containerLogs; + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerInstanceManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-10-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.containerGroups = new ContainerGroupsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.containerLogs = new ContainerLogsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ContainerInstanceManagementClient", "2017-10-01-preview"); + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerInstanceManager.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerInstanceManager.java new file mode 100644 index 0000000000000..6c7a5110e10bd --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerInstanceManager.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Operations; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerLogs; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerInstance resource management. + */ +public final class ContainerInstanceManager extends ManagerCore { + private ContainerGroups containerGroups; + private Operations operations; + private ContainerLogs containerLogs; + /** + * Get a Configurable instance that can be used to create ContainerInstanceManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerInstanceManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerInstanceManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerInstanceManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerInstance management API entry points that work across subscriptions + */ + ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ContainerGroups. + */ + public ContainerGroups containerGroups() { + if (this.containerGroups == null) { + this.containerGroups = new ContainerGroupsImpl(this); + } + return this.containerGroups; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage ContainerLogs. + */ + public ContainerLogs containerLogs() { + if (this.containerLogs == null) { + this.containerLogs = new ContainerLogsImpl(this); + } + return this.containerLogs; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerInstanceManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerInstanceManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerInstanceManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerLogsImpl.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerLogsImpl.java new file mode 100644 index 0000000000000..f436cc3cab33e --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerLogsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerLogs; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Logs; + +class ContainerLogsImpl extends WrapperImpl implements ContainerLogs { + private final ContainerInstanceManager manager; + + ContainerLogsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerLogs()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName) { + ContainerLogsInner client = this.inner(); + return client.listAsync(resourceGroupName, containerGroupName, containerName) + .map(new Func1() { + @Override + public Logs call(LogsInner inner) { + return new LogsImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerLogsInner.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerLogsInner.java new file mode 100644 index 0000000000000..99a6b98d225cf --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/ContainerLogsInner.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerLogs. + */ +public class ContainerLogsInner { + /** The Retrofit service to perform REST calls. */ + private ContainerLogsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerLogsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerLogsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerLogsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerLogs to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerLogsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerLogs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Query("tail") Integer tail, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerGroupName, String containerName) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerGroupName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer tail = null; + return service.list(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/IdParsingUtils.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..398cf8e5f8775 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/LogsImpl.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/LogsImpl.java new file mode 100644 index 0000000000000..95882eb55c253 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/LogsImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Logs; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LogsImpl extends WrapperImpl implements Logs { + private final ContainerInstanceManager manager; + LogsImpl(LogsInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String content() { + return this.inner().content(); + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/LogsInner.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/LogsInner.java new file mode 100644 index 0000000000000..03b524d1257b7 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/LogsInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The logs. + */ +public class LogsInner { + /** + * The content of the log. + */ + @JsonProperty(value = "content") + private String content; + + /** + * Get the content of the log. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationInner.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationInner.java new file mode 100644 index 0000000000000..8e1faaac8bfcf --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationInner.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.OperationDisplay; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.ContainerInstanceOperationsOrigin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An operation for Azure Container Instance service. + */ +public class OperationInner { + /** + * The name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display information of the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * The intended executor of the operation. Possible values include: 'User', + * 'System'. + */ + @JsonProperty(value = "origin") + private ContainerInstanceOperationsOrigin origin; + + /** + * Get the name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 information of the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set 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 intended executor of the operation. Possible values include: 'User', 'System'. + * + * @return the origin value + */ + public ContainerInstanceOperationsOrigin origin() { + return this.origin; + } + + /** + * Set the intended executor of the operation. Possible values include: 'User', 'System'. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(ContainerInstanceOperationsOrigin origin) { + this.origin = origin; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationListResultImpl.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationListResultImpl.java new file mode 100644 index 0000000000000..b4e7740eabf86 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationListResultImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.OperationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class OperationListResultImpl extends WrapperImpl implements OperationListResult { + private final ContainerInstanceManager manager; + OperationListResultImpl(OperationListResultInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationListResultInner.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationListResultInner.java new file mode 100644 index 0000000000000..a178d7d9734ee --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The operation list response that contains all operations for Azure Container + * Instance service. + */ +public class OperationListResultInner { + /** + * The list of operations. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of operations. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of operations. + * + * @param value the value value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationsImpl.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..adcdcffe82b4f --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2017_10_01_preview.OperationListResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ContainerInstanceManager manager; + + OperationsImpl(ContainerInstanceManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationListResult call(OperationListResultInner inner) { + return new OperationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationsInner.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..a0e0a2951b5bb --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_10_01_preview.Operations list" }) + @GET("providers/Microsoft.ContainerInstance/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationListResultInner object if successful. + */ + public OperationListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListResultInner>() { + @Override + public OperationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/PageImpl.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..eb2860b879231 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/package-info.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..a9d9f336ebbb6 --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview.implementation; diff --git a/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/package-info.java b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/package-info.java new file mode 100644 index 0000000000000..b911969cb5fda --- /dev/null +++ b/containerinstance/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_10_01_preview/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2017_10_01_preview; diff --git a/containerinstance/resource-manager/v2017_12_01_preview/pom.xml b/containerinstance/resource-manager/v2017_12_01_preview/pom.xml new file mode 100644 index 0000000000000..c61d4f1f2c9db --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.containerinstance.v2017_12_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-containerinstance + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerInstance Management + This package contains Microsoft ContainerInstance Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/AzureFileVolume.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/AzureFileVolume.java new file mode 100644 index 0000000000000..eaba9f6c731cb --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/AzureFileVolume.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Azure File volume. Azure File shares are mounted as + * volumes. + */ +public 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 name of the Azure File share to be mounted as a volume. + * + * @return the shareName value + */ + public String shareName() { + return this.shareName; + } + + /** + * Set 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 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 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 name of the storage account that contains the Azure File share. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set 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 storage account access key used to access the Azure File share. + * + * @return the storageAccountKey value + */ + public String storageAccountKey() { + return this.storageAccountKey; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Container.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Container.java new file mode 100644 index 0000000000000..68cf3e5efe4d1 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Container.java @@ -0,0 +1,217 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A container instance. + */ +@JsonFlatten +public class Container { + /** + * The user-provided name of the container instance. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The name of the image used to create the container instance. + */ + @JsonProperty(value = "properties.image", required = true) + private String image; + + /** + * The commands to execute within the container instance in exec form. + */ + @JsonProperty(value = "properties.command") + private List command; + + /** + * The exposed ports on the container instance. + */ + @JsonProperty(value = "properties.ports") + private List ports; + + /** + * The environment variables to set in the container instance. + */ + @JsonProperty(value = "properties.environmentVariables") + private List environmentVariables; + + /** + * The instance view of the container instance. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerPropertiesInstanceView instanceView; + + /** + * The resource requirements of the container instance. + */ + @JsonProperty(value = "properties.resources", required = true) + private ResourceRequirements resources; + + /** + * The volume mounts available to the container instance. + */ + @JsonProperty(value = "properties.volumeMounts") + private List volumeMounts; + + /** + * Get the user-provided name of the container instance. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 name of the image used to create the container instance. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set 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) { + this.image = image; + return this; + } + + /** + * Get the commands to execute within the container instance in exec form. + * + * @return the command value + */ + public List command() { + return this.command; + } + + /** + * Set 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) { + this.command = command; + return this; + } + + /** + * Get the exposed ports on the container instance. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the exposed ports on the container instance. + * + * @param ports the ports value to set + * @return the Container object itself. + */ + public Container withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the environment variables to set in the container instance. + * + * @return the environmentVariables value + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set 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) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instance view of the container instance. Only valid in response. + * + * @return the instanceView value + */ + public ContainerPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the resource requirements of the container instance. + * + * @return the resources value + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set the resource requirements of the container instance. + * + * @param resources the resources value to set + * @return the Container object itself. + */ + public Container withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volume mounts available to the container instance. + * + * @return the volumeMounts value + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set 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) { + this.volumeMounts = volumeMounts; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroup.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroup.java new file mode 100644 index 0000000000000..d4670680e18ed --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroup.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.ContainerInstanceManager; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.ContainerGroupInner; + +/** + * Type representing ContainerGroup. + */ +public interface ContainerGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the containers value. + */ + List containers(); + + /** + * @return the imageRegistryCredentials value. + */ + List imageRegistryCredentials(); + + /** + * @return the instanceView value. + */ + ContainerGroupPropertiesInstanceView instanceView(); + + /** + * @return the ipAddress value. + */ + IpAddress ipAddress(); + + /** + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the restartPolicy value. + */ + ContainerGroupRestartPolicy restartPolicy(); + + /** + * @return the volumes value. + */ + List volumes(); + + /** + * The entirety of the ContainerGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithContainers, DefinitionStages.WithOsType, DefinitionStages.WithCreate { + } + + /** + * Grouping of ContainerGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ContainerGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ContainerGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the containergroup definition allowing to specify Containers. + */ + interface WithContainers { + /** + * Specifies containers. + */ + WithOsType withContainers(List containers); + } + + /** + * The stage of the containergroup definition allowing to specify OsType. + */ + interface WithOsType { + /** + * Specifies osType. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + + /** + * The stage of the containergroup update allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + WithCreate withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + WithCreate withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup update allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + WithCreate withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup update allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + WithCreate withVolumes(List volumes); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithImageRegistryCredentials, DefinitionStages.WithIpAddress, DefinitionStages.WithRestartPolicy, DefinitionStages.WithVolumes { + } + } + /** + * The template for a ContainerGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithImageRegistryCredentials, UpdateStages.WithIpAddress, UpdateStages.WithRestartPolicy, UpdateStages.WithVolumes { + } + + /** + * Grouping of ContainerGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the containergroup {0} allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + Update withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup {0} allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + Update withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup {0} allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + Update withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup {0} allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + Update withVolumes(List volumes); + } + + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupNetworkProtocol.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupNetworkProtocol.java new file mode 100644 index 0000000000000..604e3be112def --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerGroupNetworkProtocol values + */ + public static Collection values() { + return values(ContainerGroupNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupPropertiesInstanceView.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupPropertiesInstanceView.java new file mode 100644 index 0000000000000..bc6c7d695fafb --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupPropertiesInstanceView.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container group. Only valid in response. + */ +public 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 of this container group. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Get the state of the container group. Only valid in response. + * + * @return the state value + */ + public String state() { + return this.state; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupRestartPolicy.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupRestartPolicy.java new file mode 100644 index 0000000000000..97f2f98e52bed --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupRestartPolicy.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerGroupRestartPolicy values + */ + public static Collection values() { + return values(ContainerGroupRestartPolicy.class); + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupUsages.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupUsages.java new file mode 100644 index 0000000000000..bafd7bf8390f8 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroupUsages.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import rx.Observable; + +/** + * Type representing ContainerGroupUsages. + */ +public interface ContainerGroupUsages { + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String location); + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroups.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroups.java new file mode 100644 index 0000000000000..edede22072fef --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.ContainerGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerGroups. + */ +public interface ContainerGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerInstanceOperationsOrigin.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerInstanceOperationsOrigin.java new file mode 100644 index 0000000000000..5b58d4c67b496 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerInstanceOperationsOrigin.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerInstanceOperationsOrigin values + */ + public static Collection values() { + return values(ContainerInstanceOperationsOrigin.class); + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerLogs.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerLogs.java new file mode 100644 index 0000000000000..ef810fa2f7078 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerLogs.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import rx.Observable; + +/** + * Type representing ContainerLogs. + */ +public interface ContainerLogs { + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String containerGroupName, String containerName); + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerNetworkProtocol.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerNetworkProtocol.java new file mode 100644 index 0000000000000..1dfb78d817107 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerNetworkProtocol values + */ + public static Collection values() { + return values(ContainerNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerPort.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerPort.java new file mode 100644 index 0000000000000..d55246ce541ec --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerPort.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container instance. + */ +public class ContainerPort { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @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 associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @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 number exposed within the container group. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerPropertiesInstanceView.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerPropertiesInstanceView.java new file mode 100644 index 0000000000000..e132a8f63ef72 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerPropertiesInstanceView.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container instance. Only valid in response. + */ +public 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 number of times that the container instance has been restarted. + * + * @return the restartCount value + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Get current container instance state. + * + * @return the currentState value + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Get previous container instance state. + * + * @return the previousState value + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Get the events of the container instance. + * + * @return the events value + */ + public List events() { + return this.events; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerState.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerState.java new file mode 100644 index 0000000000000..f370c38d54523 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ContainerState.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container instance state. + */ +public class ContainerState { + /** + * The state of the container instance. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The date-time when the container instance state started. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The container instance exit codes correspond to those from the `docker + * run` command. + */ + @JsonProperty(value = "exitCode") + private Integer exitCode; + + /** + * The date-time when the container instance state finished. + */ + @JsonProperty(value = "finishTime") + private DateTime finishTime; + + /** + * The human-readable status of the container instance state. + */ + @JsonProperty(value = "detailStatus") + private String detailStatus; + + /** + * Get the state of the container instance. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state of the container instance. + * + * @param state the state value to set + * @return the ContainerState object itself. + */ + public ContainerState withState(String state) { + this.state = state; + return this; + } + + /** + * Get the date-time when the container instance state started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the date-time when the container instance state started. + * + * @param startTime the startTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the container instance exit codes correspond to those from the `docker run` command. + * + * @return the exitCode value + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Set the container instance exit codes correspond to those from the `docker run` command. + * + * @param exitCode the exitCode value to set + * @return the ContainerState object itself. + */ + public ContainerState withExitCode(Integer exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get the date-time when the container instance state finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the date-time when the container instance state finished. + * + * @param finishTime the finishTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the human-readable status of the container instance state. + * + * @return the detailStatus value + */ + public String detailStatus() { + return this.detailStatus; + } + + /** + * Set the human-readable status of the container instance state. + * + * @param detailStatus the detailStatus value to set + * @return the ContainerState object itself. + */ + public ContainerState withDetailStatus(String detailStatus) { + this.detailStatus = detailStatus; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/EnvironmentVariable.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/EnvironmentVariable.java new file mode 100644 index 0000000000000..20ddbb1644955 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/EnvironmentVariable.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The environment variable to set within the container instance. + */ +public 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", required = true) + private String value; + + /** + * Get the name of the environment variable. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 of the environment variable. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Event.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Event.java new file mode 100644 index 0000000000000..eb5b476c937b7 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Event.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container group or container instance event. + */ +public class Event { + /** + * The count of the event. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * The date-time of the earliest logged event. + */ + @JsonProperty(value = "firstTimestamp") + private DateTime firstTimestamp; + + /** + * The date-time of the latest logged event. + */ + @JsonProperty(value = "lastTimestamp") + private DateTime lastTimestamp; + + /** + * The event name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The event message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The event type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the count of the event. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the count of the event. + * + * @param count the count value to set + * @return the Event object itself. + */ + public Event withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the date-time of the earliest logged event. + * + * @return the firstTimestamp value + */ + public DateTime firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Set the date-time of the earliest logged event. + * + * @param firstTimestamp the firstTimestamp value to set + * @return the Event object itself. + */ + public Event withFirstTimestamp(DateTime firstTimestamp) { + this.firstTimestamp = firstTimestamp; + return this; + } + + /** + * Get the date-time of the latest logged event. + * + * @return the lastTimestamp value + */ + public DateTime lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Set the date-time of the latest logged event. + * + * @param lastTimestamp the lastTimestamp value to set + * @return the Event object itself. + */ + public Event withLastTimestamp(DateTime lastTimestamp) { + this.lastTimestamp = lastTimestamp; + return this; + } + + /** + * Get the event name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the event name. + * + * @param name the name value to set + * @return the Event object itself. + */ + public Event withName(String name) { + this.name = name; + return this; + } + + /** + * Get the event message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the event message. + * + * @param message the message value to set + * @return the Event object itself. + */ + public Event withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the event type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the event type. + * + * @param type the type value to set + * @return the Event object itself. + */ + public Event withType(String type) { + this.type = type; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/GitRepoVolume.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/GitRepoVolume.java new file mode 100644 index 0000000000000..f1be753fda70d --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/GitRepoVolume.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a volume that is populated with the contents of a git repository. + */ +public 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 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 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 repository URL. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set 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 commit hash for the specified revision. + * + * @return the revision value + */ + public String revision() { + return this.revision; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ImageRegistryCredential.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ImageRegistryCredential.java new file mode 100644 index 0000000000000..1e81b2c74198c --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ImageRegistryCredential.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Image registry credential. + */ +public 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; + + /** + * Get 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 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 for the private registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set 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 for the private registry. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/IpAddress.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/IpAddress.java new file mode 100644 index 0000000000000..6170ff48bf2d9 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/IpAddress.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP address for the container group. + */ +public 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. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * The IP exposed to the public internet. + */ + @JsonProperty(value = "ip") + private String ip; + + /** + * Creates an instance of IpAddress class. + * @param ports the list of ports exposed on the container group. + */ + public IpAddress() { + type = "Public"; + } + + /** + * Get the list of ports exposed on the container group. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set 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 specifies if the IP is exposed to the public internet. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies if the IP is exposed to the public internet. + * + * @param type the type value to set + * @return the IpAddress object itself. + */ + public IpAddress withType(String type) { + this.type = type; + return this; + } + + /** + * Get the IP exposed to the public internet. + * + * @return the ip value + */ + public String ip() { + return this.ip; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Logs.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Logs.java new file mode 100644 index 0000000000000..e9730d5956f5f --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Logs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.LogsInner; + +/** + * Type representing Logs. + */ +public interface Logs extends HasInner, HasManager { + /** + * @return the content value. + */ + String content(); + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperatingSystemTypes.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperatingSystemTypes.java new file mode 100644 index 0000000000000..dba8fff938824 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperatingSystemTypes.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known OperatingSystemTypes values + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperationDisplay.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperationDisplay.java new file mode 100644 index 0000000000000..77ca1e6d210d3 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information of the operation. + */ +public 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 name of the provider of the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set 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 name of the resource type of the operation. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set 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 friendly name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set 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 of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperationListResult.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperationListResult.java new file mode 100644 index 0000000000000..402297329fdec --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/OperationListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.OperationListResultInner; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.OperationInner; +import java.util.List; + +/** + * Type representing OperationListResult. + */ +public interface OperationListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Operations.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Operations.java new file mode 100644 index 0000000000000..41f811728e421 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Port.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Port.java new file mode 100644 index 0000000000000..7e3bc49f759e4 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Port.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container group. + */ +public class Port { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerGroupNetworkProtocol protocol; + + /** + * The port number. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerGroupNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @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 number. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceLimits.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceLimits.java new file mode 100644 index 0000000000000..19dbde3da9cb3 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceLimits.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource limits. + */ +public 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; + + /** + * Get the memory limit in GB of this container instance. + * + * @return the memoryInGB value + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set 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 limit of this container instance. + * + * @return the cpu value + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceRequests.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceRequests.java new file mode 100644 index 0000000000000..563ef70d54dc1 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceRequests.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requests. + */ +public 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; + + /** + * Get the memory request in GB of this container instance. + * + * @return the memoryInGB value + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set 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 request of this container instance. + * + * @return the cpu value + */ + public double cpu() { + return this.cpu; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceRequirements.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceRequirements.java new file mode 100644 index 0000000000000..885e5b7386f2a --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/ResourceRequirements.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requirements. + */ +public 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 resource requests of this container instance. + * + * @return the requests value + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set 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 resource limits of this container instance. + * + * @return the limits value + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Usage.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Usage.java new file mode 100644 index 0000000000000..9a02b49f6f154 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Usage.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A single usage result. + */ +public class Usage { + /** + * 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 unit of the usage result. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Get the current usage of the resource. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get the maximum permitted usage of the resource. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Get the name object of the resource. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/UsageListResult.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/UsageListResult.java new file mode 100644 index 0000000000000..18256ea734b50 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/UsageListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation.UsageListResultInner; +import java.util.List; + +/** + * Type representing UsageListResult. + */ +public interface UsageListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/UsageName.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/UsageName.java new file mode 100644 index 0000000000000..becea77481c43 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/UsageName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The name object of the resource. + */ +public 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 name of the resource. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get the localized name of the resource. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Volume.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Volume.java new file mode 100644 index 0000000000000..62fe6a234550c --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/Volume.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume. + */ +public 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") + private Map secret; + + /** + * The git repo volume. + */ + @JsonProperty(value = "gitRepo") + private GitRepoVolume gitRepo; + + /** + * Get the name of the volume. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 Azure File volume. + * + * @return the azureFile value + */ + public AzureFileVolume azureFile() { + return this.azureFile; + } + + /** + * Set 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 empty directory volume. + * + * @return the emptyDir value + */ + public Object emptyDir() { + return this.emptyDir; + } + + /** + * Set 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 volume. + * + * @return the secret value + */ + public Map secret() { + return this.secret; + } + + /** + * Set 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 git repo volume. + * + * @return the gitRepo value + */ + public GitRepoVolume gitRepo() { + return this.gitRepo; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/VolumeMount.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/VolumeMount.java new file mode 100644 index 0000000000000..5de6d35ef27e1 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/VolumeMount.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume mount. + */ +public 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 of the volume mount. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 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 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 flag indicating whether the volume mount is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupImpl.java new file mode 100644 index 0000000000000..93051c97a2264 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupImpl.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroup; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Container; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.IpAddress; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Volume; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroupPropertiesInstanceView; + +class ContainerGroupImpl extends GroupableResourceCoreImpl implements ContainerGroup, ContainerGroup.Definition, ContainerGroup.Update { + ContainerGroupImpl(String name, ContainerGroupInner inner, ContainerInstanceManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List containers() { + return this.inner().containers(); + } + + @Override + public List imageRegistryCredentials() { + return this.inner().imageRegistryCredentials(); + } + + @Override + public ContainerGroupPropertiesInstanceView instanceView() { + return this.inner().instanceView(); + } + + @Override + public IpAddress ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public OperatingSystemTypes osType() { + return this.inner().osType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ContainerGroupRestartPolicy restartPolicy() { + return this.inner().restartPolicy(); + } + + @Override + public List volumes() { + return this.inner().volumes(); + } + + @Override + public ContainerGroupImpl withContainers(List containers) { + this.inner().withContainers(containers); + return this; + } + + @Override + public ContainerGroupImpl withOsType(OperatingSystemTypes osType) { + this.inner().withOsType(osType); + return this; + } + + @Override + public ContainerGroupImpl withImageRegistryCredentials(List imageRegistryCredentials) { + this.inner().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + @Override + public ContainerGroupImpl withIpAddress(IpAddress ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public ContainerGroupImpl withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.inner().withRestartPolicy(restartPolicy); + return this; + } + + @Override + public ContainerGroupImpl withVolumes(List volumes) { + this.inner().withVolumes(volumes); + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupInner.java new file mode 100644 index 0000000000000..438a7880bd92f --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupInner.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Container; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.IpAddress; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Volume; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroupPropertiesInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A container group. + */ +@JsonFlatten +public class ContainerGroupInner extends Resource { + /** + * The provisioning state of the container group. This only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The containers within the container group. + */ + @JsonProperty(value = "properties.containers", required = true) + private List containers; + + /** + * The image registry credentials by which the container group is created + * from. + */ + @JsonProperty(value = "properties.imageRegistryCredentials") + private List imageRegistryCredentials; + + /** + * Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + * . Possible values include: 'Always', 'OnFailure', 'Never'. + */ + @JsonProperty(value = "properties.restartPolicy") + private ContainerGroupRestartPolicy restartPolicy; + + /** + * The IP address type of the container group. + */ + @JsonProperty(value = "properties.ipAddress") + private IpAddress ipAddress; + + /** + * The operating system type required by the containers in the container + * group. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.osType", required = true) + private OperatingSystemTypes osType; + + /** + * The list of volumes that can be mounted by containers in this container + * group. + */ + @JsonProperty(value = "properties.volumes") + private List volumes; + + /** + * The instance view of the container group. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerGroupPropertiesInstanceView instanceView; + + /** + * Get 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 within the container group. + * + * @return the containers value + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers within the container group. + * + * @param containers the containers value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the image registry credentials by which the container group is created from. + * + * @return the imageRegistryCredentials value + */ + public List imageRegistryCredentials() { + return this.imageRegistryCredentials; + } + + /** + * Set 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) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * Get restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @return the restartPolicy value + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.restartPolicy; + } + + /** + * Set restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @param restartPolicy the restartPolicy value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.restartPolicy = restartPolicy; + return this; + } + + /** + * Get the IP address type of the container group. + * + * @return the ipAddress value + */ + public IpAddress ipAddress() { + return this.ipAddress; + } + + /** + * Set 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) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get 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 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) { + this.volumes = volumes; + return this; + } + + /** + * Get the instance view of the container group. Only valid in response. + * + * @return the instanceView value + */ + public ContainerGroupPropertiesInstanceView instanceView() { + return this.instanceView; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupUsagesImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupUsagesImpl.java new file mode 100644 index 0000000000000..ef9ec6293c69d --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupUsagesImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroupUsages; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.UsageListResult; + +class ContainerGroupUsagesImpl extends WrapperImpl implements ContainerGroupUsages { + private final ContainerInstanceManager manager; + + ContainerGroupUsagesImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroupUsages()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String location) { + ContainerGroupUsagesInner client = this.inner(); + return client.listAsync(location) + .map(new Func1() { + @Override + public UsageListResult call(UsageListResultInner inner) { + return new UsageListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupUsagesInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupUsagesInner.java new file mode 100644 index 0000000000000..d03080f74cd1b --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupUsagesInner.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroupUsages. + */ +public class ContainerGroupUsagesInner { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupUsagesService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupUsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupUsagesInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupUsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroupUsages to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupUsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroupUsages list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UsageListResultInner object if successful. + */ + public UsageListResultInner list(String location) { + return listWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsageListResultInner object + */ + public Observable listAsync(String location) { + return listWithServiceResponseAsync(location).map(new Func1, UsageListResultInner>() { + @Override + public UsageListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsageListResultInner object + */ + public Observable> listWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupsImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupsImpl.java new file mode 100644 index 0000000000000..dc8dd7f101ad2 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ContainerGroupsImpl extends GroupableResourcesCoreImpl implements ContainerGroups { + protected ContainerGroupsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ContainerGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ContainerGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ContainerGroupImpl wrapModel(ContainerGroupInner inner) { + return new ContainerGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ContainerGroupImpl wrapModel(String name) { + return new ContainerGroupImpl(name, new ContainerGroupInner(), this.manager()); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupsInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupsInner.java new file mode 100644 index 0000000000000..b430a7c73a241 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerGroupsInner.java @@ -0,0 +1,841 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroups. + */ +public class ContainerGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().single().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner delete(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable deleteAsync(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerInstanceManagementClientImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerInstanceManagementClientImpl.java new file mode 100644 index 0000000000000..b318560b84884 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerInstanceManagementClientImpl.java @@ -0,0 +1,238 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerInstanceManagementClientImpl class. + */ +public class ContainerInstanceManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private 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 subscriptionId() { + return this.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 service client itself + */ + public ContainerInstanceManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ContainerGroupsInner object to access its operations. + */ + private ContainerGroupsInner containerGroups; + + /** + * Gets the ContainerGroupsInner object to access its operations. + * @return the ContainerGroupsInner object. + */ + public ContainerGroupsInner containerGroups() { + return this.containerGroups; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The ContainerGroupUsagesInner object to access its operations. + */ + private ContainerGroupUsagesInner containerGroupUsages; + + /** + * Gets the ContainerGroupUsagesInner object to access its operations. + * @return the ContainerGroupUsagesInner object. + */ + public ContainerGroupUsagesInner containerGroupUsages() { + return this.containerGroupUsages; + } + + /** + * The ContainerLogsInner object to access its operations. + */ + private ContainerLogsInner containerLogs; + + /** + * Gets the ContainerLogsInner object to access its operations. + * @return the ContainerLogsInner object. + */ + public ContainerLogsInner containerLogs() { + return this.containerLogs; + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerInstanceManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-12-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.containerGroups = new ContainerGroupsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.containerGroupUsages = new ContainerGroupUsagesInner(restClient().retrofit(), this); + this.containerLogs = new ContainerLogsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ContainerInstanceManagementClient", "2017-12-01-preview"); + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerInstanceManager.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerInstanceManager.java new file mode 100644 index 0000000000000..1c38833e7b541 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerInstanceManager.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Operations; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerGroupUsages; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerLogs; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerInstance resource management. + */ +public final class ContainerInstanceManager extends ManagerCore { + private ContainerGroups containerGroups; + private Operations operations; + private ContainerGroupUsages containerGroupUsages; + private ContainerLogs containerLogs; + /** + * Get a Configurable instance that can be used to create ContainerInstanceManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerInstanceManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerInstanceManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerInstanceManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerInstance management API entry points that work across subscriptions + */ + ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ContainerGroups. + */ + public ContainerGroups containerGroups() { + if (this.containerGroups == null) { + this.containerGroups = new ContainerGroupsImpl(this); + } + return this.containerGroups; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage ContainerGroupUsages. + */ + public ContainerGroupUsages containerGroupUsages() { + if (this.containerGroupUsages == null) { + this.containerGroupUsages = new ContainerGroupUsagesImpl(this); + } + return this.containerGroupUsages; + } + + /** + * @return Entry point to manage ContainerLogs. + */ + public ContainerLogs containerLogs() { + if (this.containerLogs == null) { + this.containerLogs = new ContainerLogsImpl(this); + } + return this.containerLogs; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerInstanceManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerInstanceManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerInstanceManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerLogsImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerLogsImpl.java new file mode 100644 index 0000000000000..5595703022245 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerLogsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerLogs; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Logs; + +class ContainerLogsImpl extends WrapperImpl implements ContainerLogs { + private final ContainerInstanceManager manager; + + ContainerLogsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerLogs()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName) { + ContainerLogsInner client = this.inner(); + return client.listAsync(resourceGroupName, containerGroupName, containerName) + .map(new Func1() { + @Override + public Logs call(LogsInner inner) { + return new LogsImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerLogsInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerLogsInner.java new file mode 100644 index 0000000000000..bab33c386aa7c --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/ContainerLogsInner.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerLogs. + */ +public class ContainerLogsInner { + /** The Retrofit service to perform REST calls. */ + private ContainerLogsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerLogsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerLogsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerLogsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerLogs to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerLogsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerLogs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Query("tail") Integer tail, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerGroupName, String containerName) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerGroupName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer tail = null; + return service.list(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/IdParsingUtils.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..7918041098731 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/LogsImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/LogsImpl.java new file mode 100644 index 0000000000000..05e95b84ddd5d --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/LogsImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Logs; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LogsImpl extends WrapperImpl implements Logs { + private final ContainerInstanceManager manager; + LogsImpl(LogsInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String content() { + return this.inner().content(); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/LogsInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/LogsInner.java new file mode 100644 index 0000000000000..21b2cc1773e9a --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/LogsInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The logs. + */ +public class LogsInner { + /** + * The content of the log. + */ + @JsonProperty(value = "content") + private String content; + + /** + * Get the content of the log. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationInner.java new file mode 100644 index 0000000000000..2c2c6a9cc79db --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationInner.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.OperationDisplay; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.ContainerInstanceOperationsOrigin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An operation for Azure Container Instance service. + */ +public 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 intended executor of the operation. Possible values include: 'User', + * 'System'. + */ + @JsonProperty(value = "origin") + private ContainerInstanceOperationsOrigin origin; + + /** + * Get the name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 information of the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set 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 intended executor of the operation. Possible values include: 'User', 'System'. + * + * @return the origin value + */ + public ContainerInstanceOperationsOrigin origin() { + return this.origin; + } + + /** + * Set the intended executor of the operation. Possible values include: 'User', 'System'. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(ContainerInstanceOperationsOrigin origin) { + this.origin = origin; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationListResultImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationListResultImpl.java new file mode 100644 index 0000000000000..8fcc29ff7e0cf --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.OperationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class OperationListResultImpl extends WrapperImpl implements OperationListResult { + private final ContainerInstanceManager manager; + OperationListResultImpl(OperationListResultInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationListResultInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationListResultInner.java new file mode 100644 index 0000000000000..9bc849288f3a0 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The operation list response that contains all operations for Azure Container + * Instance service. + */ +public class OperationListResultInner { + /** + * 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 list of operations. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of operations. + * + * @param value the value value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URI to fetch the next page of operations. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URI to fetch the next page of operations. + * + * @param nextLink the nextLink value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationsImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..3bdcfeed19025 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.OperationListResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ContainerInstanceManager manager; + + OperationsImpl(ContainerInstanceManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationListResult call(OperationListResultInner inner) { + return new OperationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationsInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..bfa14ef27060b --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Operations list" }) + @GET("providers/Microsoft.ContainerInstance/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationListResultInner object if successful. + */ + public OperationListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListResultInner>() { + @Override + public OperationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/PageImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..7448495be5543 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/UsageListResultImpl.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/UsageListResultImpl.java new file mode 100644 index 0000000000000..6f1eb89e44220 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/UsageListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.UsageListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Usage; + +class UsageListResultImpl extends WrapperImpl implements UsageListResult { + private final ContainerInstanceManager manager; + UsageListResultImpl(UsageListResultInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/UsageListResultInner.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/UsageListResultInner.java new file mode 100644 index 0000000000000..c87bed496da79 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/UsageListResultInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2017_12_01_preview.Usage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response containing the usage data. + */ +public class UsageListResultInner { + /** + * The value property. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/package-info.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..dd9147e92b75a --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview.implementation; diff --git a/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/package-info.java b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/package-info.java new file mode 100644 index 0000000000000..9b501a395fb17 --- /dev/null +++ b/containerinstance/resource-manager/v2017_12_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2017_12_01_preview/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2017_12_01_preview; diff --git a/containerinstance/resource-manager/v2018_02_01_preview/pom.xml b/containerinstance/resource-manager/v2018_02_01_preview/pom.xml new file mode 100644 index 0000000000000..c3b681ddd1f67 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.containerinstance.v2018_02_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-containerinstance + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerInstance Management + This package contains Microsoft ContainerInstance Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/AzureFileVolume.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/AzureFileVolume.java new file mode 100644 index 0000000000000..2936632001bd0 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/AzureFileVolume.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Azure File volume. Azure File shares are mounted as + * volumes. + */ +public 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 name of the Azure File share to be mounted as a volume. + * + * @return the shareName value + */ + public String shareName() { + return this.shareName; + } + + /** + * Set 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 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 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 name of the storage account that contains the Azure File share. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set 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 storage account access key used to access the Azure File share. + * + * @return the storageAccountKey value + */ + public String storageAccountKey() { + return this.storageAccountKey; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Container.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Container.java new file mode 100644 index 0000000000000..80dc8762cd1ae --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Container.java @@ -0,0 +1,217 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A container instance. + */ +@JsonFlatten +public class Container { + /** + * The user-provided name of the container instance. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The name of the image used to create the container instance. + */ + @JsonProperty(value = "properties.image", required = true) + private String image; + + /** + * The commands to execute within the container instance in exec form. + */ + @JsonProperty(value = "properties.command") + private List command; + + /** + * The exposed ports on the container instance. + */ + @JsonProperty(value = "properties.ports") + private List ports; + + /** + * The environment variables to set in the container instance. + */ + @JsonProperty(value = "properties.environmentVariables") + private List environmentVariables; + + /** + * The instance view of the container instance. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerPropertiesInstanceView instanceView; + + /** + * The resource requirements of the container instance. + */ + @JsonProperty(value = "properties.resources", required = true) + private ResourceRequirements resources; + + /** + * The volume mounts available to the container instance. + */ + @JsonProperty(value = "properties.volumeMounts") + private List volumeMounts; + + /** + * Get the user-provided name of the container instance. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 name of the image used to create the container instance. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set 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) { + this.image = image; + return this; + } + + /** + * Get the commands to execute within the container instance in exec form. + * + * @return the command value + */ + public List command() { + return this.command; + } + + /** + * Set 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) { + this.command = command; + return this; + } + + /** + * Get the exposed ports on the container instance. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the exposed ports on the container instance. + * + * @param ports the ports value to set + * @return the Container object itself. + */ + public Container withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the environment variables to set in the container instance. + * + * @return the environmentVariables value + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set 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) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instance view of the container instance. Only valid in response. + * + * @return the instanceView value + */ + public ContainerPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the resource requirements of the container instance. + * + * @return the resources value + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set the resource requirements of the container instance. + * + * @param resources the resources value to set + * @return the Container object itself. + */ + public Container withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volume mounts available to the container instance. + * + * @return the volumeMounts value + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set 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) { + this.volumeMounts = volumeMounts; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecRequest.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecRequest.java new file mode 100644 index 0000000000000..7d492d5daa748 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecRequest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The start container exec request. + */ +public 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 to be executed. + * + * @return the command value + */ + public String command() { + return this.command; + } + + /** + * Set 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 size of the terminal. + * + * @return the terminalSize value + */ + public ContainerExecRequestTerminalSize terminalSize() { + return this.terminalSize; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecRequestTerminalSize.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecRequestTerminalSize.java new file mode 100644 index 0000000000000..95ee4d500d09c --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecRequestTerminalSize.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The size of the terminal. + */ +public 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 row size of the terminal. + * + * @return the rows value + */ + public Integer rows() { + return this.rows; + } + + /** + * Set 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 column size of the terminal. + * + * @return the cols value + */ + public Integer cols() { + return this.cols; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecResponse.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecResponse.java new file mode 100644 index 0000000000000..8a69e351c565e --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerExecResponse.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerExecResponseInner; + +/** + * Type representing ContainerExecResponse. + */ +public interface ContainerExecResponse extends HasInner, HasManager { + /** + * @return the password value. + */ + String password(); + + /** + * @return the webSocketUri value. + */ + String webSocketUri(); + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroup.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroup.java new file mode 100644 index 0000000000000..34e82e1876f53 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroup.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerInstanceManager; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerGroupInner; + +/** + * Type representing ContainerGroup. + */ +public interface ContainerGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the containers value. + */ + List containers(); + + /** + * @return the imageRegistryCredentials value. + */ + List imageRegistryCredentials(); + + /** + * @return the instanceView value. + */ + ContainerGroupPropertiesInstanceView instanceView(); + + /** + * @return the ipAddress value. + */ + IpAddress ipAddress(); + + /** + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the restartPolicy value. + */ + ContainerGroupRestartPolicy restartPolicy(); + + /** + * @return the volumes value. + */ + List volumes(); + + /** + * The entirety of the ContainerGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithContainers, DefinitionStages.WithOsType, DefinitionStages.WithCreate { + } + + /** + * Grouping of ContainerGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ContainerGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ContainerGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the containergroup definition allowing to specify Containers. + */ + interface WithContainers { + /** + * Specifies containers. + */ + WithOsType withContainers(List containers); + } + + /** + * The stage of the containergroup definition allowing to specify OsType. + */ + interface WithOsType { + /** + * Specifies osType. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + + /** + * The stage of the containergroup update allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + WithCreate withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + WithCreate withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup update allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + WithCreate withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup update allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + WithCreate withVolumes(List volumes); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithImageRegistryCredentials, DefinitionStages.WithIpAddress, DefinitionStages.WithRestartPolicy, DefinitionStages.WithVolumes { + } + } + /** + * The template for a ContainerGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of ContainerGroup update stages. + */ + interface UpdateStages { + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupNetworkProtocol.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupNetworkProtocol.java new file mode 100644 index 0000000000000..18cea3a76faaf --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerGroupNetworkProtocol values + */ + public static Collection values() { + return values(ContainerGroupNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupPropertiesInstanceView.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupPropertiesInstanceView.java new file mode 100644 index 0000000000000..f3b72ebb2b69f --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupPropertiesInstanceView.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container group. Only valid in response. + */ +public 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 of this container group. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Get the state of the container group. Only valid in response. + * + * @return the state value + */ + public String state() { + return this.state; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupRestartPolicy.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupRestartPolicy.java new file mode 100644 index 0000000000000..5d6f22d8f6cde --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupRestartPolicy.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerGroupRestartPolicy values + */ + public static Collection values() { + return values(ContainerGroupRestartPolicy.class); + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupUsages.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupUsages.java new file mode 100644 index 0000000000000..48a1932a0714e --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroupUsages.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import rx.Observable; + +/** + * Type representing ContainerGroupUsages. + */ +public interface ContainerGroupUsages { + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String location); + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroups.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroups.java new file mode 100644 index 0000000000000..e935d9b5d0b08 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerGroups. + */ +public interface ContainerGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerInstanceOperationsOrigin.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerInstanceOperationsOrigin.java new file mode 100644 index 0000000000000..c5d79eee2e815 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerInstanceOperationsOrigin.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerInstanceOperationsOrigin values + */ + public static Collection values() { + return values(ContainerInstanceOperationsOrigin.class); + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerLogs.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerLogs.java new file mode 100644 index 0000000000000..5fb5e48566024 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerLogs.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerLogsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerLogs. + */ +public interface ContainerLogs extends HasInner { + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String containerGroupName, String containerName); + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerNetworkProtocol.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerNetworkProtocol.java new file mode 100644 index 0000000000000..8c895d1bb35c4 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerNetworkProtocol values + */ + public static Collection values() { + return values(ContainerNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerPort.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerPort.java new file mode 100644 index 0000000000000..3d931819a9841 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerPort.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container instance. + */ +public class ContainerPort { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @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 associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @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 number exposed within the container group. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerPropertiesInstanceView.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerPropertiesInstanceView.java new file mode 100644 index 0000000000000..97ffa7fb1d28f --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerPropertiesInstanceView.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container instance. Only valid in response. + */ +public 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 number of times that the container instance has been restarted. + * + * @return the restartCount value + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Get current container instance state. + * + * @return the currentState value + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Get previous container instance state. + * + * @return the previousState value + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Get the events of the container instance. + * + * @return the events value + */ + public List events() { + return this.events; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerState.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerState.java new file mode 100644 index 0000000000000..276069080112d --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ContainerState.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container instance state. + */ +public class ContainerState { + /** + * The state of the container instance. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The date-time when the container instance state started. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The container instance exit codes correspond to those from the `docker + * run` command. + */ + @JsonProperty(value = "exitCode") + private Integer exitCode; + + /** + * The date-time when the container instance state finished. + */ + @JsonProperty(value = "finishTime") + private DateTime finishTime; + + /** + * The human-readable status of the container instance state. + */ + @JsonProperty(value = "detailStatus") + private String detailStatus; + + /** + * Get the state of the container instance. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state of the container instance. + * + * @param state the state value to set + * @return the ContainerState object itself. + */ + public ContainerState withState(String state) { + this.state = state; + return this; + } + + /** + * Get the date-time when the container instance state started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the date-time when the container instance state started. + * + * @param startTime the startTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the container instance exit codes correspond to those from the `docker run` command. + * + * @return the exitCode value + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Set the container instance exit codes correspond to those from the `docker run` command. + * + * @param exitCode the exitCode value to set + * @return the ContainerState object itself. + */ + public ContainerState withExitCode(Integer exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get the date-time when the container instance state finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the date-time when the container instance state finished. + * + * @param finishTime the finishTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the human-readable status of the container instance state. + * + * @return the detailStatus value + */ + public String detailStatus() { + return this.detailStatus; + } + + /** + * Set the human-readable status of the container instance state. + * + * @param detailStatus the detailStatus value to set + * @return the ContainerState object itself. + */ + public ContainerState withDetailStatus(String detailStatus) { + this.detailStatus = detailStatus; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/EnvironmentVariable.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/EnvironmentVariable.java new file mode 100644 index 0000000000000..808b5d040752d --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/EnvironmentVariable.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The environment variable to set within the container instance. + */ +public 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", required = true) + private String value; + + /** + * Get the name of the environment variable. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 of the environment variable. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Event.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Event.java new file mode 100644 index 0000000000000..d6d31ac1a8377 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Event.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container group or container instance event. + */ +public class Event { + /** + * The count of the event. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * The date-time of the earliest logged event. + */ + @JsonProperty(value = "firstTimestamp") + private DateTime firstTimestamp; + + /** + * The date-time of the latest logged event. + */ + @JsonProperty(value = "lastTimestamp") + private DateTime lastTimestamp; + + /** + * The event name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The event message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The event type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the count of the event. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the count of the event. + * + * @param count the count value to set + * @return the Event object itself. + */ + public Event withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the date-time of the earliest logged event. + * + * @return the firstTimestamp value + */ + public DateTime firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Set the date-time of the earliest logged event. + * + * @param firstTimestamp the firstTimestamp value to set + * @return the Event object itself. + */ + public Event withFirstTimestamp(DateTime firstTimestamp) { + this.firstTimestamp = firstTimestamp; + return this; + } + + /** + * Get the date-time of the latest logged event. + * + * @return the lastTimestamp value + */ + public DateTime lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Set the date-time of the latest logged event. + * + * @param lastTimestamp the lastTimestamp value to set + * @return the Event object itself. + */ + public Event withLastTimestamp(DateTime lastTimestamp) { + this.lastTimestamp = lastTimestamp; + return this; + } + + /** + * Get the event name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the event name. + * + * @param name the name value to set + * @return the Event object itself. + */ + public Event withName(String name) { + this.name = name; + return this; + } + + /** + * Get the event message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the event message. + * + * @param message the message value to set + * @return the Event object itself. + */ + public Event withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the event type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the event type. + * + * @param type the type value to set + * @return the Event object itself. + */ + public Event withType(String type) { + this.type = type; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/GitRepoVolume.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/GitRepoVolume.java new file mode 100644 index 0000000000000..146e9e9c348dd --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/GitRepoVolume.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a volume that is populated with the contents of a git repository. + */ +public 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 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 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 repository URL. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set 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 commit hash for the specified revision. + * + * @return the revision value + */ + public String revision() { + return this.revision; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ImageRegistryCredential.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ImageRegistryCredential.java new file mode 100644 index 0000000000000..1fcd1544894d1 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ImageRegistryCredential.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Image registry credential. + */ +public 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; + + /** + * Get 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 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 for the private registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set 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 for the private registry. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/IpAddress.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/IpAddress.java new file mode 100644 index 0000000000000..86c7ac1e56486 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/IpAddress.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP address for the container group. + */ +public 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. + */ + @JsonProperty(value = "type", required = true) + private String 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 FQDN for the IP. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /** + * Creates an instance of IpAddress class. + * @param ports the list of ports exposed on the container group. + */ + public IpAddress() { + type = "Public"; + } + + /** + * Get the list of ports exposed on the container group. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set 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 specifies if the IP is exposed to the public internet. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies if the IP is exposed to the public internet. + * + * @param type the type value to set + * @return the IpAddress object itself. + */ + public IpAddress withType(String type) { + this.type = type; + return this; + } + + /** + * Get the IP exposed to the public internet. + * + * @return the ip value + */ + public String ip() { + return this.ip; + } + + /** + * Set 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 Dns name label for the IP. + * + * @return the dnsNameLabel value + */ + public String dnsNameLabel() { + return this.dnsNameLabel; + } + + /** + * Set 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 FQDN for the IP. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Logs.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Logs.java new file mode 100644 index 0000000000000..9724792f3dc1e --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Logs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.LogsInner; + +/** + * Type representing Logs. + */ +public interface Logs extends HasInner, HasManager { + /** + * @return the content value. + */ + String content(); + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperatingSystemTypes.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperatingSystemTypes.java new file mode 100644 index 0000000000000..933f093491354 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperatingSystemTypes.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known OperatingSystemTypes values + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperationDisplay.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperationDisplay.java new file mode 100644 index 0000000000000..30ab8dbb8dcde --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information of the operation. + */ +public 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 name of the provider of the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set 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 name of the resource type of the operation. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set 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 friendly name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set 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 of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperationListResult.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperationListResult.java new file mode 100644 index 0000000000000..b772484ec2e17 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/OperationListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.OperationListResultInner; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.OperationInner; +import java.util.List; + +/** + * Type representing OperationListResult. + */ +public interface OperationListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Operations.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Operations.java new file mode 100644 index 0000000000000..1452ee0f1c65e --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Port.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Port.java new file mode 100644 index 0000000000000..89c3e67f6e466 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Port.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container group. + */ +public class Port { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerGroupNetworkProtocol protocol; + + /** + * The port number. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerGroupNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @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 number. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceLimits.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceLimits.java new file mode 100644 index 0000000000000..e80f0cb9f9c57 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceLimits.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource limits. + */ +public 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; + + /** + * Get the memory limit in GB of this container instance. + * + * @return the memoryInGB value + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set 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 limit of this container instance. + * + * @return the cpu value + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceRequests.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceRequests.java new file mode 100644 index 0000000000000..52fcb7fb89cc4 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceRequests.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requests. + */ +public 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; + + /** + * Get the memory request in GB of this container instance. + * + * @return the memoryInGB value + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set 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 request of this container instance. + * + * @return the cpu value + */ + public double cpu() { + return this.cpu; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceRequirements.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceRequirements.java new file mode 100644 index 0000000000000..2d7e11b6b02a1 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/ResourceRequirements.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requirements. + */ +public 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 resource requests of this container instance. + * + * @return the requests value + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set 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 resource limits of this container instance. + * + * @return the limits value + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/StartContainers.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/StartContainers.java new file mode 100644 index 0000000000000..094363a0afb37 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/StartContainers.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.StartContainersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StartContainers. + */ +public interface StartContainers extends HasInner { + /** + * Starts the exec command for a specific container instance. + * Starts the exec command 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 containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable launchExecAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest); + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Usage.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Usage.java new file mode 100644 index 0000000000000..557bcba76f559 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Usage.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A single usage result. + */ +public class Usage { + /** + * 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 unit of the usage result. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Get the current usage of the resource. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get the maximum permitted usage of the resource. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Get the name object of the resource. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/UsageListResult.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/UsageListResult.java new file mode 100644 index 0000000000000..3017f616a6c1e --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/UsageListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation.UsageListResultInner; +import java.util.List; + +/** + * Type representing UsageListResult. + */ +public interface UsageListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/UsageName.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/UsageName.java new file mode 100644 index 0000000000000..c282c4c8580a7 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/UsageName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The name object of the resource. + */ +public 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 name of the resource. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get the localized name of the resource. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Volume.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Volume.java new file mode 100644 index 0000000000000..8d8eee9cc82aa --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/Volume.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume. + */ +public 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") + private Map secret; + + /** + * The git repo volume. + */ + @JsonProperty(value = "gitRepo") + private GitRepoVolume gitRepo; + + /** + * Get the name of the volume. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 Azure File volume. + * + * @return the azureFile value + */ + public AzureFileVolume azureFile() { + return this.azureFile; + } + + /** + * Set 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 empty directory volume. + * + * @return the emptyDir value + */ + public Object emptyDir() { + return this.emptyDir; + } + + /** + * Set 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 volume. + * + * @return the secret value + */ + public Map secret() { + return this.secret; + } + + /** + * Set 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 git repo volume. + * + * @return the gitRepo value + */ + public GitRepoVolume gitRepo() { + return this.gitRepo; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/VolumeMount.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/VolumeMount.java new file mode 100644 index 0000000000000..4b6b03d661e49 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/VolumeMount.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume mount. + */ +public 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 of the volume mount. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 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 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 flag indicating whether the volume mount is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerExecResponseImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerExecResponseImpl.java new file mode 100644 index 0000000000000..855530c5c1501 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerExecResponseImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerExecResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ContainerExecResponseImpl extends WrapperImpl implements ContainerExecResponse { + private final ContainerInstanceManager manager; + ContainerExecResponseImpl(ContainerExecResponseInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String password() { + return this.inner().password(); + } + + @Override + public String webSocketUri() { + return this.inner().webSocketUri(); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerExecResponseInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerExecResponseInner.java new file mode 100644 index 0000000000000..b87ea1b000058 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerExecResponseInner.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The information for the container exec command. + */ +public 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 uri for the exec websocket. + * + * @return the webSocketUri value + */ + public String webSocketUri() { + return this.webSocketUri; + } + + /** + * Set 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 to start the exec command. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupImpl.java new file mode 100644 index 0000000000000..20a98fb8e6502 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroup; +import rx.Observable; +import com.microsoft.azure.Resource; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Container; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.IpAddress; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Volume; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroupPropertiesInstanceView; +import rx.functions.Func1; + +class ContainerGroupImpl extends GroupableResourceCoreImpl implements ContainerGroup, ContainerGroup.Definition, ContainerGroup.Update { + private Resource updateParameter; + ContainerGroupImpl(String name, ContainerGroupInner inner, ContainerInstanceManager manager) { + super(name, inner, manager); + this.updateParameter = new Resource(); + } + + @Override + public Observable createResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public ContainerGroupInner call(ContainerGroupInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public ContainerGroupInner call(ContainerGroupInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new Resource(); + } + + @Override + public List containers() { + return this.inner().containers(); + } + + @Override + public List imageRegistryCredentials() { + return this.inner().imageRegistryCredentials(); + } + + @Override + public ContainerGroupPropertiesInstanceView instanceView() { + return this.inner().instanceView(); + } + + @Override + public IpAddress ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public OperatingSystemTypes osType() { + return this.inner().osType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ContainerGroupRestartPolicy restartPolicy() { + return this.inner().restartPolicy(); + } + + @Override + public List volumes() { + return this.inner().volumes(); + } + + @Override + public ContainerGroupImpl withContainers(List containers) { + this.inner().withContainers(containers); + return this; + } + + @Override + public ContainerGroupImpl withOsType(OperatingSystemTypes osType) { + this.inner().withOsType(osType); + return this; + } + + @Override + public ContainerGroupImpl withImageRegistryCredentials(List imageRegistryCredentials) { + this.inner().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + @Override + public ContainerGroupImpl withIpAddress(IpAddress ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public ContainerGroupImpl withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.inner().withRestartPolicy(restartPolicy); + return this; + } + + @Override + public ContainerGroupImpl withVolumes(List volumes) { + this.inner().withVolumes(volumes); + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupInner.java new file mode 100644 index 0000000000000..c1f0866e735f0 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupInner.java @@ -0,0 +1,232 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Container; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.IpAddress; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Volume; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroupPropertiesInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A container group. + */ +@JsonFlatten +@SkipParentValidation +public class ContainerGroupInner extends Resource { + /** + * The provisioning state of the container group. This only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The containers within the container group. + */ + @JsonProperty(value = "properties.containers", required = true) + private List containers; + + /** + * The image registry credentials by which the container group is created + * from. + */ + @JsonProperty(value = "properties.imageRegistryCredentials") + private List imageRegistryCredentials; + + /** + * Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + * . Possible values include: 'Always', 'OnFailure', 'Never'. + */ + @JsonProperty(value = "properties.restartPolicy") + private ContainerGroupRestartPolicy restartPolicy; + + /** + * The IP address type of the container group. + */ + @JsonProperty(value = "properties.ipAddress") + private IpAddress ipAddress; + + /** + * The operating system type required by the containers in the container + * group. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.osType", required = true) + private OperatingSystemTypes osType; + + /** + * The list of volumes that can be mounted by containers in this container + * group. + */ + @JsonProperty(value = "properties.volumes") + private List volumes; + + /** + * The instance view of the container group. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerGroupPropertiesInstanceView instanceView; + + /** + * Get 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 within the container group. + * + * @return the containers value + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers within the container group. + * + * @param containers the containers value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the image registry credentials by which the container group is created from. + * + * @return the imageRegistryCredentials value + */ + public List imageRegistryCredentials() { + return this.imageRegistryCredentials; + } + + /** + * Set 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) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * Get restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @return the restartPolicy value + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.restartPolicy; + } + + /** + * Set restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @param restartPolicy the restartPolicy value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.restartPolicy = restartPolicy; + return this; + } + + /** + * Get the IP address type of the container group. + * + * @return the ipAddress value + */ + public IpAddress ipAddress() { + return this.ipAddress; + } + + /** + * Set 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) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get 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 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) { + this.volumes = volumes; + return this; + } + + /** + * Get the instance view of the container group. Only valid in response. + * + * @return the instanceView value + */ + public ContainerGroupPropertiesInstanceView instanceView() { + return this.instanceView; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupUsagesImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupUsagesImpl.java new file mode 100644 index 0000000000000..556033bfbd8d7 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupUsagesImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroupUsages; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.UsageListResult; + +class ContainerGroupUsagesImpl extends WrapperImpl implements ContainerGroupUsages { + private final ContainerInstanceManager manager; + + ContainerGroupUsagesImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroupUsages()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String location) { + ContainerGroupUsagesInner client = this.inner(); + return client.listAsync(location) + .map(new Func1() { + @Override + public UsageListResult call(UsageListResultInner inner) { + return new UsageListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupUsagesInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupUsagesInner.java new file mode 100644 index 0000000000000..e063c9b62e417 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupUsagesInner.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroupUsages. + */ +public class ContainerGroupUsagesInner { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupUsagesService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupUsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupUsagesInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupUsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroupUsages to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupUsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroupUsages list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UsageListResultInner object if successful. + */ + public UsageListResultInner list(String location) { + return listWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsageListResultInner object + */ + public Observable listAsync(String location) { + return listWithServiceResponseAsync(location).map(new Func1, UsageListResultInner>() { + @Override + public UsageListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsageListResultInner object + */ + public Observable> listWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsImpl.java new file mode 100644 index 0000000000000..a2df543c260ff --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ContainerGroupsImpl extends GroupableResourcesCoreImpl implements ContainerGroups { + protected ContainerGroupsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ContainerGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ContainerGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ContainerGroupImpl wrapModel(ContainerGroupInner inner) { + return new ContainerGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ContainerGroupImpl wrapModel(String name) { + return new ContainerGroupImpl(name, new ContainerGroupInner(), this.manager()); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsInner.java new file mode 100644 index 0000000000000..e237d2933b046 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsInner.java @@ -0,0 +1,1030 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Resource; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroups. + */ +public class ContainerGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body Resource resource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().last().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner beginCreateOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().single().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner update(String resourceGroupName, String containerGroupName, Resource resource) { + return updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource).toBlocking().single().body(); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String containerGroupName, Resource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource), serviceCallback); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable updateAsync(String resourceGroupName, String containerGroupName, Resource resource) { + return updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, Resource resource) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + return service.update(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), resource, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner delete(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable deleteAsync(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerInstanceManagementClientImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerInstanceManagementClientImpl.java new file mode 100644 index 0000000000000..763b6bcf859a3 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerInstanceManagementClientImpl.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerInstanceManagementClientImpl class. + */ +public class ContainerInstanceManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private 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 subscriptionId() { + return this.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 service client itself + */ + public ContainerInstanceManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ContainerGroupsInner object to access its operations. + */ + private ContainerGroupsInner containerGroups; + + /** + * Gets the ContainerGroupsInner object to access its operations. + * @return the ContainerGroupsInner object. + */ + public ContainerGroupsInner containerGroups() { + return this.containerGroups; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The ContainerGroupUsagesInner object to access its operations. + */ + private ContainerGroupUsagesInner containerGroupUsages; + + /** + * Gets the ContainerGroupUsagesInner object to access its operations. + * @return the ContainerGroupUsagesInner object. + */ + public ContainerGroupUsagesInner containerGroupUsages() { + return this.containerGroupUsages; + } + + /** + * The ContainerLogsInner object to access its operations. + */ + private ContainerLogsInner containerLogs; + + /** + * Gets the ContainerLogsInner object to access its operations. + * @return the ContainerLogsInner object. + */ + public ContainerLogsInner containerLogs() { + return this.containerLogs; + } + + /** + * The StartContainersInner object to access its operations. + */ + private StartContainersInner startContainers; + + /** + * Gets the StartContainersInner object to access its operations. + * @return the StartContainersInner object. + */ + public StartContainersInner startContainers() { + return this.startContainers; + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerInstanceManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-02-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.containerGroups = new ContainerGroupsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.containerGroupUsages = new ContainerGroupUsagesInner(restClient().retrofit(), this); + this.containerLogs = new ContainerLogsInner(restClient().retrofit(), this); + this.startContainers = new StartContainersInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ContainerInstanceManagementClient", "2018-02-01-preview"); + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerInstanceManager.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerInstanceManager.java new file mode 100644 index 0000000000000..bdeda181d8b90 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerInstanceManager.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Operations; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerGroupUsages; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerLogs; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.StartContainers; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerInstance resource management. + */ +public final class ContainerInstanceManager extends ManagerCore { + private ContainerGroups containerGroups; + private Operations operations; + private ContainerGroupUsages containerGroupUsages; + private ContainerLogs containerLogs; + private StartContainers startContainers; + /** + * Get a Configurable instance that can be used to create ContainerInstanceManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerInstanceManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerInstanceManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerInstanceManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerInstance management API entry points that work across subscriptions + */ + ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ContainerGroups. + */ + public ContainerGroups containerGroups() { + if (this.containerGroups == null) { + this.containerGroups = new ContainerGroupsImpl(this); + } + return this.containerGroups; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage ContainerGroupUsages. + */ + public ContainerGroupUsages containerGroupUsages() { + if (this.containerGroupUsages == null) { + this.containerGroupUsages = new ContainerGroupUsagesImpl(this); + } + return this.containerGroupUsages; + } + + /** + * @return Entry point to manage ContainerLogs. + */ + public ContainerLogs containerLogs() { + if (this.containerLogs == null) { + this.containerLogs = new ContainerLogsImpl(this); + } + return this.containerLogs; + } + + /** + * @return Entry point to manage StartContainers. + */ + public StartContainers startContainers() { + if (this.startContainers == null) { + this.startContainers = new StartContainersImpl(this); + } + return this.startContainers; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerInstanceManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerInstanceManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerInstanceManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerLogsImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerLogsImpl.java new file mode 100644 index 0000000000000..c42273c29dd29 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerLogsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerLogs; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Logs; + +class ContainerLogsImpl extends WrapperImpl implements ContainerLogs { + private final ContainerInstanceManager manager; + + ContainerLogsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerLogs()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName) { + ContainerLogsInner client = this.inner(); + return client.listAsync(resourceGroupName, containerGroupName, containerName) + .map(new Func1() { + @Override + public Logs call(LogsInner inner) { + return new LogsImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerLogsInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerLogsInner.java new file mode 100644 index 0000000000000..847d88938442b --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerLogsInner.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerLogs. + */ +public class ContainerLogsInner { + /** The Retrofit service to perform REST calls. */ + private ContainerLogsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerLogsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerLogsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerLogsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerLogs to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerLogsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerLogs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Query("tail") Integer tail, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerGroupName, String containerName) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerGroupName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer tail = null; + return service.list(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/IdParsingUtils.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..919cec8008e01 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/LogsImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/LogsImpl.java new file mode 100644 index 0000000000000..f5035b3b45ac3 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/LogsImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Logs; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LogsImpl extends WrapperImpl implements Logs { + private final ContainerInstanceManager manager; + LogsImpl(LogsInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String content() { + return this.inner().content(); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/LogsInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/LogsInner.java new file mode 100644 index 0000000000000..4af48a1272f5f --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/LogsInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The logs. + */ +public class LogsInner { + /** + * The content of the log. + */ + @JsonProperty(value = "content") + private String content; + + /** + * Get the content of the log. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationInner.java new file mode 100644 index 0000000000000..416e3951f3747 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationInner.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.OperationDisplay; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerInstanceOperationsOrigin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An operation for Azure Container Instance service. + */ +public 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 intended executor of the operation. Possible values include: 'User', + * 'System'. + */ + @JsonProperty(value = "origin") + private ContainerInstanceOperationsOrigin origin; + + /** + * Get the name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 information of the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set 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 intended executor of the operation. Possible values include: 'User', 'System'. + * + * @return the origin value + */ + public ContainerInstanceOperationsOrigin origin() { + return this.origin; + } + + /** + * Set the intended executor of the operation. Possible values include: 'User', 'System'. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(ContainerInstanceOperationsOrigin origin) { + this.origin = origin; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationListResultImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationListResultImpl.java new file mode 100644 index 0000000000000..a6ec70c32ce80 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.OperationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class OperationListResultImpl extends WrapperImpl implements OperationListResult { + private final ContainerInstanceManager manager; + OperationListResultImpl(OperationListResultInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationListResultInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationListResultInner.java new file mode 100644 index 0000000000000..5c741fbbf9a1c --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The operation list response that contains all operations for Azure Container + * Instance service. + */ +public class OperationListResultInner { + /** + * 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 list of operations. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of operations. + * + * @param value the value value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URI to fetch the next page of operations. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URI to fetch the next page of operations. + * + * @param nextLink the nextLink value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationsImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..f332a863857cc --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.OperationListResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ContainerInstanceManager manager; + + OperationsImpl(ContainerInstanceManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationListResult call(OperationListResultInner inner) { + return new OperationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationsInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..14d4494425dfc --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Operations list" }) + @GET("providers/Microsoft.ContainerInstance/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationListResultInner object if successful. + */ + public OperationListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListResultInner>() { + @Override + public OperationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/PageImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..ac273a371349f --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/StartContainersImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/StartContainersImpl.java new file mode 100644 index 0000000000000..ab1ef9a847280 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/StartContainersImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.StartContainers; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerExecResponse; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerExecRequest; + +class StartContainersImpl extends WrapperImpl implements StartContainers { + private final ContainerInstanceManager manager; + + StartContainersImpl(ContainerInstanceManager manager) { + super(manager.inner().startContainers()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable launchExecAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + StartContainersInner client = this.inner(); + return client.launchExecAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest) + .map(new Func1() { + @Override + public ContainerExecResponse call(ContainerExecResponseInner inner) { + return new ContainerExecResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/StartContainersInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/StartContainersInner.java new file mode 100644 index 0000000000000..df1aec7289009 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/StartContainersInner.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.ContainerExecRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StartContainers. + */ +public class StartContainersInner { + /** The Retrofit service to perform REST calls. */ + private StartContainersService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of StartContainersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StartContainersInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(StartContainersService.class); + this.client = client; + } + + /** + * The interface defining all the services for StartContainers to be + * used by Retrofit to perform actually REST calls. + */ + interface StartContainersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_02_01_preview.StartContainers launchExec" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec") + Observable> launchExec(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Body ContainerExecRequest containerExecRequest, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Starts the exec command for a specific container instance. + * Starts the exec command 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 containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerExecResponseInner object if successful. + */ + public ContainerExecResponseInner launchExec(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + return launchExecWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).toBlocking().single().body(); + } + + /** + * Starts the exec command for a specific container instance. + * Starts the exec command 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 containerExecRequest The request for the exec command. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture launchExecAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(launchExecWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest), serviceCallback); + } + + /** + * Starts the exec command for a specific container instance. + * Starts the exec command 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 containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerExecResponseInner object + */ + public Observable launchExecAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + return launchExecWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).map(new Func1, ContainerExecResponseInner>() { + @Override + public ContainerExecResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the exec command for a specific container instance. + * Starts the exec command 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 containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerExecResponseInner object + */ + public Observable> launchExecWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerExecRequest == null) { + throw new IllegalArgumentException("Parameter containerExecRequest is required and cannot be null."); + } + Validator.validate(containerExecRequest); + return service.launchExec(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), containerExecRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = launchExecDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse launchExecDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/UsageListResultImpl.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/UsageListResultImpl.java new file mode 100644 index 0000000000000..f494e9fba76ad --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/UsageListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.UsageListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Usage; + +class UsageListResultImpl extends WrapperImpl implements UsageListResult { + private final ContainerInstanceManager manager; + UsageListResultImpl(UsageListResultInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/UsageListResultInner.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/UsageListResultInner.java new file mode 100644 index 0000000000000..c4743ffe3cd27 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/UsageListResultInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_02_01_preview.Usage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response containing the usage data. + */ +public class UsageListResultInner { + /** + * The value property. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/package-info.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..213866d12dd65 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview.implementation; diff --git a/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/package-info.java b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/package-info.java new file mode 100644 index 0000000000000..6721143ad8552 --- /dev/null +++ b/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2018_02_01_preview; diff --git a/containerinstance/resource-manager/v2018_04_01/pom.xml b/containerinstance/resource-manager/v2018_04_01/pom.xml new file mode 100644 index 0000000000000..7d045270bd3e1 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.containerinstance.v2018_04_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-containerinstance + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerInstance Management + This package contains Microsoft ContainerInstance Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/AzureFileVolume.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/AzureFileVolume.java new file mode 100644 index 0000000000000..9a9f787101727 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/AzureFileVolume.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Azure File volume. Azure File shares are mounted as + * volumes. + */ +public 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 name of the Azure File share to be mounted as a volume. + * + * @return the shareName value + */ + public String shareName() { + return this.shareName; + } + + /** + * Set 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 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 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 name of the storage account that contains the Azure File share. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set 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 storage account access key used to access the Azure File share. + * + * @return the storageAccountKey value + */ + public String storageAccountKey() { + return this.storageAccountKey; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Container.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Container.java new file mode 100644 index 0000000000000..1cc8423871088 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Container.java @@ -0,0 +1,217 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A container instance. + */ +@JsonFlatten +public class Container { + /** + * The user-provided name of the container instance. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The name of the image used to create the container instance. + */ + @JsonProperty(value = "properties.image", required = true) + private String image; + + /** + * The commands to execute within the container instance in exec form. + */ + @JsonProperty(value = "properties.command") + private List command; + + /** + * The exposed ports on the container instance. + */ + @JsonProperty(value = "properties.ports") + private List ports; + + /** + * The environment variables to set in the container instance. + */ + @JsonProperty(value = "properties.environmentVariables") + private List environmentVariables; + + /** + * The instance view of the container instance. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerPropertiesInstanceView instanceView; + + /** + * The resource requirements of the container instance. + */ + @JsonProperty(value = "properties.resources", required = true) + private ResourceRequirements resources; + + /** + * The volume mounts available to the container instance. + */ + @JsonProperty(value = "properties.volumeMounts") + private List volumeMounts; + + /** + * Get the user-provided name of the container instance. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 name of the image used to create the container instance. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set 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) { + this.image = image; + return this; + } + + /** + * Get the commands to execute within the container instance in exec form. + * + * @return the command value + */ + public List command() { + return this.command; + } + + /** + * Set 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) { + this.command = command; + return this; + } + + /** + * Get the exposed ports on the container instance. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the exposed ports on the container instance. + * + * @param ports the ports value to set + * @return the Container object itself. + */ + public Container withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the environment variables to set in the container instance. + * + * @return the environmentVariables value + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set 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) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instance view of the container instance. Only valid in response. + * + * @return the instanceView value + */ + public ContainerPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the resource requirements of the container instance. + * + * @return the resources value + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set the resource requirements of the container instance. + * + * @param resources the resources value to set + * @return the Container object itself. + */ + public Container withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volume mounts available to the container instance. + * + * @return the volumeMounts value + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set 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) { + this.volumeMounts = volumeMounts; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecRequest.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecRequest.java new file mode 100644 index 0000000000000..8deba7acc53f9 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecRequest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The start container exec request. + */ +public 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 to be executed. + * + * @return the command value + */ + public String command() { + return this.command; + } + + /** + * Set 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 size of the terminal. + * + * @return the terminalSize value + */ + public ContainerExecRequestTerminalSize terminalSize() { + return this.terminalSize; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecRequestTerminalSize.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecRequestTerminalSize.java new file mode 100644 index 0000000000000..5530364a37126 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecRequestTerminalSize.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The size of the terminal. + */ +public class ContainerExecRequestTerminalSize { + /** + * The row size of the terminal. + */ + @JsonProperty(value = "row") + private Integer row; + + /** + * The column size of the terminal. + */ + @JsonProperty(value = "column") + private Integer column; + + /** + * Get the row size of the terminal. + * + * @return the row value + */ + public Integer row() { + return this.row; + } + + /** + * Set the row size of the terminal. + * + * @param row the row value to set + * @return the ContainerExecRequestTerminalSize object itself. + */ + public ContainerExecRequestTerminalSize withRow(Integer row) { + this.row = row; + return this; + } + + /** + * Get the column size of the terminal. + * + * @return the column value + */ + public Integer column() { + return this.column; + } + + /** + * Set the column size of the terminal. + * + * @param column the column value to set + * @return the ContainerExecRequestTerminalSize object itself. + */ + public ContainerExecRequestTerminalSize withColumn(Integer column) { + this.column = column; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecResponse.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecResponse.java new file mode 100644 index 0000000000000..471efd2d1910c --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerExecResponse.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerExecResponseInner; + +/** + * Type representing ContainerExecResponse. + */ +public interface ContainerExecResponse extends HasInner, HasManager { + /** + * @return the password value. + */ + String password(); + + /** + * @return the webSocketUri value. + */ + String webSocketUri(); + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroup.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroup.java new file mode 100644 index 0000000000000..5ce75ed879f70 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroup.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerInstanceManager; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerGroupInner; + +/** + * Type representing ContainerGroup. + */ +public interface ContainerGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the containers value. + */ + List containers(); + + /** + * @return the imageRegistryCredentials value. + */ + List imageRegistryCredentials(); + + /** + * @return the instanceView value. + */ + ContainerGroupPropertiesInstanceView instanceView(); + + /** + * @return the ipAddress value. + */ + IpAddress ipAddress(); + + /** + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the restartPolicy value. + */ + ContainerGroupRestartPolicy restartPolicy(); + + /** + * @return the volumes value. + */ + List volumes(); + + /** + * The entirety of the ContainerGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithContainers, DefinitionStages.WithOsType, DefinitionStages.WithCreate { + } + + /** + * Grouping of ContainerGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ContainerGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ContainerGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the containergroup definition allowing to specify Containers. + */ + interface WithContainers { + /** + * Specifies containers. + */ + WithOsType withContainers(List containers); + } + + /** + * The stage of the containergroup definition allowing to specify OsType. + */ + interface WithOsType { + /** + * Specifies osType. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + + /** + * The stage of the containergroup update allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + */ + WithCreate withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + WithCreate withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup update allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + */ + WithCreate withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup update allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + */ + WithCreate withVolumes(List volumes); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithImageRegistryCredentials, DefinitionStages.WithIpAddress, DefinitionStages.WithRestartPolicy, DefinitionStages.WithVolumes { + } + } + /** + * The template for a ContainerGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of ContainerGroup update stages. + */ + interface UpdateStages { + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupNetworkProtocol.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupNetworkProtocol.java new file mode 100644 index 0000000000000..f6e7686ed7ad2 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerGroupNetworkProtocol values + */ + public static Collection values() { + return values(ContainerGroupNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupPropertiesInstanceView.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupPropertiesInstanceView.java new file mode 100644 index 0000000000000..e32bfe7d63221 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupPropertiesInstanceView.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container group. Only valid in response. + */ +public 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 of this container group. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Get the state of the container group. Only valid in response. + * + * @return the state value + */ + public String state() { + return this.state; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupRestartPolicy.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupRestartPolicy.java new file mode 100644 index 0000000000000..8fc04367010f3 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupRestartPolicy.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerGroupRestartPolicy values + */ + public static Collection values() { + return values(ContainerGroupRestartPolicy.class); + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupUsages.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupUsages.java new file mode 100644 index 0000000000000..19c1898083516 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroupUsages.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import rx.Observable; + +/** + * Type representing ContainerGroupUsages. + */ +public interface ContainerGroupUsages { + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String location); + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroups.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroups.java new file mode 100644 index 0000000000000..b88818c3a2d43 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerGroups. + */ +public interface ContainerGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerInstanceOperationsOrigin.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerInstanceOperationsOrigin.java new file mode 100644 index 0000000000000..dc51f087df09b --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerInstanceOperationsOrigin.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerInstanceOperationsOrigin values + */ + public static Collection values() { + return values(ContainerInstanceOperationsOrigin.class); + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerLogs.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerLogs.java new file mode 100644 index 0000000000000..ad8f81d7907de --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerLogs.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerLogsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerLogs. + */ +public interface ContainerLogs extends HasInner { + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String containerGroupName, String containerName); + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerNetworkProtocol.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerNetworkProtocol.java new file mode 100644 index 0000000000000..82c4870b0674e --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerNetworkProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known ContainerNetworkProtocol values + */ + public static Collection values() { + return values(ContainerNetworkProtocol.class); + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerPort.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerPort.java new file mode 100644 index 0000000000000..005134aa5561f --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerPort.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container instance. + */ +public class ContainerPort { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @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 associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @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 number exposed within the container group. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerPropertiesInstanceView.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerPropertiesInstanceView.java new file mode 100644 index 0000000000000..408d13a0b28b4 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerPropertiesInstanceView.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container instance. Only valid in response. + */ +public 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 number of times that the container instance has been restarted. + * + * @return the restartCount value + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Get current container instance state. + * + * @return the currentState value + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Get previous container instance state. + * + * @return the previousState value + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Get the events of the container instance. + * + * @return the events value + */ + public List events() { + return this.events; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerState.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerState.java new file mode 100644 index 0000000000000..3e68e0d40760f --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ContainerState.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container instance state. + */ +public 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 DateTime 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 DateTime finishTime; + + /** + * The human-readable status of the container instance state. + */ + @JsonProperty(value = "detailStatus", access = JsonProperty.Access.WRITE_ONLY) + private String detailStatus; + + /** + * Get the state of the container instance. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Get the date-time when the container instance state started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Get 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 date-time when the container instance state finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Get the human-readable status of the container instance state. + * + * @return the detailStatus value + */ + public String detailStatus() { + return this.detailStatus; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/EnvironmentVariable.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/EnvironmentVariable.java new file mode 100644 index 0000000000000..99d5fb0fe3526 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/EnvironmentVariable.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The environment variable to set within the container instance. + */ +public 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", required = true) + private String value; + + /** + * Get the name of the environment variable. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 of the environment variable. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Event.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Event.java new file mode 100644 index 0000000000000..94ebd82e22788 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Event.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container group or container instance event. + */ +public 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 DateTime firstTimestamp; + + /** + * The date-time of the latest logged event. + */ + @JsonProperty(value = "lastTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime 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 of the event. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Get the date-time of the earliest logged event. + * + * @return the firstTimestamp value + */ + public DateTime firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Get the date-time of the latest logged event. + * + * @return the lastTimestamp value + */ + public DateTime lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Get the event name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the event message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the event type. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/GitRepoVolume.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/GitRepoVolume.java new file mode 100644 index 0000000000000..39ff72c45df68 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/GitRepoVolume.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a volume that is populated with the contents of a git repository. + */ +public 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 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 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 repository URL. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set 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 commit hash for the specified revision. + * + * @return the revision value + */ + public String revision() { + return this.revision; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ImageRegistryCredential.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ImageRegistryCredential.java new file mode 100644 index 0000000000000..d0303a91e1425 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ImageRegistryCredential.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Image registry credential. + */ +public 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; + + /** + * Get 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 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 for the private registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set 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 for the private registry. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/IpAddress.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/IpAddress.java new file mode 100644 index 0000000000000..ee3047e0723d6 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/IpAddress.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP address for the container group. + */ +public 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. + */ + @JsonProperty(value = "type", required = true) + private String 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 FQDN for the IP. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /** + * Creates an instance of IpAddress class. + * @param ports the list of ports exposed on the container group. + */ + public IpAddress() { + type = "Public"; + } + + /** + * Get the list of ports exposed on the container group. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set 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 specifies if the IP is exposed to the public internet. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies if the IP is exposed to the public internet. + * + * @param type the type value to set + * @return the IpAddress object itself. + */ + public IpAddress withType(String type) { + this.type = type; + return this; + } + + /** + * Get the IP exposed to the public internet. + * + * @return the ip value + */ + public String ip() { + return this.ip; + } + + /** + * Set 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 Dns name label for the IP. + * + * @return the dnsNameLabel value + */ + public String dnsNameLabel() { + return this.dnsNameLabel; + } + + /** + * Set 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 FQDN for the IP. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Logs.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Logs.java new file mode 100644 index 0000000000000..2e0e564b4f34b --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Logs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.LogsInner; + +/** + * Type representing Logs. + */ +public interface Logs extends HasInner, HasManager { + /** + * @return the content value. + */ + String content(); + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperatingSystemTypes.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperatingSystemTypes.java new file mode 100644 index 0000000000000..4f8ecfa4c0cc5 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperatingSystemTypes.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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); + } + + /** + * @return known OperatingSystemTypes values + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperationDisplay.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperationDisplay.java new file mode 100644 index 0000000000000..a2b490576449a --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperationDisplay.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information of the operation. + */ +public class OperationDisplay { + /** + * The name of the provider of the operation. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * The name of the resource type of the operation. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * The friendly name of the operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * The description of the operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the name of the provider of the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get the name of the resource type of the operation. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get the friendly name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get the description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperationListResult.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperationListResult.java new file mode 100644 index 0000000000000..dcf10259ad4a9 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/OperationListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.OperationListResultInner; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.OperationInner; +import java.util.List; + +/** + * Type representing OperationListResult. + */ +public interface OperationListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Operations.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Operations.java new file mode 100644 index 0000000000000..9b9956a567d6d --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Port.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Port.java new file mode 100644 index 0000000000000..9cd513eda6169 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Port.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container group. + */ +public class Port { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerGroupNetworkProtocol protocol; + + /** + * The port number. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerGroupNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @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 number. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceLimits.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceLimits.java new file mode 100644 index 0000000000000..5bf7aa0971631 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceLimits.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource limits. + */ +public 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; + + /** + * Get the memory limit in GB of this container instance. + * + * @return the memoryInGB value + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set 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 limit of this container instance. + * + * @return the cpu value + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceRequests.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceRequests.java new file mode 100644 index 0000000000000..4e78f46ba6e33 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceRequests.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requests. + */ +public 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; + + /** + * Get the memory request in GB of this container instance. + * + * @return the memoryInGB value + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set 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 request of this container instance. + * + * @return the cpu value + */ + public double cpu() { + return this.cpu; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceRequirements.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceRequirements.java new file mode 100644 index 0000000000000..8999ae0ae6365 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/ResourceRequirements.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requirements. + */ +public 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 resource requests of this container instance. + * + * @return the requests value + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set 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 resource limits of this container instance. + * + * @return the limits value + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/StartContainers.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/StartContainers.java new file mode 100644 index 0000000000000..bd0aa6b94fcce --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/StartContainers.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.StartContainersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StartContainers. + */ +public interface StartContainers extends HasInner { + /** + * Starts the exec command for a specific container instance. + * Starts the exec command 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 containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable launchExecAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest); + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Usage.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Usage.java new file mode 100644 index 0000000000000..f2cb9fce43d00 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Usage.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A single usage result. + */ +public class Usage { + /** + * 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 unit of the usage result. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Get the current usage of the resource. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get the maximum permitted usage of the resource. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Get the name object of the resource. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/UsageListResult.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/UsageListResult.java new file mode 100644 index 0000000000000..c45c4c41143e0 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/UsageListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2018_04_01.implementation.UsageListResultInner; +import java.util.List; + +/** + * Type representing UsageListResult. + */ +public interface UsageListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/UsageName.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/UsageName.java new file mode 100644 index 0000000000000..568c36699efaf --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/UsageName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The name object of the resource. + */ +public 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 name of the resource. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get the localized name of the resource. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Volume.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Volume.java new file mode 100644 index 0000000000000..7982d7654851b --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/Volume.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume. + */ +public 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") + private Map secret; + + /** + * The git repo volume. + */ + @JsonProperty(value = "gitRepo") + private GitRepoVolume gitRepo; + + /** + * Get the name of the volume. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 Azure File volume. + * + * @return the azureFile value + */ + public AzureFileVolume azureFile() { + return this.azureFile; + } + + /** + * Set 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 empty directory volume. + * + * @return the emptyDir value + */ + public Object emptyDir() { + return this.emptyDir; + } + + /** + * Set 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 volume. + * + * @return the secret value + */ + public Map secret() { + return this.secret; + } + + /** + * Set 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 git repo volume. + * + * @return the gitRepo value + */ + public GitRepoVolume gitRepo() { + return this.gitRepo; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/VolumeMount.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/VolumeMount.java new file mode 100644 index 0000000000000..6f92c21214f68 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/VolumeMount.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume mount. + */ +public 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 of the volume mount. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 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 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 flag indicating whether the volume mount is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set 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; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerExecResponseImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerExecResponseImpl.java new file mode 100644 index 0000000000000..5e18b6787896f --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerExecResponseImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerExecResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ContainerExecResponseImpl extends WrapperImpl implements ContainerExecResponse { + private final ContainerInstanceManager manager; + ContainerExecResponseImpl(ContainerExecResponseInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String password() { + return this.inner().password(); + } + + @Override + public String webSocketUri() { + return this.inner().webSocketUri(); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerExecResponseInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerExecResponseInner.java new file mode 100644 index 0000000000000..40ea2cab935a5 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerExecResponseInner.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The information for the container exec command. + */ +public class ContainerExecResponseInner { + /** + * The uri for the exec websocket. + */ + @JsonProperty(value = "webSocketUri", access = JsonProperty.Access.WRITE_ONLY) + private String webSocketUri; + + /** + * The password to start the exec command. + */ + @JsonProperty(value = "password", access = JsonProperty.Access.WRITE_ONLY) + private String password; + + /** + * Get the uri for the exec websocket. + * + * @return the webSocketUri value + */ + public String webSocketUri() { + return this.webSocketUri; + } + + /** + * Get the password to start the exec command. + * + * @return the password value + */ + public String password() { + return this.password; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupImpl.java new file mode 100644 index 0000000000000..652fab22e1b5f --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroup; +import rx.Observable; +import com.microsoft.azure.Resource; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Container; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2018_04_01.IpAddress; +import com.microsoft.azure.management.containerinstance.v2018_04_01.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Volume; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroupPropertiesInstanceView; +import rx.functions.Func1; + +class ContainerGroupImpl extends GroupableResourceCoreImpl implements ContainerGroup, ContainerGroup.Definition, ContainerGroup.Update { + private Resource updateParameter; + ContainerGroupImpl(String name, ContainerGroupInner inner, ContainerInstanceManager manager) { + super(name, inner, manager); + this.updateParameter = new Resource(); + } + + @Override + public Observable createResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public ContainerGroupInner call(ContainerGroupInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public ContainerGroupInner call(ContainerGroupInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new Resource(); + } + + @Override + public List containers() { + return this.inner().containers(); + } + + @Override + public List imageRegistryCredentials() { + return this.inner().imageRegistryCredentials(); + } + + @Override + public ContainerGroupPropertiesInstanceView instanceView() { + return this.inner().instanceView(); + } + + @Override + public IpAddress ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public OperatingSystemTypes osType() { + return this.inner().osType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ContainerGroupRestartPolicy restartPolicy() { + return this.inner().restartPolicy(); + } + + @Override + public List volumes() { + return this.inner().volumes(); + } + + @Override + public ContainerGroupImpl withContainers(List containers) { + this.inner().withContainers(containers); + return this; + } + + @Override + public ContainerGroupImpl withOsType(OperatingSystemTypes osType) { + this.inner().withOsType(osType); + return this; + } + + @Override + public ContainerGroupImpl withImageRegistryCredentials(List imageRegistryCredentials) { + this.inner().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + @Override + public ContainerGroupImpl withIpAddress(IpAddress ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public ContainerGroupImpl withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.inner().withRestartPolicy(restartPolicy); + return this; + } + + @Override + public ContainerGroupImpl withVolumes(List volumes) { + this.inner().withVolumes(volumes); + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupInner.java new file mode 100644 index 0000000000000..606cf23748639 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupInner.java @@ -0,0 +1,232 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Container; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2018_04_01.IpAddress; +import com.microsoft.azure.management.containerinstance.v2018_04_01.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Volume; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroupPropertiesInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A container group. + */ +@JsonFlatten +@SkipParentValidation +public class ContainerGroupInner extends Resource { + /** + * The provisioning state of the container group. This only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The containers within the container group. + */ + @JsonProperty(value = "properties.containers", required = true) + private List containers; + + /** + * The image registry credentials by which the container group is created + * from. + */ + @JsonProperty(value = "properties.imageRegistryCredentials") + private List imageRegistryCredentials; + + /** + * Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + * . Possible values include: 'Always', 'OnFailure', 'Never'. + */ + @JsonProperty(value = "properties.restartPolicy") + private ContainerGroupRestartPolicy restartPolicy; + + /** + * The IP address type of the container group. + */ + @JsonProperty(value = "properties.ipAddress") + private IpAddress ipAddress; + + /** + * The operating system type required by the containers in the container + * group. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.osType", required = true) + private OperatingSystemTypes osType; + + /** + * The list of volumes that can be mounted by containers in this container + * group. + */ + @JsonProperty(value = "properties.volumes") + private List volumes; + + /** + * The instance view of the container group. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerGroupPropertiesInstanceView instanceView; + + /** + * Get 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 within the container group. + * + * @return the containers value + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers within the container group. + * + * @param containers the containers value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the image registry credentials by which the container group is created from. + * + * @return the imageRegistryCredentials value + */ + public List imageRegistryCredentials() { + return this.imageRegistryCredentials; + } + + /** + * Set 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) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * Get restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @return the restartPolicy value + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.restartPolicy; + } + + /** + * Set restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @param restartPolicy the restartPolicy value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.restartPolicy = restartPolicy; + return this; + } + + /** + * Get the IP address type of the container group. + * + * @return the ipAddress value + */ + public IpAddress ipAddress() { + return this.ipAddress; + } + + /** + * Set 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) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get 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 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) { + this.volumes = volumes; + return this; + } + + /** + * Get the instance view of the container group. Only valid in response. + * + * @return the instanceView value + */ + public ContainerGroupPropertiesInstanceView instanceView() { + return this.instanceView; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupUsagesImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupUsagesImpl.java new file mode 100644 index 0000000000000..4589c804d84a8 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupUsagesImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroupUsages; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_04_01.UsageListResult; + +class ContainerGroupUsagesImpl extends WrapperImpl implements ContainerGroupUsages { + private final ContainerInstanceManager manager; + + ContainerGroupUsagesImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroupUsages()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String location) { + ContainerGroupUsagesInner client = this.inner(); + return client.listAsync(location) + .map(new Func1() { + @Override + public UsageListResult call(UsageListResultInner inner) { + return new UsageListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupUsagesInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupUsagesInner.java new file mode 100644 index 0000000000000..24f7ff11b629d --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupUsagesInner.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroupUsages. + */ +public class ContainerGroupUsagesInner { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupUsagesService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupUsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupUsagesInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupUsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroupUsages to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupUsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroupUsages list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UsageListResultInner object if successful. + */ + public UsageListResultInner list(String location) { + return listWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsageListResultInner object + */ + public Observable listAsync(String location) { + return listWithServiceResponseAsync(location).map(new Func1, UsageListResultInner>() { + @Override + public UsageListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsageListResultInner object + */ + public Observable> listWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupsImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupsImpl.java new file mode 100644 index 0000000000000..eb1b5ccb4dc5a --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ContainerGroupsImpl extends GroupableResourcesCoreImpl implements ContainerGroups { + protected ContainerGroupsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ContainerGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ContainerGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ContainerGroupImpl wrapModel(ContainerGroupInner inner) { + return new ContainerGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ContainerGroupImpl wrapModel(String name) { + return new ContainerGroupImpl(name, new ContainerGroupInner(), this.manager()); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupsInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupsInner.java new file mode 100644 index 0000000000000..0c9d16997964b --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerGroupsInner.java @@ -0,0 +1,1030 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Resource; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroups. + */ +public class ContainerGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body Resource resource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().last().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner beginCreateOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().single().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner update(String resourceGroupName, String containerGroupName, Resource resource) { + return updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource).toBlocking().single().body(); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String containerGroupName, Resource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource), serviceCallback); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable updateAsync(String resourceGroupName, String containerGroupName, Resource resource) { + return updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, Resource resource) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + return service.update(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), resource, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner delete(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable deleteAsync(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerInstanceManagementClientImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerInstanceManagementClientImpl.java new file mode 100644 index 0000000000000..07288168f400a --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerInstanceManagementClientImpl.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerInstanceManagementClientImpl class. + */ +public class ContainerInstanceManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private 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 subscriptionId() { + return this.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 service client itself + */ + public ContainerInstanceManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerInstanceManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ContainerGroupsInner object to access its operations. + */ + private ContainerGroupsInner containerGroups; + + /** + * Gets the ContainerGroupsInner object to access its operations. + * @return the ContainerGroupsInner object. + */ + public ContainerGroupsInner containerGroups() { + return this.containerGroups; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The ContainerGroupUsagesInner object to access its operations. + */ + private ContainerGroupUsagesInner containerGroupUsages; + + /** + * Gets the ContainerGroupUsagesInner object to access its operations. + * @return the ContainerGroupUsagesInner object. + */ + public ContainerGroupUsagesInner containerGroupUsages() { + return this.containerGroupUsages; + } + + /** + * The ContainerLogsInner object to access its operations. + */ + private ContainerLogsInner containerLogs; + + /** + * Gets the ContainerLogsInner object to access its operations. + * @return the ContainerLogsInner object. + */ + public ContainerLogsInner containerLogs() { + return this.containerLogs; + } + + /** + * The StartContainersInner object to access its operations. + */ + private StartContainersInner startContainers; + + /** + * Gets the StartContainersInner object to access its operations. + * @return the StartContainersInner object. + */ + public StartContainersInner startContainers() { + return this.startContainers; + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerInstanceManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-04-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.containerGroups = new ContainerGroupsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.containerGroupUsages = new ContainerGroupUsagesInner(restClient().retrofit(), this); + this.containerLogs = new ContainerLogsInner(restClient().retrofit(), this); + this.startContainers = new StartContainersInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ContainerInstanceManagementClient", "2018-04-01"); + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerInstanceManager.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerInstanceManager.java new file mode 100644 index 0000000000000..2a494ccf10600 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerInstanceManager.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Operations; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerGroupUsages; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerLogs; +import com.microsoft.azure.management.containerinstance.v2018_04_01.StartContainers; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerInstance resource management. + */ +public final class ContainerInstanceManager extends ManagerCore { + private ContainerGroups containerGroups; + private Operations operations; + private ContainerGroupUsages containerGroupUsages; + private ContainerLogs containerLogs; + private StartContainers startContainers; + /** + * Get a Configurable instance that can be used to create ContainerInstanceManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerInstanceManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerInstanceManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerInstanceManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerInstance management API entry points that work across subscriptions + */ + ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ContainerGroups. + */ + public ContainerGroups containerGroups() { + if (this.containerGroups == null) { + this.containerGroups = new ContainerGroupsImpl(this); + } + return this.containerGroups; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage ContainerGroupUsages. + */ + public ContainerGroupUsages containerGroupUsages() { + if (this.containerGroupUsages == null) { + this.containerGroupUsages = new ContainerGroupUsagesImpl(this); + } + return this.containerGroupUsages; + } + + /** + * @return Entry point to manage ContainerLogs. + */ + public ContainerLogs containerLogs() { + if (this.containerLogs == null) { + this.containerLogs = new ContainerLogsImpl(this); + } + return this.containerLogs; + } + + /** + * @return Entry point to manage StartContainers. + */ + public StartContainers startContainers() { + if (this.startContainers == null) { + this.startContainers = new StartContainersImpl(this); + } + return this.startContainers; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerInstanceManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerInstanceManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerInstanceManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerLogsImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerLogsImpl.java new file mode 100644 index 0000000000000..b6d96c09d8e13 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerLogsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerLogs; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Logs; + +class ContainerLogsImpl extends WrapperImpl implements ContainerLogs { + private final ContainerInstanceManager manager; + + ContainerLogsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerLogs()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName) { + ContainerLogsInner client = this.inner(); + return client.listAsync(resourceGroupName, containerGroupName, containerName) + .map(new Func1() { + @Override + public Logs call(LogsInner inner) { + return new LogsImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerLogsInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerLogsInner.java new file mode 100644 index 0000000000000..2541654e026b0 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/ContainerLogsInner.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerLogs. + */ +public class ContainerLogsInner { + /** The Retrofit service to perform REST calls. */ + private ContainerLogsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerLogsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerLogsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerLogsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerLogs to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerLogsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerLogs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Query("tail") Integer tail, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerGroupName, String containerName) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerGroupName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer tail = null; + return service.list(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner list(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/IdParsingUtils.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..ad1de6037f6a2 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/LogsImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/LogsImpl.java new file mode 100644 index 0000000000000..bcb2e3a93fe2e --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/LogsImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_04_01.Logs; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LogsImpl extends WrapperImpl implements Logs { + private final ContainerInstanceManager manager; + LogsImpl(LogsInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String content() { + return this.inner().content(); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/LogsInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/LogsInner.java new file mode 100644 index 0000000000000..858439c628c4a --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/LogsInner.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The logs. + */ +public class LogsInner { + /** + * The content of the log. + */ + @JsonProperty(value = "content", access = JsonProperty.Access.WRITE_ONLY) + private String content; + + /** + * Get the content of the log. + * + * @return the content value + */ + public String content() { + return this.content; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..85a8188f0835c --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationInner.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_04_01.OperationDisplay; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerInstanceOperationsOrigin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An operation for Azure Container Instance service. + */ +public class OperationInner { + /** + * The name of the operation. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The display information of the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * The intended executor of the operation. Possible values include: 'User', + * 'System'. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private ContainerInstanceOperationsOrigin origin; + + /** + * Get the name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the display information of the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set 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 intended executor of the operation. Possible values include: 'User', 'System'. + * + * @return the origin value + */ + public ContainerInstanceOperationsOrigin origin() { + return this.origin; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationListResultImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationListResultImpl.java new file mode 100644 index 0000000000000..bdcda8013f636 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_04_01.OperationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class OperationListResultImpl extends WrapperImpl implements OperationListResult { + private final ContainerInstanceManager manager; + OperationListResultImpl(OperationListResultInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationListResultInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationListResultInner.java new file mode 100644 index 0000000000000..0b21c9a0ae5d5 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The operation list response that contains all operations for Azure Container + * Instance service. + */ +public class OperationListResultInner { + /** + * 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 list of operations. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of operations. + * + * @param value the value value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URI to fetch the next page of operations. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URI to fetch the next page of operations. + * + * @param nextLink the nextLink value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationsImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..71f6a5a2bbff9 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_04_01.OperationListResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ContainerInstanceManager manager; + + OperationsImpl(ContainerInstanceManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationListResult call(OperationListResultInner inner) { + return new OperationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationsInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..ec457f1345b2c --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.Operations list" }) + @GET("providers/Microsoft.ContainerInstance/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationListResultInner object if successful. + */ + public OperationListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListResultInner>() { + @Override + public OperationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/PageImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..f7504ee6eb424 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/StartContainersImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/StartContainersImpl.java new file mode 100644 index 0000000000000..310260895df2d --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/StartContainersImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2018_04_01.StartContainers; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerExecResponse; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerExecRequest; + +class StartContainersImpl extends WrapperImpl implements StartContainers { + private final ContainerInstanceManager manager; + + StartContainersImpl(ContainerInstanceManager manager) { + super(manager.inner().startContainers()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable launchExecAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + StartContainersInner client = this.inner(); + return client.launchExecAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest) + .map(new Func1() { + @Override + public ContainerExecResponse call(ContainerExecResponseInner inner) { + return new ContainerExecResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/StartContainersInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/StartContainersInner.java new file mode 100644 index 0000000000000..41825d1d61718 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/StartContainersInner.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerExecRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StartContainers. + */ +public class StartContainersInner { + /** The Retrofit service to perform REST calls. */ + private StartContainersService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of StartContainersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StartContainersInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(StartContainersService.class); + this.client = client; + } + + /** + * The interface defining all the services for StartContainers to be + * used by Retrofit to perform actually REST calls. + */ + interface StartContainersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2018_04_01.StartContainers launchExec" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec") + Observable> launchExec(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Body ContainerExecRequest containerExecRequest, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Starts the exec command for a specific container instance. + * Starts the exec command 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 containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerExecResponseInner object if successful. + */ + public ContainerExecResponseInner launchExec(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + return launchExecWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).toBlocking().single().body(); + } + + /** + * Starts the exec command for a specific container instance. + * Starts the exec command 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 containerExecRequest The request for the exec command. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture launchExecAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(launchExecWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest), serviceCallback); + } + + /** + * Starts the exec command for a specific container instance. + * Starts the exec command 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 containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerExecResponseInner object + */ + public Observable launchExecAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + return launchExecWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).map(new Func1, ContainerExecResponseInner>() { + @Override + public ContainerExecResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the exec command for a specific container instance. + * Starts the exec command 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 containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerExecResponseInner object + */ + public Observable> launchExecWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (containerExecRequest == null) { + throw new IllegalArgumentException("Parameter containerExecRequest is required and cannot be null."); + } + Validator.validate(containerExecRequest); + return service.launchExec(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), containerExecRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = launchExecDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse launchExecDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/UsageListResultImpl.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/UsageListResultImpl.java new file mode 100644 index 0000000000000..3387587a8e75f --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/UsageListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2018_04_01.UsageListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Usage; + +class UsageListResultImpl extends WrapperImpl implements UsageListResult { + private final ContainerInstanceManager manager; + UsageListResultImpl(UsageListResultInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/UsageListResultInner.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/UsageListResultInner.java new file mode 100644 index 0000000000000..bd1845a83b9a2 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/UsageListResultInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2018_04_01.Usage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response containing the usage data. + */ +public class UsageListResultInner { + /** + * The value property. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/package-info.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/package-info.java new file mode 100644 index 0000000000000..185355b3e94ed --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation; diff --git a/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/package-info.java b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/package-info.java new file mode 100644 index 0000000000000..60a429082d769 --- /dev/null +++ b/containerinstance/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_04_01/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2018_04_01;