OLD | NEW |
1 library googleapis.compute.v1; | 1 library googleapis.compute.v1; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import "package:crypto/crypto.dart" as crypto; | 8 import "package:crypto/crypto.dart" as crypto; |
9 import 'package:http/http.dart' as http; | 9 import 'package:http/http.dart' as http; |
10 import '../src/common_internal.dart' as common_internal; | 10 import '../src/common_internal.dart' as common_internal; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 RegionsResourceApi get regions => new RegionsResourceApi(_requester); | 54 RegionsResourceApi get regions => new RegionsResourceApi(_requester); |
55 RoutesResourceApi get routes => new RoutesResourceApi(_requester); | 55 RoutesResourceApi get routes => new RoutesResourceApi(_requester); |
56 SnapshotsResourceApi get snapshots => new SnapshotsResourceApi(_requester); | 56 SnapshotsResourceApi get snapshots => new SnapshotsResourceApi(_requester); |
57 TargetHttpProxiesResourceApi get targetHttpProxies => new TargetHttpProxiesRes
ourceApi(_requester); | 57 TargetHttpProxiesResourceApi get targetHttpProxies => new TargetHttpProxiesRes
ourceApi(_requester); |
58 TargetInstancesResourceApi get targetInstances => new TargetInstancesResourceA
pi(_requester); | 58 TargetInstancesResourceApi get targetInstances => new TargetInstancesResourceA
pi(_requester); |
59 TargetPoolsResourceApi get targetPools => new TargetPoolsResourceApi(_requeste
r); | 59 TargetPoolsResourceApi get targetPools => new TargetPoolsResourceApi(_requeste
r); |
60 UrlMapsResourceApi get urlMaps => new UrlMapsResourceApi(_requester); | 60 UrlMapsResourceApi get urlMaps => new UrlMapsResourceApi(_requester); |
61 ZoneOperationsResourceApi get zoneOperations => new ZoneOperationsResourceApi(
_requester); | 61 ZoneOperationsResourceApi get zoneOperations => new ZoneOperationsResourceApi(
_requester); |
62 ZonesResourceApi get zones => new ZonesResourceApi(_requester); | 62 ZonesResourceApi get zones => new ZonesResourceApi(_requester); |
63 | 63 |
64 ComputeApi(http.Client client) : | 64 ComputeApi(http.Client client, {core.String rootUrl: "https://www.googleapis.c
om/", core.String servicePath: "compute/v1/projects/"}) : |
65 _requester = new common_internal.ApiRequester(client, "https://www.googlea
pis.com/", "compute/v1/projects/"); | 65 _requester = new common_internal.ApiRequester(client, rootUrl, servicePath
); |
66 } | 66 } |
67 | 67 |
68 | 68 |
69 /** Not documented yet. */ | 69 /** Not documented yet. */ |
70 class AddressesResourceApi { | 70 class AddressesResourceApi { |
71 final common_internal.ApiRequester _requester; | 71 final common_internal.ApiRequester _requester; |
72 | 72 |
73 AddressesResourceApi(common_internal.ApiRequester client) : | 73 AddressesResourceApi(common_internal.ApiRequester client) : |
74 _requester = client; | 74 _requester = client; |
75 | 75 |
(...skipping 4310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4386 var _response = _requester.request(_url, | 4386 var _response = _requester.request(_url, |
4387 "POST", | 4387 "POST", |
4388 body: _body, | 4388 body: _body, |
4389 queryParams: _queryParams, | 4389 queryParams: _queryParams, |
4390 uploadOptions: _uploadOptions, | 4390 uploadOptions: _uploadOptions, |
4391 uploadMedia: _uploadMedia, | 4391 uploadMedia: _uploadMedia, |
4392 downloadOptions: _downloadOptions); | 4392 downloadOptions: _downloadOptions); |
4393 return _response.then((data) => new Operation.fromJson(data)); | 4393 return _response.then((data) => new Operation.fromJson(data)); |
4394 } | 4394 } |
4395 | 4395 |
| 4396 /** |
| 4397 * Starts an instance |
| 4398 * |
| 4399 * Request parameters: |
| 4400 * |
| 4401 * [project] - Name of the project scoping this request. |
| 4402 * Value must have pattern |
| 4403 * "(?:(?:[-a-z0-9]{1,63}\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{
1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))". |
| 4404 * |
| 4405 * [zone] - Name of the zone scoping this request. |
| 4406 * Value must have pattern "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?". |
| 4407 * |
| 4408 * [instance] - Name of the instance resource to start. |
| 4409 * Value must have pattern "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?". |
| 4410 * |
| 4411 * Completes with a [Operation]. |
| 4412 * |
| 4413 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 4414 * error. |
| 4415 * |
| 4416 * If the used [http.Client] completes with an error when making a REST call, |
| 4417 * this method will complete with the same error. |
| 4418 */ |
| 4419 async.Future<Operation> start(core.String project, core.String zone, core.Stri
ng instance) { |
| 4420 var _url = null; |
| 4421 var _queryParams = new core.Map(); |
| 4422 var _uploadMedia = null; |
| 4423 var _uploadOptions = null; |
| 4424 var _downloadOptions = common.DownloadOptions.Metadata; |
| 4425 var _body = null; |
| 4426 |
| 4427 if (project == null) { |
| 4428 throw new core.ArgumentError("Parameter project is required."); |
| 4429 } |
| 4430 if (zone == null) { |
| 4431 throw new core.ArgumentError("Parameter zone is required."); |
| 4432 } |
| 4433 if (instance == null) { |
| 4434 throw new core.ArgumentError("Parameter instance is required."); |
| 4435 } |
| 4436 |
| 4437 |
| 4438 _url = common_internal.Escaper.ecapeVariable('$project') + '/zones/' + commo
n_internal.Escaper.ecapeVariable('$zone') + '/instances/' + common_internal.Esca
per.ecapeVariable('$instance') + '/start'; |
| 4439 |
| 4440 var _response = _requester.request(_url, |
| 4441 "POST", |
| 4442 body: _body, |
| 4443 queryParams: _queryParams, |
| 4444 uploadOptions: _uploadOptions, |
| 4445 uploadMedia: _uploadMedia, |
| 4446 downloadOptions: _downloadOptions); |
| 4447 return _response.then((data) => new Operation.fromJson(data)); |
| 4448 } |
| 4449 |
| 4450 /** |
| 4451 * Stops an instance |
| 4452 * |
| 4453 * Request parameters: |
| 4454 * |
| 4455 * [project] - Name of the project scoping this request. |
| 4456 * Value must have pattern |
| 4457 * "(?:(?:[-a-z0-9]{1,63}\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{
1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))". |
| 4458 * |
| 4459 * [zone] - Name of the zone scoping this request. |
| 4460 * Value must have pattern "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?". |
| 4461 * |
| 4462 * [instance] - Name of the instance resource to start. |
| 4463 * Value must have pattern "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?". |
| 4464 * |
| 4465 * Completes with a [Operation]. |
| 4466 * |
| 4467 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 4468 * error. |
| 4469 * |
| 4470 * If the used [http.Client] completes with an error when making a REST call, |
| 4471 * this method will complete with the same error. |
| 4472 */ |
| 4473 async.Future<Operation> stop(core.String project, core.String zone, core.Strin
g instance) { |
| 4474 var _url = null; |
| 4475 var _queryParams = new core.Map(); |
| 4476 var _uploadMedia = null; |
| 4477 var _uploadOptions = null; |
| 4478 var _downloadOptions = common.DownloadOptions.Metadata; |
| 4479 var _body = null; |
| 4480 |
| 4481 if (project == null) { |
| 4482 throw new core.ArgumentError("Parameter project is required."); |
| 4483 } |
| 4484 if (zone == null) { |
| 4485 throw new core.ArgumentError("Parameter zone is required."); |
| 4486 } |
| 4487 if (instance == null) { |
| 4488 throw new core.ArgumentError("Parameter instance is required."); |
| 4489 } |
| 4490 |
| 4491 |
| 4492 _url = common_internal.Escaper.ecapeVariable('$project') + '/zones/' + commo
n_internal.Escaper.ecapeVariable('$zone') + '/instances/' + common_internal.Esca
per.ecapeVariable('$instance') + '/stop'; |
| 4493 |
| 4494 var _response = _requester.request(_url, |
| 4495 "POST", |
| 4496 body: _body, |
| 4497 queryParams: _queryParams, |
| 4498 uploadOptions: _uploadOptions, |
| 4499 uploadMedia: _uploadMedia, |
| 4500 downloadOptions: _downloadOptions); |
| 4501 return _response.then((data) => new Operation.fromJson(data)); |
| 4502 } |
| 4503 |
4396 } | 4504 } |
4397 | 4505 |
4398 | 4506 |
4399 /** Not documented yet. */ | 4507 /** Not documented yet. */ |
4400 class LicensesResourceApi { | 4508 class LicensesResourceApi { |
4401 final common_internal.ApiRequester _requester; | 4509 final common_internal.ApiRequester _requester; |
4402 | 4510 |
4403 LicensesResourceApi(common_internal.ApiRequester client) : | 4511 LicensesResourceApi(common_internal.ApiRequester client) : |
4404 _requester = client; | 4512 _requester = client; |
4405 | 4513 |
(...skipping 11669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16075 _json["nextPageToken"] = nextPageToken; | 16183 _json["nextPageToken"] = nextPageToken; |
16076 } | 16184 } |
16077 if (selfLink != null) { | 16185 if (selfLink != null) { |
16078 _json["selfLink"] = selfLink; | 16186 _json["selfLink"] = selfLink; |
16079 } | 16187 } |
16080 return _json; | 16188 return _json; |
16081 } | 16189 } |
16082 } | 16190 } |
16083 | 16191 |
16084 | 16192 |
OLD | NEW |