OLD | NEW |
(Empty) | |
| 1 library googleapis_beta.replicapoolupdater.v1beta1; |
| 2 |
| 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; |
| 7 |
| 8 import "package:crypto/crypto.dart" as crypto; |
| 9 import 'package:http/http.dart' as http; |
| 10 import '../src/common_internal.dart' as common_internal; |
| 11 import '../common/common.dart' as common; |
| 12 |
| 13 export '../common/common.dart' show ApiRequestError; |
| 14 export '../common/common.dart' show DetailedApiRequestError; |
| 15 |
| 16 /** |
| 17 * The Google Compute Engine Instance Group Updater API provides services for |
| 18 * updating groups of Compute Engine Instances. |
| 19 */ |
| 20 class ReplicapoolupdaterApi { |
| 21 /** View and manage your data across Google Cloud Platform services */ |
| 22 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; |
| 23 |
| 24 /** View and manage replica pools */ |
| 25 static const ReplicapoolScope = "https://www.googleapis.com/auth/replicapool"; |
| 26 |
| 27 /** View replica pools */ |
| 28 static const ReplicapoolReadonlyScope = "https://www.googleapis.com/auth/repli
capool.readonly"; |
| 29 |
| 30 |
| 31 final common_internal.ApiRequester _requester; |
| 32 |
| 33 UpdatesResourceApi get updates => new UpdatesResourceApi(_requester); |
| 34 |
| 35 ReplicapoolupdaterApi(http.Client client) : |
| 36 _requester = new common_internal.ApiRequester(client, "https://www.googlea
pis.com/", "replicapoolupdater/v1beta1/projects/"); |
| 37 } |
| 38 |
| 39 |
| 40 /** Not documented yet. */ |
| 41 class UpdatesResourceApi { |
| 42 final common_internal.ApiRequester _requester; |
| 43 |
| 44 UpdatesResourceApi(common_internal.ApiRequester client) : |
| 45 _requester = client; |
| 46 |
| 47 /** |
| 48 * Called on the particular Update endpoint. Cancels the update in state |
| 49 * PAUSED. No-op if invoked in state CANCELLED. |
| 50 * |
| 51 * Request parameters: |
| 52 * |
| 53 * [project] - Project ID for this request. |
| 54 * |
| 55 * [zone] - Zone for the instance group manager. |
| 56 * |
| 57 * [instanceGroupManager] - Name of the instance group manager for this |
| 58 * request. |
| 59 * |
| 60 * [update] - Unique (in the context of a group) handle of an update. |
| 61 * |
| 62 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 63 * error. |
| 64 * |
| 65 * If the used [http.Client] completes with an error when making a REST call, |
| 66 * this method will complete with the same error. |
| 67 */ |
| 68 async.Future cancel(core.String project, core.String zone, core.String instanc
eGroupManager, core.String update) { |
| 69 var _url = null; |
| 70 var _queryParams = new core.Map(); |
| 71 var _uploadMedia = null; |
| 72 var _uploadOptions = null; |
| 73 var _downloadOptions = common.DownloadOptions.Metadata; |
| 74 var _body = null; |
| 75 |
| 76 if (project == null) { |
| 77 throw new core.ArgumentError("Parameter project is required."); |
| 78 } |
| 79 if (zone == null) { |
| 80 throw new core.ArgumentError("Parameter zone is required."); |
| 81 } |
| 82 if (instanceGroupManager == null) { |
| 83 throw new core.ArgumentError("Parameter instanceGroupManager is required."
); |
| 84 } |
| 85 if (update == null) { |
| 86 throw new core.ArgumentError("Parameter update is required."); |
| 87 } |
| 88 |
| 89 _downloadOptions = null; |
| 90 |
| 91 _url = common_internal.Escaper.ecapeVariable('$project') + '/zones/' + commo
n_internal.Escaper.ecapeVariable('$zone') + '/instanceGroupManagers/' + common_i
nternal.Escaper.ecapeVariable('$instanceGroupManager') + '/updates/' + common_in
ternal.Escaper.ecapeVariable('$update') + '/cancel'; |
| 92 |
| 93 var _response = _requester.request(_url, |
| 94 "POST", |
| 95 body: _body, |
| 96 queryParams: _queryParams, |
| 97 uploadOptions: _uploadOptions, |
| 98 uploadMedia: _uploadMedia, |
| 99 downloadOptions: _downloadOptions); |
| 100 return _response.then((data) => null); |
| 101 } |
| 102 |
| 103 /** |
| 104 * Called on the particular Update endpoint. Returns the Update resource. |
| 105 * |
| 106 * Request parameters: |
| 107 * |
| 108 * [project] - Project ID for this request. |
| 109 * |
| 110 * [zone] - Zone for the instance group manager. |
| 111 * |
| 112 * [instanceGroupManager] - Name of the instance group manager for this |
| 113 * request. |
| 114 * |
| 115 * [update] - Unique (in the context of a group) handle of an update. |
| 116 * |
| 117 * Completes with a [Update]. |
| 118 * |
| 119 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 120 * error. |
| 121 * |
| 122 * If the used [http.Client] completes with an error when making a REST call, |
| 123 * this method will complete with the same error. |
| 124 */ |
| 125 async.Future<Update> get(core.String project, core.String zone, core.String in
stanceGroupManager, core.String update) { |
| 126 var _url = null; |
| 127 var _queryParams = new core.Map(); |
| 128 var _uploadMedia = null; |
| 129 var _uploadOptions = null; |
| 130 var _downloadOptions = common.DownloadOptions.Metadata; |
| 131 var _body = null; |
| 132 |
| 133 if (project == null) { |
| 134 throw new core.ArgumentError("Parameter project is required."); |
| 135 } |
| 136 if (zone == null) { |
| 137 throw new core.ArgumentError("Parameter zone is required."); |
| 138 } |
| 139 if (instanceGroupManager == null) { |
| 140 throw new core.ArgumentError("Parameter instanceGroupManager is required."
); |
| 141 } |
| 142 if (update == null) { |
| 143 throw new core.ArgumentError("Parameter update is required."); |
| 144 } |
| 145 |
| 146 |
| 147 _url = common_internal.Escaper.ecapeVariable('$project') + '/zones/' + commo
n_internal.Escaper.ecapeVariable('$zone') + '/instanceGroupManagers/' + common_i
nternal.Escaper.ecapeVariable('$instanceGroupManager') + '/updates/' + common_in
ternal.Escaper.ecapeVariable('$update'); |
| 148 |
| 149 var _response = _requester.request(_url, |
| 150 "GET", |
| 151 body: _body, |
| 152 queryParams: _queryParams, |
| 153 uploadOptions: _uploadOptions, |
| 154 uploadMedia: _uploadMedia, |
| 155 downloadOptions: _downloadOptions); |
| 156 return _response.then((data) => new Update.fromJson(data)); |
| 157 } |
| 158 |
| 159 /** |
| 160 * Called on the collection endpoint. Inserts the new Update resource and |
| 161 * starts the update. |
| 162 * |
| 163 * [request] - The metadata request object. |
| 164 * |
| 165 * Request parameters: |
| 166 * |
| 167 * [project] - Project ID for this request. |
| 168 * |
| 169 * [zone] - Zone for the instance group manager. |
| 170 * |
| 171 * [instanceGroupManager] - Name of the instance group manager for this |
| 172 * request. |
| 173 * |
| 174 * Completes with a [InsertResponse]. |
| 175 * |
| 176 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 177 * error. |
| 178 * |
| 179 * If the used [http.Client] completes with an error when making a REST call, |
| 180 * this method will complete with the same error. |
| 181 */ |
| 182 async.Future<InsertResponse> insert(Update request, core.String project, core.
String zone, core.String instanceGroupManager) { |
| 183 var _url = null; |
| 184 var _queryParams = new core.Map(); |
| 185 var _uploadMedia = null; |
| 186 var _uploadOptions = null; |
| 187 var _downloadOptions = common.DownloadOptions.Metadata; |
| 188 var _body = null; |
| 189 |
| 190 if (request != null) { |
| 191 _body = convert.JSON.encode((request).toJson()); |
| 192 } |
| 193 if (project == null) { |
| 194 throw new core.ArgumentError("Parameter project is required."); |
| 195 } |
| 196 if (zone == null) { |
| 197 throw new core.ArgumentError("Parameter zone is required."); |
| 198 } |
| 199 if (instanceGroupManager == null) { |
| 200 throw new core.ArgumentError("Parameter instanceGroupManager is required."
); |
| 201 } |
| 202 |
| 203 |
| 204 _url = common_internal.Escaper.ecapeVariable('$project') + '/zones/' + commo
n_internal.Escaper.ecapeVariable('$zone') + '/instanceGroupManagers/' + common_i
nternal.Escaper.ecapeVariable('$instanceGroupManager') + '/updates'; |
| 205 |
| 206 var _response = _requester.request(_url, |
| 207 "POST", |
| 208 body: _body, |
| 209 queryParams: _queryParams, |
| 210 uploadOptions: _uploadOptions, |
| 211 uploadMedia: _uploadMedia, |
| 212 downloadOptions: _downloadOptions); |
| 213 return _response.then((data) => new InsertResponse.fromJson(data)); |
| 214 } |
| 215 |
| 216 /** |
| 217 * Called on the collection endpoint. Lists updates for a given instance |
| 218 * group, in reverse chronological order. Pagination is supported, see |
| 219 * ListRequestHeader. |
| 220 * |
| 221 * Request parameters: |
| 222 * |
| 223 * [project] - Project ID for this request. |
| 224 * |
| 225 * [zone] - Zone for the instance group manager. |
| 226 * |
| 227 * [instanceGroupManager] - Name of the instance group manager for this |
| 228 * request. |
| 229 * |
| 230 * [maxResults] - Maximum count of results to be returned. Acceptable values |
| 231 * are 1 to 100, inclusive. (Default: 50) |
| 232 * Value must be between "1" and "100". |
| 233 * |
| 234 * [pageToken] - Set this to the nextPageToken value returned by a previous |
| 235 * list request to obtain the next page of results from the previous list |
| 236 * request. |
| 237 * |
| 238 * Completes with a [UpdateList]. |
| 239 * |
| 240 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 241 * error. |
| 242 * |
| 243 * If the used [http.Client] completes with an error when making a REST call, |
| 244 * this method will complete with the same error. |
| 245 */ |
| 246 async.Future<UpdateList> list(core.String project, core.String zone, core.Stri
ng instanceGroupManager, {core.int maxResults, core.String pageToken}) { |
| 247 var _url = null; |
| 248 var _queryParams = new core.Map(); |
| 249 var _uploadMedia = null; |
| 250 var _uploadOptions = null; |
| 251 var _downloadOptions = common.DownloadOptions.Metadata; |
| 252 var _body = null; |
| 253 |
| 254 if (project == null) { |
| 255 throw new core.ArgumentError("Parameter project is required."); |
| 256 } |
| 257 if (zone == null) { |
| 258 throw new core.ArgumentError("Parameter zone is required."); |
| 259 } |
| 260 if (instanceGroupManager == null) { |
| 261 throw new core.ArgumentError("Parameter instanceGroupManager is required."
); |
| 262 } |
| 263 if (maxResults != null) { |
| 264 _queryParams["maxResults"] = ["${maxResults}"]; |
| 265 } |
| 266 if (pageToken != null) { |
| 267 _queryParams["pageToken"] = [pageToken]; |
| 268 } |
| 269 |
| 270 |
| 271 _url = common_internal.Escaper.ecapeVariable('$project') + '/zones/' + commo
n_internal.Escaper.ecapeVariable('$zone') + '/instanceGroupManagers/' + common_i
nternal.Escaper.ecapeVariable('$instanceGroupManager') + '/updates'; |
| 272 |
| 273 var _response = _requester.request(_url, |
| 274 "GET", |
| 275 body: _body, |
| 276 queryParams: _queryParams, |
| 277 uploadOptions: _uploadOptions, |
| 278 uploadMedia: _uploadMedia, |
| 279 downloadOptions: _downloadOptions); |
| 280 return _response.then((data) => new UpdateList.fromJson(data)); |
| 281 } |
| 282 |
| 283 /** |
| 284 * Called on the particular Update endpoint. Pauses the update in state from { |
| 285 * ROLLING_FORWARD, ROLLING_BACK, PAUSED }. No-op if invoked in state PAUSED. |
| 286 * |
| 287 * Request parameters: |
| 288 * |
| 289 * [project] - Project ID for this request. |
| 290 * |
| 291 * [zone] - Zone for the instance group manager. |
| 292 * |
| 293 * [instanceGroupManager] - Name of the instance group manager for this |
| 294 * request. |
| 295 * |
| 296 * [update] - Unique (in the context of a group) handle of an update. |
| 297 * |
| 298 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 299 * error. |
| 300 * |
| 301 * If the used [http.Client] completes with an error when making a REST call, |
| 302 * this method will complete with the same error. |
| 303 */ |
| 304 async.Future pause(core.String project, core.String zone, core.String instance
GroupManager, core.String update) { |
| 305 var _url = null; |
| 306 var _queryParams = new core.Map(); |
| 307 var _uploadMedia = null; |
| 308 var _uploadOptions = null; |
| 309 var _downloadOptions = common.DownloadOptions.Metadata; |
| 310 var _body = null; |
| 311 |
| 312 if (project == null) { |
| 313 throw new core.ArgumentError("Parameter project is required."); |
| 314 } |
| 315 if (zone == null) { |
| 316 throw new core.ArgumentError("Parameter zone is required."); |
| 317 } |
| 318 if (instanceGroupManager == null) { |
| 319 throw new core.ArgumentError("Parameter instanceGroupManager is required."
); |
| 320 } |
| 321 if (update == null) { |
| 322 throw new core.ArgumentError("Parameter update is required."); |
| 323 } |
| 324 |
| 325 _downloadOptions = null; |
| 326 |
| 327 _url = common_internal.Escaper.ecapeVariable('$project') + '/zones/' + commo
n_internal.Escaper.ecapeVariable('$zone') + '/instanceGroupManagers/' + common_i
nternal.Escaper.ecapeVariable('$instanceGroupManager') + '/updates/' + common_in
ternal.Escaper.ecapeVariable('$update') + '/pause'; |
| 328 |
| 329 var _response = _requester.request(_url, |
| 330 "POST", |
| 331 body: _body, |
| 332 queryParams: _queryParams, |
| 333 uploadOptions: _uploadOptions, |
| 334 uploadMedia: _uploadMedia, |
| 335 downloadOptions: _downloadOptions); |
| 336 return _response.then((data) => null); |
| 337 } |
| 338 |
| 339 /** |
| 340 * Called on the particular Update endpoint. Rolls back the update in state |
| 341 * from { ROLLING_FORWARD, ROLLING_BACK, PAUSED }. No-op if invoked in state |
| 342 * ROLLED_BACK. |
| 343 * |
| 344 * Request parameters: |
| 345 * |
| 346 * [project] - Project ID for this request. |
| 347 * |
| 348 * [zone] - Zone for the instance group manager. |
| 349 * |
| 350 * [instanceGroupManager] - Name of the instance group manager for this |
| 351 * request. |
| 352 * |
| 353 * [update] - Unique (in the context of a group) handle of an update. |
| 354 * |
| 355 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 356 * error. |
| 357 * |
| 358 * If the used [http.Client] completes with an error when making a REST call, |
| 359 * this method will complete with the same error. |
| 360 */ |
| 361 async.Future rollback(core.String project, core.String zone, core.String insta
nceGroupManager, core.String update) { |
| 362 var _url = null; |
| 363 var _queryParams = new core.Map(); |
| 364 var _uploadMedia = null; |
| 365 var _uploadOptions = null; |
| 366 var _downloadOptions = common.DownloadOptions.Metadata; |
| 367 var _body = null; |
| 368 |
| 369 if (project == null) { |
| 370 throw new core.ArgumentError("Parameter project is required."); |
| 371 } |
| 372 if (zone == null) { |
| 373 throw new core.ArgumentError("Parameter zone is required."); |
| 374 } |
| 375 if (instanceGroupManager == null) { |
| 376 throw new core.ArgumentError("Parameter instanceGroupManager is required."
); |
| 377 } |
| 378 if (update == null) { |
| 379 throw new core.ArgumentError("Parameter update is required."); |
| 380 } |
| 381 |
| 382 _downloadOptions = null; |
| 383 |
| 384 _url = common_internal.Escaper.ecapeVariable('$project') + '/zones/' + commo
n_internal.Escaper.ecapeVariable('$zone') + '/instanceGroupManagers/' + common_i
nternal.Escaper.ecapeVariable('$instanceGroupManager') + '/updates/' + common_in
ternal.Escaper.ecapeVariable('$update') + '/rollback'; |
| 385 |
| 386 var _response = _requester.request(_url, |
| 387 "POST", |
| 388 body: _body, |
| 389 queryParams: _queryParams, |
| 390 uploadOptions: _uploadOptions, |
| 391 uploadMedia: _uploadMedia, |
| 392 downloadOptions: _downloadOptions); |
| 393 return _response.then((data) => null); |
| 394 } |
| 395 |
| 396 /** |
| 397 * Called on the particular Update endpoint. Rolls forward the update in state |
| 398 * from { ROLLING_FORWARD, ROLLING_BACK, PAUSED }. No-op if invoked in state |
| 399 * ROLLED_OUT. |
| 400 * |
| 401 * Request parameters: |
| 402 * |
| 403 * [project] - Project ID for this request. |
| 404 * |
| 405 * [zone] - Zone for the instance group manager. |
| 406 * |
| 407 * [instanceGroupManager] - Name of the instance group manager for this |
| 408 * request. |
| 409 * |
| 410 * [update] - Unique (in the context of a group) handle of an update. |
| 411 * |
| 412 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 413 * error. |
| 414 * |
| 415 * If the used [http.Client] completes with an error when making a REST call, |
| 416 * this method will complete with the same error. |
| 417 */ |
| 418 async.Future rollforward(core.String project, core.String zone, core.String in
stanceGroupManager, core.String update) { |
| 419 var _url = null; |
| 420 var _queryParams = new core.Map(); |
| 421 var _uploadMedia = null; |
| 422 var _uploadOptions = null; |
| 423 var _downloadOptions = common.DownloadOptions.Metadata; |
| 424 var _body = null; |
| 425 |
| 426 if (project == null) { |
| 427 throw new core.ArgumentError("Parameter project is required."); |
| 428 } |
| 429 if (zone == null) { |
| 430 throw new core.ArgumentError("Parameter zone is required."); |
| 431 } |
| 432 if (instanceGroupManager == null) { |
| 433 throw new core.ArgumentError("Parameter instanceGroupManager is required."
); |
| 434 } |
| 435 if (update == null) { |
| 436 throw new core.ArgumentError("Parameter update is required."); |
| 437 } |
| 438 |
| 439 _downloadOptions = null; |
| 440 |
| 441 _url = common_internal.Escaper.ecapeVariable('$project') + '/zones/' + commo
n_internal.Escaper.ecapeVariable('$zone') + '/instanceGroupManagers/' + common_i
nternal.Escaper.ecapeVariable('$instanceGroupManager') + '/updates/' + common_in
ternal.Escaper.ecapeVariable('$update') + '/rollforward'; |
| 442 |
| 443 var _response = _requester.request(_url, |
| 444 "POST", |
| 445 body: _body, |
| 446 queryParams: _queryParams, |
| 447 uploadOptions: _uploadOptions, |
| 448 uploadMedia: _uploadMedia, |
| 449 downloadOptions: _downloadOptions); |
| 450 return _response.then((data) => null); |
| 451 } |
| 452 |
| 453 } |
| 454 |
| 455 |
| 456 |
| 457 /** Response returned by Insert method. */ |
| 458 class InsertResponse { |
| 459 /** Unique (in the context of a group) handle of an update. */ |
| 460 core.String update; |
| 461 |
| 462 |
| 463 InsertResponse(); |
| 464 |
| 465 InsertResponse.fromJson(core.Map _json) { |
| 466 if (_json.containsKey("update")) { |
| 467 update = _json["update"]; |
| 468 } |
| 469 } |
| 470 |
| 471 core.Map toJson() { |
| 472 var _json = new core.Map(); |
| 473 if (update != null) { |
| 474 _json["update"] = update; |
| 475 } |
| 476 return _json; |
| 477 } |
| 478 } |
| 479 |
| 480 |
| 481 /** Update of a single instance. */ |
| 482 class InstanceUpdate { |
| 483 /** Name of an instance. */ |
| 484 core.String instanceName; |
| 485 |
| 486 /** State of an instance update. */ |
| 487 core.String state; |
| 488 |
| 489 |
| 490 InstanceUpdate(); |
| 491 |
| 492 InstanceUpdate.fromJson(core.Map _json) { |
| 493 if (_json.containsKey("instanceName")) { |
| 494 instanceName = _json["instanceName"]; |
| 495 } |
| 496 if (_json.containsKey("state")) { |
| 497 state = _json["state"]; |
| 498 } |
| 499 } |
| 500 |
| 501 core.Map toJson() { |
| 502 var _json = new core.Map(); |
| 503 if (instanceName != null) { |
| 504 _json["instanceName"] = instanceName; |
| 505 } |
| 506 if (state != null) { |
| 507 _json["state"] = state; |
| 508 } |
| 509 return _json; |
| 510 } |
| 511 } |
| 512 |
| 513 |
| 514 /** |
| 515 * Resource describing a single update (rollout) of an instance group to the |
| 516 * given template. |
| 517 */ |
| 518 class Update { |
| 519 /** [Output Only] Human-readable description of an update progress. */ |
| 520 core.String details; |
| 521 |
| 522 /** |
| 523 * [Output Only] Unique (in the context of a group) handle assigned to this |
| 524 * update. |
| 525 */ |
| 526 core.String handle; |
| 527 |
| 528 /** Url of an instance template to be applied. */ |
| 529 core.String instanceTemplate; |
| 530 |
| 531 /** [Output Only] Collection of instance updates. */ |
| 532 core.List<InstanceUpdate> instanceUpdates; |
| 533 |
| 534 /** [Output only] The resource type. Always replicapoolupdater#update. */ |
| 535 core.String kind; |
| 536 |
| 537 /** Parameters of an update process. */ |
| 538 UpdatePolicy policy; |
| 539 |
| 540 /** [Output only] The fully qualified URL for this resource. */ |
| 541 core.String selfLink; |
| 542 |
| 543 /** [Output Only] Current state of an update. */ |
| 544 core.String state; |
| 545 |
| 546 /** |
| 547 * [Output Only] Requested state of an update. This is the state that the |
| 548 * updater is moving towards. Acceptable values are: |
| 549 * - "ROLLED_OUT": The user has requested the update to go forward. |
| 550 * - "ROLLED_BACK": The user has requested the update to be rolled back. |
| 551 * - "PAUSED": The user has requested the update to be paused. |
| 552 * |
| 553 * - "CANCELLED": The user has requested the update to be cancelled. The |
| 554 * updater service is in the process of canceling the update. |
| 555 */ |
| 556 core.String targetState; |
| 557 |
| 558 |
| 559 Update(); |
| 560 |
| 561 Update.fromJson(core.Map _json) { |
| 562 if (_json.containsKey("details")) { |
| 563 details = _json["details"]; |
| 564 } |
| 565 if (_json.containsKey("handle")) { |
| 566 handle = _json["handle"]; |
| 567 } |
| 568 if (_json.containsKey("instanceTemplate")) { |
| 569 instanceTemplate = _json["instanceTemplate"]; |
| 570 } |
| 571 if (_json.containsKey("instanceUpdates")) { |
| 572 instanceUpdates = _json["instanceUpdates"].map((value) => new InstanceUpda
te.fromJson(value)).toList(); |
| 573 } |
| 574 if (_json.containsKey("kind")) { |
| 575 kind = _json["kind"]; |
| 576 } |
| 577 if (_json.containsKey("policy")) { |
| 578 policy = new UpdatePolicy.fromJson(_json["policy"]); |
| 579 } |
| 580 if (_json.containsKey("selfLink")) { |
| 581 selfLink = _json["selfLink"]; |
| 582 } |
| 583 if (_json.containsKey("state")) { |
| 584 state = _json["state"]; |
| 585 } |
| 586 if (_json.containsKey("targetState")) { |
| 587 targetState = _json["targetState"]; |
| 588 } |
| 589 } |
| 590 |
| 591 core.Map toJson() { |
| 592 var _json = new core.Map(); |
| 593 if (details != null) { |
| 594 _json["details"] = details; |
| 595 } |
| 596 if (handle != null) { |
| 597 _json["handle"] = handle; |
| 598 } |
| 599 if (instanceTemplate != null) { |
| 600 _json["instanceTemplate"] = instanceTemplate; |
| 601 } |
| 602 if (instanceUpdates != null) { |
| 603 _json["instanceUpdates"] = instanceUpdates.map((value) => (value).toJson()
).toList(); |
| 604 } |
| 605 if (kind != null) { |
| 606 _json["kind"] = kind; |
| 607 } |
| 608 if (policy != null) { |
| 609 _json["policy"] = (policy).toJson(); |
| 610 } |
| 611 if (selfLink != null) { |
| 612 _json["selfLink"] = selfLink; |
| 613 } |
| 614 if (state != null) { |
| 615 _json["state"] = state; |
| 616 } |
| 617 if (targetState != null) { |
| 618 _json["targetState"] = targetState; |
| 619 } |
| 620 return _json; |
| 621 } |
| 622 } |
| 623 |
| 624 |
| 625 /** Response returned by List method. */ |
| 626 class UpdateList { |
| 627 /** Collection of requested updates. */ |
| 628 core.List<Update> items; |
| 629 |
| 630 /** A token used to continue a truncated list request. */ |
| 631 core.String nextPageToken; |
| 632 |
| 633 |
| 634 UpdateList(); |
| 635 |
| 636 UpdateList.fromJson(core.Map _json) { |
| 637 if (_json.containsKey("items")) { |
| 638 items = _json["items"].map((value) => new Update.fromJson(value)).toList()
; |
| 639 } |
| 640 if (_json.containsKey("nextPageToken")) { |
| 641 nextPageToken = _json["nextPageToken"]; |
| 642 } |
| 643 } |
| 644 |
| 645 core.Map toJson() { |
| 646 var _json = new core.Map(); |
| 647 if (items != null) { |
| 648 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 649 } |
| 650 if (nextPageToken != null) { |
| 651 _json["nextPageToken"] = nextPageToken; |
| 652 } |
| 653 return _json; |
| 654 } |
| 655 } |
| 656 |
| 657 |
| 658 /** Parameters of an update process. */ |
| 659 class UpdatePolicy { |
| 660 /** Parameters of a canary phase. If absent, canary will NOT be performed. */ |
| 661 UpdatePolicyCanary canary; |
| 662 |
| 663 /** |
| 664 * Maximum number of instances that can be updated simultaneously |
| 665 * (concurrently). An update of an instance starts when the instance is about |
| 666 * to be restarted and finishes after the instance has been restarted and the |
| 667 * sleep period (defined by sleep_after_instance_restart_sec) has passed. |
| 668 */ |
| 669 core.int maxNumConcurrentInstances; |
| 670 |
| 671 /** |
| 672 * Time period after the instance has been restarted but before marking the |
| 673 * update of this instance as done. |
| 674 */ |
| 675 core.int sleepAfterInstanceRestartSec; |
| 676 |
| 677 |
| 678 UpdatePolicy(); |
| 679 |
| 680 UpdatePolicy.fromJson(core.Map _json) { |
| 681 if (_json.containsKey("canary")) { |
| 682 canary = new UpdatePolicyCanary.fromJson(_json["canary"]); |
| 683 } |
| 684 if (_json.containsKey("maxNumConcurrentInstances")) { |
| 685 maxNumConcurrentInstances = _json["maxNumConcurrentInstances"]; |
| 686 } |
| 687 if (_json.containsKey("sleepAfterInstanceRestartSec")) { |
| 688 sleepAfterInstanceRestartSec = _json["sleepAfterInstanceRestartSec"]; |
| 689 } |
| 690 } |
| 691 |
| 692 core.Map toJson() { |
| 693 var _json = new core.Map(); |
| 694 if (canary != null) { |
| 695 _json["canary"] = (canary).toJson(); |
| 696 } |
| 697 if (maxNumConcurrentInstances != null) { |
| 698 _json["maxNumConcurrentInstances"] = maxNumConcurrentInstances; |
| 699 } |
| 700 if (sleepAfterInstanceRestartSec != null) { |
| 701 _json["sleepAfterInstanceRestartSec"] = sleepAfterInstanceRestartSec; |
| 702 } |
| 703 return _json; |
| 704 } |
| 705 } |
| 706 |
| 707 |
| 708 /** Parameters of a canary phase. */ |
| 709 class UpdatePolicyCanary { |
| 710 /** |
| 711 * Number of instances updated as a part of canary phase. If absent, the |
| 712 * default number of instances will be used. |
| 713 */ |
| 714 core.int numInstances; |
| 715 |
| 716 |
| 717 UpdatePolicyCanary(); |
| 718 |
| 719 UpdatePolicyCanary.fromJson(core.Map _json) { |
| 720 if (_json.containsKey("numInstances")) { |
| 721 numInstances = _json["numInstances"]; |
| 722 } |
| 723 } |
| 724 |
| 725 core.Map toJson() { |
| 726 var _json = new core.Map(); |
| 727 if (numInstances != null) { |
| 728 _json["numInstances"] = numInstances; |
| 729 } |
| 730 return _json; |
| 731 } |
| 732 } |
| 733 |
| 734 |
OLD | NEW |