Skip to content
Closed
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
2 changes: 1 addition & 1 deletion sdk/batch/batch/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020 Microsoft
Copyright (c) 2021 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
68 changes: 68 additions & 0 deletions sdk/batch/batch/src/batchService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import { TokenCredential } from "@azure/core-auth";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as Models from "./models";
import * as Mappers from "./models/mappers";
import * as operations from "./operations";
import { BatchServiceContext } from "./batchServiceContext";


class BatchService extends BatchServiceContext {
// Operation groups
application: operations.Application;
pool: operations.Pool;
account: operations.Account;
job: operations.Job;
certificate: operations.CertificateOperations;
file: operations.File;
jobSchedule: operations.JobSchedule;
task: operations.Task;
computeNode: operations.ComputeNodeOperations;
computeNodeExtension: operations.ComputeNodeExtension;
computeNodeExtensions: operations.ComputeNodeExtensions;

/**
* Initializes a new instance of the BatchService class.
* @param credentials Credentials needed for the client to connect to Azure. Credentials
* implementing the TokenCredential interface from the @azure/identity package are recommended. For
* more information about these credentials, see
* {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
* ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
* @azure/ms-rest-browserauth are also supported.
* @param batchUrl The base URL for all Azure Batch service requests.
* @param [options] The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, batchUrl: string, options?: msRest.AzureServiceClientOptions) {
super(credentials, batchUrl, options);
this.application = new operations.Application(this);
this.pool = new operations.Pool(this);
this.account = new operations.Account(this);
this.job = new operations.Job(this);
this.certificate = new operations.CertificateOperations(this);
this.file = new operations.File(this);
this.jobSchedule = new operations.JobSchedule(this);
this.task = new operations.Task(this);
this.computeNode = new operations.ComputeNodeOperations(this);
this.computeNodeExtension = new operations.ComputeNodeExtension(this);
this.computeNodeExtensions = new operations.ComputeNodeExtensions(this);
}
}

// Operation Specifications

export {
BatchService,
BatchServiceContext,
Models as BatchServiceModels,
Mappers as BatchServiceMappers
};
export * from "./operations";
66 changes: 66 additions & 0 deletions sdk/batch/batch/src/batchServiceContext.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import { TokenCredential } from "@azure/core-auth";

const packageName = "@azure/batch";
const packageVersion = "8.0.0";

export class BatchServiceContext extends msRestAzure.AzureServiceClient {
credentials: msRest.ServiceClientCredentials | TokenCredential;
apiVersion?: string;
batchUrl: string;

/**
* Initializes a new instance of the BatchService class.
* @param credentials Credentials needed for the client to connect to Azure. Credentials
* implementing the TokenCredential interface from the @azure/identity package are recommended. For
* more information about these credentials, see
* {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
* ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
* @azure/ms-rest-browserauth are also supported.
* @param batchUrl The base URL for all Azure Batch service requests.
* @param [options] The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, batchUrl: string, options?: msRestAzure.AzureServiceClientOptions) {
if (credentials == undefined) {
throw new Error('\'credentials\' cannot be null.');
}
if (batchUrl == undefined) {
throw new Error('\'batchUrl\' cannot be null.');
}

if (!options) {
options = {};
}
if (!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}

super(credentials, options);

this.apiVersion = '2021-06-01.14.0';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.baseUri = "{batchUrl}";
this.requestContentType = "application/json; charset=utf-8";
this.credentials = credentials;
this.batchUrl = batchUrl;

if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
}
}
}
4 changes: 2 additions & 2 deletions sdk/batch/batch/src/models/accountMappers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
4 changes: 2 additions & 2 deletions sdk/batch/batch/src/models/applicationMappers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
4 changes: 2 additions & 2 deletions sdk/batch/batch/src/models/certificateOperationsMappers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
18 changes: 18 additions & 0 deletions sdk/batch/batch/src/models/computeNodeExtensionMappers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

export {
BatchError,
BatchErrorDetail,
ComputeNodeExtensionGetHeaders,
ErrorMessage,
InstanceViewStatus,
NodeVMExtension,
VMExtension,
VMExtensionInstanceView
} from "../models/mappers";
19 changes: 19 additions & 0 deletions sdk/batch/batch/src/models/computeNodeExtensionsMappers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

export {
BatchError,
BatchErrorDetail,
ComputeNodeExtensionsListHeaders,
ErrorMessage,
InstanceViewStatus,
NodeVMExtension,
NodeVMExtensionList,
VMExtension,
VMExtensionInstanceView
} from "../models/mappers";
9 changes: 6 additions & 3 deletions sdk/batch/batch/src/models/computeNodeOperationsMappers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand All @@ -22,6 +22,7 @@ export {
ComputeNodeGetRemoteDesktopHeaders,
ComputeNodeGetRemoteLoginSettingsHeaders,
ComputeNodeGetRemoteLoginSettingsResult,
ComputeNodeIdentityReference,
ComputeNodeListHeaders,
ComputeNodeListResult,
ComputeNodeRebootHeaders,
Expand All @@ -32,6 +33,7 @@ export {
ContainerRegistry,
EnvironmentSetting,
ErrorMessage,
ImageReference,
InboundEndpoint,
NameValuePair,
NodeAgentInformation,
Expand All @@ -49,5 +51,6 @@ export {
TaskInformation,
UploadBatchServiceLogsConfiguration,
UploadBatchServiceLogsResult,
UserIdentity
UserIdentity,
VirtualMachineInfo
} from "../models/mappers";
4 changes: 2 additions & 2 deletions sdk/batch/batch/src/models/fileMappers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Loading