@azure/arm-automation
Version:
AutomationClient Library with typescript type definitions for node.js and browser.
337 lines (322 loc) • 13.9 kB
text/typescript
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* 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 * as Models from "../models";
import * as Mappers from "../models/dscCompilationJobOperationsMappers";
import * as Parameters from "../models/parameters";
import { AutomationClientContext } from "../automationClientContext";
/** Class representing a DscCompilationJobOperations. */
export class DscCompilationJobOperations {
private readonly client: AutomationClientContext;
/**
* Create a DscCompilationJobOperations.
* @param {AutomationClientContext} client Reference to the service client.
*/
constructor(client: AutomationClientContext) {
this.client = client;
}
/**
* Creates the Dsc compilation job of the configuration.
* @param resourceGroupName Name of an Azure Resource group.
* @param automationAccountName The name of the automation account.
* @param compilationJobName The the DSC configuration Id.
* @param parameters The parameters supplied to the create compilation job operation.
* @param [options] The optional parameters
* @returns Promise<Models.DscCompilationJobCreateResponse>
*/
create(resourceGroupName: string, automationAccountName: string, compilationJobName: string, parameters: Models.DscCompilationJobCreateParameters, options?: msRest.RequestOptionsBase): Promise<Models.DscCompilationJobCreateResponse> {
return this.beginCreate(resourceGroupName,automationAccountName,compilationJobName,parameters,options)
.then(lroPoller => lroPoller.pollUntilFinished()) as Promise<Models.DscCompilationJobCreateResponse>;
}
/**
* Retrieve the Dsc configuration compilation job identified by job id.
* @param resourceGroupName Name of an Azure Resource group.
* @param automationAccountName The name of the automation account.
* @param compilationJobName The the DSC configuration Id.
* @param [options] The optional parameters
* @returns Promise<Models.DscCompilationJobGetResponse>
*/
get(resourceGroupName: string, automationAccountName: string, compilationJobName: string, options?: msRest.RequestOptionsBase): Promise<Models.DscCompilationJobGetResponse>;
/**
* @param resourceGroupName Name of an Azure Resource group.
* @param automationAccountName The name of the automation account.
* @param compilationJobName The the DSC configuration Id.
* @param callback The callback
*/
get(resourceGroupName: string, automationAccountName: string, compilationJobName: string, callback: msRest.ServiceCallback<Models.DscCompilationJob>): void;
/**
* @param resourceGroupName Name of an Azure Resource group.
* @param automationAccountName The name of the automation account.
* @param compilationJobName The the DSC configuration Id.
* @param options The optional parameters
* @param callback The callback
*/
get(resourceGroupName: string, automationAccountName: string, compilationJobName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.DscCompilationJob>): void;
get(resourceGroupName: string, automationAccountName: string, compilationJobName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.DscCompilationJob>, callback?: msRest.ServiceCallback<Models.DscCompilationJob>): Promise<Models.DscCompilationJobGetResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
automationAccountName,
compilationJobName,
options
},
getOperationSpec,
callback) as Promise<Models.DscCompilationJobGetResponse>;
}
/**
* Retrieve a list of dsc compilation jobs.
* @param resourceGroupName Name of an Azure Resource group.
* @param automationAccountName The name of the automation account.
* @param [options] The optional parameters
* @returns Promise<Models.DscCompilationJobListByAutomationAccountResponse>
*/
listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options?: Models.DscCompilationJobListByAutomationAccountOptionalParams): Promise<Models.DscCompilationJobListByAutomationAccountResponse>;
/**
* @param resourceGroupName Name of an Azure Resource group.
* @param automationAccountName The name of the automation account.
* @param callback The callback
*/
listByAutomationAccount(resourceGroupName: string, automationAccountName: string, callback: msRest.ServiceCallback<Models.DscCompilationJobListResult>): void;
/**
* @param resourceGroupName Name of an Azure Resource group.
* @param automationAccountName The name of the automation account.
* @param options The optional parameters
* @param callback The callback
*/
listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options: Models.DscCompilationJobListByAutomationAccountOptionalParams, callback: msRest.ServiceCallback<Models.DscCompilationJobListResult>): void;
listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options?: Models.DscCompilationJobListByAutomationAccountOptionalParams | msRest.ServiceCallback<Models.DscCompilationJobListResult>, callback?: msRest.ServiceCallback<Models.DscCompilationJobListResult>): Promise<Models.DscCompilationJobListByAutomationAccountResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
automationAccountName,
options
},
listByAutomationAccountOperationSpec,
callback) as Promise<Models.DscCompilationJobListByAutomationAccountResponse>;
}
/**
* Retrieve the job stream identified by job stream id.
* @param resourceGroupName Name of an Azure Resource group.
* @param automationAccountName The name of the automation account.
* @param jobId The job id.
* @param jobStreamId The job stream id.
* @param [options] The optional parameters
* @returns Promise<Models.DscCompilationJobGetStreamResponse>
*/
getStream(resourceGroupName: string, automationAccountName: string, jobId: string, jobStreamId: string, options?: msRest.RequestOptionsBase): Promise<Models.DscCompilationJobGetStreamResponse>;
/**
* @param resourceGroupName Name of an Azure Resource group.
* @param automationAccountName The name of the automation account.
* @param jobId The job id.
* @param jobStreamId The job stream id.
* @param callback The callback
*/
getStream(resourceGroupName: string, automationAccountName: string, jobId: string, jobStreamId: string, callback: msRest.ServiceCallback<Models.JobStream>): void;
/**
* @param resourceGroupName Name of an Azure Resource group.
* @param automationAccountName The name of the automation account.
* @param jobId The job id.
* @param jobStreamId The job stream id.
* @param options The optional parameters
* @param callback The callback
*/
getStream(resourceGroupName: string, automationAccountName: string, jobId: string, jobStreamId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.JobStream>): void;
getStream(resourceGroupName: string, automationAccountName: string, jobId: string, jobStreamId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.JobStream>, callback?: msRest.ServiceCallback<Models.JobStream>): Promise<Models.DscCompilationJobGetStreamResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
automationAccountName,
jobId,
jobStreamId,
options
},
getStreamOperationSpec,
callback) as Promise<Models.DscCompilationJobGetStreamResponse>;
}
/**
* Creates the Dsc compilation job of the configuration.
* @param resourceGroupName Name of an Azure Resource group.
* @param automationAccountName The name of the automation account.
* @param compilationJobName The the DSC configuration Id.
* @param parameters The parameters supplied to the create compilation job operation.
* @param [options] The optional parameters
* @returns Promise<msRestAzure.LROPoller>
*/
beginCreate(resourceGroupName: string, automationAccountName: string, compilationJobName: string, parameters: Models.DscCompilationJobCreateParameters, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
return this.client.sendLRORequest(
{
resourceGroupName,
automationAccountName,
compilationJobName,
parameters,
options
},
beginCreateOperationSpec,
options);
}
/**
* Retrieve a list of dsc compilation jobs.
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @param [options] The optional parameters
* @returns Promise<Models.DscCompilationJobListByAutomationAccountNextResponse>
*/
listByAutomationAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.DscCompilationJobListByAutomationAccountNextResponse>;
/**
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @param callback The callback
*/
listByAutomationAccountNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.DscCompilationJobListResult>): void;
/**
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @param options The optional parameters
* @param callback The callback
*/
listByAutomationAccountNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.DscCompilationJobListResult>): void;
listByAutomationAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.DscCompilationJobListResult>, callback?: msRest.ServiceCallback<Models.DscCompilationJobListResult>): Promise<Models.DscCompilationJobListByAutomationAccountNextResponse> {
return this.client.sendOperationRequest(
{
nextPageLink,
options
},
listByAutomationAccountNextOperationSpec,
callback) as Promise<Models.DscCompilationJobListByAutomationAccountNextResponse>;
}
}
// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const getOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}",
urlParameters: [
Parameters.resourceGroupName,
Parameters.automationAccountName,
Parameters.compilationJobName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion2
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.DscCompilationJob
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
serializer
};
const listByAutomationAccountOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs",
urlParameters: [
Parameters.resourceGroupName,
Parameters.automationAccountName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.filter,
Parameters.apiVersion2
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.DscCompilationJobListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
serializer
};
const getStreamOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/{jobStreamId}",
urlParameters: [
Parameters.resourceGroupName,
Parameters.automationAccountName,
Parameters.jobId,
Parameters.jobStreamId,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion2
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.JobStream
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
serializer
};
const beginCreateOperationSpec: msRest.OperationSpec = {
httpMethod: "PUT",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}",
urlParameters: [
Parameters.resourceGroupName,
Parameters.automationAccountName,
Parameters.compilationJobName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion2
],
headerParameters: [
Parameters.acceptLanguage
],
requestBody: {
parameterPath: "parameters",
mapper: {
...Mappers.DscCompilationJobCreateParameters,
required: true
}
},
responses: {
201: {
bodyMapper: Mappers.DscCompilationJob
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
serializer
};
const listByAutomationAccountNextOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
baseUrl: "https://management.azure.com",
path: "{nextLink}",
urlParameters: [
Parameters.nextPageLink
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.DscCompilationJobListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
serializer
};