Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure.Batch Go configuration #32768

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions specification/batch/Azure.Batch/client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,61 @@ interface BatchClient {
"csharp"
);

/* GO OVERRIDES */
// don't export API for this operation because it retired before the first Go SDK release
@@access(Azure.Batch.Pools.listPoolUsageMetrics, Access.internal, "go");
// capitalize initialisms
@@clientName(Azure.Batch.AutomaticOsUpgradePolicy, "AutomaticOSUpgradePolicy", "go");
@@clientName(Azure.Batch.AzureBlobFileSystemConfiguration.sasKey, "SASKey", "go");
@@clientName(Azure.Batch.BatchCommonListHeaders.maxresults, "MaxResults", "go");
@@clientName(Azure.Batch.BatchJobScheduleStatistics.readIOps, "ReadIOPS", "go");
@@clientName(Azure.Batch.BatchJobScheduleStatistics.writeIOps, "WriteIOPS", "go");
@@clientName(Azure.Batch.BatchPoolResourceStatistics.diskReadIOps, "DiskReadIOPS", "go");
@@clientName(Azure.Batch.BatchPoolResourceStatistics.diskWriteIOps, "DiskWriteIOPS", "go");
@@clientName(Azure.Batch.BatchTaskStatistics.readIOps, "ReadIOPS", "go");
@@clientName(Azure.Batch.BatchTaskStatistics.writeIOps, "WriteIOPS", "go");
@@clientName(Azure.Batch.CifsMountConfiguration, "CIFSMountConfiguration", "go");
@@clientName(Azure.Batch.HttpHeader, "HTTPHeader", "go");
@@clientName(Azure.Batch.InboundNatPool, "InboundNATPool", "go");
@@clientName(Azure.Batch.IpAddressProvisioningType, "IPAddressProvisioningType", "go");
@@clientName(Azure.Batch.LinuxUserConfiguration.gid, "GID", "go");
@@clientName(Azure.Batch.NfsMountConfiguration, "NFSMountConfiguration", "go");
@@clientName(Azure.Batch.PublicIpAddressConfiguration, "PublicIPAddressConfiguration", "go");
@@clientName(Azure.Batch.UefiSettings, "UEFISettings", "go");
@@clientName(Azure.Batch.UefiSettings.vTpmEnabled, "VTPMEnabled", "go");
// align model names with method names
@@clientName(Azure.Batch.BatchJobCreateContent, "CreateJobContent", "go");
@@clientName(Azure.Batch.BatchJobDisableContent, "DisableJobContent", "go");
@@clientName(Azure.Batch.BatchJobScheduleCreateContent, "CreateJobScheduleContent", "go");
@@clientName(Azure.Batch.BatchJobTerminateContent, "TerminateJobContent", "go");
@@clientName(Azure.Batch.BatchJobUpdateContent, "UpdateJobContent", "go");
@@clientName(Azure.Batch.BatchJobScheduleUpdateContent, "UpdateJobScheduleContent", "go");
@@clientName(Azure.Batch.BatchNodeDeallocateContent, "DeallocateNodeContent", "go");
@@clientName(Azure.Batch.BatchNodeDisableSchedulingContent, "DisableNodeSchedulingContent", "go");
@@clientName(Azure.Batch.BatchPoolCreateContent, "CreatePoolContent", "go");
@@clientName(Azure.Batch.BatchPoolEnableAutoScaleContent, "EnablePoolAutoScaleContent", "go");
@@clientName(Azure.Batch.BatchPoolEvaluateAutoScaleContent, "EvaluatePoolAutoScaleContent", "go");
@@clientName(Azure.Batch.BatchPoolListUsageMetricsResult, "ListPoolUsageMetricsResult", "go");
@@clientName(Azure.Batch.BatchPoolNodeCountsListResult, "ListPoolNodeCountsResult", "go");
@@clientName(Azure.Batch.BatchPoolReplaceContent, "ReplacePoolContent", "go");
@@clientName(Azure.Batch.BatchPoolResizeContent, "ResizePoolContent", "go");
@@clientName(Azure.Batch.BatchPoolUpdateContent, "UpdatePoolContent", "go");
@@clientName(Azure.Batch.BatchTaskAddCollectionResult, "AddTaskCollectionResult", "go");
@@clientName(Azure.Batch.BatchTaskCreateContent, "CreateTaskContent", "go");
@@clientName(Azure.Batch.BatchNodeRebootContent, "RebootNodeContent", "go");
@@clientName(Azure.Batch.BatchNodeReimageContent, "ReimageNodeContent", "go");
@@clientName(Azure.Batch.BatchNodeRemoveContent, "RemoveNodeContent", "go");
@@clientName(Azure.Batch.BatchNodeUserCreateContent, "CreateNodeUserContent", "go");
@@clientName(Azure.Batch.BatchNodeUserUpdateContent, "UpdateNodeUserContent", "go");
@@clientName(Azure.Batch.UploadBatchServiceLogsContent, "UploadNodeLogsContent", "go");
@@clientName(Azure.Batch.UploadBatchServiceLogsResult, "UploadNodeLogsResult", "go");
// remove "Batch" from field names
@@clientName(Azure.Batch.ContainerHostBatchBindMountEntry, "ContainerHostBindMountEntry", "go");
@@clientName(Azure.Batch.DisableBatchJobOption, "DisableJobOption", "go");
@@clientName(Azure.Batch.OnAllBatchTasksComplete, "OnAllTasksComplete", "go");
@@clientName(Azure.Batch.OnBatchTaskFailure, "OnTaskFailure", "go");
@@clientName(Azure.Batch.RecentBatchJob, "RecentJob", "go");

