From 68c8da604a93740f5f074046f9d8ffe23c5a2f41 Mon Sep 17 00:00:00 2001 From: wiboris <54044985+wiboris@users.noreply.github.com> Date: Thu, 9 May 2024 14:22:36 -0700 Subject: [PATCH] TypeSpec changes for CSharp (#29018) * changes for CSharp --- specification/batch/Azure.Batch/client.tsp | 25 +- specification/batch/Azure.Batch/common.tsp | 405 ++++++++++++++ specification/batch/Azure.Batch/main.tsp | 2 +- specification/batch/Azure.Batch/models.tsp | 14 +- specification/batch/Azure.Batch/routes.tsp | 527 +++--------------- .../batch/Azure.Batch/tspconfig.yaml | 2 +- .../preview/2024-02-01.19.0/BatchService.json | 102 ++-- 7 files changed, 562 insertions(+), 515 deletions(-) create mode 100644 specification/batch/Azure.Batch/common.tsp diff --git a/specification/batch/Azure.Batch/client.tsp b/specification/batch/Azure.Batch/client.tsp index 16ca55edcaa0..646d764ec8bd 100644 --- a/specification/batch/Azure.Batch/client.tsp +++ b/specification/batch/Azure.Batch/client.tsp @@ -4,19 +4,26 @@ import "./main.tsp"; using Azure.ClientGenerator.Core; // operation overrides -@@access(Azure.Batch.BatchOps.ListOperation, Access.internal, "java"); -@@access(Azure.Batch.BatchOps.ReadOperation, Access.internal, "java"); -@@access(Azure.Batch.BatchOps.DeleteOperation, Access.internal, "java"); -@@access(Azure.Batch.BatchOps.CreateOperation, Access.internal, "java"); -@@access(Azure.Batch.BatchOps.UpdateOperation, Access.internal, "java"); -@@access(Azure.Batch.BatchOps.ReplaceOperation, Access.internal, "java"); -@@access(Azure.Batch.BatchOps.PostOperation, Access.internal, "java"); -@@access(Azure.Batch.BatchOps.ResourceInfoOperation, Access.internal, "java"); -@@access(Azure.Batch.BatchOps.ResourceInfoOperationWithAdditionalResponse, +@@access(Azure.Batch.ListOperation, Access.internal, "java"); +@@access(Azure.Batch.ReadOperation, Access.internal, "java"); +@@access(Azure.Batch.DeleteOperation, Access.internal, "java"); +@@access(Azure.Batch.CreateOperation, Access.internal, "java"); +@@access(Azure.Batch.UpdateOperation, Access.internal, "java"); +@@access(Azure.Batch.ReplaceOperation, Access.internal, "java"); +@@access(Azure.Batch.PostOperation, Access.internal, "java"); +@@access(Azure.Batch.FileOperation, Access.internal, "java"); +@@access(Azure.Batch.HeadFileOperation, Access.internal, "java"); +@@access(Azure.Batch.ResourceInfoOperationWithAdditionalResponse, Access.internal, "java" ); +// Api overrides +@@access(Azure.Batch.Batch.poolExists, Access.internal, "csharp"); +@@access(Azure.Batch.Batch.jobScheduleExists, Access.internal, "csharp"); +@@access(Azure.Batch.Batch.getTaskFileProperties, Access.internal, "csharp"); +@@access(Azure.Batch.Batch.getNodeFileProperties, Access.internal, "csharp"); + // model overrides @@access(Azure.Batch.BatchApplicationListResult, Access.public, "java"); @@access(Azure.Batch.BatchApplication, Access.public, "java"); diff --git a/specification/batch/Azure.Batch/common.tsp b/specification/batch/Azure.Batch/common.tsp new file mode 100644 index 000000000000..a0d24afac769 --- /dev/null +++ b/specification/batch/Azure.Batch/common.tsp @@ -0,0 +1,405 @@ +import "@typespec/versioning"; +import "@typespec/http"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-client-generator-core"; +import "@typespec/rest"; +import "./models.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Azure.Core; +using Azure.Core.Traits; +using Azure.ClientGenerator.Core; + +namespace Azure.Batch; + +// Batch operation definitions +#suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" +@get +op ListOperation is Azure.Core.RpcOperation< + BatchCommonListHeaders & TFilter, + BatchResponseHeaders & TResponse, + NoFilter, + BatchError +>; + +#suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" +@get +op ReadOperation< + TPathParams extends TypeSpec.Reflection.Model, + TResource +> is Azure.Core.RpcOperation< + BatchClientRequestHeaders & TPathParams, + TResource & BatchResponseHeaders, + NoFilter, + BatchError +>; + +#suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" +@get +op FileOperation< + TPathParams extends TypeSpec.Reflection.Model, + TResource +> is Azure.Core.RpcOperation< + BatchClientRequestHeaders & TPathParams, + TResource & FileResponseHeaders, + NoFilter, + BatchError +>; + +#suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" +@head +op HeadFileOperation< + TPathParams extends TypeSpec.Reflection.Model, + TResource +> is Azure.Core.RpcOperation< + BatchClientRequestHeaders & TPathParams, + TResource & FileResponseHeaders, + NoFilter, + BatchError +>; + +#suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" +@delete +op DeleteOperation< + TFilter, + TResponse extends TypeSpec.Reflection.Model +> is Azure.Core.RpcOperation< + BatchClientRequestHeaders & TFilter, + TResponse, + NoFilter, + BatchError +>; + +#suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" +@post +op CreateOperation is RpcOperation< + BatchClientRequestHeaders & MinimalMetadata & TResource, + Created & BatchResponseHeaders, + NoFilter, + BatchError +>; + +#suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" +@patch +op UpdateOperation is RpcOperation< + BatchClientRequestHeaders & MinimalMetadata & TResource, + TResponse & BatchResponseHeaders, + NoFilter, + BatchError +>; + +#suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" +@put +op ReplaceOperation is RpcOperation< + BatchClientRequestHeaders & MinimalMetadata & TResource, + TResponse & BatchResponseHeaders, + NoFilter, + BatchError +>; + +#suppress "@azure-tools/typespec-azure-core/no-error-status-codes" "Azure REST API guidelines recommend using 'default' error response for all error cases. Avoid defining custom 4xx or 5xx error cases." +#suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" +@doc("New rpc operation allowing multiple repsonses") +@Foundations.Private.needsRoute +@head +op ResourceInfoOperationWithAdditionalResponse< + TParams extends TypeSpec.Reflection.Model, + TResponse extends TypeSpec.Reflection.Model, + TAdditionalResponse extends {} = {} +> is Foundations.Operation< + TParams, + TResponse | TAdditionalResponse, + NoFilter, + BatchError +>; + +#suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" +@post +op PostOperation is RpcOperation< + BatchClientRequestHeaders & TResource, + TResponse & BatchResponseHeaders, + NoFilter, + BatchError +>; + +// Templates +alias NoFilter = {}; +alias MinimalMetadata = { + @doc("Type of content") + @header("content-type") + contentType: "application/json; odata=minimalmetadata"; +}; + +alias Created = { + @doc("A process exit code.") + @statusCode + code: "201"; + + @header("DataServiceId") + @doc("The OData ID of the resource to which the request applied.") + dataServiceId: string; + + ...T; +}; + +// headers //////////////////// + +alias AcceptedProcessingResponseHeaders = { + @doc("A process exit code.") + @statusCode + code: "202"; + + ...DataServiceResponseHeaders; +}; + +alias NoContentSuccessResponseHeaders = { + @doc("A process exit code.") + @statusCode + code: "204"; + + ...DataServiceResponseHeaders; +}; + +alias RequestSuccessResponseHeaders = { + @doc("A process exit code.") + @statusCode + code: "200"; + + ...DataServiceResponseHeaders; +}; + +alias DataServiceResponseHeaders = { + @header("DataServiceId") + @doc("The OData ID of the resource to which the request applied.") + dataServiceId: string; +}; + +alias FileResponseHeaders = { + @doc("A process exit code.") + @statusCode + code: "200"; + + @header("Content-Length") + @doc("The length of the file.") + contentLength: int64; + + ...BatchEtagResponseHeaders; + + @doc("The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true.") + @header("client-request-id") + clientRequestId?: string; + + @header("ocp-batch-file-isdirectory") + @doc("Whether the object represents a directory.") + ocpbatchfileisdirectory: boolean; + + @header("ocp-batch-file-mode") + @doc("The file mode attribute in octal format.") + ocpbatchfilemode: string; + + @header("ocp-batch-file-url") + @doc("The URL of the file.") + ocpbatchfileurl: string; + + @header("ocp-creation-time") + @doc("The file creation time.") + @encode(DateTimeKnownEncoding.rfc7231) + ocpcreationtime?: utcDateTime; + + @doc("A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in.") + @header("request-id") + requestid?: string; +}; + +alias BatchPoolHeaders = { + ...BatchMatchHeaders; + + @doc("The ID of the Pool to get.") + @path + poolId: string; +}; + +alias BatchMatchHeaders = { + ...BatchModifiedSinceHeaders; + + @doc(""" + An ETag value associated with the version of the resource known to the client. + The operation will be performed only if the resource's current ETag on the + service exactly matches the value specified by the client. + """) + @header("If-Match") + @clientName("if__match", "python") + ifMatch?: string; + + @doc(""" + An ETag value associated with the version of the resource known to the client. + The operation will be performed only if the resource's current ETag on the + service does not match the value specified by the client. + """) + @header("If-None-Match") + @clientName("if_none_match", "python") + ifNoneMatch?: string; +}; + +alias BatchModifiedSinceHeaders = { + @doc(""" + A timestamp indicating the last modified time of the resource known to the + client. The operation will be performed only if the resource on the service has + been modified since the specified time. + """) + @header("If-Modified-Since") + @encode(DateTimeKnownEncoding.rfc7231) + @clientName("if_modified_since", "python") + ifModifiedSince?: utcDateTime; + + @doc(""" + A timestamp indicating the last modified time of the resource known to the + client. The operation will be performed only if the resource on the service has + not been modified since the specified time. + """) + @header("If-Unmodified-Since") + @encode(DateTimeKnownEncoding.rfc7231) + @clientName("if_unmodified_since", "python") + ifUnmodifiedSince?: utcDateTime; +}; + +// This is the standard set of headers that most of batch apis return +alias BatchResponseHeaders = BatchEtagResponseHeaders & + BatchClientResponseHeaders; + +alias BatchEtagResponseHeaders = { + @doc("The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers.") + @header("ETag") + @clientName("etag", "python") + etag?: string; + + @doc("The time at which the resource was last modified.") + @header("Last-Modified") + @encode(DateTimeKnownEncoding.rfc7231) + lastmodified?: utcDateTime; +}; + +alias BatchClientResponseHeaders = { + @doc("The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true.") + @header("client-request-id") + clientRequestId?: string; + + @doc("A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in.") + @header("request-id") + requestid?: string; +}; + +alias PoolDoesExistResponseHeaders = { + ...BatchResponseHeaders; + + @doc("A process exit code.") + @statusCode + code: "200"; +}; + +alias PoolDoesNotExistResponseHeaders = { + @doc("A process exit code.") + @statusCode + code: "404"; +}; + +alias JobScheduleDoesExistResponseHeaders = { + ...BatchResponseHeaders; + + @doc("A response containing headers related to the Job Schedule, if it exists.") + @statusCode + code: "200"; +}; + +alias JobScheduleDoesNotExistResponseHeaders = { + @doc("The Job Schedule does not exist.") + @statusCode + code: "404"; +}; + +alias DeleteResponseHeaders = { + @doc("A process exit code.") + @statusCode + code: "202"; + + @doc("The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true.") + @header("client-request-id") + clientRequestId?: string; + + @doc("A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in.") + @header("request-id") + requestid?: string; +}; + +alias BatchCommonListHeaders = { + ...BatchClientRequestHeaders; + + @doc(""" + The maximum number of items to return in the response. A maximum of 1000 + applications can be returned. + """) + @query + @minValue(1) + @maxValue(1000) + @clientName("maxPageSize", "java") + maxresults?: int32 = 1000; +}; + +alias BatchNodeFileClientPathContent = { + @doc("The ID of the Pool that contains the Compute Node.") + @path + poolId: string; + + @doc("The ID of the Compute Node.") + @path + nodeId: string; + + @doc("The path to the file or directory.") + @path + filePath: string; +}; + +alias BatchTaskFileClientPathContent = { + @doc("The ID of the Job that contains the Task.") + @path + jobId: string; + + @doc("The ID of the Task whose file you want to retrieve.") + @path + taskId: string; + + @doc("The path to the Task file that you want to get the content of.") + @path + filePath: string; +}; + +alias BatchClientRequestHeaders = { + @doc(""" + The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + """) + @query + @clientName("timeOutInSeconds") + timeOut?: int32 = 30; + + @doc(""" + The caller-generated request identity, in the form of a GUID with no decoration + such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + """) + @header("client-request-id") + clientRequestId?: string; + + @doc("Whether the server should return the client-request-id in the response.") + @header("return-client-request-id") + returnClientRequestId?: boolean = false; + + @doc(""" + The time the request was issued. Client libraries typically set this to the + current system clock time; set it explicitly if you are calling the REST API + directly. + """) + @header("ocp-date") + @encode(DateTimeKnownEncoding.rfc7231) + ocpdate?: utcDateTime; +}; diff --git a/specification/batch/Azure.Batch/main.tsp b/specification/batch/Azure.Batch/main.tsp index b46ce19b1dd3..e61b87a7f3aa 100644 --- a/specification/batch/Azure.Batch/main.tsp +++ b/specification/batch/Azure.Batch/main.tsp @@ -33,5 +33,5 @@ namespace Azure.Batch; enum Versions { @doc("API Version 2024-02-01.19.0") @useDependency(Azure.Core.Versions.v1_0_Preview_2) - `2024-02-01.19.0`, + v2024_02_01: "2024-02-01.19.0", } diff --git a/specification/batch/Azure.Batch/models.tsp b/specification/batch/Azure.Batch/models.tsp index fc0b941a9cf8..3d1ec61ad43a 100644 --- a/specification/batch/Azure.Batch/models.tsp +++ b/specification/batch/Azure.Batch/models.tsp @@ -745,7 +745,7 @@ model BatchPoolUsageMetrics { model BatchAccountListSupportedImagesResult { @doc("The list of supported Virtual Machine Images.") @items - value?: ImageInfo[]; + value?: BatchSupportedImage[]; #suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Property types must use camelCase" @doc("The URL to get the next set of results.") @@ -757,7 +757,7 @@ model BatchAccountListSupportedImagesResult { A reference to the Azure Virtual Machines Marketplace Image and additional information about the Image. """) -model ImageInfo { +model BatchSupportedImage { #suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Property types must use camelCase" @doc("The ID of the Compute Node agent SKU which the Image supports.") @clientName("nodeAgentSkuId") @@ -1349,14 +1349,14 @@ model BatchTaskContainerSettings { imageName: string; @doc("The private registry which contains the container Image. This setting can be omitted if was already provided at Pool creation.") - registry?: ContainerRegistry; + registry?: ContainerRegistryReference; @doc("The location of the container Task working directory. The default is 'taskWorkingDirectory'.") workingDirectory?: ContainerWorkingDirectory; } @doc("A private container registry.") -model ContainerRegistry { +model ContainerRegistryReference { @doc("The user name to log into the registry server.") username?: string; @@ -1810,7 +1810,7 @@ model ContainerConfiguration { containerImageNames?: string[]; @doc("Additional private registries from which containers can be pulled. If any Images must be downloaded from a private registry which requires credentials, then those credentials must be provided here.") - containerRegistries?: ContainerRegistry[]; + containerRegistries?: ContainerRegistryReference[]; } @doc(""" @@ -1923,7 +1923,7 @@ model NetworkConfiguration { model BatchPoolEndpointConfiguration { @doc("A list of inbound NAT Pools that can be used to address specific ports on an individual Compute Node externally. The maximum number of inbound NAT Pools per Batch Pool is 5. If the maximum number of inbound NAT Pools is exceeded the request fails with HTTP status code 400. This cannot be specified if the IPAddressProvisioningType is NoPublicIPAddresses.") @clientName("inboundNatPools") - inboundNATPools: InboundNATPool[]; + inboundNATPools: InboundNatPool[]; } #suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Property types must use camelCase" @@ -1931,7 +1931,7 @@ model BatchPoolEndpointConfiguration { A inbound NAT Pool that can be used to address specific ports on Compute Nodes in a Batch Pool externally. """) -model InboundNATPool { +model InboundNatPool { @doc("The name of the endpoint. The name must be unique within a Batch Pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400.") name: string; diff --git a/specification/batch/Azure.Batch/routes.tsp b/specification/batch/Azure.Batch/routes.tsp index 7ca8fc711a75..803597d80403 100644 --- a/specification/batch/Azure.Batch/routes.tsp +++ b/specification/batch/Azure.Batch/routes.tsp @@ -4,6 +4,7 @@ import "@azure-tools/typespec-azure-core"; import "@azure-tools/typespec-client-generator-core"; import "@typespec/rest"; import "./models.tsp"; +import "./common.tsp"; using TypeSpec.Http; using TypeSpec.Rest; @@ -14,124 +15,6 @@ using Azure.ClientGenerator.Core; namespace Azure.Batch; -// Templates - -@clientName("Ops") -interface BatchOps { - #suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" - @get - ListOperation is Azure.Core.RpcOperation< - BatchCommonListHeaders & TFilter, - BatchResponseHeaders & TResponse, - NoFilter, - BatchError - >; - - #suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" - @get - ReadOperation< - TPathParams extends TypeSpec.Reflection.Model, - TResource - > is Azure.Core.RpcOperation< - BatchClientRequestHeaders & TPathParams, - BatchResponseHeaders & TResource, - NoFilter, - BatchError - >; - - #suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" - @delete - DeleteOperation< - TFilter, - TResponse extends TypeSpec.Reflection.Model - > is Azure.Core.RpcOperation< - BatchClientRequestHeaders & TFilter, - TResponse, - NoFilter, - BatchError - >; - - #suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" - @post - CreateOperation is RpcOperation< - BatchClientRequestHeaders & MinimalMetadata & TResource, - BatchResponseHeaders & Created, - NoFilter, - BatchError - >; - - #suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" - @patch - UpdateOperation is RpcOperation< - BatchClientRequestHeaders & MinimalMetadata & TResource, - BatchResponseHeaders & TResponse, - NoFilter, - BatchError - >; - - #suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" - @put - ReplaceOperation is RpcOperation< - BatchClientRequestHeaders & MinimalMetadata & TResource, - BatchResponseHeaders & TResponse, - NoFilter, - BatchError - >; - - #suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" - @head - ResourceInfoOperation is RpcOperation< - BatchClientRequestHeaders & TResource, - BatchResponseHeaders & TResponse, - NoFilter, - BatchError - >; - - #suppress "@azure-tools/typespec-azure-core/no-error-status-codes" "Azure REST API guidelines recommend using 'default' error response for all error cases. Avoid defining custom 4xx or 5xx error cases." - #suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" - @doc("New rpc operation allowing multiple repsonses") - @Foundations.Private.needsRoute - @head - ResourceInfoOperationWithAdditionalResponse< - TParams extends TypeSpec.Reflection.Model, - TResponse extends TypeSpec.Reflection.Model, - TAdditionalResponse extends {} = {} - > is Foundations.Operation< - TParams, - TResponse | TAdditionalResponse, - NoFilter, - BatchError - >; - - #suppress "@azure-tools/typespec-azure-core/no-response-body" "Legacy behavior" - @post - PostOperation is RpcOperation< - BatchClientRequestHeaders & TResource, - BatchResponseHeaders & TResponse, - NoFilter, - BatchError - >; -} - -alias NoFilter = {}; -alias MinimalMetadata = { - @doc("Type of content") - @header("content-type") - contentType: "application/json; odata=minimalmetadata"; -}; - -alias Created = { - @doc("A process exit code.") - @statusCode - code: "201"; - - @header("DataServiceId") - @doc("The OData ID of the resource to which the request applied.") - dataServiceId: string; - - ...T; -}; - // Interfaces //////////////////// #suppress "@azure-tools/typespec-azure-core/no-response-body" "The body of non-204 responses should not be empty." @@ -140,8 +23,11 @@ alias Created = { #suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Model types must use camelCase" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Operation 'Exists' should be defined using a signature from the Azure.Core namespace." #suppress "@azure-tools/typespec-azure-core/rpc-operation-request-body" "BatchOperation with '@get' cannot have a body." -@clientName("Batch") -interface BatchApi { +@client({ + name: "BatchClient", + service: Azure.Batch, +}) +interface Batch { @summary("Lists all of the applications available in the specified Account.") @doc(""" This operation returns only Applications and versions that are available for @@ -152,7 +38,7 @@ API. """) @route("/applications") @clientName("listApplicationsInternal", "java") - listApplications is BatchOps.ListOperation<{}, BatchApplicationListResult>; + listApplications is ListOperation<{}, BatchApplicationListResult>; @summary("Gets information about the specified Application.") @doc(""" @@ -164,7 +50,7 @@ API. """) @route("/applications/{applicationId}") @clientName("getApplicationInternal", "java") - getApplication is BatchOps.ReadOperation< + getApplication is ReadOperation< { @doc("The ID of the Application") @path @@ -187,7 +73,7 @@ last aggregation interval is returned. """) @route("/poolusagemetrics") @clientName("listPoolUsageMetricsInternal", "java") - listPoolUsageMetrics is BatchOps.ListOperation< + listPoolUsageMetrics is ListOperation< { @doc(""" The earliest time from which to include metrics. This must be at least two and @@ -225,7 +111,7 @@ to Microsoft Support engineers. """) @route("/pools") @clientName("createPoolInternal", "java") - createPool is BatchOps.CreateOperation< + createPool is CreateOperation< { @body @doc("The Pool to be created.") @@ -238,7 +124,7 @@ to Microsoft Support engineers. @doc("Lists all of the Pools in the specified Account.") @route("/pools") @clientName("listPoolsInternal", "java") - listPools is BatchOps.ListOperation< + listPools is ListOperation< { @doc(""" An OData $filter clause. For more information on constructing this filter, see @@ -282,15 +168,12 @@ error code PoolBeingDeleted. """) @route("/pools/{poolId}") @clientName("deletePoolInternal", "java") - deletePool is BatchOps.DeleteOperation< - BatchPoolHeaders, - DeleteResponseHeaders - >; + deletePool is DeleteOperation; @doc("Gets basic properties of a Pool.") @route("/pools/{poolId}") @clientName("poolExistsInternal", "java") - poolExists is BatchOps.ResourceInfoOperationWithAdditionalResponse< + poolExists is ResourceInfoOperationWithAdditionalResponse< BatchClientRequestHeaders & BatchPoolHeaders, PoolDoesNotExistResponseHeaders, PoolDoesExistResponseHeaders @@ -299,7 +182,7 @@ error code PoolBeingDeleted. @doc("Gets information about the specified Pool.") @route("/pools/{poolId}") @clientName("getPoolInternal", "java") - getPool is BatchOps.ReadOperation< + getPool is ReadOperation< BatchPoolHeaders & { @doc("An OData $select clause.") @query({ @@ -326,7 +209,7 @@ a StartTask element, then the Pool keeps the existing StartTask. """) @route("/pools/{poolId}") @clientName("updatePoolInternal", "java") - updatePool is BatchOps.UpdateOperation< + updatePool is UpdateOperation< BatchPoolHeaders & { @doc("The pool properties to update.") @body @@ -339,7 +222,7 @@ a StartTask element, then the Pool keeps the existing StartTask. @doc("Disables automatic scaling for a Pool.") @route("/pools/{poolId}/disableautoscale") @clientName("disablePoolAutoScaleInternal", "java") - disablePoolAutoScale is BatchOps.PostOperation< + disablePoolAutoScale is PostOperation< { @doc("The ID of the Pool on which to disable automatic scaling.") @path @@ -359,7 +242,7 @@ more than once every 30 seconds. """) @route("/pools/{poolId}/enableautoscale") @clientName("enablePoolAutoScaleInternal", "java") - enablePoolAutoScale is BatchOps.PostOperation< + enablePoolAutoScale is PostOperation< BatchPoolHeaders & MinimalMetadata & { @doc("The options to use for enabling automatic scaling.") @@ -377,7 +260,7 @@ scaling enabled in order to evaluate a formula. """) @route("/pools/{poolId}/evaluateautoscale") @clientName("evaluatePoolAutoScaleInternal", "java") - evaluatePoolAutoScale is BatchOps.PostOperation< + evaluatePoolAutoScale is PostOperation< MinimalMetadata & { @doc("The ID of the Pool on which to evaluate the automatic scaling formula.") @path @@ -402,7 +285,7 @@ Nodes, use the Pool remove Compute Nodes API instead. """) @route("/pools/{poolId}/resize") @clientName("resizePoolInternal", "java") - resizePool is BatchOps.PostOperation< + resizePool is PostOperation< BatchPoolHeaders & MinimalMetadata & { @doc("The options to use for resizing the pool.") @@ -424,7 +307,7 @@ be used to halt the initial sizing of the Pool when it is created. """) @route("/pools/{poolId}/stopresize") @clientName("stopPoolResizeInternal", "java") - stopPoolResize is BatchOps.PostOperation< + stopPoolResize is PostOperation< BatchPoolHeaders, AcceptedProcessingResponseHeaders >; @@ -437,7 +320,7 @@ with this request, then the Batch service will remove the existing StartTask. """) @route("/pools/{poolId}/updateproperties") @clientName("replacePoolPropertiesInternal", "java") - replacePoolProperties is BatchOps.PostOperation< + replacePoolProperties is PostOperation< MinimalMetadata & { @doc("The ID of the Pool to update.") @path @@ -458,7 +341,7 @@ Each request may remove up to 100 nodes. """) @route("/pools/{poolId}/removenodes") @clientName("removeNodesInternal", "java") - removeNodes is BatchOps.PostOperation< + removeNodes is PostOperation< BatchPoolHeaders & MinimalMetadata & { @doc("The options to use for removing the node.") @@ -472,7 +355,7 @@ Each request may remove up to 100 nodes. @doc("Lists all Virtual Machine Images supported by the Azure Batch service.") @route("/supportedimages") @clientName("listSupportedImagesInternal", "java") - listSupportedImages is BatchOps.ListOperation< + listSupportedImages is ListOperation< { @doc(""" An OData $filter clause. For more information on constructing this filter, see @@ -492,7 +375,7 @@ use a list query. """) @route("/nodecounts") @clientName("listPoolNodeCountsInternal", "java") - listPoolNodeCounts is BatchOps.ListOperation< + listPoolNodeCounts is ListOperation< { @doc(""" An OData $filter clause. For more information on constructing this filter, see @@ -518,7 +401,7 @@ that the Job is being deleted. """) @route("/jobs/{jobId}") @clientName("deleteJobInternal", "java") - deleteJob is BatchOps.DeleteOperation< + deleteJob is DeleteOperation< BatchMatchHeaders & { @doc("The ID of the Job to delete.") @path @@ -531,7 +414,7 @@ that the Job is being deleted. @doc("Gets information about the specified Job.") @route("/jobs/{jobId}") @clientName("getJobInternal", "java") - getJob is BatchOps.ReadOperation< + getJob is ReadOperation< BatchMatchHeaders & { @doc("The ID of the Job.") @path @@ -562,7 +445,7 @@ element, then the Job keeps the existing constraints. """) @route("/jobs/{jobId}") @clientName("updateJobInternal", "java") - updateJob is BatchOps.UpdateOperation< + updateJob is UpdateOperation< BatchMatchHeaders & { @doc("The ID of the Job whose properties you want to update.") @path @@ -583,7 +466,7 @@ with this request, then the Batch service will remove the existing constraints. """) @route("/jobs/{jobId}") @clientName("replaceJobInternal", "java") - replaceJob is BatchOps.ReplaceOperation< + replaceJob is ReplaceOperation< BatchMatchHeaders & { @doc("The ID of the Job whose properties you want to update.") @path @@ -609,7 +492,7 @@ the request fails with status code 409. """) @route("/jobs/{jobId}/disable") @clientName("disableJobInternal", "java") - disableJob is BatchOps.PostOperation< + disableJob is PostOperation< BatchMatchHeaders & MinimalMetadata & { @doc("The ID of the Job to disable.") @@ -634,7 +517,7 @@ than 180 days ago, those Tasks will not run. """) @route("/jobs/{jobId}/enable") @clientName("enableJobInternal", "java") - enableJob is BatchOps.PostOperation< + enableJob is PostOperation< BatchMatchHeaders & { @doc("The ID of the Job to enable.") @path @@ -654,7 +537,7 @@ Tasks cannot be added and any remaining active Tasks will not be scheduled. """) @route("/jobs/{jobId}/terminate") @clientName("terminateJobInternal", "java") - terminateJob is BatchOps.PostOperation< + terminateJob is PostOperation< BatchMatchHeaders & MinimalMetadata & { @doc("The ID of the Job to terminate.") @@ -682,7 +565,7 @@ engineers. """) @route("/jobs") @clientName("createJobInternal", "java") - createJob is BatchOps.CreateOperation< + createJob is CreateOperation< { @doc("The Job to be created.") @body @@ -695,7 +578,7 @@ engineers. @doc("Lists all of the Jobs in the specified Account.") @route("/jobs") @clientName("listJobsInternal", "java") - listJobs is BatchOps.ListOperation< + listJobs is ListOperation< { @doc(""" An OData $filter clause. For more information on constructing this filter, see @@ -726,7 +609,7 @@ https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#li @doc("Lists the Jobs that have been created under the specified Job Schedule.") @route("/jobschedules/{jobScheduleId}/jobs") @clientName("listJobsFromScheduleInternal", "java") - listJobsFromSchedule is BatchOps.ListOperation< + listJobsFromSchedule is ListOperation< { @doc("The ID of the Job Schedule from which you want to get a list of Jobs.") @path @@ -771,7 +654,7 @@ JobPreparationTaskNotSpecified. """) @route("/jobs/{jobId}/jobpreparationandreleasetaskstatus") @clientName("listJobPreparationAndReleaseTaskStatusInternal", "java") - listJobPreparationAndReleaseTaskStatus is BatchOps.ListOperation< + listJobPreparationAndReleaseTaskStatus is ListOperation< { @doc("The ID of the Job.") @path @@ -804,7 +687,7 @@ up to date. If you need exact task counts, use a list query. """) @route("/jobs/{jobId}/taskcounts") @clientName("getJobTaskCountsInternal", "java") - getJobTaskCounts is BatchOps.ReadOperation< + getJobTaskCounts is ReadOperation< { @doc("The ID of the Job.") @path @@ -817,7 +700,7 @@ up to date. If you need exact task counts, use a list query. @doc("Checks the specified Job Schedule exists.") @route("/jobschedules/{jobScheduleId}") @clientName("jobScheduleExistsInternal", "java") - jobScheduleExists is BatchOps.ResourceInfoOperationWithAdditionalResponse< + jobScheduleExists is ResourceInfoOperationWithAdditionalResponse< BatchClientRequestHeaders & BatchMatchHeaders & { @doc("The ID of the Job Schedule which you want to check.") @@ -838,7 +721,7 @@ though they are still counted towards Account lifetime statistics. """) @route("/jobschedules/{jobScheduleId}") @clientName("deleteJobScheduleInternal", "java") - deleteJobSchedule is BatchOps.DeleteOperation< + deleteJobSchedule is DeleteOperation< BatchMatchHeaders & { @doc("The ID of the Job Schedule to delete.") @path @@ -850,7 +733,7 @@ though they are still counted towards Account lifetime statistics. @doc("Gets information about the specified Job Schedule.") @route("/jobschedules/{jobScheduleId}") @clientName("getJobScheduleInternal", "java") - getJobSchedule is BatchOps.ReadOperation< + getJobSchedule is ReadOperation< BatchMatchHeaders & { @doc("The ID of the Job Schedule to get.") @path @@ -883,7 +766,7 @@ running Jobs are unaffected. """) @route("/jobschedules/{jobScheduleId}") @clientName("updateJobScheduleInternal", "java") - updateJobSchedule is BatchOps.UpdateOperation< + updateJobSchedule is UpdateOperation< BatchMatchHeaders & { @doc("The ID of the Job Schedule to update.") @path @@ -906,7 +789,7 @@ running Jobs are unaffected. """) @route("/jobschedules/{jobScheduleId}") @clientName("replaceJobScheduleInternal", "java") - replaceJobSchedule is BatchOps.ReplaceOperation< + replaceJobSchedule is ReplaceOperation< BatchMatchHeaders & { @doc("The ID of the Job Schedule to update.") @path @@ -923,7 +806,7 @@ running Jobs are unaffected. @doc("No new Jobs will be created until the Job Schedule is enabled again.") @route("/jobschedules/{jobScheduleId}/disable") @clientName("disableJobScheduleInternal", "java") - disableJobSchedule is BatchOps.PostOperation< + disableJobSchedule is PostOperation< BatchMatchHeaders & { @doc("The ID of the Job Schedule to disable.") @path @@ -936,7 +819,7 @@ running Jobs are unaffected. @doc("Enables a Job Schedule.") @route("/jobschedules/{jobScheduleId}/enable") @clientName("enableJobScheduleInternal", "java") - enableJobSchedule is BatchOps.PostOperation< + enableJobSchedule is PostOperation< BatchMatchHeaders & { @doc("The ID of the Job Schedule to enable.") @path @@ -949,7 +832,7 @@ running Jobs are unaffected. @doc("Terminates a Job Schedule.") @route("/jobschedules/{jobScheduleId}/terminate") @clientName("terminateJobScheduleInternal", "java") - terminateJobSchedule is BatchOps.PostOperation< + terminateJobSchedule is PostOperation< BatchMatchHeaders & { @doc("The ID of the Job Schedule to terminates.") @path @@ -962,7 +845,7 @@ running Jobs are unaffected. @doc("Creates a Job Schedule to the specified Account.") @route("/jobschedules") @clientName("createJobScheduleInternal", "java") - createJobSchedule is BatchOps.CreateOperation< + createJobSchedule is CreateOperation< { @doc("The Job Schedule to be created.") @body @@ -975,7 +858,7 @@ running Jobs are unaffected. @doc("Lists all of the Job Schedules in the specified Account.") @route("/jobschedules") @clientName("listJobSchedulesInternal", "java") - listJobSchedules is BatchOps.ListOperation< + listJobSchedules is ListOperation< { @doc(""" An OData $filter clause. For more information on constructing this filter, see @@ -1010,7 +893,7 @@ the Batch service and left in whatever state it was in at that time. """) @route("/jobs/{jobId}/tasks") @clientName("createTaskInternal", "java") - createTask is BatchOps.CreateOperation< + createTask is CreateOperation< { @doc("The ID of the Job to which the Task is to be created.") @path @@ -1031,7 +914,7 @@ information about subtasks. """) @route("/jobs/{jobId}/tasks") @clientName("listTasksInternal", "java") - listTasks is BatchOps.ListOperation< + listTasks is ListOperation< { @doc("The ID of the Job.") @path @@ -1081,7 +964,7 @@ service and left in whatever state it was in at that time. """) @route("/jobs/{jobId}/addtaskcollection") @clientName("createTaskCollectionInternal", "java") - createTaskCollection is BatchOps.PostOperation< + createTaskCollection is PostOperation< MinimalMetadata & { @doc("The ID of the Job to which the Task collection is to be added.") @path @@ -1104,7 +987,7 @@ background. """) @route("/jobs/{jobId}/tasks/{taskId}") @clientName("deleteTaskInternal", "java") - deleteTask is BatchOps.DeleteOperation< + deleteTask is DeleteOperation< BatchMatchHeaders & { @doc("The ID of the Job from which to delete the Task.") @path @@ -1129,7 +1012,7 @@ information about subtasks. """) @route("/jobs/{jobId}/tasks/{taskId}") @clientName("getTaskInternal", "java") - getTask is BatchOps.ReadOperation< + getTask is ReadOperation< BatchMatchHeaders & { @doc("The ID of the Job that contains the Task.") @path @@ -1159,7 +1042,7 @@ information about subtasks. @doc("Updates the properties of the specified Task.") @route("/jobs/{jobId}/tasks/{taskId}") @clientName("replaceTaskInternal", "java") - replaceTask is BatchOps.ReplaceOperation< + replaceTask is ReplaceOperation< BatchMatchHeaders & { @doc("The ID of the Job containing the Task.") @path @@ -1184,7 +1067,7 @@ Task. @doc("If the Task is not a multi-instance Task then this returns an empty collection.") @route("/jobs/{jobId}/tasks/{taskId}/subtasksinfo") @clientName("listSubTasksInternal", "java") - listSubTasks is BatchOps.ReadOperation< + listSubTasks is ReadOperation< { @doc("The ID of the Job.") @path @@ -1212,7 +1095,7 @@ primary task; subtasks are then terminated asynchronously in the background. """) @route("/jobs/{jobId}/tasks/{taskId}/terminate") @clientName("terminateTaskInternal", "java") - terminateTask is BatchOps.PostOperation< + terminateTask is PostOperation< BatchMatchHeaders & { @doc("The ID of the Job containing the Task.") @path @@ -1240,7 +1123,7 @@ will fail if the Job has completed (or is terminating or deleting). """) @route("/jobs/{jobId}/tasks/{taskId}/reactivate") @clientName("reactivateTaskInternal", "java") - reactivateTask is BatchOps.PostOperation< + reactivateTask is PostOperation< BatchMatchHeaders & { @doc("The ID of the Job containing the Task.") @path @@ -1257,7 +1140,7 @@ will fail if the Job has completed (or is terminating or deleting). @doc("Deletes the specified Task file from the Compute Node where the Task ran.") @route("/jobs/{jobId}/tasks/{taskId}/files/{filePath}") @clientName("deleteTaskFileInternal", "java") - deleteTaskFile is BatchOps.DeleteOperation< + deleteTaskFile is DeleteOperation< BatchTaskFileClientPathContent & { @doc(""" Whether to delete children of a directory. If the filePath parameter represents @@ -1278,7 +1161,7 @@ then the directory must be empty or deletion will fail. @doc("Returns the content of the specified Task file.") @route("/jobs/{jobId}/tasks/{taskId}/files/{filePath}") @clientName("getTaskFileInternal", "java") - getTaskFile is BatchOps.ReadOperation< + getTaskFile is FileOperation< BatchTaskFileClientPathContent & BatchModifiedSinceHeaders & { @doc(""" @@ -1288,7 +1171,7 @@ format is bytes=startRange-endRange. @header `ocp-range`?: string; }, - FileResponseHeaders & { + { @doc("Type of content") @header("content-type") contentType: "application/octet-stream"; @@ -1302,16 +1185,17 @@ format is bytes=startRange-endRange. @doc("Gets the properties of the specified Task file.") @route("/jobs/{jobId}/tasks/{taskId}/files/{filePath}") @clientName("getTaskFilePropertiesInternal", "java") - getTaskFileProperties is BatchOps.ResourceInfoOperation< + @clientName("getTaskFilePropertiesInternal", "csharp") + getTaskFileProperties is HeadFileOperation< BatchTaskFileClientPathContent & BatchModifiedSinceHeaders, - FileResponseHeaders + {} >; @summary("Lists the files in a Task's directory on its Compute Node.") @doc("Lists the files in a Task's directory on its Compute Node.") @route("/jobs/{jobId}/tasks/{taskId}/files") @clientName("listTaskFilesInternal", "java") - listTaskFiles is BatchOps.ListOperation< + listTaskFiles is ListOperation< { @doc("The ID of the Job that contains the Task.") @path @@ -1346,7 +1230,7 @@ running state. """) @route("/pools/{poolId}/nodes/{nodeId}/users") @clientName("createNodeUserInternal", "java") - createNodeUser is BatchOps.CreateOperation< + createNodeUser is CreateOperation< { @doc("The ID of the Pool that contains the Compute Node.") @path @@ -1370,7 +1254,7 @@ running state. """) @route("/pools/{poolId}/nodes/{nodeId}/users/{userName}") @clientName("deleteNodeUserInternal", "java") - deleteNodeUser is BatchOps.DeleteOperation< + deleteNodeUser is DeleteOperation< { @doc("The ID of the Pool that contains the Compute Node.") @path @@ -1402,7 +1286,7 @@ Account on a Compute Node only when it is in the idle or running state. """) @route("/pools/{poolId}/nodes/{nodeId}/users/{userName}") @clientName("replaceNodeUserInternal", "java") - replaceNodeUser is BatchOps.ReplaceOperation< + replaceNodeUser is ReplaceOperation< { @doc("The ID of the Pool that contains the Compute Node.") @path @@ -1427,7 +1311,7 @@ Account on a Compute Node only when it is in the idle or running state. @doc("Gets information about the specified Compute Node.") @route("/pools/{poolId}/nodes/{nodeId}") @clientName("getNodeInternal", "java") - getNode is BatchOps.ReadOperation< + getNode is ReadOperation< { @doc("The ID of the Pool that contains the Compute Node.") @path @@ -1451,7 +1335,7 @@ Account on a Compute Node only when it is in the idle or running state. @doc("You can restart a Compute Node only if it is in an idle or running state.") @route("/pools/{poolId}/nodes/{nodeId}/reboot") @clientName("rebootNodeInternal", "java") - rebootNode is BatchOps.PostOperation< + rebootNode is PostOperation< MinimalMetadata & { @doc("The ID of the Pool that contains the Compute Node.") @path @@ -1475,7 +1359,7 @@ scheduling state is enabled. """) @route("/pools/{poolId}/nodes/{nodeId}/disablescheduling") @clientName("disableNodeSchedulingInternal", "java") - disableNodeScheduling is BatchOps.PostOperation< + disableNodeScheduling is PostOperation< MinimalMetadata & { @doc("The ID of the Pool that contains the Compute Node.") @path @@ -1499,7 +1383,7 @@ state is disabled """) @route("/pools/{poolId}/nodes/{nodeId}/enablescheduling") @clientName("enableNodeSchedulingInternal", "java") - enableNodeScheduling is BatchOps.PostOperation< + enableNodeScheduling is PostOperation< { @doc("The ID of the Pool that contains the Compute Node.") @path @@ -1520,7 +1404,7 @@ invoked only on Pools created with the virtual machine configuration property. """) @route("/pools/{poolId}/nodes/{nodeId}/remoteloginsettings") @clientName("getNodeRemoteLoginSettingsInternal", "java") - getNodeRemoteLoginSettings is BatchOps.ReadOperation< + getNodeRemoteLoginSettings is ReadOperation< { @doc("The ID of the Pool that contains the Compute Node.") @path @@ -1545,7 +1429,7 @@ support to aid in debugging issues with the Batch service. """) @route("/pools/{poolId}/nodes/{nodeId}/uploadbatchservicelogs") @clientName("uploadNodeLogsInternal", "java") - uploadNodeLogs is BatchOps.PostOperation< + uploadNodeLogs is PostOperation< MinimalMetadata & { @doc("The ID of the Pool that contains the Compute Node.") @path @@ -1569,7 +1453,7 @@ Protocol file. @doc("Lists the Compute Nodes in the specified Pool.") @route("/pools/{poolId}/nodes") @clientName("listNodesInternal", "java") - listNodes is BatchOps.ListOperation< + listNodes is ListOperation< { @doc("The ID of the Pool from which you want to list Compute Nodes.") @path @@ -1597,7 +1481,7 @@ https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#li @doc("Gets information about the specified Compute Node Extension.") @route("/pools/{poolId}/nodes/{nodeId}/extensions/{extensionName}") @clientName("getNodeExtensionInternal", "java") - getNodeExtension is BatchOps.ReadOperation< + getNodeExtension is ReadOperation< { @doc("The ID of the Pool that contains the Compute Node.") @path @@ -1627,7 +1511,7 @@ The name of the Compute Node Extension that you want to get information about. @doc("Lists the Compute Nodes Extensions in the specified Pool.") @route("/pools/{poolId}/nodes/{nodeId}/extensions") @clientName("listNodeExtensionsInternal", "java") - listNodeExtensions is BatchOps.ListOperation< + listNodeExtensions is ListOperation< { @doc("The ID of the Pool that contains Compute Node.") @path @@ -1651,7 +1535,7 @@ The name of the Compute Node Extension that you want to get information about. @doc("Deletes the specified file from the Compute Node.") @route("/pools/{poolId}/nodes/{nodeId}/files/{filePath}") @clientName("deleteNodeFileInternal", "java") - deleteNodeFile is BatchOps.DeleteOperation< + deleteNodeFile is DeleteOperation< BatchNodeFileClientPathContent & { @doc(""" Whether to delete children of a directory. If the filePath parameter represents @@ -1672,7 +1556,7 @@ then the directory must be empty or deletion will fail. @doc("Returns the content of the specified Compute Node file.") @route("/pools/{poolId}/nodes/{nodeId}/files/{filePath}") @clientName("getNodeFileInternal", "java") - getNodeFile is BatchOps.ReadOperation< + getNodeFile is FileOperation< BatchNodeFileClientPathContent & BatchModifiedSinceHeaders & { @doc(""" @@ -1682,7 +1566,7 @@ format is bytes=startRange-endRange. @header `ocp-range`?: string; }, - FileResponseHeaders & { + { @doc("Type of content") @header("content-type") contentType: "application/octet-stream"; @@ -1696,16 +1580,17 @@ format is bytes=startRange-endRange. @doc("Gets the properties of the specified Compute Node file.") @route("/pools/{poolId}/nodes/{nodeId}/files/{filePath}") @clientName("getNodeFilePropertiesInternal", "java") - getNodeFileProperties is BatchOps.ResourceInfoOperation< + @clientName("getNodeFilePropertiesInternal", "csharp") + getNodeFileProperties is HeadFileOperation< BatchNodeFileClientPathContent & BatchModifiedSinceHeaders, - FileResponseHeaders + {} >; @summary("Lists all of the files in Task directories on the specified Compute Node.") @doc("Lists all of the files in Task directories on the specified Compute Node.") @route("/pools/{poolId}/nodes/{nodeId}/files") @clientName("listNodeFilesInternal", "java") - listNodeFiles is BatchOps.ListOperation< + listNodeFiles is ListOperation< { @doc("The ID of the Pool that contains the Compute Node.") @path @@ -1730,253 +1615,3 @@ https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#li BatchNodeFileListResult >; } - -// headers //////////////////// - -alias AcceptedProcessingResponseHeaders = { - @doc("A process exit code.") - @statusCode - code: "202"; - - ...DataServiceResponseHeaders; -}; - -alias NoContentSuccessResponseHeaders = { - @doc("A process exit code.") - @statusCode - code: "204"; - - ...DataServiceResponseHeaders; -}; - -alias RequestSuccessResponseHeaders = { - @doc("A process exit code.") - @statusCode - code: "200"; - - ...DataServiceResponseHeaders; -}; - -alias DataServiceResponseHeaders = { - @header("DataServiceId") - @doc("The OData ID of the resource to which the request applied.") - dataServiceId: string; -}; - -alias FileResponseHeaders = { - @doc("A process exit code.") - @statusCode - code: "200"; - - @header("ocp-creation-time") - @doc("The file creation time.") - @encode(DateTimeKnownEncoding.rfc7231) - ocpcreationtime?: utcDateTime; - - @header("ocp-batch-file-isdirectory") - @doc("Whether the object represents a directory.") - ocpbatchfileisdirectory: boolean; - - @header("ocp-batch-file-url") - @doc("The URL of the file.") - ocpbatchfileurl: string; - - @header("ocp-batch-file-mode") - @doc("The file mode attribute in octal format.") - ocpbatchfilemode: string; - - @header("Content-Length") - @doc("The length of the file.") - contentLength: int64; -}; - -alias BatchPoolHeaders = { - ...BatchMatchHeaders; - - @doc("The ID of the Pool to get.") - @path - poolId: string; -}; - -alias BatchMatchHeaders = { - ...BatchModifiedSinceHeaders; - - @doc(""" -An ETag value associated with the version of the resource known to the client. -The operation will be performed only if the resource's current ETag on the -service exactly matches the value specified by the client. -""") - @header("If-Match") - @clientName("if__match", "python") - ifMatch?: string; - - @doc(""" -An ETag value associated with the version of the resource known to the client. -The operation will be performed only if the resource's current ETag on the -service does not match the value specified by the client. -""") - @header("If-None-Match") - @clientName("if_none_match", "python") - ifNoneMatch?: string; -}; - -alias BatchModifiedSinceHeaders = { - @doc(""" -A timestamp indicating the last modified time of the resource known to the -client. The operation will be performed only if the resource on the service has -been modified since the specified time. -""") - @header("If-Modified-Since") - @encode(DateTimeKnownEncoding.rfc7231) - @clientName("if_modified_since", "python") - ifModifiedSince?: utcDateTime; - - @doc(""" -A timestamp indicating the last modified time of the resource known to the -client. The operation will be performed only if the resource on the service has -not been modified since the specified time. -""") - @header("If-Unmodified-Since") - @encode(DateTimeKnownEncoding.rfc7231) - @clientName("if_unmodified_since", "python") - ifUnmodifiedSince?: utcDateTime; -}; - -// This is the standard set of headers that most of batch apis return -alias BatchResponseHeaders = BatchClientResponseHeaders & - BatchEtagResponseHeaders; - -alias BatchEtagResponseHeaders = { - @doc("The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers.") - @header("ETag") - @clientName("etag", "python") - etag?: string; - - @doc("The time at which the resource was last modified.") - @header("Last-Modified") - @encode(DateTimeKnownEncoding.rfc7231) - lastmodified?: utcDateTime; -}; - -alias BatchClientResponseHeaders = { - @doc("The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true.") - @header("client-request-id") - clientRequestId?: string; - - @doc("A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in.") - @header("request-id") - requestid?: string; -}; - -alias PoolDoesExistResponseHeaders = { - ...BatchResponseHeaders; - - @doc("A process exit code.") - @statusCode - code: "200"; -}; - -alias PoolDoesNotExistResponseHeaders = { - @doc("A process exit code.") - @statusCode - code: "404"; -}; - -alias JobScheduleDoesExistResponseHeaders = { - ...BatchResponseHeaders; - - @doc("A response containing headers related to the Job Schedule, if it exists.") - @statusCode - code: "200"; -}; - -alias JobScheduleDoesNotExistResponseHeaders = { - @doc("The Job Schedule does not exist.") - @statusCode - code: "404"; -}; - -alias DeleteResponseHeaders = { - @doc("A process exit code.") - @statusCode - code: "202"; - - @doc("The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true.") - @header("client-request-id") - clientRequestId?: string; - - @doc("A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in.") - @header("request-id") - requestid?: string; -}; - -alias BatchCommonListHeaders = { - ...BatchClientRequestHeaders; - - @doc(""" -The maximum number of items to return in the response. A maximum of 1000 -applications can be returned. -""") - @query - @minValue(1) - @maxValue(1000) - @clientName("maxPageSize", "java") - maxresults?: int32 = 1000; -}; - -alias BatchNodeFileClientPathContent = { - @doc("The ID of the Pool that contains the Compute Node.") - @path - poolId: string; - - @doc("The ID of the Compute Node.") - @path - nodeId: string; - - @doc("The path to the file or directory.") - @path - filePath: string; -}; - -alias BatchTaskFileClientPathContent = { - @doc("The ID of the Job that contains the Task.") - @path - jobId: string; - - @doc("The ID of the Task whose file you want to retrieve.") - @path - taskId: string; - - @doc("The path to the Task file that you want to get the content of.") - @path - filePath: string; -}; - -alias BatchClientRequestHeaders = { - @doc(""" -The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". -""") - @query - @clientName("timeOutInSeconds") - timeOut?: int32 = 30; - - @doc(""" -The caller-generated request identity, in the form of a GUID with no decoration -such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. -""") - @header("client-request-id") - clientRequestId?: string; - - @doc("Whether the server should return the client-request-id in the response.") - @header("return-client-request-id") - returnClientRequestId?: boolean = false; - - @doc(""" -The time the request was issued. Client libraries typically set this to the -current system clock time; set it explicitly if you are calling the REST API -directly. -""") - @header("ocp-date") - @encode(DateTimeKnownEncoding.rfc7231) - ocpdate?: utcDateTime; -}; diff --git a/specification/batch/Azure.Batch/tspconfig.yaml b/specification/batch/Azure.Batch/tspconfig.yaml index 70fe5978cfd4..f1283c2b239f 100644 --- a/specification/batch/Azure.Batch/tspconfig.yaml +++ b/specification/batch/Azure.Batch/tspconfig.yaml @@ -16,7 +16,7 @@ options: package-dir: "Azure.Batch" clear-output-folder: true model-namespace: false - head-as-boolean: true + head-as-boolean: false namespace: Azure.Compute.Batch flavor: azure "@azure-tools/typespec-java": diff --git a/specification/batch/data-plane/Azure.Batch/preview/2024-02-01.19.0/BatchService.json b/specification/batch/data-plane/Azure.Batch/preview/2024-02-01.19.0/BatchService.json index 92e720442c8a..0bbaab972290 100644 --- a/specification/batch/data-plane/Azure.Batch/preview/2024-02-01.19.0/BatchService.json +++ b/specification/batch/data-plane/Azure.Batch/preview/2024-02-01.19.0/BatchService.json @@ -8789,7 +8789,7 @@ "type": "array", "description": "The list of supported Virtual Machine Images.", "items": { - "$ref": "#/definitions/ImageInfo" + "$ref": "#/definitions/BatchSupportedImage" }, "x-ms-identifiers": [] }, @@ -11827,7 +11827,7 @@ "type": "array", "description": "A list of inbound NAT Pools that can be used to address specific ports on an individual Compute Node externally. The maximum number of inbound NAT Pools per Batch Pool is 5. If the maximum number of inbound NAT Pools is exceeded the request fails with HTTP status code 400. This cannot be specified if the IPAddressProvisioningType is NoPublicIPAddresses.", "items": { - "$ref": "#/definitions/InboundNATPool" + "$ref": "#/definitions/InboundNatPool" }, "x-ms-client-name": "inboundNatPools", "x-ms-identifiers": [] @@ -11845,7 +11845,7 @@ "type": "array", "description": "A list of inbound NAT Pools that can be used to address specific ports on an individual Compute Node externally. The maximum number of inbound NAT Pools per Batch Pool is 5. If the maximum number of inbound NAT Pools is exceeded the request fails with HTTP status code 400. This cannot be specified if the IPAddressProvisioningType is NoPublicIPAddresses.", "items": { - "$ref": "#/definitions/InboundNATPool" + "$ref": "#/definitions/InboundNatPool" }, "x-ms-client-name": "inboundNatPools", "x-ms-identifiers": [] @@ -12811,6 +12811,47 @@ ] } }, + "BatchSupportedImage": { + "type": "object", + "description": "A reference to the Azure Virtual Machines Marketplace Image and additional\ninformation about the Image.", + "properties": { + "nodeAgentSKUId": { + "type": "string", + "description": "The ID of the Compute Node agent SKU which the Image supports.", + "x-ms-client-name": "nodeAgentSkuId" + }, + "imageReference": { + "$ref": "#/definitions/ImageReference", + "description": "The reference to the Azure Virtual Machine's Marketplace Image." + }, + "osType": { + "$ref": "#/definitions/OSType", + "description": "The type of operating system (e.g. Windows or Linux) of the Image." + }, + "capabilities": { + "type": "array", + "description": "The capabilities or features which the Image supports. Not every capability of the Image is listed. Capabilities in this list are considered of special interest and are generally related to integration with other features in the Azure Batch service.", + "items": { + "type": "string" + } + }, + "batchSupportEndOfLife": { + "type": "string", + "format": "date-time", + "description": "The time when the Azure Batch service will stop accepting create Pool requests for the Image." + }, + "verificationType": { + "$ref": "#/definitions/ImageVerificationType", + "description": "Whether the Azure Batch service actively verifies that the Image is compatible with the associated Compute Node agent SKU." + } + }, + "required": [ + "nodeAgentSKUId", + "imageReference", + "osType", + "verificationType" + ] + }, "BatchTask": { "type": "object", "description": "Batch will retry Tasks when a recovery operation is triggered on a Node.\nExamples of recovery operations include (but are not limited to) when an\nunhealthy Node is rebooted or a Compute Node disappeared due to host failure.\nRetries due to recovery operations are independent of and are not counted\nagainst the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal\nretry due to a recovery operation may occur. Because of this, all Tasks should\nbe idempotent. This means Tasks need to tolerate being interrupted and\nrestarted without causing any corruption or duplicate data. The best practice\nfor long running Tasks is to use some form of checkpointing.", @@ -13103,7 +13144,7 @@ "description": "The Image to use to create the container in which the Task will run. This is the full Image reference, as would be specified to \"docker pull\". If no tag is provided as part of the Image name, the tag \":latest\" is used as a default." }, "registry": { - "$ref": "#/definitions/ContainerRegistry", + "$ref": "#/definitions/ContainerRegistryReference", "description": "The private registry which contains the container Image. This setting can be omitted if was already provided at Pool creation." }, "workingDirectory": { @@ -13128,7 +13169,7 @@ "description": "The Image to use to create the container in which the Task will run. This is the full Image reference, as would be specified to \"docker pull\". If no tag is provided as part of the Image name, the tag \":latest\" is used as a default." }, "registry": { - "$ref": "#/definitions/ContainerRegistry", + "$ref": "#/definitions/ContainerRegistryReference", "description": "The private registry which contains the container Image. This setting can be omitted if was already provided at Pool creation." }, "workingDirectory": { @@ -13774,7 +13815,7 @@ "type": "array", "description": "Additional private registries from which containers can be pulled. If any Images must be downloaded from a private registry which requires credentials, then those credentials must be provided here.", "items": { - "$ref": "#/definitions/ContainerRegistry" + "$ref": "#/definitions/ContainerRegistryReference" }, "x-ms-identifiers": [] } @@ -13802,13 +13843,13 @@ "type": "array", "description": "Additional private registries from which containers can be pulled. If any Images must be downloaded from a private registry which requires credentials, then those credentials must be provided here.", "items": { - "$ref": "#/definitions/ContainerRegistry" + "$ref": "#/definitions/ContainerRegistryReference" }, "x-ms-identifiers": [] } } }, - "ContainerRegistry": { + "ContainerRegistryReference": { "type": "object", "description": "A private container registry.", "properties": { @@ -14260,47 +14301,6 @@ "name" ] }, - "ImageInfo": { - "type": "object", - "description": "A reference to the Azure Virtual Machines Marketplace Image and additional\ninformation about the Image.", - "properties": { - "nodeAgentSKUId": { - "type": "string", - "description": "The ID of the Compute Node agent SKU which the Image supports.", - "x-ms-client-name": "nodeAgentSkuId" - }, - "imageReference": { - "$ref": "#/definitions/ImageReference", - "description": "The reference to the Azure Virtual Machine's Marketplace Image." - }, - "osType": { - "$ref": "#/definitions/OSType", - "description": "The type of operating system (e.g. Windows or Linux) of the Image." - }, - "capabilities": { - "type": "array", - "description": "The capabilities or features which the Image supports. Not every capability of the Image is listed. Capabilities in this list are considered of special interest and are generally related to integration with other features in the Azure Batch service.", - "items": { - "type": "string" - } - }, - "batchSupportEndOfLife": { - "type": "string", - "format": "date-time", - "description": "The time when the Azure Batch service will stop accepting create Pool requests for the Image." - }, - "verificationType": { - "$ref": "#/definitions/ImageVerificationType", - "description": "Whether the Azure Batch service actively verifies that the Image is compatible with the associated Compute Node agent SKU." - } - }, - "required": [ - "nodeAgentSKUId", - "imageReference", - "osType", - "verificationType" - ] - }, "ImageReference": { "type": "object", "description": "A reference to an Azure Virtual Machines Marketplace Image or a Azure Compute Gallery Image.\nTo get the list of all Azure Marketplace Image references verified by Azure Batch, see the\n' List Supported Images ' operation.", @@ -14421,7 +14421,7 @@ ] } }, - "InboundNATPool": { + "InboundNatPool": { "type": "object", "description": "A inbound NAT Pool that can be used to address specific ports on Compute Nodes\nin a Batch Pool externally.", "properties": { @@ -15619,7 +15619,7 @@ "modelAsString": true, "values": [ { - "name": "2024-02-01.19.0", + "name": "v2024_02_01", "value": "2024-02-01.19.0", "description": "API Version 2024-02-01.19.0" }