mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-06 19:45:20 +01:00
chore(code): updated to latest state
This commit is contained in:
@@ -20,7 +20,7 @@ use clap::{App, SubCommand, Arg};
|
||||
|
||||
mod cmn;
|
||||
|
||||
use cmn::{InvalidOptionsError, CLIError, JsonTokenStorage, arg_from_str, writer_from_opts, parse_kv_arg,
|
||||
use cmn::{InvalidOptionsError, CLIError, JsonTokenStorage, arg_from_str, writer_from_opts, parse_kv_arg,
|
||||
input_file_from_opts, input_mime_from_opts, FieldCursor, FieldError, CallType, UploadProtocol,
|
||||
calltype_from_str, remove_json_null_values, ComplexType, JsonType, JsonTypeInfo};
|
||||
|
||||
@@ -36,22 +36,22 @@ enum DoitError {
|
||||
ApiError(api::Error),
|
||||
}
|
||||
|
||||
struct Engine<'n, 'a> {
|
||||
opt: ArgMatches<'n, 'a>,
|
||||
struct Engine<'n> {
|
||||
opt: ArgMatches<'n>,
|
||||
hub: api::CloudMonitoring<hyper::Client, Authenticator<DefaultAuthenticatorDelegate, JsonTokenStorage, hyper::Client>>,
|
||||
gp: Vec<&'static str>,
|
||||
gpm: Vec<(&'static str, &'static str)>,
|
||||
}
|
||||
|
||||
|
||||
impl<'n, 'a> Engine<'n, 'a> {
|
||||
fn _metric_descriptors_create(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
impl<'n> Engine<'n> {
|
||||
fn _metric_descriptors_create(&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").unwrap_or(Vec::new()).iter() {
|
||||
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();
|
||||
@@ -65,8 +65,8 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
let type_info: Option<(&'static str, JsonTypeInfo)> =
|
||||
|
||||
let type_info: Option<(&'static str, JsonTypeInfo)> =
|
||||
match &temp_cursor.to_string()[..] {
|
||||
"project" => Some(("project", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"type-descriptor.value-type" => Some(("typeDescriptor.valueType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
@@ -85,7 +85,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
let mut request: api::MetricDescriptor = json::value::from_value(object).unwrap();
|
||||
let mut call = self.hub.metric_descriptors().create(request, opt.value_of("project").unwrap_or(""));
|
||||
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
|
||||
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 {
|
||||
_ => {
|
||||
@@ -98,7 +98,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v } ));
|
||||
@@ -111,7 +111,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
Ok(())
|
||||
} else {
|
||||
assert!(err.issues.len() == 0);
|
||||
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
|
||||
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")) {
|
||||
@@ -134,10 +134,10 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn _metric_descriptors_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
fn _metric_descriptors_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
let mut call = self.hub.metric_descriptors().delete(opt.value_of("project").unwrap_or(""), opt.value_of("metric").unwrap_or(""));
|
||||
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
|
||||
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 {
|
||||
_ => {
|
||||
@@ -150,7 +150,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v } ));
|
||||
@@ -163,7 +163,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
Ok(())
|
||||
} else {
|
||||
assert!(err.issues.len() == 0);
|
||||
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
|
||||
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")) {
|
||||
@@ -186,13 +186,13 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn _metric_descriptors_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
fn _metric_descriptors_list(&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").unwrap_or(Vec::new()).iter() {
|
||||
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();
|
||||
@@ -206,8 +206,8 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
let type_info: Option<(&'static str, JsonTypeInfo)> =
|
||||
|
||||
let type_info: Option<(&'static str, JsonTypeInfo)> =
|
||||
match &temp_cursor.to_string()[..] {
|
||||
"kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
_ => {
|
||||
@@ -222,7 +222,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
let mut request: api::ListMetricDescriptorsRequest = json::value::from_value(object).unwrap();
|
||||
let mut call = self.hub.metric_descriptors().list(request, opt.value_of("project").unwrap_or(""));
|
||||
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
|
||||
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 {
|
||||
"query" => {
|
||||
@@ -244,7 +244,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v.extend(["count", "query", "page-token"].iter().map(|v|*v));
|
||||
@@ -258,7 +258,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
Ok(())
|
||||
} else {
|
||||
assert!(err.issues.len() == 0);
|
||||
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
|
||||
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")) {
|
||||
@@ -281,13 +281,13 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn _timeseries_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
fn _timeseries_list(&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").unwrap_or(Vec::new()).iter() {
|
||||
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();
|
||||
@@ -301,8 +301,8 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
let type_info: Option<(&'static str, JsonTypeInfo)> =
|
||||
|
||||
let type_info: Option<(&'static str, JsonTypeInfo)> =
|
||||
match &temp_cursor.to_string()[..] {
|
||||
"kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
_ => {
|
||||
@@ -317,7 +317,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
let mut request: api::ListTimeseriesRequest = json::value::from_value(object).unwrap();
|
||||
let mut call = self.hub.timeseries().list(request, opt.value_of("project").unwrap_or(""), opt.value_of("metric").unwrap_or(""), opt.value_of("youngest").unwrap_or(""));
|
||||
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
|
||||
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 {
|
||||
"window" => {
|
||||
@@ -351,7 +351,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v.extend(["count", "timespan", "aggregator", "labels", "page-token", "window", "oldest"].iter().map(|v|*v));
|
||||
@@ -365,7 +365,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
Ok(())
|
||||
} else {
|
||||
assert!(err.issues.len() == 0);
|
||||
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
|
||||
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")) {
|
||||
@@ -388,13 +388,13 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn _timeseries_write(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
fn _timeseries_write(&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").unwrap_or(Vec::new()).iter() {
|
||||
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();
|
||||
@@ -408,8 +408,8 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
let type_info: Option<(&'static str, JsonTypeInfo)> =
|
||||
|
||||
let type_info: Option<(&'static str, JsonTypeInfo)> =
|
||||
match &temp_cursor.to_string()[..] {
|
||||
"common-labels" => Some(("commonLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })),
|
||||
_ => {
|
||||
@@ -424,7 +424,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
let mut request: api::WriteTimeseriesRequest = json::value::from_value(object).unwrap();
|
||||
let mut call = self.hub.timeseries().write(request, opt.value_of("project").unwrap_or(""));
|
||||
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
|
||||
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 {
|
||||
_ => {
|
||||
@@ -437,7 +437,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v } ));
|
||||
@@ -450,7 +450,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
Ok(())
|
||||
} else {
|
||||
assert!(err.issues.len() == 0);
|
||||
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
|
||||
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")) {
|
||||
@@ -473,13 +473,13 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn _timeseries_descriptors_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
fn _timeseries_descriptors_list(&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").unwrap_or(Vec::new()).iter() {
|
||||
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();
|
||||
@@ -493,8 +493,8 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
let type_info: Option<(&'static str, JsonTypeInfo)> =
|
||||
|
||||
let type_info: Option<(&'static str, JsonTypeInfo)> =
|
||||
match &temp_cursor.to_string()[..] {
|
||||
"kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
_ => {
|
||||
@@ -509,7 +509,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
let mut request: api::ListTimeseriesDescriptorsRequest = json::value::from_value(object).unwrap();
|
||||
let mut call = self.hub.timeseries_descriptors().list(request, opt.value_of("project").unwrap_or(""), opt.value_of("metric").unwrap_or(""), opt.value_of("youngest").unwrap_or(""));
|
||||
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
|
||||
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 {
|
||||
"window" => {
|
||||
@@ -543,7 +543,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v.extend(["count", "timespan", "aggregator", "labels", "page-token", "window", "oldest"].iter().map(|v|*v));
|
||||
@@ -557,7 +557,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
Ok(())
|
||||
} else {
|
||||
assert!(err.issues.len() == 0);
|
||||
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
|
||||
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")) {
|
||||
@@ -644,14 +644,14 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
|
||||
// Please note that this call will fail if any part of the opt can't be handled
|
||||
fn new(opt: ArgMatches<'a, 'n>) -> Result<Engine<'a, 'n>, InvalidOptionsError> {
|
||||
fn new(opt: ArgMatches<'n>) -> Result<Engine<'n>, InvalidOptionsError> {
|
||||
let (config_dir, secret) = {
|
||||
let config_dir = match cmn::assure_config_dir_exists(opt.value_of("folder").unwrap_or("~/.google-service-cli")) {
|
||||
Err(e) => return Err(InvalidOptionsError::single(e, 3)),
|
||||
Ok(p) => p,
|
||||
};
|
||||
|
||||
match cmn::application_secret_from_directory(&config_dir, "cloudmonitoring2-beta2-secret.json",
|
||||
match cmn::application_secret_from_directory(&config_dir, "cloudmonitoring2-beta2-secret.json",
|
||||
"{\"installed\":{\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_secret\":\"hCsslbCUyfehWMmbkG8vTYxG\",\"token_uri\":\"https://accounts.google.com/o/oauth2/token\",\"client_email\":\"\",\"redirect_uris\":[\"urn:ietf:wg:oauth:2.0:oob\",\"oob\"],\"client_x509_cert_url\":\"\",\"client_id\":\"620010449518-9ngf7o4dhs0dka470npqvor6dc5lqb9b.apps.googleusercontent.com\",\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\"}}") {
|
||||
Ok(secret) => (config_dir, secret),
|
||||
Err(e) => return Err(InvalidOptionsError::single(e, 4))
|
||||
@@ -671,7 +671,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
db_dir: config_dir.clone(),
|
||||
}, None);
|
||||
|
||||
let client =
|
||||
let client =
|
||||
if opt.is_present("debug") {
|
||||
hyper::Client::with_connector(mock::TeeConnector {
|
||||
connector: hyper::net::HttpsConnector::<hyper::net::Openssl>::default()
|
||||
@@ -710,7 +710,7 @@ fn main() {
|
||||
let mut exit_status = 0i32;
|
||||
let arg_data = [
|
||||
("metric-descriptors", "methods: 'create', 'delete' and 'list'", vec![
|
||||
("create",
|
||||
("create",
|
||||
Some(r##"Create a new metric."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_cloudmonitoring2_beta2_cli/metric-descriptors_create",
|
||||
vec![
|
||||
@@ -738,7 +738,7 @@ fn main() {
|
||||
Some(false),
|
||||
Some(false)),
|
||||
]),
|
||||
("delete",
|
||||
("delete",
|
||||
Some(r##"Delete an existing metric."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_cloudmonitoring2_beta2_cli/metric-descriptors_delete",
|
||||
vec![
|
||||
@@ -766,7 +766,7 @@ fn main() {
|
||||
Some(false),
|
||||
Some(false)),
|
||||
]),
|
||||
("list",
|
||||
("list",
|
||||
Some(r##"List metric descriptors that match the query. If the query is not set, then all of the metric descriptors will be returned. Large responses will be paginated, use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_cloudmonitoring2_beta2_cli/metric-descriptors_list",
|
||||
vec![
|
||||
@@ -797,7 +797,7 @@ fn main() {
|
||||
]),
|
||||
|
||||
("timeseries", "methods: 'list' and 'write'", vec![
|
||||
("list",
|
||||
("list",
|
||||
Some(r##"List the data points of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_cloudmonitoring2_beta2_cli/timeseries_list",
|
||||
vec![
|
||||
@@ -837,7 +837,7 @@ fn main() {
|
||||
Some(false),
|
||||
Some(false)),
|
||||
]),
|
||||
("write",
|
||||
("write",
|
||||
Some(r##"Put data points to one or more time series for one or more metrics. If a time series does not exist, a new time series will be created. It is not allowed to write a time series point that is older than the existing youngest point of that time series. Points that are older than the existing youngest point of that time series will be discarded silently. Therefore, users should make sure that points of a time series are written sequentially in the order of their end time."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_cloudmonitoring2_beta2_cli/timeseries_write",
|
||||
vec![
|
||||
@@ -868,7 +868,7 @@ fn main() {
|
||||
]),
|
||||
|
||||
("timeseries-descriptors", "methods: 'list'", vec![
|
||||
("list",
|
||||
("list",
|
||||
Some(r##"List the descriptors of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_cloudmonitoring2_beta2_cli/timeseries-descriptors_list",
|
||||
vec![
|
||||
@@ -914,7 +914,7 @@ fn main() {
|
||||
|
||||
let mut app = App::new("cloudmonitoring2-beta2")
|
||||
.author("Sebastian Thiel <byronimo@gmail.com>")
|
||||
.version("0.3.2+20151012")
|
||||
.version("0.3.3+20160124")
|
||||
.about("API for accessing Google Cloud and API monitoring data.")
|
||||
.after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudmonitoring2_beta2_cli")
|
||||
.arg(Arg::with_name("url")
|
||||
@@ -938,7 +938,7 @@ fn main() {
|
||||
.multiple(false)
|
||||
.takes_value(false));
|
||||
|
||||
for &(main_command_name, ref about, ref subcommands) in arg_data.iter() {
|
||||
for &(main_command_name, about, ref subcommands) in arg_data.iter() {
|
||||
let mut mcmd = SubCommand::with_name(main_command_name).about(about);
|
||||
|
||||
for &(sub_command_name, ref desc, url_info, ref args) in subcommands {
|
||||
@@ -949,7 +949,7 @@ fn main() {
|
||||
scmd = scmd.after_help(url_info);
|
||||
|
||||
for &(ref arg_name, ref flag, ref desc, ref required, ref multi) in args {
|
||||
let arg_name_str =
|
||||
let arg_name_str =
|
||||
match (arg_name, flag) {
|
||||
(&Some(an), _ ) => an,
|
||||
(_ , &Some(f)) => f,
|
||||
|
||||
Reference in New Issue
Block a user