mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-13 21:19:05 +01:00
chore(code-update): to latest schema version
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
[package]
|
||||
|
||||
name = "google-compute1-cli"
|
||||
version = "0.3.3+20160224"
|
||||
version = "0.3.4+20160328"
|
||||
authors = ["Sebastian Thiel <byronimo@gmail.com>"]
|
||||
description = "A complete library to interact with compute (protocol v1)"
|
||||
repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/compute1-cli"
|
||||
@@ -17,18 +17,18 @@ keywords = ["compute", "google", "cli"]
|
||||
name = "compute1"
|
||||
|
||||
[dependencies]
|
||||
hyper = "0.7"
|
||||
mime = "0.1.0"
|
||||
serde = ">= 0.7.0"
|
||||
serde_json = ">= 0.7.0"
|
||||
yup-oauth2 = ">= 0.5.4"
|
||||
hyper = "0.8"
|
||||
mime = "0.2.0"
|
||||
serde = "0.6.0"
|
||||
serde_json = "0.6.0"
|
||||
yup-oauth2 = ">= 0.5.6"
|
||||
strsim = "0.4"
|
||||
yup-hyper-mock = "1.0"
|
||||
clap = "2.0"
|
||||
|
||||
[build-dependencies]
|
||||
syntex = { version = ">= 0.23" }
|
||||
serde_codegen = { version = ">= 0.6" }
|
||||
syntex = { version = "= 0.28" }
|
||||
serde_codegen = { version = "= 0.6.13" }
|
||||
|
||||
|
||||
[dependencies.google-compute1]
|
||||
|
||||
@@ -17,14 +17,14 @@ Everything else about the *compute* API can be found at the
|
||||
|
||||
You can download the pre-compiled 64bit binaries for the following platforms:
|
||||
|
||||
*  [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.3/ubuntu/compute1.tar.gz)
|
||||
*  [osx](http://dl.byronimo.de/google.rs/cli/0.3.3/osx/compute1.tar.gz)
|
||||
*  [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.4/ubuntu/compute1.tar.gz)
|
||||
*  [osx](http://dl.byronimo.de/google.rs/cli/0.3.4/osx/compute1.tar.gz)
|
||||
|
||||
Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/compute1-cli).
|
||||
|
||||
# Usage
|
||||
|
||||
This documentation was generated from the *compute* API at revision *20160224*. The CLI is at version *0.3.3*.
|
||||
This documentation was generated from the *compute* API at revision *20160328*. The CLI is at version *0.3.4*.
|
||||
|
||||
```bash
|
||||
compute1 [options]
|
||||
@@ -61,6 +61,7 @@ compute1 [options]
|
||||
get <project> <zone> <disk> [-p <v>]... [-o <out>]
|
||||
insert <project> <zone> (-r <kv>)... [-p <v>]... [-o <out>]
|
||||
list <project> <zone> [-p <v>]... [-o <out>]
|
||||
resize <project> <zone> <disk> (-r <kv>)... [-p <v>]... [-o <out>]
|
||||
firewalls
|
||||
delete <project> <firewall> [-p <v>]... [-o <out>]
|
||||
get <project> <firewall> [-p <v>]... [-o <out>]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
site_name: compute v0.3.3+20160224
|
||||
site_name: compute v0.3.4+20160328
|
||||
site_url: http://byron.github.io/google-apis-rs/google-compute1-cli
|
||||
site_description: Write integrating applications with bcore
|
||||
|
||||
@@ -37,6 +37,7 @@ pages:
|
||||
- ['disks_get.md', 'Disks', 'Get']
|
||||
- ['disks_insert.md', 'Disks', 'Insert']
|
||||
- ['disks_list.md', 'Disks', 'List']
|
||||
- ['disks_resize.md', 'Disks', 'Resize']
|
||||
- ['firewalls_delete.md', 'Firewalls', 'Delete']
|
||||
- ['firewalls_get.md', 'Firewalls', 'Get']
|
||||
- ['firewalls_insert.md', 'Firewalls', 'Insert']
|
||||
|
||||
@@ -414,7 +414,7 @@ impl TokenStorage for JsonTokenStorage {
|
||||
Err(err) =>
|
||||
match err.kind() {
|
||||
io::ErrorKind::NotFound => Ok(()),
|
||||
_ => Err(json::Error::Io(err))
|
||||
_ => Err(json::Error::IoError(err))
|
||||
},
|
||||
Ok(_) => Ok(()),
|
||||
}
|
||||
@@ -427,7 +427,7 @@ impl TokenStorage for JsonTokenStorage {
|
||||
Err(serde_err) => Err(serde_err),
|
||||
}
|
||||
},
|
||||
Err(io_err) => Err(json::Error::Io(io_err))
|
||||
Err(io_err) => Err(json::Error::IoError(io_err))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -444,7 +444,7 @@ impl TokenStorage for JsonTokenStorage {
|
||||
Err(io_err) => {
|
||||
match io_err.kind() {
|
||||
io::ErrorKind::NotFound => Ok(None),
|
||||
_ => Err(json::Error::Io(io_err))
|
||||
_ => Err(json::Error::IoError(io_err))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -683,7 +683,7 @@ pub fn application_secret_from_directory(dir: &str,
|
||||
= json::from_str(json_console_secret).unwrap();
|
||||
match json::to_writer_pretty(&mut f, &console_secret) {
|
||||
Err(serde_err) => match serde_err {
|
||||
json::Error::Io(err) => err,
|
||||
json::Error::IoError(err) => err,
|
||||
_ => panic!("Unexpected serde error: {:#?}", serde_err)
|
||||
},
|
||||
Ok(_) => continue,
|
||||
@@ -696,7 +696,7 @@ pub fn application_secret_from_directory(dir: &str,
|
||||
},
|
||||
Ok(f) => {
|
||||
match json::de::from_reader::<_, ConsoleApplicationSecret>(f) {
|
||||
Err(json::Error::Io(err)) =>
|
||||
Err(json::Error::IoError(err)) =>
|
||||
return secret_io_error(err),
|
||||
Err(json_err) =>
|
||||
return Err(CLIError::Configuration(
|
||||
|
||||
@@ -1106,6 +1106,7 @@ impl<'n> Engine<'n> {
|
||||
"protocol" => Some(("protocol", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"timeout-sec" => Some(("timeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
||||
"region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"port" => Some(("port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
||||
"fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"port-name" => Some(("portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
@@ -1115,7 +1116,7 @@ impl<'n> Engine<'n> {
|
||||
"self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "fingerprint", "health-checks", "id", "kind", "name", "port", "port-name", "protocol", "self-link", "timeout-sec"]);
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "fingerprint", "health-checks", "id", "kind", "name", "port", "port-name", "protocol", "region", "self-link", "timeout-sec"]);
|
||||
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
||||
None
|
||||
}
|
||||
@@ -1264,6 +1265,7 @@ impl<'n> Engine<'n> {
|
||||
"protocol" => Some(("protocol", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"timeout-sec" => Some(("timeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
||||
"region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"port" => Some(("port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
||||
"fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"port-name" => Some(("portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
@@ -1273,7 +1275,7 @@ impl<'n> Engine<'n> {
|
||||
"self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "fingerprint", "health-checks", "id", "kind", "name", "port", "port-name", "protocol", "self-link", "timeout-sec"]);
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "fingerprint", "health-checks", "id", "kind", "name", "port", "port-name", "protocol", "region", "self-link", "timeout-sec"]);
|
||||
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
||||
None
|
||||
}
|
||||
@@ -1360,6 +1362,7 @@ impl<'n> Engine<'n> {
|
||||
"protocol" => Some(("protocol", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"timeout-sec" => Some(("timeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
||||
"region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"port" => Some(("port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
||||
"fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"port-name" => Some(("portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
@@ -1369,7 +1372,7 @@ impl<'n> Engine<'n> {
|
||||
"self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "fingerprint", "health-checks", "id", "kind", "name", "port", "port-name", "protocol", "self-link", "timeout-sec"]);
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "fingerprint", "health-checks", "id", "kind", "name", "port", "port-name", "protocol", "region", "self-link", "timeout-sec"]);
|
||||
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
||||
None
|
||||
}
|
||||
@@ -2037,6 +2040,91 @@ impl<'n> Engine<'n> {
|
||||
}
|
||||
}
|
||||
|
||||
fn _disks_resize(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
|
||||
let mut field_cursor = FieldCursor::default();
|
||||
let mut object = json::value::Value::Object(Default::default());
|
||||
|
||||
for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
|
||||
let last_errc = err.issues.len();
|
||||
let (key, value) = parse_kv_arg(&*kvarg, err, false);
|
||||
let mut temp_cursor = field_cursor.clone();
|
||||
if let Err(field_err) = temp_cursor.set(&*key) {
|
||||
err.issues.push(field_err);
|
||||
}
|
||||
if value.is_none() {
|
||||
field_cursor = temp_cursor.clone();
|
||||
if err.issues.len() > last_errc {
|
||||
err.issues.remove(last_errc);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
let type_info: Option<(&'static str, JsonTypeInfo)> =
|
||||
match &temp_cursor.to_string()[..] {
|
||||
"size-gb" => Some(("sizeGb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["size-gb"]);
|
||||
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
||||
None
|
||||
}
|
||||
};
|
||||
if let Some((field_cursor_str, type_info)) = type_info {
|
||||
FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor);
|
||||
}
|
||||
}
|
||||
let mut request: api::DisksResizeRequest = json::value::from_value(object).unwrap();
|
||||
let mut call = self.hub.disks().resize(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("disk").unwrap_or(""));
|
||||
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
|
||||
let (key, value) = parse_kv_arg(&*parg, err, false);
|
||||
match key {
|
||||
_ => {
|
||||
let mut found = false;
|
||||
for param in &self.gp {
|
||||
if key == *param {
|
||||
found = true;
|
||||
call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v } ));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let protocol = CallType::Standard;
|
||||
if dry_run {
|
||||
Ok(())
|
||||
} else {
|
||||
assert!(err.issues.len() == 0);
|
||||
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
|
||||
call = call.add_scope(scope);
|
||||
}
|
||||
let mut ostream = match writer_from_opts(opt.value_of("out")) {
|
||||
Ok(mut f) => f,
|
||||
Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)),
|
||||
};
|
||||
match match protocol {
|
||||
CallType::Standard => call.doit(),
|
||||
_ => unreachable!()
|
||||
} {
|
||||
Err(api_err) => Err(DoitError::ApiError(api_err)),
|
||||
Ok((mut response, output_schema)) => {
|
||||
let mut value = json::value::to_value(&output_schema);
|
||||
remove_json_null_values(&mut value);
|
||||
json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
ostream.flush().unwrap();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn _firewalls_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
let mut call = self.hub.firewalls().delete(opt.value_of("project").unwrap_or(""), opt.value_of("firewall").unwrap_or(""));
|
||||
@@ -13694,6 +13782,9 @@ impl<'n> Engine<'n> {
|
||||
("list", Some(opt)) => {
|
||||
call_result = self._disks_list(opt, dry_run, &mut err);
|
||||
},
|
||||
("resize", Some(opt)) => {
|
||||
call_result = self._disks_resize(opt, dry_run, &mut err);
|
||||
},
|
||||
_ => {
|
||||
err.issues.push(CLIError::MissingMethodError("disks".to_string()));
|
||||
writeln!(io::stderr(), "{}\n", opt.usage()).ok();
|
||||
@@ -15216,7 +15307,7 @@ fn main() {
|
||||
]),
|
||||
]),
|
||||
|
||||
("disks", "methods: 'aggregated-list', 'create-snapshot', 'delete', 'get', 'insert' and 'list'", vec![
|
||||
("disks", "methods: 'aggregated-list', 'create-snapshot', 'delete', 'get', 'insert', 'list' and 'resize'", vec![
|
||||
("aggregated-list",
|
||||
Some(r##"Retrieves an aggregated list of persistent disks."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_compute1_cli/disks_aggregated-list",
|
||||
@@ -15348,7 +15439,7 @@ fn main() {
|
||||
Some(false)),
|
||||
]),
|
||||
("insert",
|
||||
Some(r##"Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create an empty 200 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property."##),
|
||||
Some(r##"Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_compute1_cli/disks_insert",
|
||||
vec![
|
||||
(Some(r##"project"##),
|
||||
@@ -15403,6 +15494,46 @@ fn main() {
|
||||
Some(false),
|
||||
Some(true)),
|
||||
|
||||
(Some(r##"out"##),
|
||||
Some(r##"o"##),
|
||||
Some(r##"Specify the file into which to write the program's output"##),
|
||||
Some(false),
|
||||
Some(false)),
|
||||
]),
|
||||
("resize",
|
||||
Some(r##"Resizes the specified persistent disk."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_compute1_cli/disks_resize",
|
||||
vec![
|
||||
(Some(r##"project"##),
|
||||
None,
|
||||
Some(r##"Project ID for this request."##),
|
||||
Some(true),
|
||||
Some(false)),
|
||||
|
||||
(Some(r##"zone"##),
|
||||
None,
|
||||
Some(r##"The name of the zone for this request."##),
|
||||
Some(true),
|
||||
Some(false)),
|
||||
|
||||
(Some(r##"disk"##),
|
||||
None,
|
||||
Some(r##"The name of the persistent disk."##),
|
||||
Some(true),
|
||||
Some(false)),
|
||||
|
||||
(Some(r##"kv"##),
|
||||
Some(r##"r"##),
|
||||
Some(r##"Set various fields of the request structure, matching the key=value form"##),
|
||||
Some(true),
|
||||
Some(true)),
|
||||
|
||||
(Some(r##"v"##),
|
||||
Some(r##"p"##),
|
||||
Some(r##"Set various optional parameters, matching the key=value form"##),
|
||||
Some(false),
|
||||
Some(true)),
|
||||
|
||||
(Some(r##"out"##),
|
||||
Some(r##"o"##),
|
||||
Some(r##"Specify the file into which to write the program's output"##),
|
||||
@@ -20662,7 +20793,7 @@ fn main() {
|
||||
|
||||
let mut app = App::new("compute1")
|
||||
.author("Sebastian Thiel <byronimo@gmail.com>")
|
||||
.version("0.3.3+20160224")
|
||||
.version("0.3.4+20160328")
|
||||
.about("API for the Google Compute Engine service.")
|
||||
.after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_compute1_cli")
|
||||
.arg(Arg::with_name("url")
|
||||
|
||||
Reference in New Issue
Block a user