|
|
|
|
@@ -679,6 +679,91 @@ where
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async fn _projects_locations_batches_analyze(&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()[..] {
|
|
|
|
|
"request-id" => Some(("requestId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
_ => {
|
|
|
|
|
let suggestion = FieldCursor::did_you_mean(key, &vec!["request-id"]);
|
|
|
|
|
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::AnalyzeBatchRequest = json::value::from_value(object).unwrap();
|
|
|
|
|
let mut call = self.hub.projects().locations_batches_analyze(request, opt.value_of("name").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().await,
|
|
|
|
|
_ => unreachable!()
|
|
|
|
|
} {
|
|
|
|
|
Err(api_err) => Err(DoitError::ApiError(api_err)),
|
|
|
|
|
Ok((mut response, output_schema)) => {
|
|
|
|
|
let mut value = json::value::to_value(&output_schema).expect("serde to work");
|
|
|
|
|
remove_json_null_values(&mut value);
|
|
|
|
|
json::to_writer_pretty(&mut ostream, &value).unwrap();
|
|
|
|
|
ostream.flush().unwrap();
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async fn _projects_locations_batches_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
|
|
|
|
-> Result<(), DoitError> {
|
|
|
|
|
|
|
|
|
|
@@ -7984,6 +8069,9 @@ where
|
|
|
|
|
("locations-autoscaling-policies-update", Some(opt)) => {
|
|
|
|
|
call_result = self._projects_locations_autoscaling_policies_update(opt, dry_run, &mut err).await;
|
|
|
|
|
},
|
|
|
|
|
("locations-batches-analyze", Some(opt)) => {
|
|
|
|
|
call_result = self._projects_locations_batches_analyze(opt, dry_run, &mut err).await;
|
|
|
|
|
},
|
|
|
|
|
("locations-batches-create", Some(opt)) => {
|
|
|
|
|
call_result = self._projects_locations_batches_create(opt, dry_run, &mut err).await;
|
|
|
|
|
},
|
|
|
|
|
@@ -8303,7 +8391,7 @@ where
|
|
|
|
|
async fn main() {
|
|
|
|
|
let mut exit_status = 0i32;
|
|
|
|
|
let arg_data = [
|
|
|
|
|
("projects", "methods: 'locations-autoscaling-policies-create', 'locations-autoscaling-policies-delete', 'locations-autoscaling-policies-get', 'locations-autoscaling-policies-get-iam-policy', 'locations-autoscaling-policies-list', 'locations-autoscaling-policies-set-iam-policy', 'locations-autoscaling-policies-test-iam-permissions', 'locations-autoscaling-policies-update', 'locations-batches-create', 'locations-batches-delete', 'locations-batches-get', 'locations-batches-list', 'locations-operations-cancel', 'locations-operations-delete', 'locations-operations-get', 'locations-operations-list', 'locations-session-templates-create', 'locations-session-templates-delete', 'locations-session-templates-get', 'locations-session-templates-list', 'locations-session-templates-patch', 'locations-sessions-create', 'locations-sessions-delete', 'locations-sessions-get', 'locations-sessions-list', 'locations-sessions-terminate', 'locations-workflow-templates-create', 'locations-workflow-templates-delete', 'locations-workflow-templates-get', 'locations-workflow-templates-get-iam-policy', 'locations-workflow-templates-instantiate', 'locations-workflow-templates-instantiate-inline', 'locations-workflow-templates-list', 'locations-workflow-templates-set-iam-policy', 'locations-workflow-templates-test-iam-permissions', 'locations-workflow-templates-update', 'regions-autoscaling-policies-create', 'regions-autoscaling-policies-delete', 'regions-autoscaling-policies-get', 'regions-autoscaling-policies-get-iam-policy', 'regions-autoscaling-policies-list', 'regions-autoscaling-policies-set-iam-policy', 'regions-autoscaling-policies-test-iam-permissions', 'regions-autoscaling-policies-update', 'regions-clusters-create', 'regions-clusters-delete', 'regions-clusters-diagnose', 'regions-clusters-get', 'regions-clusters-get-iam-policy', 'regions-clusters-inject-credentials', 'regions-clusters-list', 'regions-clusters-node-groups-create', 'regions-clusters-node-groups-get', 'regions-clusters-node-groups-repair', 'regions-clusters-node-groups-resize', 'regions-clusters-patch', 'regions-clusters-repair', 'regions-clusters-set-iam-policy', 'regions-clusters-start', 'regions-clusters-stop', 'regions-clusters-test-iam-permissions', 'regions-jobs-cancel', 'regions-jobs-delete', 'regions-jobs-get', 'regions-jobs-get-iam-policy', 'regions-jobs-list', 'regions-jobs-patch', 'regions-jobs-set-iam-policy', 'regions-jobs-submit', 'regions-jobs-submit-as-operation', 'regions-jobs-test-iam-permissions', 'regions-operations-cancel', 'regions-operations-delete', 'regions-operations-get', 'regions-operations-get-iam-policy', 'regions-operations-list', 'regions-operations-set-iam-policy', 'regions-operations-test-iam-permissions', 'regions-workflow-templates-create', 'regions-workflow-templates-delete', 'regions-workflow-templates-get', 'regions-workflow-templates-get-iam-policy', 'regions-workflow-templates-instantiate', 'regions-workflow-templates-instantiate-inline', 'regions-workflow-templates-list', 'regions-workflow-templates-set-iam-policy', 'regions-workflow-templates-test-iam-permissions' and 'regions-workflow-templates-update'", vec![
|
|
|
|
|
("projects", "methods: 'locations-autoscaling-policies-create', 'locations-autoscaling-policies-delete', 'locations-autoscaling-policies-get', 'locations-autoscaling-policies-get-iam-policy', 'locations-autoscaling-policies-list', 'locations-autoscaling-policies-set-iam-policy', 'locations-autoscaling-policies-test-iam-permissions', 'locations-autoscaling-policies-update', 'locations-batches-analyze', 'locations-batches-create', 'locations-batches-delete', 'locations-batches-get', 'locations-batches-list', 'locations-operations-cancel', 'locations-operations-delete', 'locations-operations-get', 'locations-operations-list', 'locations-session-templates-create', 'locations-session-templates-delete', 'locations-session-templates-get', 'locations-session-templates-list', 'locations-session-templates-patch', 'locations-sessions-create', 'locations-sessions-delete', 'locations-sessions-get', 'locations-sessions-list', 'locations-sessions-terminate', 'locations-workflow-templates-create', 'locations-workflow-templates-delete', 'locations-workflow-templates-get', 'locations-workflow-templates-get-iam-policy', 'locations-workflow-templates-instantiate', 'locations-workflow-templates-instantiate-inline', 'locations-workflow-templates-list', 'locations-workflow-templates-set-iam-policy', 'locations-workflow-templates-test-iam-permissions', 'locations-workflow-templates-update', 'regions-autoscaling-policies-create', 'regions-autoscaling-policies-delete', 'regions-autoscaling-policies-get', 'regions-autoscaling-policies-get-iam-policy', 'regions-autoscaling-policies-list', 'regions-autoscaling-policies-set-iam-policy', 'regions-autoscaling-policies-test-iam-permissions', 'regions-autoscaling-policies-update', 'regions-clusters-create', 'regions-clusters-delete', 'regions-clusters-diagnose', 'regions-clusters-get', 'regions-clusters-get-iam-policy', 'regions-clusters-inject-credentials', 'regions-clusters-list', 'regions-clusters-node-groups-create', 'regions-clusters-node-groups-get', 'regions-clusters-node-groups-repair', 'regions-clusters-node-groups-resize', 'regions-clusters-patch', 'regions-clusters-repair', 'regions-clusters-set-iam-policy', 'regions-clusters-start', 'regions-clusters-stop', 'regions-clusters-test-iam-permissions', 'regions-jobs-cancel', 'regions-jobs-delete', 'regions-jobs-get', 'regions-jobs-get-iam-policy', 'regions-jobs-list', 'regions-jobs-patch', 'regions-jobs-set-iam-policy', 'regions-jobs-submit', 'regions-jobs-submit-as-operation', 'regions-jobs-test-iam-permissions', 'regions-operations-cancel', 'regions-operations-delete', 'regions-operations-get', 'regions-operations-get-iam-policy', 'regions-operations-list', 'regions-operations-set-iam-policy', 'regions-operations-test-iam-permissions', 'regions-workflow-templates-create', 'regions-workflow-templates-delete', 'regions-workflow-templates-get', 'regions-workflow-templates-get-iam-policy', 'regions-workflow-templates-instantiate', 'regions-workflow-templates-instantiate-inline', 'regions-workflow-templates-list', 'regions-workflow-templates-set-iam-policy', 'regions-workflow-templates-test-iam-permissions' and 'regions-workflow-templates-update'", vec![
|
|
|
|
|
("locations-autoscaling-policies-create",
|
|
|
|
|
Some(r##"Creates new autoscaling policy."##),
|
|
|
|
|
"Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_locations-autoscaling-policies-create",
|
|
|
|
|
@@ -8504,6 +8592,34 @@ async 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)),
|
|
|
|
|
]),
|
|
|
|
|
("locations-batches-analyze",
|
|
|
|
|
Some(r##"Analyze a Batch for possible recommendations and insights."##),
|
|
|
|
|
"Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_locations-batches-analyze",
|
|
|
|
|
vec![
|
|
|
|
|
(Some(r##"name"##),
|
|
|
|
|
None,
|
|
|
|
|
Some(r##"Required. The fully qualified name of the batch to analyze in the format "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID""##),
|
|
|
|
|
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"##),
|
|
|
|
|
@@ -10732,7 +10848,7 @@ async fn main() {
|
|
|
|
|
|
|
|
|
|
let mut app = App::new("dataproc1")
|
|
|
|
|
.author("Sebastian Thiel <byronimo@gmail.com>")
|
|
|
|
|
.version("5.0.4+20240222")
|
|
|
|
|
.version("5.0.5+20240414")
|
|
|
|
|
.about("Manages Hadoop-based clusters and jobs on Google Cloud Platform.")
|
|
|
|
|
.after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dataproc1_cli")
|
|
|
|
|
.arg(Arg::with_name("url")
|
|
|
|
|
@@ -10796,6 +10912,7 @@ async fn main() {
|
|
|
|
|
|
|
|
|
|
let debug = matches.is_present("adebug");
|
|
|
|
|
let connector = hyper_rustls::HttpsConnectorBuilder::new().with_native_roots()
|
|
|
|
|
.unwrap()
|
|
|
|
|
.https_or_http()
|
|
|
|
|
.enable_http1()
|
|
|
|
|
.build();
|
|
|
|
|
|