From 396c1492f90de637c966292a394812f3d7224aef Mon Sep 17 00:00:00 2001 From: Mike Ganbold Date: Fri, 10 May 2019 17:52:51 -0700 Subject: [PATCH 1/4] completed iot_create_reg, iot_get_device, iot_del_reg --- google/cloud/iot/v1/cloudiot_gapic.yaml | 326 ++++++++++++++++++++++++ 1 file changed, 326 insertions(+) diff --git a/google/cloud/iot/v1/cloudiot_gapic.yaml b/google/cloud/iot/v1/cloudiot_gapic.yaml index 72ed2c09b67df..1b8786d21e257 100644 --- a/google/cloud/iot/v1/cloudiot_gapic.yaml +++ b/google/cloud/iot/v1/cloudiot_gapic.yaml @@ -147,6 +147,60 @@ interfaces: parent: location resource_name_treatment: STATIC_TYPES timeout_millis: 60000 + + samples: + standalone: + - region_tag: iot_create_registry + value_sets: [iot_create_registry] + + sample_value_sets: + - id: iot_create_registry + description: Create Device Registry + + # Setup the request object + parameters: + + # Set some default values + defaults: + - parent%project="[Google Cloud Project ID]" + - parent%location="us-central1" + - device_registry.id="my-registry" + # Configure request fields: + # - configure so you can provide them to the method (CLI) + # - give them a nice text description + # - and more + attributes: + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: device_registry.id + sample_argument_name: registry_id + description: Identifier of this device registry, e.g. my-registry + # Print things out from the response! + on_success: + - print: + - "Created registry: %s" + - $resp.name + # - name: GetDeviceRegistry + # flattening: + # groups: + # - parameters: + # - name + # required_fields: + # - name + # header_request_params: + # - name + # retry_codes_name: idempotent + # retry_params_name: default + # field_name_patterns: + # name: registry + # resource_name_treatment: STATIC_TYPES + # timeout_millis: 60000 + + - name: GetDeviceRegistry flattening: groups: @@ -162,6 +216,50 @@ interfaces: name: registry resource_name_treatment: STATIC_TYPES timeout_millis: 60000 + + samples: + standalone: + - region_tag: iot_get_registry + value_sets: [iot_get_registry] + + sample_value_sets: + - id: iot_get_registry + description: Get Device Registry + + # Setup the request object + parameters: + + # Set some default values + defaults: + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + - name%registry="[DeviceRegistry ID]" + + # Configure request fields: + # - configure so you can provide them to the method (CLI) + # - give them a nice text description + # - and more + attributes: + - parameter: name%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: name%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: name%registry + sample_argument_name: registry_id + description: ID of the DeviceRegistry + + # Print things out from the response! + on_success: + + - print: + - "Device Registry ID: %s" + - $resp.id + + - print: ["Name: %s", $resp.name] + + - name: UpdateDeviceRegistry flattening: groups: @@ -194,6 +292,45 @@ interfaces: name: registry resource_name_treatment: STATIC_TYPES timeout_millis: 60000 + samples: + standalone: + - region_tag: iot_delete_registry + value_sets: [iot_delete_registry] + + sample_value_sets: + - id: iot_delete_registry + description: Get Device Registry + + # Setup the request object + parameters: + + # Set some default values + defaults: + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + - name%registry="[DeviceRegistry ID]" + + # Configure request fields: + # - configure so you can provide them to the method (CLI) + # - give them a nice text description + # - and more + attributes: + - parameter: name%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: name%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: name%registry + sample_argument_name: registry_id + description: ID of the DeviceRegistry + + # Print things out from the response! + on_success: + - print: + - "Successfully deleted the registry" + + - name: ListDeviceRegistries flattening: groups: @@ -216,6 +353,36 @@ interfaces: parent: location resource_name_treatment: STATIC_TYPES timeout_millis: 60000 + samples: + standalone: + - region_tag: iot_list_registries + value_sets: [iot_list_registries] + + sample_value_sets: + - id: iot_list_registries + description: List Device Registries + + # Setup the request object + parameters: + + # Set some default values + defaults: + - parent%project="[Google Cloud Project ID]" + - parent%location="us-central1" + - page_size=5 + # Configure request fields: + # - configure so you can provide them to the method (CLI) + # - give them a nice text description + # - and more + attributes: + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1 + + - name: CreateDevice flattening: groups: @@ -233,6 +400,47 @@ interfaces: parent: registry resource_name_treatment: STATIC_TYPES timeout_millis: 60000 + samples: + standalone: + - region_tag: iot_create_device + value_sets: [iot_create_device] + + sample_value_sets: + - id: iot_create_device + description: Create Device + + # Setup the request object + parameters: + # Set some default values + defaults: + - parent%project="[Google Cloud Project ID]" + - parent%location="us-central1" + - parent%registry_id="[DeviceRegistry ID]" + - device.id="my-device" + # Configure request fields: + # - configure so you can provide them to the method (CLI) + # - give them a nice text description + # - and more + attributes: + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: parent%registry + sample_argument_name: registry_id + description: registry_id, e.g. us-central1 + - parameter: device.id + sample_argument_name: device_id + description: device id + on_success: + - print: + - "Created Device with ID: %s" + - $resp.id + + + - name: GetDevice flattening: groups: @@ -265,6 +473,45 @@ interfaces: device.name: device resource_name_treatment: STATIC_TYPES timeout_millis: 60000 + samples: + standalone: + - region_tag: iot_get_device + value_sets: [iot_get_device] + + sample_value_sets: + - id: iot_get_device + description: Retrieve Device metadate from a registry. + + # Setup the request object + parameters: + # Set some default values + defaults: + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + - name%registry_id="[DeviceRegistry ID]" + - device.id="my-device" + # Configure request fields: + # - configure so you can provide them to the method (CLI) + # - give them a nice text description + # - and more + attributes: + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: parent%registry + sample_argument_name: registry_id + description: Device Registry + - parameter: device.id + sample_argument_name: device_id + description: device id + on_success: + - print: + - "Retrieving Device: %s" + - $resp.name + - name: DeleteDevice flattening: groups: @@ -280,6 +527,46 @@ interfaces: name: device resource_name_treatment: STATIC_TYPES timeout_millis: 60000 + + samples: + standalone: + - region_tag: iot_delete_device + value_sets: [iot_delete_device] + + sample_value_sets: + - id: iot_delete_device + # Setup the request object + parameters: + + # Set some default values + defaults: + - name%device="my-device" + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + - name%registry="[DeviceRegistry ID]" + + # Configure request fields: + # - configure so you can provide them to the method (CLI) + # - give them a nice text description + # - and more + attributes: + - parameter: name%device + sample_argument_name: device_id + description: Your Iot Device ID + - parameter: name%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: name%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: name%registry + sample_argument_name: registry_id + description: ID of the DeviceRegistry + # Print things out from the response! + on_success: + - print: + - "Deleted device" + - name: ListDevices flattening: groups: @@ -302,6 +589,45 @@ interfaces: parent: registry resource_name_treatment: STATIC_TYPES timeout_millis: 60000 + samples: + standalone: + - region_tag: iot_list_devices + value_sets: [iot_list_devices] + + sample_value_sets: + - id: iot_list_devices + description: List All Devices in Registry + + # Setup the request object + parameters: + + # Set some default values + defaults: + - parent%project="[Google Cloud Project ID]" + - parent%location="us-central1" + - parent%registry="[DeviceRegistry ID]" + + # Configure request fields: + # - configure so you can provide them to the method (CLI) + # - give them a nice text description + # - and more + attributes: + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: parent%registry + sample_argument_name: registry_id + description: ID of the DeviceRegistry + + # Print things out from the response! + on_success: + - define: device=$resp + + + - name: ModifyCloudToDeviceConfig flattening: groups: From ef6ea616f2b6423e80fa941e9d568bb988f219f6 Mon Sep 17 00:00:00 2001 From: Mike Ganbold Date: Tue, 21 May 2019 14:12:22 -0700 Subject: [PATCH 2/4] 70% is done, only weird ones are left --- google/cloud/iot/v1/cloudiot_gapic.yaml | 455 ++++++++++++++++++++++-- 1 file changed, 422 insertions(+), 33 deletions(-) diff --git a/google/cloud/iot/v1/cloudiot_gapic.yaml b/google/cloud/iot/v1/cloudiot_gapic.yaml index 1b8786d21e257..32f83264c556f 100644 --- a/google/cloud/iot/v1/cloudiot_gapic.yaml +++ b/google/cloud/iot/v1/cloudiot_gapic.yaml @@ -381,6 +381,10 @@ interfaces: - parameter: parent%location sample_argument_name: location description: Location, e.g. us-central1 + on_success: + - print: ["ID: %s", $resp.id] + - print: ["name: %s\n", $resp.name] + - name: CreateDevice @@ -456,23 +460,6 @@ interfaces: name: device resource_name_treatment: STATIC_TYPES timeout_millis: 60000 - - name: UpdateDevice - flattening: - groups: - - parameters: - - device - - update_mask - required_fields: - - device - - update_mask - header_request_params: - - device.name - retry_codes_name: non_idempotent - retry_params_name: default - field_name_patterns: - device.name: device - resource_name_treatment: STATIC_TYPES - timeout_millis: 60000 samples: standalone: - region_tag: iot_get_device @@ -480,38 +467,64 @@ interfaces: sample_value_sets: - id: iot_get_device - description: Retrieve Device metadate from a registry. - + description: Retrieves device metadata from a registry. # Setup the request object parameters: # Set some default values defaults: + - name%device_id="my-device" - name%project="[Google Cloud Project ID]" - name%location="us-central1" - - name%registry_id="[DeviceRegistry ID]" - - device.id="my-device" + - name%registry="[DeviceRegistry ID]" + # Configure request fields: # - configure so you can provide them to the method (CLI) # - give them a nice text description # - and more attributes: - - parameter: parent%project + - parameter: name%device + sample_argument_name: device_id + description: Your Iot Device + - parameter: name%project sample_argument_name: project_id description: Your Google Cloud Project ID - - parameter: parent%location + - parameter: name%location sample_argument_name: location description: Location, e.g. us-central1 - - parameter: parent%registry + - parameter: name%registry sample_argument_name: registry_id - description: Device Registry - - parameter: device.id - sample_argument_name: device_id - description: device id + description: ID of the DeviceRegistry + + # Print things out from the response! on_success: - - print: - - "Retrieving Device: %s" - - $resp.name + - define: device=$resp + - print: + - "ID: %s" + - device.id + - print: + - "Retrieving device %s" + - device.name + - name: UpdateDevice + flattening: + groups: + - parameters: + - device + - update_mask + required_fields: + - device + - update_mask + header_request_params: + - device.name + retry_codes_name: non_idempotent + retry_params_name: default + field_name_patterns: + device.name: device + resource_name_treatment: STATIC_TYPES + timeout_millis: 60000 + + +# STOPPED HERE---------------__________-----------> - name: DeleteDevice flattening: groups: @@ -527,7 +540,6 @@ interfaces: name: device resource_name_treatment: STATIC_TYPES timeout_millis: 60000 - samples: standalone: - region_tag: iot_delete_device @@ -593,7 +605,10 @@ interfaces: standalone: - region_tag: iot_list_devices value_sets: [iot_list_devices] - + - region_tag: list_gateways + value_sets: [list_gateways] + - region_tag: list_devices_for_gateway + value_sets: [list_devices_for_gateway] sample_value_sets: - id: iot_list_devices description: List All Devices in Registry @@ -625,8 +640,98 @@ interfaces: # Print things out from the response! on_success: - define: device=$resp + - print: + - "ID: %s" + - device.id + - comment: + - "Note that this will show the device config in Base64 encoded format." + - print: + - "Config: %s\n" + - device.config + - id: list_gateways + description: List All Gateways in Registry + + # Setup the request object + parameters: + + # Set some default values + defaults: + - parent%project="[Google Cloud Project ID]" + - parent%location="us-central1" + - parent%registry="[DeviceRegistry ID]" + - gateway_list_options.gateway_type=GATEWAY + # Configure request fields: + # - configure so you can provide them to the method (CLI) + # - give them a nice text description + # - and more + attributes: + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: parent%registry + sample_argument_name: registry_id + description: ID of the DeviceRegistry + # - parameter: gateway_list_options.associations_gateway_id + # sample_argument_name: gateway_id + # description: Gateway ID + + # Print things out from the response! + on_success: + - define: device=$resp + - print: + - "ID: %s" + - device.id + - comment: + - "Note that this will show the device config in Base64 encoded format." + - print: + - "Config: %s\n" + - device.config + + + - id: list_devices_for_gateway + description: List All Devices that are bound to a gateway + + # Setup the request object + parameters: + # Set some default values + defaults: + - parent%project="[Google Cloud Project ID]" + - parent%location="us-central1" + - parent%registry="[DeviceRegistry ID]" + - gateway_list_options.associations_gateway_id=my-gateway + # Configure request fields: + # - configure so you can provide them to the method (CLI) + # - give them a nice text description + # - and more + attributes: + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: parent%registry + sample_argument_name: registry_id + description: ID of the DeviceRegistry + - parameter: gateway_list_options.associations_gateway_id + sample_argument_name: gateway_id + description: Gateway ID + # Print things out from the response! + on_success: + - define: device=$resp + - print: + - "ID: %s" + - device.id + - comment: + - "Note that this will show the device config in Base64 encoded format." + - print: + - "Config: %s\n" + - device.config - name: ModifyCloudToDeviceConfig flattening: @@ -645,6 +750,45 @@ interfaces: name: device resource_name_treatment: STATIC_TYPES timeout_millis: 60000 + samples: + standalone: + - region_tag: iot_set_device_config + value_sets: [iot_set_device_config] + sample_value_sets: + - id: iot_set_device_config + description: Set a device configuration to the specified data (string, JSON) and version (0 for latest). + + # Setup the request object + parameters: + # Set some default values + defaults: + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + - name%registry="[DeviceRegistry ID]" + - name%device="my-device" + # Configure request fields: + # - configure so you can provide them to the method (CLI) + # - give them a nice text description + # - and more + attributes: + - parameter: name%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: name%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: name%registry + sample_argument_name: registry_id + description: ID of the DeviceRegistry + - parameter: name%device + sample_argument_name: device_id + description: Device ID + + # Print things out from the response! + on_success: + - define: device=$resp + + - name: ListDeviceConfigVersions flattening: groups: @@ -660,6 +804,46 @@ interfaces: name: device resource_name_treatment: STATIC_TYPES timeout_millis: 60000 + samples: + standalone: + - region_tag: iot_get_device_configs + value_sets: [iot_get_device_configs] + + sample_value_sets: + - id: iot_get_device_configs + description: Retrieves device metadata from a registry. + parameters: + defaults: + - name%device="my-device" + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + - name%registry="[DeviceRegistry ID]" + attributes: + - parameter: name%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: name%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: name%registry + sample_argument_name: registry_id + description: Device Registry ID + - parameter: name%device + sample_argument_name: deviceId + description: Device ID + on_success: + - loop: + collection: $resp.device_configs + variable: config + body: + - print: + - "Config version: %s" + - config.version + - print: + - "Contents: %s\n" + - config.binary_data + + - name: ListDeviceStates flattening: groups: @@ -675,6 +859,44 @@ interfaces: name: device resource_name_treatment: STATIC_TYPES timeout_millis: 60000 + samples: + standalone: + - region_tag: iot_get_device_state + value_sets: [iot_get_device_state] + + sample_value_sets: + - id: iot_get_device_state + description: Retrieves device metadata from a registry. + parameters: + defaults: + - name%device="my-device" + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + - name%registry="[DeviceRegistry ID]" + attributes: + - parameter: name%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: name%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: name%registry + sample_argument_name: registry_id + description: Device Registry ID + - parameter: name%device + sample_argument_name: deviceId + description: Device ID + on_success: + - print: + - "Device state" + - loop: + collection: $resp.device_states + variable: device_state + body: + - print: + - "Device state: %s" + - device_state + #TODO: - name: SetIamPolicy flattening: groups: @@ -692,6 +914,33 @@ interfaces: resource: registry resource_name_treatment: STATIC_TYPES timeout_millis: 60000 + samples: + standalone: + - region_tag: iot_set_iam_policy + value_sets: [iot_set_iam_policy] + sample_value_sets: + - id: iot_set_iam_policy + description: Sets IAM permissions for the given registry to a single role/member. + parameters: + defaults: + - resource%project="[Google Cloud Project ID]" + - resource%location="us-central1" + - resource%registry="[DeviceRegistry ID]" + # - policy%role="admin" + attributes: + - parameter: resource%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: resource%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: resource%registry + sample_argument_name: registry_id + description: Device Registry ID + - parameter: policy%member + sample_argument_name: registry_ids + description: Device Registry ID + - name: GetIamPolicy flattening: groups: @@ -707,6 +956,45 @@ interfaces: resource: registry resource_name_treatment: STATIC_TYPES timeout_millis: 60000 + samples: + standalone: + - region_tag: iot_get_iam_policy + value_sets: [iot_get_iam_policy] + sample_value_sets: + - id: iot_get_iam_policy + description: Retrieves IAM permissions for the given registry. + parameters: + defaults: + - resource%project="[Google Cloud Project ID]" + - resource%location="us-central1" + - resource%registry="[DeviceRegistry ID]" + attributes: + - parameter: resource%project + sample_argument_name: projectId + description: Your Google Cloud Project ID + - parameter: resource%location + sample_argument_name: cloudRegion + description: Location, e.g. us-central1 + - parameter: resource%registry + sample_argument_name: registry_id + description: Device Registry ID + on_success: + - print: ["Policy ETAG: %s", $resp.etag] + - loop: + collection: $resp.bindings + variable: binding + body: + - print: + - "Role: %s" + - binding.role + + - loop: + collection: binding.members + variable: member + body: + - print: ["\t%s", member] + + - name: TestIamPermissions flattening: groups: @@ -742,6 +1030,40 @@ interfaces: name: device resource_name_treatment: STATIC_TYPES timeout_millis: 60000 + samples: + standalone: + - region_tag: iot_send_command + value_sets: [iot_send_command] + sample_value_sets: + - id: iot_send_command + description: Send a command to a device. + parameters: + defaults: + - name%device="my-device" + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + - name%registry="[DeviceRegistry ID]" + - name%binary_data.encoding=LINEAR16 + attributes: + - parameter: name%device + sample_argument_name: deviceId + description: Device ID + - parameter: name%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: name%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: name%registry + sample_argument_name: registry_id + description: Device Registry ID + - parameter: name%data + sample_argument_name: data + description: The command data to send to the device. + - parameter: name%binary_data + sample_argument_name: data2 + description: The command data to send to the device. + - name: BindDeviceToGateway flattening: groups: @@ -761,6 +1083,40 @@ interfaces: parent: registry resource_name_treatment: STATIC_TYPES timeout_millis: 60000 + samples: + standalone: + - region_tag: bind_device_to_gateway + value_sets: [bind_device_to_gateway] + sample_value_sets: + - id: bind_device_to_gateway + description: Bind a device to the gateway. + parameters: + defaults: + - gateway_id="my-gateway" + - device_id="my-device" + - parent%project="[Google Cloud Project ID]" + - parent%location="us-central1" + - parent%registry="[DeviceRegistry ID]" + attributes: + - parameter: gateway_id + sample_argument_name: gatewayId + description: Gateway ID + - parameter: device_id + sample_argument_name: deviceId + description: Device ID + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: parent%registry + sample_argument_name: registry_id + description: Device Registry ID + on_success: + - print: ["Device Bound!"] + + - name: UnbindDeviceFromGateway flattening: groups: @@ -780,6 +1136,39 @@ interfaces: parent: registry resource_name_treatment: STATIC_TYPES timeout_millis: 60000 + samples: + standalone: + - region_tag: unbind_device_from_gateway + value_sets: [unbind_device_from_gateway] + sample_value_sets: + - id: unbind_device_from_gateway + description: Bind a device to the gateway. + parameters: + defaults: + - gateway_id="my-gateway" + - device_id="my-device" + - parent%project="[Google Cloud Project ID]" + - parent%location="us-central1" + - parent%registry="[DeviceRegistry ID]" + attributes: + - parameter: gateway_id + sample_argument_name: gatewayId + description: Gateway ID + - parameter: device_id + sample_argument_name: deviceId + description: Device ID + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: parent%registry + sample_argument_name: registry_id + description: Device Registry ID + on_success: + - print: ["Device Unbound: %s", $resp] + resource_name_generation: - message_name: google.iam.v1.SetIamPolicyRequest field_entity_map: From 77eadd18de5288dc74ba67840e9a661706ca558e Mon Sep 17 00:00:00 2001 From: Mike Ganbold Date: Fri, 31 May 2019 16:14:26 -0700 Subject: [PATCH 3/4] automl vision dataset CRUD --- google/cloud/automl/v1beta1/automl_gapic.yaml | 197 ++++++++++++++++++ 1 file changed, 197 insertions(+) diff --git a/google/cloud/automl/v1beta1/automl_gapic.yaml b/google/cloud/automl/v1beta1/automl_gapic.yaml index ba3e9edf23f2d..38f61e7bce826 100644 --- a/google/cloud/automl/v1beta1/automl_gapic.yaml +++ b/google/cloud/automl/v1beta1/automl_gapic.yaml @@ -262,6 +262,64 @@ interfaces: parent: location resource_name_treatment: STATIC_TYPES timeout_millis: 5000 + samples: + standalone: + - region_tag: automl_vision_create_dataset + value_sets: [automl_vision_create_dataset] + + sample_value_sets: + - id: automl_vision_create_dataset + description: Create a Dataset + parameters: + defaults: + - parent%project="[Google Cloud Project ID]" + - parent%location="us-central1" + - dataset.image_classification_dataset_metadata.classification_type=MULTILABEL + - dataset.display_name="defaultname" + + attributes: + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: parent%dataset + sample_argument_name: dataset_name + description: Dataset name + - parameter: dataset.display_name + sample_argument_name: dataset_display_name + description: Dataset display name + - parameter: dataset.image_classification_dataset_metadata.classification_type + sample_argument_name: type + description: Type of the classification problem. + + + + # [Response Handling Part] + + on_success: + - print: + - "Dataset name: %s" + - $resp.name + - print: + - "Dataset display name: %s" + - $resp.display_name + - print: + - "Image classification dataset specification: %s" + - $resp.image_classification_dataset_metadata.classification_type + - print: + - "Dataset example count: %s" + - $resp.example_count + - print: + - "Dataset create time:" + - print: + - "\tseconds: %s" + - $resp.create_time.seconds + - print: + - "\tnanos %s" + - $resp.create_time.nanos + - name: UpdateDataset flattening: groups: @@ -274,6 +332,8 @@ interfaces: field_name_patterns: dataset.name: dataset timeout_millis: 5000 + + - name: GetDataset flattening: groups: @@ -287,6 +347,59 @@ interfaces: name: dataset resource_name_treatment: STATIC_TYPES timeout_millis: 5000 + samples: + standalone: + - region_tag: automl_vision_get_dataset + value_sets: [automl_vision_get_dataset] + + sample_value_sets: + - id: automl_vision_get_dataset + description: Get Dataset + + parameters: + defaults: + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + + attributes: + - parameter: name%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: name%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: name%dataset + sample_argument_name: dataset_id + description: Dataset + + + # [Response Handling Part] + + on_success: + - print: + - "Dataset name: %s" + - $resp.name + - print: + - "Dataset display name: %s" + - $resp.display_name + - print: + - "Image classification dataset specification:" + - print: + - "\t%s" + - $resp.image_classification_dataset_metadata + - print: + - "Dataset example count: %s" + - $resp.example_count + - print: + - "Dataset create time:" + - print: + - "\tseconds: %s" + - $resp.create_time.seconds + - print: + - "\tnanos %s" + - $resp.create_time.nanos + + - name: ListDatasets flattening: groups: @@ -307,6 +420,62 @@ interfaces: parent: location resource_name_treatment: STATIC_TYPES timeout_millis: 5000 + samples: + standalone: + - region_tag: automl_vision_list_datasets + value_sets: [automl_vision_list_datasets] + + sample_value_sets: + - id: automl_vision_list_datasets + description: List Datasets + + parameters: + defaults: + - parent%project="[Google Cloud Project ID]" + - parent%location="us-central1" + - filter="test filter" + + attributes: + - parameter: filter + sample_argument_name: filter + description: Filter for datasets + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1 + + + # [Response Handling Part] + + on_success: + - define: dataset=$resp + - print: + - "Dataset name: %s" + - dataset.name + - print: + - "Dataset display name: %s" + - dataset.display_name + - print: + - "Image classification dataset specification:" + - print: + - "\t%s" + - dataset.image_classification_dataset_metadata + - print: + - "Dataset example count: %s" + - dataset.example_count + - print: + - "Dataset create time:" + - print: + - "\tseconds: %s" + - dataset.create_time.seconds + - print: + - "\tnanos %s" + - dataset.create_time.nanos + + + - name: DeleteDataset flattening: groups: @@ -327,6 +496,34 @@ interfaces: poll_delay_multiplier: 1.5 max_poll_delay_millis: 5000 total_poll_timeout_millis: 300000 + samples: + standalone: + - region_tag: automl_vision_delete_dataset + value_sets: [automl_vision_delete_dataset] + + sample_value_sets: + - id: automl_vision_delete_dataset + description: Delete Dataset + + parameters: + defaults: + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + + attributes: + - parameter: name%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: name%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: name%dataset + sample_argument_name: dataset_id + description: Dataset + on_success: + - print: + - "Dataset deleted." + - name: ImportData flattening: groups: From fe9e31333b20d426248bdd0b9dd968a8796cb01a Mon Sep 17 00:00:00 2001 From: Mike Ganbold Date: Tue, 11 Jun 2019 11:23:26 -0700 Subject: [PATCH 4/4] finished vision, started on translate & lang --- google/cloud/automl/v1beta1/automl_gapic.yaml | 544 +++++++++++++++++- 1 file changed, 541 insertions(+), 3 deletions(-) diff --git a/google/cloud/automl/v1beta1/automl_gapic.yaml b/google/cloud/automl/v1beta1/automl_gapic.yaml index 38f61e7bce826..f9520a945c7dd 100644 --- a/google/cloud/automl/v1beta1/automl_gapic.yaml +++ b/google/cloud/automl/v1beta1/automl_gapic.yaml @@ -266,7 +266,8 @@ interfaces: standalone: - region_tag: automl_vision_create_dataset value_sets: [automl_vision_create_dataset] - + - region_tag: automl_translate_create_dataset + value_sets: [automl_translate_create_dataset] sample_value_sets: - id: automl_vision_create_dataset description: Create a Dataset @@ -276,6 +277,7 @@ interfaces: - parent%location="us-central1" - dataset.image_classification_dataset_metadata.classification_type=MULTILABEL - dataset.display_name="defaultname" + - parent%dataset="default_dataset_name" attributes: - parameter: parent%project @@ -320,6 +322,59 @@ interfaces: - "\tnanos %s" - $resp.create_time.nanos + - id: automl_translate_create_dataset + description: Demonstrates using the AutoML client to create a dataset + parameters: + defaults: + - parent%project="[Google Cloud Project ID]" + - parent%location="us-central1" + - dataset.translation_dataset_metadata.source_language_code="default_val_source_langcode" + - dataset.translation_dataset_metadata.target_language_code="default_val_target_langcode" + - dataset.display_name="defaultname" + attributes: + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: dataset.display_name + sample_argument_name: dataset_display_name + description: Dataset display name + - parameter: dataset.translation_dataset_metadata.source_language_code + sample_argument_name: source + description: Language code of the source language + - parameter: dataset.translation_dataset_metadata.target_language_code + sample_argument_name: target + description: Language code of the target language + + on_success: + - print: + - "Dataset name: %s" + - $resp.name + - print: + - "Dataset display name: %s" + - $resp.display_name + - print: + - "Translation dataset Metadata:" + - print: + - "\tSource language code: %s" + - $resp.translation_dataset_metadata.source_language_code + - print: + - "\tTarget language code: %s" + - $resp.translation_dataset_metadata.target_language_code + - print: + - "Dataset example count: %s" + - $resp.example_count + - print: + - "Dataset create time:" + - print: + - "\tseconds: %s" + - $resp.create_time.seconds + - print: + - "\tnanos %s" + - $resp.create_time.nanos + - name: UpdateDataset flattening: groups: @@ -347,6 +402,8 @@ interfaces: name: dataset resource_name_treatment: STATIC_TYPES timeout_millis: 5000 + # This is also broken + samples: standalone: - region_tag: automl_vision_get_dataset @@ -360,6 +417,7 @@ interfaces: defaults: - name%project="[Google Cloud Project ID]" - name%location="us-central1" + - name%dataset="default_id" attributes: - parameter: name%project @@ -424,7 +482,10 @@ interfaces: standalone: - region_tag: automl_vision_list_datasets value_sets: [automl_vision_list_datasets] - + - region_tag: automl_translate_list_datasets + value_sets: [automl_translate_list_datasets] + - region_tag: automl_language_list_datasets + value_sets: [automl_language_list_datasets] sample_value_sets: - id: automl_vision_list_datasets description: List Datasets @@ -473,8 +534,102 @@ interfaces: - print: - "\tnanos %s" - dataset.create_time.nanos + #translate + - id: automl_translate_list_datasets + description: List Datasets + + parameters: + defaults: + - parent%project="[Google Cloud Project ID]" + - parent%location="us-central1" + - filter="test filter" + attributes: + - parameter: filter + sample_argument_name: filter + description: Filter for datasets + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1 + + + # [Response Handling Part] + + on_success: + - define: dataset=$resp + - print: + - "Dataset name: %s" + - dataset.name + - print: + - "Dataset display name: %s" + - dataset.display_name + - print: + - "Image classification dataset specification:" + - print: + - "\t%s" + - dataset.image_classification_dataset_metadata + - print: + - "Dataset example count: %s" + - dataset.example_count + - print: + - "Dataset create time:" + - print: + - "\tseconds: %s" + - dataset.create_time.seconds + - print: + - "\tnanos %s" + - dataset.create_time.nanos + #language + - id: automl_language_list_datasets + description: List Datasets + parameters: + defaults: + - parent%project="[Google Cloud Project ID]" + - parent%location="us-central1" + - filter="test filter" + + attributes: + - parameter: filter + sample_argument_name: filter + description: Filter for datasets + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1 + + + # [Response Handling Part] + + on_success: + - define: dataset=$resp + - print: + - "Dataset name: %s" + - dataset.name + - print: + - "Dataset display name: %s" + - dataset.display_name + - print: + - "Image classification dataset specification:" + - print: + - "\t%s" + - dataset.image_classification_dataset_metadata + - print: + - "Dataset example count: %s" + - dataset.example_count + - print: + - "Dataset create time:" + - print: + - "\tseconds: %s" + - dataset.create_time.seconds + - print: + - "\tnanos %s" + - dataset.create_time.nanos - name: DeleteDataset flattening: @@ -496,11 +651,14 @@ interfaces: poll_delay_multiplier: 1.5 max_poll_delay_millis: 5000 total_poll_timeout_millis: 300000 + #----------_> this is one messaed up + samples: standalone: - region_tag: automl_vision_delete_dataset value_sets: [automl_vision_delete_dataset] - + - region_tag: automl_translate_delete_dataset + value_sets: [automl_translate_delete_dataset] sample_value_sets: - id: automl_vision_delete_dataset description: Delete Dataset @@ -509,7 +667,28 @@ interfaces: defaults: - name%project="[Google Cloud Project ID]" - name%location="us-central1" + - name%dataset="default_dataset_id" + attributes: + - parameter: name%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: name%location + sample_argument_name: location + description: Location, e.g. us-central1 + - parameter: name%dataset + sample_argument_name: dataset_id + description: Dataset + on_success: + - print: + - "Dataset deleted." + - id: automl_translate_delete_dataset + description: Delete Dataset + parameters: + defaults: + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + - name%dataset="default_dataset_id" attributes: - parameter: name%project sample_argument_name: project_id @@ -590,6 +769,39 @@ interfaces: poll_delay_multiplier: 1.5 max_poll_delay_millis: 5000 total_poll_timeout_millis: 300000 + samples: + standalone: + - region_tag: automl_vision_create_model + value_sets: [automl_vision_create_model] + + sample_value_sets: + - id: automl_vision_create_model + description: Demonstrates using the AutoML client to create a model. + + parameters: + defaults: + - parent%project="[Google Cloud Project ID]" + - parent%location="us-central1" + - parent%dataset_id="test-dataset" + - model.display_name="[default_display_name_for_model]" + - model.image_classification_model_metadata.train_budget=64 + + + attributes: + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1. + - parameter: model.display_name + sample_argument_name: model_name + description: the Name of the model. + #-------->GETTING ERROR HERE!!!! + # - parameter: model.image_classification_model_metadata.train_budget + # sample_argument_name: train_budget + # description: the Budget for training the model. + - name: GetModel flattening: groups: @@ -603,6 +815,147 @@ interfaces: name: model resource_name_treatment: STATIC_TYPES timeout_millis: 5000 + samples: + standalone: + - region_tag: automl_vision_get_model + value_sets: [automl_vision_get_model] + - region_tag: automl_translate_get_model + value_sets: [automl_translate_get_model] + - region_tag: automl_language_get_model + value_sets: [automl_language_get_model] + sample_value_sets: + - id: automl_vision_get_model + description: Demonstrates using the AutoML client to get model details. + + parameters: + defaults: + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + - name%model="def_model_id" + attributes: + - parameter: name%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: name%location + sample_argument_name: location + description: Location, e.g. us-central1. + - parameter: name%model + sample_argument_name: model_id + description: modelId the Id of the model. + # [Response Handling Part] + + on_success: + - print: + - "Model name: %s" + - $resp.name + - print: + - "Model display name: %s" + - $resp.display_name + - print: + - "Image classification model metadata:" + - print: + - "Tranning budget: %s" + - $resp.image_classification_model_metadata.train_budget + - print: + - "Tranning cost: %s" + - $resp.image_classification_model_metadata.train_cost + - print: + - "Stop reason: %s" + - $resp.image_classification_model_metadata.stop_reason + - print: + - "Base model id: %s" + - $resp.image_classification_model_metadata.base_model_id + - print: + - "Model create time:" + - print: + - "\tseconds: %s" + - $resp.create_time.seconds + - print: + - "\tnanos %s" + - $resp.create_time.nanos + - print: + - "Model deployment state: %s" + - $resp.deployment_state + + #language + - id: automl_language_get_model + description: Demonstrates using the AutoML client to get model details. + + parameters: + defaults: + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + - name%model="def_model_id" + attributes: + - parameter: name%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: name%location + sample_argument_name: location + description: Location, e.g. us-central1. + - parameter: name%model + sample_argument_name: model_id + description: modelId the Id of the model. + # [Response Handling Part] + + on_success: + - print: + - "Model name: %s" + - $resp.name + - print: + - "Model display name: %s" + - $resp.display_name + - print: + - "Model create time:" + - print: + - "\tseconds: %s" + - $resp.create_time.seconds + - print: + - "\tnanos %s" + - $resp.create_time.nanos + - print: + - "Model deployment state: %s" + - $resp.deployment_state + #translate + - id: automl_translate_get_model + description: Demonstrates using the AutoML client to get model details. + + parameters: + defaults: + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + - name%model="def_model_id" + attributes: + - parameter: name%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: name%location + sample_argument_name: location + description: Location, e.g. us-central1. + - parameter: name%model + sample_argument_name: model_id + description: modelId the Id of the model. + # [Response Handling Part] + + on_success: + - print: + - "Model name: %s" + - $resp.name + - print: + - "Model display name: %s" + - $resp.display_name + - print: + - "Model create time:" + - print: + - "\tseconds: %s" + - $resp.create_time.seconds + - print: + - "\tnanos %s" + - $resp.create_time.nanos + - print: + - "Model deployment state: %s" + - $resp.deployment_state + - name: ListModels flattening: groups: @@ -623,6 +976,64 @@ interfaces: parent: location resource_name_treatment: STATIC_TYPES timeout_millis: 5000 + samples: + standalone: + - region_tag: automl_vision_list_models + value_sets: [automl_vision_list_models] + + sample_value_sets: + - id: automl_vision_list_models + description: Demonstrates using the AutoML client to get model details. + + parameters: + defaults: + - parent%project="[Google Cloud Project ID]" + - parent%location="us-central1" + - filter="default_filter" + attributes: + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1. + - parameter: filter + sample_argument_name: filter + description: Filter expression. + + # [Response Handling Part] + + on_success: + - print: + - "Model name: %s" + - $resp.name + - print: + - "Model display name: %s" + - $resp.display_name + - print: + - "Image classification model specification:" + - print: + - "Training budget: %s" + - $resp.image_classification_model_metadata.train_budget + - print: + - "Training cost: %s" + - $resp.image_classification_model_metadata.train_cost + - print: + - "Stop reason: %s" + - $resp.image_classification_model_metadata.stop_reason + - print: + - "Base model id: %s" + - $resp.image_classification_model_metadata.base_model_id + - print: + - "Model create time:" + - print: + - "\tseconds: %s" + - $resp.create_time.seconds + - print: + - "\tnanos %s" + - $resp.create_time.nanos + + - name: DeleteModel flattening: groups: @@ -643,6 +1054,61 @@ interfaces: poll_delay_multiplier: 1.5 max_poll_delay_millis: 5000 total_poll_timeout_millis: 300000 + samples: + standalone: + - region_tag: automl_vision_delete_model + value_sets: [automl_vision_delete_model] + - region_tag: automl_language_delete_model + value_sets: [automl_language_delete_model] + sample_value_sets: + - id: automl_vision_delete_model + description: Demonstrates using the AutoML client to delete a model. + + parameters: + defaults: + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + - name%model="def_id" + + attributes: + - parameter: name%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: name%location + sample_argument_name: location + description: Location, e.g. us-central1. + - parameter: name%model + sample_argument_name: model_id + description: the Id of the model. + + on_success: + - print: + - "Model deletion started..." + + - id: automl_language_delete_model + description: Demonstrates using the AutoML client to delete a model. + + parameters: + defaults: + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + - name%model="def_id" + + attributes: + - parameter: name%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: name%location + sample_argument_name: location + description: Location, e.g. us-central1. + - parameter: name%model + sample_argument_name: model_id + description: the Id of the model. + + on_success: + - print: + - "Model deletion started..." + - name: DeployModel flattening: groups: @@ -696,6 +1162,37 @@ interfaces: name: model_evaluation resource_name_treatment: STATIC_TYPES timeout_millis: 5000 + samples: + standalone: + - region_tag: automl_vision_get_model_evaluation + value_sets: [automl_vision_get_model_evaluation] + + sample_value_sets: + - id: automl_vision_get_model_evaluation + description: Demonstrates using the AutoML client to get model evaluations. + + parameters: + defaults: + - name%project="[Google Cloud Project ID]" + - name%location="us-central1" + - name%model="def_id" + - name%model_evaluation="def_model_eval_id" + + attributes: + - parameter: name%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: name%location + sample_argument_name: location + description: Location, e.g. us-central1. + - parameter: name%model + sample_argument_name: model_id + description: the Id of the model. + - parameter: name%model_evaluation + sample_argument_name: model_eval_id + description: the Id of your model evaluation. + + - name: ExportModel required_fields: - name @@ -712,6 +1209,11 @@ interfaces: max_poll_delay_millis: 5000 total_poll_timeout_millis: 300000 timeout_millis: 5000 + + # on_success: + # - print: + # - "Model deletion started..." + - name: ExportEvaluatedExamples required_fields: - name @@ -748,6 +1250,42 @@ interfaces: parent: model resource_name_treatment: STATIC_TYPES timeout_millis: 5000 + samples: + standalone: + - region_tag: automl_vision_list_model_evaluations + value_sets: [automl_vision_list_model_evaluations] + + sample_value_sets: + - id: automl_vision_list_model_evaluations + description: Demonstrates using the AutoML client to list model evaluations. + + parameters: + defaults: + - parent%project="[Google Cloud Project ID]" + - parent%location="us-central1" + - parent%model="default_model" + - filter="default_filter" + attributes: + - parameter: parent%project + sample_argument_name: project_id + description: Your Google Cloud Project ID + - parameter: parent%location + sample_argument_name: location + description: Location, e.g. us-central1. + - parameter: parent%model + sample_argument_name: model_id + description: the Id of the model. + - parameter: filter + sample_argument_name: filter + description: the Filter expression. + on_success: + - define: element=$resp + - comment: + - "List all the model evaluations in the model by applying filter." + - print: + - "Evaluation: %s" + - element + - name: GetAnnotationSpec flattening: groups: