/
assessedMachines.ts
183 lines (176 loc) · 8.12 KB
/
assessedMachines.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/*
* 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 Models from "../models";
import * as Mappers from "../models/assessedMachinesMappers";
import * as Parameters from "../models/parameters";
import { AzureMigrateContext } from "../azureMigrateContext";
/** Class representing a AssessedMachines. */
export class AssessedMachines {
private readonly client: AzureMigrateContext;
/**
* Create a AssessedMachines.
* @param {AzureMigrateContext} client Reference to the service client.
*/
constructor(client: AzureMigrateContext) {
this.client = client;
}
/**
* Get list of machines that assessed as part of the specified assessment. Returns a json array of
* objects of type 'assessedMachine' as specified in the Models section.
*
* Whenever an assessment is created or updated, it goes under computation. During this phase, the
* 'status' field of Assessment object reports 'Computing'.
* During the period when the assessment is under computation, the list of assessed machines is
* empty and no assessed machines are returned by this call.
* @summary Get assessed machines for assessment.
* @param resourceGroupName Name of the Azure Resource Group that project is part of.
* @param projectName Name of the Azure Migrate project.
* @param groupName Unique name of a group within a project.
* @param assessmentName Unique name of an assessment within a project.
* @param [options] The optional parameters
* @returns Promise<Models.AssessedMachinesListByAssessmentResponse>
*/
listByAssessment(resourceGroupName: string, projectName: string, groupName: string, assessmentName: string, options?: msRest.RequestOptionsBase): Promise<Models.AssessedMachinesListByAssessmentResponse>;
/**
* @param resourceGroupName Name of the Azure Resource Group that project is part of.
* @param projectName Name of the Azure Migrate project.
* @param groupName Unique name of a group within a project.
* @param assessmentName Unique name of an assessment within a project.
* @param callback The callback
*/
listByAssessment(resourceGroupName: string, projectName: string, groupName: string, assessmentName: string, callback: msRest.ServiceCallback<Models.AssessedMachineResultList>): void;
/**
* @param resourceGroupName Name of the Azure Resource Group that project is part of.
* @param projectName Name of the Azure Migrate project.
* @param groupName Unique name of a group within a project.
* @param assessmentName Unique name of an assessment within a project.
* @param options The optional parameters
* @param callback The callback
*/
listByAssessment(resourceGroupName: string, projectName: string, groupName: string, assessmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.AssessedMachineResultList>): void;
listByAssessment(resourceGroupName: string, projectName: string, groupName: string, assessmentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.AssessedMachineResultList>, callback?: msRest.ServiceCallback<Models.AssessedMachineResultList>): Promise<Models.AssessedMachinesListByAssessmentResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
projectName,
groupName,
assessmentName,
options
},
listByAssessmentOperationSpec,
callback) as Promise<Models.AssessedMachinesListByAssessmentResponse>;
}
/**
* Get an assessed machine with its size & cost estimnate that was evaluated in the specified
* assessment.
* @summary Get an assessed machine.
* @param resourceGroupName Name of the Azure Resource Group that project is part of.
* @param projectName Name of the Azure Migrate project.
* @param groupName Unique name of a group within a project.
* @param assessmentName Unique name of an assessment within a project.
* @param assessedMachineName Unique name of an assessed machine evaluated as part of an
* assessment.
* @param [options] The optional parameters
* @returns Promise<Models.AssessedMachinesGetResponse>
*/
get(resourceGroupName: string, projectName: string, groupName: string, assessmentName: string, assessedMachineName: string, options?: msRest.RequestOptionsBase): Promise<Models.AssessedMachinesGetResponse>;
/**
* @param resourceGroupName Name of the Azure Resource Group that project is part of.
* @param projectName Name of the Azure Migrate project.
* @param groupName Unique name of a group within a project.
* @param assessmentName Unique name of an assessment within a project.
* @param assessedMachineName Unique name of an assessed machine evaluated as part of an
* assessment.
* @param callback The callback
*/
get(resourceGroupName: string, projectName: string, groupName: string, assessmentName: string, assessedMachineName: string, callback: msRest.ServiceCallback<Models.AssessedMachine>): void;
/**
* @param resourceGroupName Name of the Azure Resource Group that project is part of.
* @param projectName Name of the Azure Migrate project.
* @param groupName Unique name of a group within a project.
* @param assessmentName Unique name of an assessment within a project.
* @param assessedMachineName Unique name of an assessed machine evaluated as part of an
* assessment.
* @param options The optional parameters
* @param callback The callback
*/
get(resourceGroupName: string, projectName: string, groupName: string, assessmentName: string, assessedMachineName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.AssessedMachine>): void;
get(resourceGroupName: string, projectName: string, groupName: string, assessmentName: string, assessedMachineName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.AssessedMachine>, callback?: msRest.ServiceCallback<Models.AssessedMachine>): Promise<Models.AssessedMachinesGetResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
projectName,
groupName,
assessmentName,
assessedMachineName,
options
},
getOperationSpec,
callback) as Promise<Models.AssessedMachinesGetResponse>;
}
}
// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const listByAssessmentOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines",
urlParameters: [
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.projectName,
Parameters.groupName,
Parameters.assessmentName
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.AssessedMachineResultList,
headersMapper: Mappers.AssessedMachinesListByAssessmentHeaders
},
default: {
bodyMapper: Mappers.CloudError
}
},
serializer
};
const getOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName}",
urlParameters: [
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.projectName,
Parameters.groupName,
Parameters.assessmentName,
Parameters.assessedMachineName
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.AssessedMachine,
headersMapper: Mappers.AssessedMachinesGetHeaders
},
default: {
bodyMapper: Mappers.CloudError
}
},
serializer
};