From 5861fb5571727894ea350ae6cb31b7fafe8fdc62 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 17 Mar 2018 00:52:48 +0000 Subject: [PATCH] Generated from c7223c25711743136805458c1fa4d43d87b325df BatchAI. Reporting job level mount volumes Server must report volumes mounted for a job. --- .../batchai/AppInsightsReference.java | 100 ++++++ .../batchai/AzureBlobFileSystemReference.java | 5 +- .../batchai/AzureFileShareReference.java | 5 +- .../azure/management/batchai/DataDisks.java | 13 +- .../batchai/EnvironmentVariable.java | 69 ++++ .../EnvironmentVariableWithSecretValue.java | 100 ++++++ .../batchai/FileServerReference.java | 5 +- .../management/batchai/ImageReference.java | 35 +++ .../management/batchai/InputDirectory.java | 8 +- .../batchai/JobPropertiesExecutionInfo.java | 2 +- .../azure/management/batchai/NodeSetup.java | 29 ++ .../management/batchai/OutputDirectory.java | 14 +- .../batchai/PerformanceCountersSettings.java | 46 +++ .../management/batchai/PyTorchSettings.java | 150 +++++++++ .../azure/management/batchai/SetupTask.java | 64 +++- .../management/batchai/SshConfiguration.java | 6 +- .../batchai/TensorFlowSettings.java | 2 +- .../batchai/UnmanagedFileSystemReference.java | 5 +- .../azure/management/batchai/UsageName.java | 69 ++++ .../BatchAIManagementClientImpl.java | 18 +- .../batchai/implementation/FileInner.java | 40 ++- .../FileServerCreateParametersInner.java | 2 +- .../JobCreateParametersInner.java | 103 +++++- .../batchai/implementation/JobInner.java | 140 ++++++++- .../batchai/implementation/JobsInner.java | 25 +- .../JobsListOutputFilesOptionsInner.java | 26 ++ .../batchai/implementation/UsageInner.java | 129 ++++++++ .../batchai/implementation/UsagesInner.java | 295 ++++++++++++++++++ 28 files changed, 1426 insertions(+), 79 deletions(-) create mode 100644 azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/AppInsightsReference.java create mode 100644 azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/EnvironmentVariable.java create mode 100644 azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/EnvironmentVariableWithSecretValue.java create mode 100644 azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/PerformanceCountersSettings.java create mode 100644 azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/PyTorchSettings.java create mode 100644 azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/UsageName.java create mode 100644 azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/UsageInner.java create mode 100644 azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/UsagesInner.java diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/AppInsightsReference.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/AppInsightsReference.java new file mode 100644 index 00000000000..7b6ed4fe68c --- /dev/null +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/AppInsightsReference.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.batchai; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies Azure Application Insights information for performance counters + * reporting. + */ +public class AppInsightsReference { + /** + * Specifies the Azure Application Insights component resource id. + */ + @JsonProperty(value = "component", required = true) + private ResourceId component; + + /** + * Value of the Azure Application Insights instrumentation key. + */ + @JsonProperty(value = "instrumentationKey") + private String instrumentationKey; + + /** + * Specifies a KeyVault Secret containing Azure Application Insights + * instrumentation key. + * Specifies KeyVault Store and Secret which contains Azure Application + * Insights instrumentation key. One of instumentationKey or + * instrumentationKeySecretReference must be specified. + */ + @JsonProperty(value = "instrumentationKeySecretReference") + private KeyVaultSecretReference instrumentationKeySecretReference; + + /** + * Get the component value. + * + * @return the component value + */ + public ResourceId component() { + return this.component; + } + + /** + * Set the component value. + * + * @param component the component value to set + * @return the AppInsightsReference object itself. + */ + public AppInsightsReference withComponent(ResourceId component) { + this.component = component; + return this; + } + + /** + * Get the instrumentationKey value. + * + * @return the instrumentationKey value + */ + public String instrumentationKey() { + return this.instrumentationKey; + } + + /** + * Set the instrumentationKey value. + * + * @param instrumentationKey the instrumentationKey value to set + * @return the AppInsightsReference object itself. + */ + public AppInsightsReference withInstrumentationKey(String instrumentationKey) { + this.instrumentationKey = instrumentationKey; + return this; + } + + /** + * Get the instrumentationKeySecretReference value. + * + * @return the instrumentationKeySecretReference value + */ + public KeyVaultSecretReference instrumentationKeySecretReference() { + return this.instrumentationKeySecretReference; + } + + /** + * Set the instrumentationKeySecretReference value. + * + * @param instrumentationKeySecretReference the instrumentationKeySecretReference value to set + * @return the AppInsightsReference object itself. + */ + public AppInsightsReference withInstrumentationKeySecretReference(KeyVaultSecretReference instrumentationKeySecretReference) { + this.instrumentationKeySecretReference = instrumentationKeySecretReference; + return this; + } + +} diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/AzureBlobFileSystemReference.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/AzureBlobFileSystemReference.java index 9ff3a7b1927..3101b5b3c57 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/AzureBlobFileSystemReference.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/AzureBlobFileSystemReference.java @@ -36,8 +36,9 @@ public class AzureBlobFileSystemReference { /** * Specifies the relative path on the compute node where the Azure Blob * file system will be mounted. - * Note that all blob file systems will be mounted under - * $AZ_BATCHAI_MOUNT_ROOT location. + * Note that all cluster level blob file systems will be mounted under + * $AZ_BATCHAI_MOUNT_ROOT location and all job level blob file systems will + * be mounted under $AZ_BATCHAI_JOB_MOUNT_ROOT. */ @JsonProperty(value = "relativeMountPath", required = true) private String relativeMountPath; diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/AzureFileShareReference.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/AzureFileShareReference.java index 3032d6e4ce4..7f0641e4ebe 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/AzureFileShareReference.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/AzureFileShareReference.java @@ -35,8 +35,9 @@ public class AzureFileShareReference { /** * Specifies the relative path on the compute node where the Azure file * share will be mounted. - * Note that all file shares will be mounted under $AZ_BATCHAI_MOUNT_ROOT - * location. + * Note that all cluster level file shares will be mounted under + * $AZ_BATCHAI_MOUNT_ROOT location and all job level file shares will be + * mounted under $AZ_BATCHAI_JOB_MOUNT_ROOT. */ @JsonProperty(value = "relativeMountPath", required = true) private String relativeMountPath; diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/DataDisks.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/DataDisks.java index b7f0dd9c1c4..bf06457c852 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/DataDisks.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/DataDisks.java @@ -26,7 +26,7 @@ public class DataDisks { * patchable. * Possible values include: 'none', 'readonly', 'readwrite'. */ - @JsonProperty(value = "cachingType", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "cachingType") private CachingType cachingType; /** @@ -73,6 +73,17 @@ public CachingType cachingType() { return this.cachingType; } + /** + * Set the cachingType value. + * + * @param cachingType the cachingType value to set + * @return the DataDisks object itself. + */ + public DataDisks withCachingType(CachingType cachingType) { + this.cachingType = cachingType; + return this; + } + /** * Get the diskCount value. * diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/EnvironmentVariable.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/EnvironmentVariable.java new file mode 100644 index 00000000000..89664f9ffcb --- /dev/null +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/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.batchai; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A collection of environment variables to set. + */ +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 value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @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 value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @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/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/EnvironmentVariableWithSecretValue.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/EnvironmentVariableWithSecretValue.java new file mode 100644 index 00000000000..16ba07ee00c --- /dev/null +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/EnvironmentVariableWithSecretValue.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.batchai; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A collection of environment variables with secret values to set. + */ +public class EnvironmentVariableWithSecretValue { + /** + * The name of the environment variable to store the secret value. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The value of the environment variable. This value will never be reported + * back by Batch AI. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Specifies the location of the Azure KeyVault secret which will be used + * as the environment variable value. + * Specifies KeyVault Store and Secret which contains the value for the + * environment variable. One of value or valueSecretReference must be + * provided. + */ + @JsonProperty(value = "valueSecretReference") + private KeyVaultSecretReference valueSecretReference; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the EnvironmentVariableWithSecretValue object itself. + */ + public EnvironmentVariableWithSecretValue withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the EnvironmentVariableWithSecretValue object itself. + */ + public EnvironmentVariableWithSecretValue withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the valueSecretReference value. + * + * @return the valueSecretReference value + */ + public KeyVaultSecretReference valueSecretReference() { + return this.valueSecretReference; + } + + /** + * Set the valueSecretReference value. + * + * @param valueSecretReference the valueSecretReference value to set + * @return the EnvironmentVariableWithSecretValue object itself. + */ + public EnvironmentVariableWithSecretValue withValueSecretReference(KeyVaultSecretReference valueSecretReference) { + this.valueSecretReference = valueSecretReference; + return this; + } + +} diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/FileServerReference.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/FileServerReference.java index 8cf2fbf971d..e0b8d195dc9 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/FileServerReference.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/FileServerReference.java @@ -32,8 +32,9 @@ public class FileServerReference { /** * Specifies the relative path on the compute node where the File Server * will be mounted. - * Note that all file shares will be mounted under $AZ_BATCHAI_MOUNT_ROOT - * location. + * Note that all cluster level file servers will be mounted under + * $AZ_BATCHAI_MOUNT_ROOT location and job level file servers will be + * mouted under $AZ_BATCHAI_JOB_MOUNT_ROOT. */ @JsonProperty(value = "relativeMountPath", required = true) private String relativeMountPath; diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/ImageReference.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/ImageReference.java index c1a2858f53e..5d0041d51ba 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/ImageReference.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/ImageReference.java @@ -38,6 +38,21 @@ public class ImageReference { @JsonProperty(value = "version") private String version; + /** + * The ARM resource identifier of the virtual machine image. Computes nodes + * of the cluster will be created using this custom image. This is of the + * form + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}. + * The virtual machine image must be in the same region and subscription as + * the cluster. For information about the firewall settings for the Batch + * node agent to communicate with the Batch service see + * https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + * Note, you need to provide publisher, offer and sku of the base OS image + * of which the custom image has been derived from. + */ + @JsonProperty(value = "virtualMachineImageId") + private String virtualMachineImageId; + /** * Get the publisher value. * @@ -118,4 +133,24 @@ public ImageReference withVersion(String version) { return this; } + /** + * Get the virtualMachineImageId value. + * + * @return the virtualMachineImageId value + */ + public String virtualMachineImageId() { + return this.virtualMachineImageId; + } + + /** + * Set the virtualMachineImageId value. + * + * @param virtualMachineImageId the virtualMachineImageId value to set + * @return the ImageReference object itself. + */ + public ImageReference withVirtualMachineImageId(String virtualMachineImageId) { + this.virtualMachineImageId = virtualMachineImageId; + return this; + } + } diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/InputDirectory.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/InputDirectory.java index 147b05dd44f..369412e8d68 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/InputDirectory.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/InputDirectory.java @@ -16,11 +16,9 @@ public class InputDirectory { /** * The id for the input directory. - * It will be available for the job as an environment variable under - * AZ_BATCHAI_INPUT_id. The service will also provide the following - * environment variable: AZ_BATCHAI_PREV_OUTPUT_Name. The value of the - * variable will be populated if the job is being retried after a previous - * failure, otherwise it will be set to nothing. + * The path of the input directory will be available as a value of an + * environment variable with AZ_BATCHAI_INPUT_<id> name, where + * <id> is the value of id attribute. */ @JsonProperty(value = "id", required = true) private String id; diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/JobPropertiesExecutionInfo.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/JobPropertiesExecutionInfo.java index 555addd22f7..ae337813d2d 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/JobPropertiesExecutionInfo.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/JobPropertiesExecutionInfo.java @@ -24,7 +24,7 @@ public class JobPropertiesExecutionInfo { * started running. This property is present only for job that are in the * running or completed state. */ - @JsonProperty(value = "startTime") + @JsonProperty(value = "startTime", required = true) private DateTime startTime; /** diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/NodeSetup.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/NodeSetup.java index 6cfd44ed084..2a96caf645d 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/NodeSetup.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/NodeSetup.java @@ -28,10 +28,19 @@ public class NodeSetup { /** * Information on shared volumes to be used by jobs. + * Specified mount volumes will be available to all jobs executing on the + * cluster. The volumes will be mounted at location specified by + * $AZ_BATCHAI_MOUNT_ROOT environment variable. */ @JsonProperty(value = "mountVolumes") private MountVolumes mountVolumes; + /** + * Specifies settings for performance counters collecting and uploading. + */ + @JsonProperty(value = "performanceCountersSettings") + private PerformanceCountersSettings performanceCountersSettings; + /** * Get the setupTask value. * @@ -72,4 +81,24 @@ public NodeSetup withMountVolumes(MountVolumes mountVolumes) { return this; } + /** + * Get the performanceCountersSettings value. + * + * @return the performanceCountersSettings value + */ + public PerformanceCountersSettings performanceCountersSettings() { + return this.performanceCountersSettings; + } + + /** + * Set the performanceCountersSettings value. + * + * @param performanceCountersSettings the performanceCountersSettings value to set + * @return the NodeSetup object itself. + */ + public NodeSetup withPerformanceCountersSettings(PerformanceCountersSettings performanceCountersSettings) { + this.performanceCountersSettings = performanceCountersSettings; + return this; + } + } diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/OutputDirectory.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/OutputDirectory.java index dcc68114d91..adae4f8dca9 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/OutputDirectory.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/OutputDirectory.java @@ -16,8 +16,9 @@ public class OutputDirectory { /** * The name for the output directory. - * It will be available for the job as an environment variable under - * AZ_BATCHAI_OUTPUT_id. + * The path of the output directory will be available as a value of an + * environment variable with AZ_BATCHAI_OUTPUT_<id> name, where + * <id> is the value of id attribute. */ @JsonProperty(value = "id", required = true) private String id; @@ -25,14 +26,19 @@ public class OutputDirectory { /** * The prefix path where the output directory will be created. * NOTE: This is an absolute path to prefix. E.g. - * $AZ_BATCHAI_MOUNT_ROOT/MyNFS/MyLogs. + * $AZ_BATCHAI_MOUNT_ROOT/MyNFS/MyLogs. You can find the full path to the + * output directory by combining pathPrefix, jobOutputDirectoryPathSegment + * (reported by get job) and pathSuffix. */ @JsonProperty(value = "pathPrefix", required = true) private String pathPrefix; /** * The suffix path where the output directory will be created. - * The suffix path where the output directory will be created. + * The suffix path where the output directory will be created. E.g. models. + * You can find the full path to the output directory by combining + * pathPrefix, jobOutputDirectoryPathSegment (reported by get job) and + * pathSuffix. */ @JsonProperty(value = "pathSuffix") private String pathSuffix; diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/PerformanceCountersSettings.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/PerformanceCountersSettings.java new file mode 100644 index 00000000000..f5dd38ad2bc --- /dev/null +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/PerformanceCountersSettings.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.batchai; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Performance counters reporting settings. + */ +public class PerformanceCountersSettings { + /** + * Specifies Azure Application Insights information for performance + * counters reporting. + * If provided, Batch AI will upload node performance counters to the + * corresponding Azure Application Insights account. + */ + @JsonProperty(value = "appInsightsReference", required = true) + private AppInsightsReference appInsightsReference; + + /** + * Get the appInsightsReference value. + * + * @return the appInsightsReference value + */ + public AppInsightsReference appInsightsReference() { + return this.appInsightsReference; + } + + /** + * Set the appInsightsReference value. + * + * @param appInsightsReference the appInsightsReference value to set + * @return the PerformanceCountersSettings object itself. + */ + public PerformanceCountersSettings withAppInsightsReference(AppInsightsReference appInsightsReference) { + this.appInsightsReference = appInsightsReference; + return this; + } + +} diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/PyTorchSettings.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/PyTorchSettings.java new file mode 100644 index 00000000000..4a3db4ac95d --- /dev/null +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/PyTorchSettings.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.batchai; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the settings for pyTorch job. + */ +public class PyTorchSettings { + /** + * The path and file name of the python script to execute the job. + */ + @JsonProperty(value = "pythonScriptFilePath", required = true) + private String pythonScriptFilePath; + + /** + * The path to python interpreter. + */ + @JsonProperty(value = "pythonInterpreterPath") + private String pythonInterpreterPath; + + /** + * Specifies the command line arguments for the master task. + */ + @JsonProperty(value = "commandLineArgs") + private String commandLineArgs; + + /** + * Number of processes to launch for the job execution. + * The default value for this property is equal to nodeCount property. + */ + @JsonProperty(value = "processCount") + private Integer processCount; + + /** + * Type of the communication backend for distributed jobs. + * Valid values are 'TCP', 'Gloo' or 'MPI'. Not required for + * non-distributed jobs. + */ + @JsonProperty(value = "communicationBackend") + private String communicationBackend; + + /** + * Get the pythonScriptFilePath value. + * + * @return the pythonScriptFilePath value + */ + public String pythonScriptFilePath() { + return this.pythonScriptFilePath; + } + + /** + * Set the pythonScriptFilePath value. + * + * @param pythonScriptFilePath the pythonScriptFilePath value to set + * @return the PyTorchSettings object itself. + */ + public PyTorchSettings withPythonScriptFilePath(String pythonScriptFilePath) { + this.pythonScriptFilePath = pythonScriptFilePath; + return this; + } + + /** + * Get the pythonInterpreterPath value. + * + * @return the pythonInterpreterPath value + */ + public String pythonInterpreterPath() { + return this.pythonInterpreterPath; + } + + /** + * Set the pythonInterpreterPath value. + * + * @param pythonInterpreterPath the pythonInterpreterPath value to set + * @return the PyTorchSettings object itself. + */ + public PyTorchSettings withPythonInterpreterPath(String pythonInterpreterPath) { + this.pythonInterpreterPath = pythonInterpreterPath; + return this; + } + + /** + * Get the commandLineArgs value. + * + * @return the commandLineArgs value + */ + public String commandLineArgs() { + return this.commandLineArgs; + } + + /** + * Set the commandLineArgs value. + * + * @param commandLineArgs the commandLineArgs value to set + * @return the PyTorchSettings object itself. + */ + public PyTorchSettings withCommandLineArgs(String commandLineArgs) { + this.commandLineArgs = commandLineArgs; + return this; + } + + /** + * Get the processCount value. + * + * @return the processCount value + */ + public Integer processCount() { + return this.processCount; + } + + /** + * Set the processCount value. + * + * @param processCount the processCount value to set + * @return the PyTorchSettings object itself. + */ + public PyTorchSettings withProcessCount(Integer processCount) { + this.processCount = processCount; + return this; + } + + /** + * Get the communicationBackend value. + * + * @return the communicationBackend value + */ + public String communicationBackend() { + return this.communicationBackend; + } + + /** + * Set the communicationBackend value. + * + * @param communicationBackend the communicationBackend value to set + * @return the PyTorchSettings object itself. + */ + public PyTorchSettings withCommunicationBackend(String communicationBackend) { + this.communicationBackend = communicationBackend; + return this; + } + +} diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/SetupTask.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/SetupTask.java index 07821bb59d5..16fb0e9a617 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/SetupTask.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/SetupTask.java @@ -23,25 +23,46 @@ public class SetupTask { private String commandLine; /** - * Collection of environment settings. + * Collection of environment variables to be set for setup task. */ @JsonProperty(value = "environmentVariables") - private List environmentVariables; + private List environmentVariables; /** - * Specifies whether to run the setup task in elevated mode. The default + * Collection of environment variables with secret values to be set for + * setup task. + * Server will never report values of these variables back. + */ + @JsonProperty(value = "secrets") + private List secrets; + + /** + * Specifies whether to run the setup task under root account. The default * value is false. + * Note. Non-elevated tasks are run under an account added into sudoer list + * and can perform sudo when required. */ @JsonProperty(value = "runElevated") private Boolean runElevated; /** - * The path where the Batch AI service will upload the stdout and stderror - * of setup task. + * The prefix of a path where the Batch AI service will upload the stdout + * and stderr of the setup task. */ @JsonProperty(value = "stdOutErrPathPrefix", required = true) private String stdOutErrPathPrefix; + /** + * A path segment appended by Batch AI to stdOutErrPathPrefix to form a + * path where stdout and stderr of the setup task will be uploaded. + * Batch AI creates the setup task output directories under an unique path + * to avoid conflicts between different clusters. You can concatinate + * stdOutErrPathPrefix and stdOutErrPathSuffix to get the full path to the + * output directory. + */ + @JsonProperty(value = "stdOutErrPathSuffix", access = JsonProperty.Access.WRITE_ONLY) + private String stdOutErrPathSuffix; + /** * Get the commandLine value. * @@ -67,7 +88,7 @@ public SetupTask withCommandLine(String commandLine) { * * @return the environmentVariables value */ - public List environmentVariables() { + public List environmentVariables() { return this.environmentVariables; } @@ -77,11 +98,31 @@ public List environmentVariables() { * @param environmentVariables the environmentVariables value to set * @return the SetupTask object itself. */ - public SetupTask withEnvironmentVariables(List environmentVariables) { + public SetupTask withEnvironmentVariables(List environmentVariables) { this.environmentVariables = environmentVariables; return this; } + /** + * Get the secrets value. + * + * @return the secrets value + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets value. + * + * @param secrets the secrets value to set + * @return the SetupTask object itself. + */ + public SetupTask withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + /** * Get the runElevated value. * @@ -122,4 +163,13 @@ public SetupTask withStdOutErrPathPrefix(String stdOutErrPathPrefix) { return this; } + /** + * Get the stdOutErrPathSuffix value. + * + * @return the stdOutErrPathSuffix value + */ + public String stdOutErrPathSuffix() { + return this.stdOutErrPathSuffix; + } + } diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/SshConfiguration.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/SshConfiguration.java index d258a8480b5..ff5f5c9b183 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/SshConfiguration.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/SshConfiguration.java @@ -16,15 +16,15 @@ */ public class SshConfiguration { /** - * List of source IP ranges to allow SSH connection to VM. + * List of source IP ranges to allow SSH connection to a node. * Default value is '*' can be used to match all source IPs. Maximum number - * of publicIPs that can be specified are 400. + * of IP ranges that can be specified are 400. */ @JsonProperty(value = "publicIPsToAllow") private List publicIPsToAllow; /** - * Settings for user account of VMs. + * Settings for user account to be created on a node. */ @JsonProperty(value = "userAccountSettings", required = true) private UserAccountSettings userAccountSettings; diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/TensorFlowSettings.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/TensorFlowSettings.java index d03cb8314e0..c745f565e38 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/TensorFlowSettings.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/TensorFlowSettings.java @@ -29,7 +29,7 @@ public class TensorFlowSettings { /** * Specifies the command line arguments for the master task. */ - @JsonProperty(value = "masterCommandLineArgs", required = true) + @JsonProperty(value = "masterCommandLineArgs") private String masterCommandLineArgs; /** diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/UnmanagedFileSystemReference.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/UnmanagedFileSystemReference.java index e121957a7ec..a56e2a71304 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/UnmanagedFileSystemReference.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/UnmanagedFileSystemReference.java @@ -23,8 +23,9 @@ public class UnmanagedFileSystemReference { /** * Specifies the relative path on the compute cluster node where the file * system will be mounted. - * Note that all file shares will be mounted under $AZ_BATCHAI_MOUNT_ROOT - * location. + * Note that all cluster level unmanaged file system will be mounted under + * $AZ_BATCHAI_MOUNT_ROOT location and job level unmanaged file system will + * be mounted under $AZ_BATCHAI_JOB_MOUNT_ROOT. */ @JsonProperty(value = "relativeMountPath", required = true) private String relativeMountPath; diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/UsageName.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/UsageName.java new file mode 100644 index 00000000000..eea4fbe762c --- /dev/null +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/UsageName.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.batchai; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Usage Names. + */ +public class UsageName { + /** + * The name of the resource. + */ + @JsonProperty(value = "value") + private String value; + + /** + * The localized name of the resource. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the UsageName object itself. + */ + public UsageName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localizedValue value. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localizedValue value. + * + * @param localizedValue the localizedValue value to set + * @return the UsageName object itself. + */ + public UsageName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + +} diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/BatchAIManagementClientImpl.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/BatchAIManagementClientImpl.java index e7f0ccbd1bf..e79273ed79d 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/BatchAIManagementClientImpl.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/BatchAIManagementClientImpl.java @@ -145,6 +145,19 @@ public OperationsInner operations() { return this.operations; } + /** + * The UsagesInner object to access its operations. + */ + private UsagesInner usages; + + /** + * Gets the UsagesInner object to access its operations. + * @return the UsagesInner object. + */ + public UsagesInner usages() { + return this.usages; + } + /** * The ClustersInner object to access its operations. */ @@ -215,11 +228,12 @@ public BatchAIManagementClientImpl(RestClient restClient) { } protected void initialize() { - this.apiVersion = "2017-09-01-preview"; + this.apiVersion = "2018-03-01"; this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; this.operations = new OperationsInner(restClient().retrofit(), this); + this.usages = new UsagesInner(restClient().retrofit(), this); this.clusters = new ClustersInner(restClient().retrofit(), this); this.jobs = new JobsInner(restClient().retrofit(), this); this.fileServers = new FileServersInner(restClient().retrofit(), this); @@ -233,6 +247,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "BatchAIManagementClient", "2017-09-01-preview"); + return String.format("%s (%s, %s)", super.userAgent(), "BatchAIManagementClient", "2018-03-01"); } } diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/FileInner.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/FileInner.java index 43d54baeb60..22d6a714b24 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/FileInner.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/FileInner.java @@ -13,25 +13,27 @@ import com.microsoft.rest.serializer.JsonFlatten; /** - * Properties of the file. + * Properties of the file or directory. */ @JsonFlatten public class FileInner { /** - * file name. + * Name of the file. */ @JsonProperty(value = "name", required = true) private String name; /** - * file downloand url, example: - * https://mystg.blob.core.windows.net/mycontainer/myModel_1.dnn. - * This will be returned only if the model has been archived. During job - * run, this won't be returned and customers can use SSH tunneling to - * download. Users can use Get Remote Login Information API to get the IP - * address and port information of all the compute nodes running the job. + * Indicates if the file is a directory. */ - @JsonProperty(value = "downloadUrl", required = true) + @JsonProperty(value = "isDirectory", required = true) + private boolean isDirectory; + + /** + * Will contain an URL to download the corresponding file. The downloadUrl + * is not returned for directories. + */ + @JsonProperty(value = "downloadUrl") private String downloadUrl; /** @@ -68,6 +70,26 @@ public FileInner withName(String name) { return this; } + /** + * Get the isDirectory value. + * + * @return the isDirectory value + */ + public boolean isDirectory() { + return this.isDirectory; + } + + /** + * Set the isDirectory value. + * + * @param isDirectory the isDirectory value to set + * @return the FileInner object itself. + */ + public FileInner withIsDirectory(boolean isDirectory) { + this.isDirectory = isDirectory; + return this; + } + /** * Get the downloadUrl value. * diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/FileServerCreateParametersInner.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/FileServerCreateParametersInner.java index e1763881b57..cc72189ca24 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/FileServerCreateParametersInner.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/FileServerCreateParametersInner.java @@ -41,7 +41,7 @@ public class FileServerCreateParametersInner { private String vmSize; /** - * SSH settings for the file server. + * SSH configuration for the file server. */ @JsonProperty(value = "properties.sshConfiguration", required = true) private SshConfiguration sshConfiguration; diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/JobCreateParametersInner.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/JobCreateParametersInner.java index 11671f99518..03a46c9c704 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/JobCreateParametersInner.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/JobCreateParametersInner.java @@ -10,8 +10,10 @@ import java.util.Map; import com.microsoft.azure.management.batchai.ResourceId; +import com.microsoft.azure.management.batchai.MountVolumes; import com.microsoft.azure.management.batchai.ContainerSettings; import com.microsoft.azure.management.batchai.CNTKsettings; +import com.microsoft.azure.management.batchai.PyTorchSettings; import com.microsoft.azure.management.batchai.TensorFlowSettings; import com.microsoft.azure.management.batchai.CaffeSettings; import com.microsoft.azure.management.batchai.Caffe2Settings; @@ -21,7 +23,8 @@ import java.util.List; import com.microsoft.azure.management.batchai.InputDirectory; import com.microsoft.azure.management.batchai.OutputDirectory; -import com.microsoft.azure.management.batchai.EnvironmentSetting; +import com.microsoft.azure.management.batchai.EnvironmentVariable; +import com.microsoft.azure.management.batchai.EnvironmentVariableWithSecretValue; import com.microsoft.azure.management.batchai.JobBasePropertiesConstraints; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -64,6 +67,15 @@ public class JobCreateParametersInner { @JsonProperty(value = "properties.cluster", required = true) private ResourceId cluster; + /** + * Information on mount volumes to be used by the job. + * These volumes will be mounted before the job execution and will be + * unmouted after the job completion. The volumes will be mounted at + * location specified by $AZ_BATCHAI_JOB_MOUNT_ROOT environment variable. + */ + @JsonProperty(value = "properties.mountVolumes") + private MountVolumes mountVolumes; + /** * Number of compute nodes to run the job on. * The job will be gang scheduled on that many compute nodes. @@ -86,6 +98,12 @@ public class JobCreateParametersInner { @JsonProperty(value = "properties.cntkSettings") private CNTKsettings cntkSettings; + /** + * Specifies the settings for pyTorch job. + */ + @JsonProperty(value = "properties.pyTorchSettings") + private PyTorchSettings pyTorchSettings; + /** * Specifies the settings for Tensor Flow job. */ @@ -138,22 +156,25 @@ public class JobCreateParametersInner { private List inputDirectories; /** - * Specifies the list of output directories where the models will be - * created. . + * Specifies the list of output directories. */ @JsonProperty(value = "properties.outputDirectories") private List outputDirectories; /** * Additional environment variables to set on the job. - * Batch AI service sets the following environment variables for all jobs: - * AZ_BATCHAI_INPUT_id, AZ_BATCHAI_OUTPUT_id, AZ_BATCHAI_NUM_GPUS_PER_NODE. - * For distributed TensorFlow jobs, following additional environment - * variables are set by the Batch AI Service: AZ_BATCHAI_PS_HOSTS, - * AZ_BATCHAI_WORKER_HOSTS. + * Batch AI will setup these additional environment variables for the job. */ @JsonProperty(value = "properties.environmentVariables") - private List environmentVariables; + private List environmentVariables; + + /** + * Additional environment variables with secret values to set on the job. + * Batch AI will setup these additional environment variables for the job. + * Server will never report values of these variables back. + */ + @JsonProperty(value = "properties.secrets") + private List secrets; /** * Constraints associated with the Job. @@ -261,6 +282,26 @@ public JobCreateParametersInner withCluster(ResourceId cluster) { return this; } + /** + * Get the mountVolumes value. + * + * @return the mountVolumes value + */ + public MountVolumes mountVolumes() { + return this.mountVolumes; + } + + /** + * Set the mountVolumes value. + * + * @param mountVolumes the mountVolumes value to set + * @return the JobCreateParametersInner object itself. + */ + public JobCreateParametersInner withMountVolumes(MountVolumes mountVolumes) { + this.mountVolumes = mountVolumes; + return this; + } + /** * Get the nodeCount value. * @@ -321,6 +362,26 @@ public JobCreateParametersInner withCntkSettings(CNTKsettings cntkSettings) { return this; } + /** + * Get the pyTorchSettings value. + * + * @return the pyTorchSettings value + */ + public PyTorchSettings pyTorchSettings() { + return this.pyTorchSettings; + } + + /** + * Set the pyTorchSettings value. + * + * @param pyTorchSettings the pyTorchSettings value to set + * @return the JobCreateParametersInner object itself. + */ + public JobCreateParametersInner withPyTorchSettings(PyTorchSettings pyTorchSettings) { + this.pyTorchSettings = pyTorchSettings; + return this; + } + /** * Get the tensorFlowSettings value. * @@ -506,7 +567,7 @@ public JobCreateParametersInner withOutputDirectories(List outp * * @return the environmentVariables value */ - public List environmentVariables() { + public List environmentVariables() { return this.environmentVariables; } @@ -516,11 +577,31 @@ public List environmentVariables() { * @param environmentVariables the environmentVariables value to set * @return the JobCreateParametersInner object itself. */ - public JobCreateParametersInner withEnvironmentVariables(List environmentVariables) { + public JobCreateParametersInner withEnvironmentVariables(List environmentVariables) { this.environmentVariables = environmentVariables; return this; } + /** + * Get the secrets value. + * + * @return the secrets value + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets value. + * + * @param secrets the secrets value to set + * @return the JobCreateParametersInner object itself. + */ + public JobCreateParametersInner withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + /** * Get the constraints value. * diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/JobInner.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/JobInner.java index cb644d9e4fe..9e55e9c1e18 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/JobInner.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/JobInner.java @@ -9,9 +9,11 @@ package com.microsoft.azure.management.batchai.implementation; import com.microsoft.azure.management.batchai.ResourceId; +import com.microsoft.azure.management.batchai.MountVolumes; import com.microsoft.azure.management.batchai.ContainerSettings; import com.microsoft.azure.management.batchai.ToolType; import com.microsoft.azure.management.batchai.CNTKsettings; +import com.microsoft.azure.management.batchai.PyTorchSettings; import com.microsoft.azure.management.batchai.TensorFlowSettings; import com.microsoft.azure.management.batchai.CaffeSettings; import com.microsoft.azure.management.batchai.ChainerSettings; @@ -20,7 +22,8 @@ import java.util.List; import com.microsoft.azure.management.batchai.InputDirectory; import com.microsoft.azure.management.batchai.OutputDirectory; -import com.microsoft.azure.management.batchai.EnvironmentSetting; +import com.microsoft.azure.management.batchai.EnvironmentVariable; +import com.microsoft.azure.management.batchai.EnvironmentVariableWithSecretValue; import com.microsoft.azure.management.batchai.JobPropertiesConstraints; import org.joda.time.DateTime; import com.microsoft.azure.management.batchai.ProvisioningState; @@ -56,6 +59,25 @@ public class JobInner extends Resource { @JsonProperty(value = "properties.cluster") private ResourceId cluster; + /** + * Information on mount volumes to be used by the job. + * These volumes will be mounted before the job execution and will be + * unmouted after the job completion. The volumes will be mounted at + * location specified by $AZ_BATCHAI_JOB_MOUNT_ROOT environment variable. + */ + @JsonProperty(value = "properties.mountVolumes") + private MountVolumes mountVolumes; + + /** + * A segment of job's output directories path created by BatchAI. + * Batch AI creates job's output directories under an unique path to avoid + * conflicts between jobs. This value contains a path segment generated by + * Batch AI to make the path unique and can be used to find the output + * directory on the node or mounted filesystem. + */ + @JsonProperty(value = "properties.jobOutputDirectoryPathSegment") + private String jobOutputDirectoryPathSegment; + /** * Number of compute nodes to run the job on. * The job will be gang scheduled on that many compute nodes. @@ -74,9 +96,9 @@ public class JobInner extends Resource { /** * The toolkit type of this job. - * Possible values are: cntk, tensorflow, caffe, caffe2, chainer, custom. - * Possible values include: 'cntk', 'tensorflow', 'caffe', 'caffe2', - * 'chainer', 'custom'. + * Possible values are: cntk, tensorflow, caffe, caffe2, chainer, pytorch, + * custom. Possible values include: 'cntk', 'tensorflow', 'caffe', + * 'caffe2', 'chainer', 'custom'. */ @JsonProperty(value = "properties.toolType") private ToolType toolType; @@ -87,6 +109,12 @@ public class JobInner extends Resource { @JsonProperty(value = "properties.cntkSettings") private CNTKsettings cntkSettings; + /** + * Specifies the settings for pyTorch job. + */ + @JsonProperty(value = "properties.pyTorchSettings") + private PyTorchSettings pyTorchSettings; + /** * Specifies the settings for Tensor Flow job. */ @@ -134,21 +162,25 @@ public class JobInner extends Resource { /** * Specifies the list of output directories where the models will be - * created. . + * created. */ @JsonProperty(value = "properties.outputDirectories") private List outputDirectories; /** - * Additional environment variables to be passed to the job. - * Batch AI services sets the following environment variables for all jobs: - * AZ_BATCHAI_INPUT_id, AZ_BATCHAI_OUTPUT_id, AZ_BATCHAI_NUM_GPUS_PER_NODE, - * For distributed TensorFlow jobs, following additional environment - * variables are set by the Batch AI Service: AZ_BATCHAI_PS_HOSTS, - * AZ_BATCHAI_WORKER_HOSTS. + * Additional environment variables to set on the job. + * Batch AI will setup these additional environment variables for the job. */ @JsonProperty(value = "properties.environmentVariables") - private List environmentVariables; + private List environmentVariables; + + /** + * Additional environment variables with secret values to set on the job. + * Batch AI will setup these additional environment variables for the job. + * Server will never report values of these variables back. + */ + @JsonProperty(value = "properties.secrets") + private List secrets; /** * Constraints associated with the Job. @@ -270,6 +302,46 @@ public JobInner withCluster(ResourceId cluster) { return this; } + /** + * Get the mountVolumes value. + * + * @return the mountVolumes value + */ + public MountVolumes mountVolumes() { + return this.mountVolumes; + } + + /** + * Set the mountVolumes value. + * + * @param mountVolumes the mountVolumes value to set + * @return the JobInner object itself. + */ + public JobInner withMountVolumes(MountVolumes mountVolumes) { + this.mountVolumes = mountVolumes; + return this; + } + + /** + * Get the jobOutputDirectoryPathSegment value. + * + * @return the jobOutputDirectoryPathSegment value + */ + public String jobOutputDirectoryPathSegment() { + return this.jobOutputDirectoryPathSegment; + } + + /** + * Set the jobOutputDirectoryPathSegment value. + * + * @param jobOutputDirectoryPathSegment the jobOutputDirectoryPathSegment value to set + * @return the JobInner object itself. + */ + public JobInner withJobOutputDirectoryPathSegment(String jobOutputDirectoryPathSegment) { + this.jobOutputDirectoryPathSegment = jobOutputDirectoryPathSegment; + return this; + } + /** * Get the nodeCount value. * @@ -350,6 +422,26 @@ public JobInner withCntkSettings(CNTKsettings cntkSettings) { return this; } + /** + * Get the pyTorchSettings value. + * + * @return the pyTorchSettings value + */ + public PyTorchSettings pyTorchSettings() { + return this.pyTorchSettings; + } + + /** + * Set the pyTorchSettings value. + * + * @param pyTorchSettings the pyTorchSettings value to set + * @return the JobInner object itself. + */ + public JobInner withPyTorchSettings(PyTorchSettings pyTorchSettings) { + this.pyTorchSettings = pyTorchSettings; + return this; + } + /** * Get the tensorFlowSettings value. * @@ -515,7 +607,7 @@ public JobInner withOutputDirectories(List outputDirectories) { * * @return the environmentVariables value */ - public List environmentVariables() { + public List environmentVariables() { return this.environmentVariables; } @@ -525,11 +617,31 @@ public List environmentVariables() { * @param environmentVariables the environmentVariables value to set * @return the JobInner object itself. */ - public JobInner withEnvironmentVariables(List environmentVariables) { + public JobInner withEnvironmentVariables(List environmentVariables) { this.environmentVariables = environmentVariables; return this; } + /** + * Get the secrets value. + * + * @return the secrets value + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets value. + * + * @param secrets the secrets value to set + * @return the JobInner object itself. + */ + public JobInner withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + /** * Get the constraints value. * diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/JobsInner.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/JobsInner.java index 8e90073e95b..48f5c0664ec 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/JobsInner.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/JobsInner.java @@ -107,7 +107,7 @@ interface JobsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.batchai.Jobs listOutputFiles" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/jobs/{jobName}/listOutputFiles") - Observable> listOutputFiles(@Path("resourceGroupName") String resourceGroupName, @Path("jobName") String jobName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("outputdirectoryid") String outputdirectoryid, @Query("linkexpiryinminutes") Integer linkexpiryinminutes, @Query("maxresults") Integer maxResults, @Header("User-Agent") String userAgent); + Observable> listOutputFiles(@Path("resourceGroupName") String resourceGroupName, @Path("jobName") String jobName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("outputdirectoryid") String outputdirectoryid, @Query("directory") String directory, @Query("linkexpiryinminutes") Integer linkexpiryinminutes, @Query("maxresults") Integer maxResults, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.batchai.Jobs listRemoteLoginInformationNext" }) @GET @@ -1292,7 +1292,7 @@ private ServiceResponse> listByResourceGroupDelegate(Response } /** - * List all files inside the given output directory (Only if the output directory is on Azure File Share or Azure Storage container). + * List all directories and files inside the given directory of the output directory (Only if the output directory is on Azure File Share or Azure Storage container). * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param jobName The name of the job within the specified resource group. Job names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. @@ -1313,7 +1313,7 @@ public Page nextPage(String nextPageLink) { } /** - * List all files inside the given output directory (Only if the output directory is on Azure File Share or Azure Storage container). + * List all directories and files inside the given directory of the output directory (Only if the output directory is on Azure File Share or Azure Storage container). * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param jobName The name of the job within the specified resource group. Job names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. @@ -1335,7 +1335,7 @@ public Observable>> call(String nextPageLink) { } /** - * List all files inside the given output directory (Only if the output directory is on Azure File Share or Azure Storage container). + * List all directories and files inside the given directory of the output directory (Only if the output directory is on Azure File Share or Azure Storage container). * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param jobName The name of the job within the specified resource group. Job names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. @@ -1354,7 +1354,7 @@ public Page call(ServiceResponse> response) { } /** - * List all files inside the given output directory (Only if the output directory is on Azure File Share or Azure Storage container). + * List all directories and files inside the given directory of the output directory (Only if the output directory is on Azure File Share or Azure Storage container). * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param jobName The name of the job within the specified resource group. Job names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. @@ -1377,7 +1377,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. ServiceResponse> * @param jobName The name of the job within the specified resource group. Job names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. @@ -1403,9 +1403,10 @@ public Observable>> listOutputFilesSinglePageAsy } Validator.validate(jobsListOutputFilesOptions); String outputdirectoryid = jobsListOutputFilesOptions.outputdirectoryid(); + String directory = jobsListOutputFilesOptions.directory(); Integer linkexpiryinminutes = jobsListOutputFilesOptions.linkexpiryinminutes(); Integer maxResults = jobsListOutputFilesOptions.maxResults(); - return service.listOutputFiles(resourceGroupName, jobName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), outputdirectoryid, linkexpiryinminutes, maxResults, this.client.userAgent()) + return service.listOutputFiles(resourceGroupName, jobName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), outputdirectoryid, directory, linkexpiryinminutes, maxResults, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -1760,7 +1761,7 @@ private ServiceResponse> listByResourceGroupNextDelegate(Resp } /** - * List all files inside the given output directory (Only if the output directory is on Azure File Share or Azure Storage container). + * List all directories and files inside the given directory of the output directory (Only if the output directory is on Azure File Share or Azure Storage container). * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1779,7 +1780,7 @@ public Page nextPage(String nextPageLink) { } /** - * List all files inside the given output directory (Only if the output directory is on Azure File Share or Azure Storage container). + * List all directories and files inside the given directory of the output directory (Only if the output directory is on Azure File Share or Azure Storage container). * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -1800,7 +1801,7 @@ public Observable>> call(String nextPageLink) { } /** - * List all files inside the given output directory (Only if the output directory is on Azure File Share or Azure Storage container). + * List all directories and files inside the given directory of the output directory (Only if the output directory is on Azure File Share or Azure Storage container). * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1817,7 +1818,7 @@ public Page call(ServiceResponse> response) { } /** - * List all files inside the given output directory (Only if the output directory is on Azure File Share or Azure Storage container). + * List all directories and files inside the given directory of the output directory (Only if the output directory is on Azure File Share or Azure Storage container). * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1838,7 +1839,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/JobsListOutputFilesOptionsInner.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/JobsListOutputFilesOptionsInner.java index 9bf3f78556b..eb91667d6db 100644 --- a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/JobsListOutputFilesOptionsInner.java +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/JobsListOutputFilesOptionsInner.java @@ -21,6 +21,12 @@ public class JobsListOutputFilesOptionsInner { @JsonProperty(value = "", required = true) private String outputdirectoryid; + /** + * The path to the directory. + */ + @JsonProperty(value = "") + private String directory; + /** * The number of minutes after which the download link will expire. */ @@ -54,6 +60,26 @@ public JobsListOutputFilesOptionsInner withOutputdirectoryid(String outputdirect return this; } + /** + * Get the directory value. + * + * @return the directory value + */ + public String directory() { + return this.directory; + } + + /** + * Set the directory value. + * + * @param directory the directory value to set + * @return the JobsListOutputFilesOptionsInner object itself. + */ + public JobsListOutputFilesOptionsInner withDirectory(String directory) { + this.directory = directory; + return this; + } + /** * Get the linkexpiryinminutes value. * diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/UsageInner.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/UsageInner.java new file mode 100644 index 00000000000..cb8bd8c5adc --- /dev/null +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/UsageInner.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.batchai.implementation; + +import com.microsoft.azure.management.batchai.UsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes Batch AI Resource Usage. + */ +public class UsageInner { + /** + * An enum describing the unit of usage measurement. + */ + @JsonProperty(value = "unit", required = true) + private String unit; + + /** + * The current usage of the resource. + */ + @JsonProperty(value = "currentValue", required = true) + private int currentValue; + + /** + * The maximum permitted usage of the resource. + */ + @JsonProperty(value = "limit", required = true) + private long limit; + + /** + * The name of the type of usage. + */ + @JsonProperty(value = "name", required = true) + private UsageName name; + + /** + * Creates an instance of UsageInner class. + */ + public UsageInner() { + unit = "Count"; + } + + /** + * Get the unit value. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit value. + * + * @param unit the unit value to set + * @return the UsageInner object itself. + */ + public UsageInner withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the currentValue value. + * + * @return the currentValue value + */ + public int currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue value. + * + * @param currentValue the currentValue value to set + * @return the UsageInner object itself. + */ + public UsageInner withCurrentValue(int currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the limit value. + * + * @return the limit value + */ + public long limit() { + return this.limit; + } + + /** + * Set the limit value. + * + * @param limit the limit value to set + * @return the UsageInner object itself. + */ + public UsageInner withLimit(long limit) { + this.limit = limit; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the UsageInner object itself. + */ + public UsageInner withName(UsageName name) { + this.name = name; + return this; + } + +} diff --git a/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/UsagesInner.java b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/UsagesInner.java new file mode 100644 index 00000000000..bda801f6949 --- /dev/null +++ b/azure-mgmt-batchai/src/main/java/com/microsoft/azure/management/batchai/implementation/UsagesInner.java @@ -0,0 +1,295 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.batchai.implementation; + +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.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +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.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 Usages. + */ +public class UsagesInner { + /** The Retrofit service to perform REST calls. */ + private UsagesService service; + /** The service client containing this operation class. */ + private BatchAIManagementClientImpl client; + + /** + * Initializes an instance of UsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsagesInner(Retrofit retrofit, BatchAIManagementClientImpl client) { + this.service = retrofit.create(UsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Usages to be + * used by Retrofit to perform actually REST calls. + */ + interface UsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.batchai.Usages list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.BatchAI/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); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.batchai.Usages listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the current usage information as well as limits for Batch AI resources for given subscription. + * + * @param location The location for which resource usage is queried. + * @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<UsageInner> object if successful. + */ + public PagedList list(final String location) { + ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the current usage information as well as limits for Batch AI resources for given subscription. + * + * @param location The location for which resource usage is queried. + * @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 String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the current usage information as well as limits for Batch AI resources for given subscription. + * + * @param location The location for which resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the current usage information as well as limits for Batch AI resources for given subscription. + * + * @param location The location for which resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { + return listSinglePageAsync(location) + .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)); + } + }); + } + + /** + * Gets the current usage information as well as limits for Batch AI resources for given subscription. + * + ServiceResponse> * @param location The location for which resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final 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> 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); + } + + /** + * Gets the current usage information as well as limits for Batch AI resources for given subscription. + * + * @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<UsageInner> 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(); + } + }; + } + + /** + * Gets the current usage information as well as limits for Batch AI resources for given subscription. + * + * @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); + } + + /** + * Gets the current usage information as well as limits for Batch AI resources for given subscription. + * + * @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<UsageInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the current usage information as well as limits for Batch AI resources for given subscription. + * + * @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<UsageInner> 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)); + } + }); + } + + /** + * Gets the current usage information as well as limits for Batch AI resources for given subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UsageInner> 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); + } + +}