/* JAVA OVERRIDES */
// client name overrides
@@clientName(BatchClient.listApplications, "listApplicationsInternal", "java");
Expand Down
2 changes: 1 addition & 1 deletion specification/batch/Azure.Batch/common.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ alias BatchClientRequestHeaders = {
@clientName("timeOutInSeconds", "java")
@clientName("timeOutInSeconds", "csharp")
@clientName("timeOutInSeconds", "javascript")
@clientName("timeout", "python")
@clientName("timeout", "go,python")
timeOut?: int32 = 30;

@doc("""
Expand Down
16 changes: 8 additions & 8 deletions specification/batch/Azure.Batch/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ model BatchNodeCounts {

#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Property types must use camelCase"
@doc("The number of Compute Nodes in the upgradingOS state.")
@clientName("upgradingOs")
@clientName("upgradingOs", "!go")
upgradingOS: int32;
}

Expand Down Expand Up @@ -992,7 +992,7 @@ model BatchPoolResourceStatistics {
lastUpdateTime: utcDateTime;

@doc("The average CPU usage across all Compute Nodes in the Pool (percentage per node).")
@clientName("avgCpuPercentage")
@clientName("avgCpuPercentage", "!go")
avgCPUPercentage: float32;

@doc("The average memory usage in GiB across all Compute Nodes in the Pool.")
Expand Down Expand Up @@ -1825,7 +1825,7 @@ model VirtualMachineConfiguration {
imageReference: ImageReference;

@doc("The SKU of the Batch Compute Node agent to be provisioned on Compute Nodes in the Pool. The Batch Compute Node agent is a program that runs on each Compute Node in the Pool, and provides the command-and-control interface between the Compute Node and the Batch service. There are different implementations of the Compute Node agent, known as SKUs, for different operating systems. You must specify a Compute Node agent SKU which matches the selected Image reference. To get the list of supported Compute Node agent SKUs along with their list of verified Image references, see the 'List supported Compute Node agent SKUs' operation.")
@clientName("nodeAgentSkuId")
@clientName("nodeAgentSkuId", "!go")
nodeAgentSKUId: string;

@doc("Windows operating system settings on the virtual machine. This property must not be specified if the imageReference property specifies a Linux OS Image.")
Expand Down Expand Up @@ -1890,7 +1890,7 @@ model DataDisk {
caching?: CachingType;

@doc("The initial disk size in gigabytes.")
@clientName("diskSizeGb")
@clientName("diskSizeGb", "!go")
diskSizeGB: int32;

@doc("The storage Account type to be used for the data disk. If omitted, the default is \"standard_lrs\".")
Expand Down Expand Up @@ -2007,7 +2007,7 @@ model NetworkConfiguration {
endpointConfiguration?: BatchPoolEndpointConfiguration;

@doc("The Public IPAddress configuration for Compute Nodes in the Batch Pool.")
@clientName("publicIpAddressConfiguration")
@clientName("publicIpAddressConfiguration", "!go")
publicIPAddressConfiguration?: PublicIpAddressConfiguration;

@doc("Whether this pool should enable accelerated networking. Accelerated networking enables single root I/O virtualization (SR-IOV) to a VM, which may lead to improved networking performance. For more details, see: https://learn.microsoft.com/azure/virtual-network/accelerated-networking-overview.")
Expand All @@ -2018,7 +2018,7 @@ model NetworkConfiguration {
@doc("The endpoint configuration for a Pool.")
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")
@clientName("inboundNatPools", "!go")
inboundNATPools: InboundNatPool[];
}

Expand Down Expand Up @@ -2302,11 +2302,11 @@ model BatchJobScheduleStatistics {
lastUpdateTime: utcDateTime;

@doc("The total user mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in all Jobs created under the schedule.")
@clientName("userCpuTime")
@clientName("userCpuTime", "!go")
userCPUTime: duration;

@doc("The total kernel mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in all Jobs created under the schedule.")
@clientName("kernelCpuTime")
@clientName("kernelCpuTime", "!go")
kernelCPUTime: duration;

@doc("The total wall clock time of all the Tasks in all the Jobs created under the schedule. The wall clock time is the elapsed time from when the Task started running on a Compute Node to when it finished (or to the last time the statistics were updated, if the Task had not finished by then). If a Task was retried, this includes the wall clock time of all the Task retries.")
Expand Down
9 changes: 9 additions & 0 deletions specification/batch/Azure.Batch/tspconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ options:
head-as-boolean: false
namespace: Azure.Compute.Batch
flavor: azure
"@azure-tools/typespec-go":
emitter-output-dir: "{project-root}"
fix-const-stuttering: true
inject-spans: true
module: "github.com/Azure/azure-sdk-for-go/{service-dir}/azbatch"
module-version: "0.1.0"
package-dir: "azbatch"
service-dir: "sdk/batch"
single-client: true
"@azure-tools/typespec-java":
namespace: "com.azure.compute.batch"
package-dir: "azure-compute-batch"
Expand Down
Loading