@azure/arm-automation
Version:
AutomationClient Library with typescript type definitions for node.js and browser.
214 lines • 8.11 kB
JavaScript
/*
* 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 { __assign } from "tslib";
import * as msRest from "@azure/ms-rest-js";
import * as Mappers from "../models/dscCompilationJobOperationsMappers";
import * as Parameters from "../models/parameters";
/** Class representing a DscCompilationJobOperations. */
var DscCompilationJobOperations = /** @class */ (function () {
/**
* Create a DscCompilationJobOperations.
* @param {AutomationClientContext} client Reference to the service client.
*/
function DscCompilationJobOperations(client) {
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>
*/
DscCompilationJobOperations.prototype.create = function (resourceGroupName, automationAccountName, compilationJobName, parameters, options) {
return this.beginCreate(resourceGroupName, automationAccountName, compilationJobName, parameters, options)
.then(function (lroPoller) { return lroPoller.pollUntilFinished(); });
};
DscCompilationJobOperations.prototype.get = function (resourceGroupName, automationAccountName, compilationJobName, options, callback) {
return this.client.sendOperationRequest({
resourceGroupName: resourceGroupName,
automationAccountName: automationAccountName,
compilationJobName: compilationJobName,
options: options
}, getOperationSpec, callback);
};
DscCompilationJobOperations.prototype.listByAutomationAccount = function (resourceGroupName, automationAccountName, options, callback) {
return this.client.sendOperationRequest({
resourceGroupName: resourceGroupName,
automationAccountName: automationAccountName,
options: options
}, listByAutomationAccountOperationSpec, callback);
};
DscCompilationJobOperations.prototype.getStream = function (resourceGroupName, automationAccountName, jobId, jobStreamId, options, callback) {
return this.client.sendOperationRequest({
resourceGroupName: resourceGroupName,
automationAccountName: automationAccountName,
jobId: jobId,
jobStreamId: jobStreamId,
options: options
}, getStreamOperationSpec, callback);
};
/**
* 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>
*/
DscCompilationJobOperations.prototype.beginCreate = function (resourceGroupName, automationAccountName, compilationJobName, parameters, options) {
return this.client.sendLRORequest({
resourceGroupName: resourceGroupName,
automationAccountName: automationAccountName,
compilationJobName: compilationJobName,
parameters: parameters,
options: options
}, beginCreateOperationSpec, options);
};
DscCompilationJobOperations.prototype.listByAutomationAccountNext = function (nextPageLink, options, callback) {
return this.client.sendOperationRequest({
nextPageLink: nextPageLink,
options: options
}, listByAutomationAccountNextOperationSpec, callback);
};
return DscCompilationJobOperations;
}());
export { DscCompilationJobOperations };
// Operation Specifications
var serializer = new msRest.Serializer(Mappers);
var getOperationSpec = {
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: serializer
};
var listByAutomationAccountOperationSpec = {
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: serializer
};
var getStreamOperationSpec = {
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: serializer
};
var beginCreateOperationSpec = {
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: __assign(__assign({}, Mappers.DscCompilationJobCreateParameters), { required: true })
},
responses: {
201: {
bodyMapper: Mappers.DscCompilationJob
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
serializer: serializer
};
var listByAutomationAccountNextOperationSpec = {
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: serializer
};
//# sourceMappingURL=dscCompilationJobOperations.js.map