oci-cli 3.67.0__py3-none-any.whl → 3.68.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- common_util/ignored_commands.py +1 -0
- oci_cli/bin/integration.psm1 +2 -2
- oci_cli/bin/iot.psm1 +121 -0
- oci_cli/bin/mysql.psm1 +4 -4
- oci_cli/bin/opensearch.psm1 +5 -5
- oci_cli/bin/redis.psm1 +2 -2
- oci_cli/help_text_producer/data_files/text/cmdref/ce/addon-option/list.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/ce/virtual-node-pool/create.txt +8 -7
- oci_cli/help_text_producer/data_files/text/cmdref/ce/virtual-node-pool/delete.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/ce/virtual-node-pool/get-virtual-node.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/ce/virtual-node-pool/get.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/ce/virtual-node-pool/list-virtual-nodes.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/ce/virtual-node-pool/update.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/db/database/convert-standby-database-type.txt +169 -0
- oci_cli/help_text_producer/data_files/text/cmdref/db/database.txt +2 -0
- oci_cli/help_text_producer/data_files/text/cmdref/db.txt +2 -0
- oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/work-request-error/{list.txt → list-errors.txt} +5 -5
- oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/work-request-error.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/{work-request-log-entry/list-work-request-logs.txt → work-request-log/list-logs.txt} +5 -5
- oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/{work-request-log-entry.txt → work-request-log.txt} +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request.txt +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control.txt +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/fn/application/create.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/fn/application/update.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/change-subscription.txt +134 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-amazon-kinesis-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-amazon-redshift-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-amazon-s3-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-azure-data-lake-storage-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-azure-synapse-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-databricks-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-db2-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-elasticsearch-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-generic-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-goldengate-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-google-big-query-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-google-cloud-storage-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-google-pub-sub-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-hdfs-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-iceberg-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-jms-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-kafka-connection.txt +44 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-kafka-schema-registry-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-microsoft-fabric-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-microsoft-sqlserver-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-mongo-db-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-mysql-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-object-storage-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-oracle-ai-data-platform-connection.txt +308 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-oracle-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-oracle-nosql-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-postgresql-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-redis-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-snowflake-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/list.txt +2 -2
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-amazon-kinesis-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-amazon-redshift-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-amazon-s3-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-azure-data-lake-storage-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-azure-synapse-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-databricks-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-db2-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-elasticsearch-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-generic-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-goldengate-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-google-big-query-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-google-cloud-storage-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-google-pub-sub-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-hdfs-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-iceberg-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-jms-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-kafka-connection.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-kafka-schema-registry-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-microsoft-fabric-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-microsoft-sqlserver-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-mongo-db-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-mysql-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-object-storage-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-oracle-ai-data-platform-connection.txt +287 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-oracle-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-oracle-nosql-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-postgresql-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-redis-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-snowflake-connection.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection.txt +6 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/deployment/change-subscription.txt +134 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/deployment/create.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/deployment/list.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/deployment/update.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/deployment.txt +2 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate.txt +8 -0
- oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request/work-request-log/{list.txt → list-logs.txt} +5 -5
- oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request/work-request-log.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/integration/integration-instance/create.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/integration/integration-instance/update.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-adapter/create.txt +199 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-adapter/delete.txt +131 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-adapter/get.txt +93 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-adapter/list.txt +157 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-adapter/update.txt +206 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-adapter.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-instance/create.txt +187 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-instance/delete.txt +131 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-instance/get-content.txt +99 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-instance/get.txt +93 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-instance/invoke-raw-binary-command.txt +119 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-instance/invoke-raw-json-command.txt +125 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-instance/invoke-raw-text-command.txt +118 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-instance/list.txt +157 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-instance/update.txt +194 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-instance.txt +36 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-model/create.txt +182 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-model/delete.txt +136 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-model/get-spec.txt +99 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-model/get.txt +98 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-model/list.txt +153 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-model/update.txt +185 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-model.txt +32 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-relationship/create.txt +192 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-relationship/delete.txt +135 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-relationship/get.txt +97 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-relationship/list.txt +162 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-relationship/update.txt +193 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-relationship.txt +29 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain/change-compartment.txt +132 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain/change-data-retention-period.txt +141 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain/configure-apex-data-access.txt +131 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain/configure-direct-data-access.txt +143 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain/configure-ords-data-access.txt +131 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain/create.txt +168 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain/delete.txt +129 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain/get.txt +91 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain/list.txt +153 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain/update.txt +175 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain-group/change-compartment.txt +132 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain-group/configure-data-access.txt +143 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain-group/create.txt +163 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain-group/delete.txt +129 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain-group/get.txt +91 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain-group/list.txt +149 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain-group/update.txt +176 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain-group.txt +33 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/domain.txt +40 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/work-request/get.txt +91 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/work-request/list-errors.txt +131 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/work-request/list-logs.txt +131 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/work-request/list.txt +148 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot/work-request.txt +24 -0
- oci_cli/help_text_producer/data_files/text/cmdref/iot.txt +121 -0
- oci_cli/help_text_producer/data_files/text/cmdref/mysql/db-system/clone.txt +14 -0
- oci_cli/help_text_producer/data_files/text/cmdref/mysql/db-system/create.txt +14 -0
- oci_cli/help_text_producer/data_files/text/cmdref/mysql/db-system/import.txt +14 -0
- oci_cli/help_text_producer/data_files/text/cmdref/mysql/db-system/update.txt +14 -0
- oci_cli/help_text_producer/data_files/text/cmdref/opensearch/cluster/create.txt +33 -0
- oci_cli/help_text_producer/data_files/text/cmdref/opensearch/cluster/shapes-details/list.txt +13 -1
- oci_cli/help_text_producer/data_files/text/cmdref/opensearch/cluster/update.txt +29 -0
- oci_cli/help_text_producer/data_files/text/cmdref/opensearch/cluster/upgrade.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/organizations/work-request-error/{list-errors.txt → list.txt} +5 -5
- oci_cli/help_text_producer/data_files/text/cmdref/organizations/work-request-error.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/organizations.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/redis/redis-cluster/redis-cluster/create.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/redis/redis-cluster/redis-cluster/update.txt +18 -0
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/associated-resource-summary/list-job-associated-resources.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/associated-resource-summary/list-stack-associated-resources.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/configuration-source-provider/change-compartment.txt +2 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/configuration-source-provider/create-bitbucket-cloud-username-app-password-provider.txt +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/configuration-source-provider/create-bitbucket-server-access-token-provider.txt +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/configuration-source-provider/create-github-access-token-provider.txt +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/configuration-source-provider/create-gitlab-access-token-provider.txt +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/configuration-source-provider/create.txt +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/configuration-source-provider/delete.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/configuration-source-provider/get.txt +2 -0
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/configuration-source-provider/list.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/configuration-source-provider/update-bitbucket-cloud-username-app-password-provider.txt +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/configuration-source-provider/update-bitbucket-server-access-token-provider.txt +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/configuration-source-provider/update-github-access-token-provider.txt +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/configuration-source-provider/update-gitlab-access-token-provider.txt +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/configuration-source-provider/update.txt +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/cancel.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/create-apply-job.txt +3 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/create-apply-rollback-job.txt +3 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/create-destroy-job.txt +3 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/create-import-tf-state-job.txt +3 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/create-plan-job.txt +3 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/create-plan-rollback-job.txt +3 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/create.txt +3 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/get-detailed-log-content.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/get-job-logs-content.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/get-job-logs.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/get-job-tf-config.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/get-job-tf-plan.txt +2 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/get-job-tf-state.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/get.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/list.txt +1 -4
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job/update.txt +3 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/job-output-summary/list-job-outputs.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/private-endpoint/change-compartment.txt +1 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/private-endpoint/create.txt +36 -16
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/private-endpoint/delete.txt +15 -14
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/private-endpoint/get-reachable-ip.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/private-endpoint/get.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/private-endpoint/list.txt +4 -4
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/private-endpoint/update.txt +36 -16
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/private-endpoint.txt +2 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/change-compartment.txt +1 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/code.txt +4 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/create-from-bitbucket-cloud.txt +4 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/create-from-bitbucket-server.txt +4 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/create-from-compartment.txt +4 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/create-from-git-provider.txt +4 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/create-from-object-storage.txt +4 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/create-from-template.txt +4 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/create-stack-create-dev-ops-config-source-details.txt +4 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/create.txt +3 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/delete.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/detect-drift.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/get-stack-tf-config.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/get-stack-tf-state.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/get.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/list-resource-discovery-services.txt +1 -0
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/list-resource-drift-details.txt +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/list-terraform-versions.txt +1 -0
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/list.txt +4 -6
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/update-from-bitbucket-cloud.txt +4 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/update-from-git-provider.txt +4 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/update-from-object-storage.txt +4 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/update-stack-update-dev-ops-config-source-details.txt +4 -3
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/stack/update.txt +3 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/template/change-compartment.txt +1 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/template/create.txt +4 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/template/delete.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/template/get-template-logo.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/template/get-template-tf-config.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/template/get.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/template/list-template-categories.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/template/list.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/template/update.txt +4 -2
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/work-request/get.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/work-request/list-work-request-errors.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/work-request/list-work-request-logs.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/resource-manager/work-request/list.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/support/incident/create.txt +6 -6
- oci_cli/help_text_producer/data_files/text/cmdref/support/incident/get.txt +2 -2
- oci_cli/help_text_producer/data_files/text/cmdref/support/incident/list.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/support/incident/update.txt +4 -4
- oci_cli/help_text_producer/data_files/text/cmdref/support/incident-resource-type/list.txt +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/support/validation-response/validate-user.txt +1 -1
- oci_cli/help_text_producer/data_files/text/index.txt +2 -0
- oci_cli/service_mapping.py +5 -0
- oci_cli/version.py +1 -1
- {oci_cli-3.67.0.dist-info → oci_cli-3.68.0.dist-info}/METADATA +2 -2
- {oci_cli-3.67.0.dist-info → oci_cli-3.68.0.dist-info}/RECORD +277 -209
- services/container_engine/src/oci_cli_container_engine/generated/containerengine_cli.py +7 -6
- services/database/src/oci_cli_database/generated/database_cli.py +71 -0
- services/functions/src/oci_cli_functions_management/generated/functionsmanagement_cli.py +20 -8
- services/golden_gate/src/oci_cli_golden_gate/generated/goldengate_cli.py +1370 -320
- services/golden_gate/src/oci_cli_golden_gate/golden_gate_cli_extended.py +59 -14
- services/integration/src/oci_cli_integration_instance/generated/integrationinstance_cli.py +29 -11
- services/iot/__init__.py +4 -0
- services/iot/src/__init__.py +4 -0
- services/iot/src/oci_cli_iot/__init__.py +4 -0
- services/iot/src/oci_cli_iot/generated/__init__.py +4 -0
- services/iot/src/oci_cli_iot/generated/client_mappings.py +14 -0
- services/iot/src/oci_cli_iot/generated/iot_cli.py +2913 -0
- services/iot/src/oci_cli_iot/iot_cli_extended.py +74 -0
- services/iot/tests/__init__.py +4 -0
- services/mysql/src/oci_cli_db_system/generated/dbsystem_cli.py +44 -20
- services/opensearch/src/oci_cli_opensearch_cluster/generated/opensearchcluster_cli.py +44 -12
- services/redis/src/oci_cli_redis_cluster/generated/rediscluster_cli.py +20 -8
- services/resource_manager/src/oci_cli_resource_manager/generated/resourcemanager_cli.py +201 -193
- {oci_cli-3.67.0.dist-info → oci_cli-3.68.0.dist-info}/LICENSE.txt +0 -0
- {oci_cli-3.67.0.dist-info → oci_cli-3.68.0.dist-info}/THIRD_PARTY_LICENSES.txt +0 -0
- {oci_cli-3.67.0.dist-info → oci_cli-3.68.0.dist-info}/WHEEL +0 -0
- {oci_cli-3.67.0.dist-info → oci_cli-3.68.0.dist-info}/entry_points.txt +0 -0
- {oci_cli-3.67.0.dist-info → oci_cli-3.68.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,2913 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
|
3
|
+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
|
4
|
+
# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20250531
|
|
5
|
+
|
|
6
|
+
from __future__ import print_function
|
|
7
|
+
import click
|
|
8
|
+
import oci # noqa: F401
|
|
9
|
+
import six # noqa: F401
|
|
10
|
+
import sys # noqa: F401
|
|
11
|
+
from oci_cli.cli_root import cli
|
|
12
|
+
from oci_cli import cli_constants # noqa: F401
|
|
13
|
+
from oci_cli import cli_util
|
|
14
|
+
from oci_cli import json_skeleton_utils
|
|
15
|
+
from oci_cli import custom_types # noqa: F401
|
|
16
|
+
from oci_cli.aliasing import CommandGroupWithAlias
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@cli.command(cli_util.override('iot.iot_root_group.command_name', 'iot'), cls=CommandGroupWithAlias, help=cli_util.override('iot.iot_root_group.help', """Use the Internet of Things (IoT) API to manage IoT domain groups, domains, and digital twin resources including models, adapters, instances, and relationships.
|
|
20
|
+
For more information, see [Internet of Things]."""), short_help=cli_util.override('iot.iot_root_group.short_help', """Internet of Things API"""))
|
|
21
|
+
@cli_util.help_option_group
|
|
22
|
+
def iot_root_group():
|
|
23
|
+
pass
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@click.command(cli_util.override('iot.iot_domain_group.command_name', 'iot-domain'), cls=CommandGroupWithAlias, help="""An IoT domain is an Oracle Cloud Infrastructure resource that provides a managed environment for organizing and managing digital twin resources, such as models, adapters, instances and relationships, within a compartment and IoT domain group.
|
|
27
|
+
|
|
28
|
+
To use any API operations, you must be authorized in an IAM policy. If you are not authorized, contact an administrator. If you are an administrator who needs to create policies to grant users access, see [Getting Started with Policies].""")
|
|
29
|
+
@cli_util.help_option_group
|
|
30
|
+
def iot_domain_group():
|
|
31
|
+
pass
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@click.command(cli_util.override('iot.digital_twin_relationship_group.command_name', 'digital-twin-relationship'), cls=CommandGroupWithAlias, help="""A digital twin relationship represents an association between two digital twin instances. It can include properties to describe the nature and context of the association within the IoT domain.
|
|
35
|
+
|
|
36
|
+
To use any API operations, you must be authorized in an IAM policy. If you are not authorized, contact an administrator. If you are an administrator who needs to create policies to grant users access, see [Getting Started with Policies].""")
|
|
37
|
+
@cli_util.help_option_group
|
|
38
|
+
def digital_twin_relationship_group():
|
|
39
|
+
pass
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@click.command(cli_util.override('iot.digital_twin_model_group.command_name', 'digital-twin-model'), cls=CommandGroupWithAlias, help="""A digital twin model, defined using [Digital Twins Definition Language], specifies the schema for digital twin instance, including its components, properties, telemetry, commands, and relationships within the IoT domain.
|
|
43
|
+
|
|
44
|
+
To use any API operations, you must be authorized in an IAM policy. If you are not authorized, contact an administrator. If you are an administrator who needs to create policies to grant users access, see [Getting Started with Policies].""")
|
|
45
|
+
@cli_util.help_option_group
|
|
46
|
+
def digital_twin_model_group():
|
|
47
|
+
pass
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@click.command(cli_util.override('iot.iot_domain_group_group.command_name', 'iot-domain-group'), cls=CommandGroupWithAlias, help="""An IoT domain group is an Oracle Cloud Infrastructure resource that provides a managed environment for organizing and managing IoT domains, within a compartment.
|
|
51
|
+
|
|
52
|
+
To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see [Getting Started with Policies].""")
|
|
53
|
+
@cli_util.help_option_group
|
|
54
|
+
def iot_domain_group_group():
|
|
55
|
+
pass
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
@click.command(cli_util.override('iot.digital_twin_adapter_group.command_name', 'digital-twin-adapter'), cls=CommandGroupWithAlias, help="""The digital twin adapter maps incoming data from IoT device into the corresponding digital twin instance. It defines the envelope structure, reference payload, routing and transformation rules using JSON Path and JQ to normalize the raw device data within the IoT domain.
|
|
59
|
+
|
|
60
|
+
To use any API operations, you must be authorized in an IAM policy. If you are not authorized, contact an administrator. If you are an administrator who needs to create policies to grant users access, see [Getting Started with Policies].""")
|
|
61
|
+
@cli_util.help_option_group
|
|
62
|
+
def digital_twin_adapter_group():
|
|
63
|
+
pass
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@click.command(cli_util.override('iot.work_request_group.command_name', 'work-request'), cls=CommandGroupWithAlias, help="""An asynchronous work request helps monitor long-running operations. When you initiate a long-running operation, the service creates a work request. This work request acts as an activity log, allowing you to track each step of the operation\u2019s progress. Each work request has an OCID, enabling programmatic interaction and automation.""")
|
|
67
|
+
@cli_util.help_option_group
|
|
68
|
+
def work_request_group():
|
|
69
|
+
pass
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
@click.command(cli_util.override('iot.digital_twin_instance_group.command_name', 'digital-twin-instance'), cls=CommandGroupWithAlias, help="""A digital twin instance is a virtual representation of a physical IoT device within the IoT domain.
|
|
73
|
+
|
|
74
|
+
To use any API operations, you must be authorized in an IAM policy. If you are not authorized, contact an administrator. If you are an administrator who needs to create policies to grant users access, see [Getting Started with Policies].""")
|
|
75
|
+
@cli_util.help_option_group
|
|
76
|
+
def digital_twin_instance_group():
|
|
77
|
+
pass
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
iot_root_group.add_command(iot_domain_group)
|
|
81
|
+
iot_root_group.add_command(digital_twin_relationship_group)
|
|
82
|
+
iot_root_group.add_command(digital_twin_model_group)
|
|
83
|
+
iot_root_group.add_command(iot_domain_group_group)
|
|
84
|
+
iot_root_group.add_command(digital_twin_adapter_group)
|
|
85
|
+
iot_root_group.add_command(work_request_group)
|
|
86
|
+
iot_root_group.add_command(digital_twin_instance_group)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
@iot_domain_group.command(name=cli_util.override('iot.change_iot_domain_compartment.command_name', 'change-compartment'), help=u"""Moves an IoT domain to a different compartment within the same tenancy. For information about moving resources between compartments, see [Moving Resources to a Different Compartment]. \n[Command Reference](changeIotDomainCompartment)""")
|
|
90
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""")
|
|
91
|
+
@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment corresponding to the resource.""")
|
|
92
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
93
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
94
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
95
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
96
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
97
|
+
@cli_util.help_option
|
|
98
|
+
@click.pass_context
|
|
99
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
100
|
+
@cli_util.wrap_exceptions
|
|
101
|
+
def change_iot_domain_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_id, compartment_id, if_match):
|
|
102
|
+
|
|
103
|
+
if isinstance(iot_domain_id, six.string_types) and len(iot_domain_id.strip()) == 0:
|
|
104
|
+
raise click.UsageError('Parameter --iot-domain-id cannot be whitespace or empty string')
|
|
105
|
+
|
|
106
|
+
kwargs = {}
|
|
107
|
+
if if_match is not None:
|
|
108
|
+
kwargs['if_match'] = if_match
|
|
109
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
110
|
+
|
|
111
|
+
_details = {}
|
|
112
|
+
_details['compartmentId'] = compartment_id
|
|
113
|
+
|
|
114
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
115
|
+
result = client.change_iot_domain_compartment(
|
|
116
|
+
iot_domain_id=iot_domain_id,
|
|
117
|
+
change_iot_domain_compartment_details=_details,
|
|
118
|
+
**kwargs
|
|
119
|
+
)
|
|
120
|
+
if wait_for_state:
|
|
121
|
+
|
|
122
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
123
|
+
try:
|
|
124
|
+
wait_period_kwargs = {}
|
|
125
|
+
if max_wait_seconds is not None:
|
|
126
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
127
|
+
if wait_interval_seconds is not None:
|
|
128
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
129
|
+
if 'opc-work-request-id' not in result.headers:
|
|
130
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
131
|
+
cli_util.render_response(result, ctx)
|
|
132
|
+
return
|
|
133
|
+
|
|
134
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
135
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
136
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
137
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
138
|
+
click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
139
|
+
cli_util.render_response(result, ctx)
|
|
140
|
+
sys.exit(2)
|
|
141
|
+
except Exception:
|
|
142
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
143
|
+
cli_util.render_response(result, ctx)
|
|
144
|
+
raise
|
|
145
|
+
else:
|
|
146
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
147
|
+
cli_util.render_response(result, ctx)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
@iot_domain_group.command(name=cli_util.override('iot.change_iot_domain_data_retention_period.command_name', 'change-iot-domain-data-retention-period'), help=u"""Updates Data Retention Period of the IoT Domain. \n[Command Reference](changeIotDomainDataRetentionPeriod)""")
|
|
151
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""")
|
|
152
|
+
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["RAW_DATA", "REJECTED_DATA", "HISTORIZED_DATA", "RAW_COMMAND_DATA"]), help=u"""The type of data retention period to apply. Allowed values are RAW_DATA, REJECTED_DATA, HISTORIZED_DATA, and RAW_COMMAND_DATA.""")
|
|
153
|
+
@cli_util.option('--data-retention-period-in-days', required=True, type=click.INT, help=u"""The duration (in days) for which data will be retained in the IoT domain.""")
|
|
154
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
155
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
156
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
157
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
158
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
159
|
+
@cli_util.help_option
|
|
160
|
+
@click.pass_context
|
|
161
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
162
|
+
@cli_util.wrap_exceptions
|
|
163
|
+
def change_iot_domain_data_retention_period(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_id, type, data_retention_period_in_days, if_match):
|
|
164
|
+
|
|
165
|
+
if isinstance(iot_domain_id, six.string_types) and len(iot_domain_id.strip()) == 0:
|
|
166
|
+
raise click.UsageError('Parameter --iot-domain-id cannot be whitespace or empty string')
|
|
167
|
+
|
|
168
|
+
kwargs = {}
|
|
169
|
+
if if_match is not None:
|
|
170
|
+
kwargs['if_match'] = if_match
|
|
171
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
172
|
+
|
|
173
|
+
_details = {}
|
|
174
|
+
_details['type'] = type
|
|
175
|
+
_details['dataRetentionPeriodInDays'] = data_retention_period_in_days
|
|
176
|
+
|
|
177
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
178
|
+
result = client.change_iot_domain_data_retention_period(
|
|
179
|
+
iot_domain_id=iot_domain_id,
|
|
180
|
+
change_iot_domain_data_retention_period_details=_details,
|
|
181
|
+
**kwargs
|
|
182
|
+
)
|
|
183
|
+
if wait_for_state:
|
|
184
|
+
|
|
185
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
186
|
+
try:
|
|
187
|
+
wait_period_kwargs = {}
|
|
188
|
+
if max_wait_seconds is not None:
|
|
189
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
190
|
+
if wait_interval_seconds is not None:
|
|
191
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
192
|
+
if 'opc-work-request-id' not in result.headers:
|
|
193
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
194
|
+
cli_util.render_response(result, ctx)
|
|
195
|
+
return
|
|
196
|
+
|
|
197
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
198
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
199
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
200
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
201
|
+
click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
202
|
+
cli_util.render_response(result, ctx)
|
|
203
|
+
sys.exit(2)
|
|
204
|
+
except Exception:
|
|
205
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
206
|
+
cli_util.render_response(result, ctx)
|
|
207
|
+
raise
|
|
208
|
+
else:
|
|
209
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
210
|
+
cli_util.render_response(result, ctx)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
@iot_domain_group_group.command(name=cli_util.override('iot.change_iot_domain_group_compartment.command_name', 'change-compartment'), help=u"""Moves an IoT domain group to a different compartment within the same tenancy. For information about moving resources between compartments, see [Moving Resources to a Different Compartment]. \n[Command Reference](changeIotDomainGroupCompartment)""")
|
|
214
|
+
@cli_util.option('--iot-domain-group-id', required=True, help=u"""The [OCID] of an IoT Domain Group.""")
|
|
215
|
+
@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment corresponding to the resource.""")
|
|
216
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
217
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
218
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
219
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
220
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
221
|
+
@cli_util.help_option
|
|
222
|
+
@click.pass_context
|
|
223
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
224
|
+
@cli_util.wrap_exceptions
|
|
225
|
+
def change_iot_domain_group_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_group_id, compartment_id, if_match):
|
|
226
|
+
|
|
227
|
+
if isinstance(iot_domain_group_id, six.string_types) and len(iot_domain_group_id.strip()) == 0:
|
|
228
|
+
raise click.UsageError('Parameter --iot-domain-group-id cannot be whitespace or empty string')
|
|
229
|
+
|
|
230
|
+
kwargs = {}
|
|
231
|
+
if if_match is not None:
|
|
232
|
+
kwargs['if_match'] = if_match
|
|
233
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
234
|
+
|
|
235
|
+
_details = {}
|
|
236
|
+
_details['compartmentId'] = compartment_id
|
|
237
|
+
|
|
238
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
239
|
+
result = client.change_iot_domain_group_compartment(
|
|
240
|
+
iot_domain_group_id=iot_domain_group_id,
|
|
241
|
+
change_iot_domain_group_compartment_details=_details,
|
|
242
|
+
**kwargs
|
|
243
|
+
)
|
|
244
|
+
if wait_for_state:
|
|
245
|
+
|
|
246
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
247
|
+
try:
|
|
248
|
+
wait_period_kwargs = {}
|
|
249
|
+
if max_wait_seconds is not None:
|
|
250
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
251
|
+
if wait_interval_seconds is not None:
|
|
252
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
253
|
+
if 'opc-work-request-id' not in result.headers:
|
|
254
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
255
|
+
cli_util.render_response(result, ctx)
|
|
256
|
+
return
|
|
257
|
+
|
|
258
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
259
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
260
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
261
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
262
|
+
click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
263
|
+
cli_util.render_response(result, ctx)
|
|
264
|
+
sys.exit(2)
|
|
265
|
+
except Exception:
|
|
266
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
267
|
+
cli_util.render_response(result, ctx)
|
|
268
|
+
raise
|
|
269
|
+
else:
|
|
270
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
271
|
+
cli_util.render_response(result, ctx)
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
@iot_domain_group.command(name=cli_util.override('iot.configure_iot_domain_data_access.command_name', 'configure-iot-domain-data-access'), help=u"""Updates an IoT domain Data Access. \n[Command Reference](configureIotDomainDataAccess)""")
|
|
275
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""")
|
|
276
|
+
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["DIRECT", "ORDS", "APEX"]), help=u"""configuration type""")
|
|
277
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
278
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
279
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
280
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
281
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
282
|
+
@cli_util.help_option
|
|
283
|
+
@click.pass_context
|
|
284
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
285
|
+
@cli_util.wrap_exceptions
|
|
286
|
+
def configure_iot_domain_data_access(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_id, type, if_match):
|
|
287
|
+
|
|
288
|
+
if isinstance(iot_domain_id, six.string_types) and len(iot_domain_id.strip()) == 0:
|
|
289
|
+
raise click.UsageError('Parameter --iot-domain-id cannot be whitespace or empty string')
|
|
290
|
+
|
|
291
|
+
kwargs = {}
|
|
292
|
+
if if_match is not None:
|
|
293
|
+
kwargs['if_match'] = if_match
|
|
294
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
295
|
+
|
|
296
|
+
_details = {}
|
|
297
|
+
_details['type'] = type
|
|
298
|
+
|
|
299
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
300
|
+
result = client.configure_iot_domain_data_access(
|
|
301
|
+
iot_domain_id=iot_domain_id,
|
|
302
|
+
configure_iot_domain_data_access_details=_details,
|
|
303
|
+
**kwargs
|
|
304
|
+
)
|
|
305
|
+
if wait_for_state:
|
|
306
|
+
|
|
307
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
308
|
+
try:
|
|
309
|
+
wait_period_kwargs = {}
|
|
310
|
+
if max_wait_seconds is not None:
|
|
311
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
312
|
+
if wait_interval_seconds is not None:
|
|
313
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
314
|
+
if 'opc-work-request-id' not in result.headers:
|
|
315
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
316
|
+
cli_util.render_response(result, ctx)
|
|
317
|
+
return
|
|
318
|
+
|
|
319
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
320
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
321
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
322
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
323
|
+
click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
324
|
+
cli_util.render_response(result, ctx)
|
|
325
|
+
sys.exit(2)
|
|
326
|
+
except Exception:
|
|
327
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
328
|
+
cli_util.render_response(result, ctx)
|
|
329
|
+
raise
|
|
330
|
+
else:
|
|
331
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
332
|
+
cli_util.render_response(result, ctx)
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
@iot_domain_group.command(name=cli_util.override('iot.configure_iot_domain_data_access_apex_data_access_details.command_name', 'configure-iot-domain-data-access-apex-data-access-details'), help=u"""Updates an IoT domain Data Access. \n[Command Reference](configureIotDomainDataAccess)""")
|
|
336
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""")
|
|
337
|
+
@cli_util.option('--db-workspace-admin-initial-password', required=True, help=u"""Initial admin password for APEX workspace associated with the IoT domain.""")
|
|
338
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
339
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
340
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
341
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
342
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
343
|
+
@cli_util.help_option
|
|
344
|
+
@click.pass_context
|
|
345
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
346
|
+
@cli_util.wrap_exceptions
|
|
347
|
+
def configure_iot_domain_data_access_apex_data_access_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_id, db_workspace_admin_initial_password, if_match):
|
|
348
|
+
|
|
349
|
+
if isinstance(iot_domain_id, six.string_types) and len(iot_domain_id.strip()) == 0:
|
|
350
|
+
raise click.UsageError('Parameter --iot-domain-id cannot be whitespace or empty string')
|
|
351
|
+
|
|
352
|
+
kwargs = {}
|
|
353
|
+
if if_match is not None:
|
|
354
|
+
kwargs['if_match'] = if_match
|
|
355
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
356
|
+
|
|
357
|
+
_details = {}
|
|
358
|
+
_details['dbWorkspaceAdminInitialPassword'] = db_workspace_admin_initial_password
|
|
359
|
+
|
|
360
|
+
_details['type'] = 'APEX'
|
|
361
|
+
|
|
362
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
363
|
+
result = client.configure_iot_domain_data_access(
|
|
364
|
+
iot_domain_id=iot_domain_id,
|
|
365
|
+
configure_iot_domain_data_access_details=_details,
|
|
366
|
+
**kwargs
|
|
367
|
+
)
|
|
368
|
+
if wait_for_state:
|
|
369
|
+
|
|
370
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
371
|
+
try:
|
|
372
|
+
wait_period_kwargs = {}
|
|
373
|
+
if max_wait_seconds is not None:
|
|
374
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
375
|
+
if wait_interval_seconds is not None:
|
|
376
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
377
|
+
if 'opc-work-request-id' not in result.headers:
|
|
378
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
379
|
+
cli_util.render_response(result, ctx)
|
|
380
|
+
return
|
|
381
|
+
|
|
382
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
383
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
384
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
385
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
386
|
+
click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
387
|
+
cli_util.render_response(result, ctx)
|
|
388
|
+
sys.exit(2)
|
|
389
|
+
except Exception:
|
|
390
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
391
|
+
cli_util.render_response(result, ctx)
|
|
392
|
+
raise
|
|
393
|
+
else:
|
|
394
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
395
|
+
cli_util.render_response(result, ctx)
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
@iot_domain_group.command(name=cli_util.override('iot.configure_iot_domain_data_access_direct_data_access_details.command_name', 'configure-iot-domain-data-access-direct-data-access-details'), help=u"""Updates an IoT domain Data Access. \n[Command Reference](configureIotDomainDataAccess)""")
|
|
399
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""")
|
|
400
|
+
@cli_util.option('--db-allow-listed-identity-group-names', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of IAM groups of form described in [here] that are allowed to directly connect to the data host.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
401
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
402
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
403
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
404
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
405
|
+
@json_skeleton_utils.get_cli_json_input_option({'db-allow-listed-identity-group-names': {'module': 'iot', 'class': 'list[string]'}})
|
|
406
|
+
@cli_util.help_option
|
|
407
|
+
@click.pass_context
|
|
408
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'db-allow-listed-identity-group-names': {'module': 'iot', 'class': 'list[string]'}})
|
|
409
|
+
@cli_util.wrap_exceptions
|
|
410
|
+
def configure_iot_domain_data_access_direct_data_access_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_id, db_allow_listed_identity_group_names, if_match):
|
|
411
|
+
|
|
412
|
+
if isinstance(iot_domain_id, six.string_types) and len(iot_domain_id.strip()) == 0:
|
|
413
|
+
raise click.UsageError('Parameter --iot-domain-id cannot be whitespace or empty string')
|
|
414
|
+
|
|
415
|
+
kwargs = {}
|
|
416
|
+
if if_match is not None:
|
|
417
|
+
kwargs['if_match'] = if_match
|
|
418
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
419
|
+
|
|
420
|
+
_details = {}
|
|
421
|
+
_details['dbAllowListedIdentityGroupNames'] = cli_util.parse_json_parameter("db_allow_listed_identity_group_names", db_allow_listed_identity_group_names)
|
|
422
|
+
|
|
423
|
+
_details['type'] = 'DIRECT'
|
|
424
|
+
|
|
425
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
426
|
+
result = client.configure_iot_domain_data_access(
|
|
427
|
+
iot_domain_id=iot_domain_id,
|
|
428
|
+
configure_iot_domain_data_access_details=_details,
|
|
429
|
+
**kwargs
|
|
430
|
+
)
|
|
431
|
+
if wait_for_state:
|
|
432
|
+
|
|
433
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
434
|
+
try:
|
|
435
|
+
wait_period_kwargs = {}
|
|
436
|
+
if max_wait_seconds is not None:
|
|
437
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
438
|
+
if wait_interval_seconds is not None:
|
|
439
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
440
|
+
if 'opc-work-request-id' not in result.headers:
|
|
441
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
442
|
+
cli_util.render_response(result, ctx)
|
|
443
|
+
return
|
|
444
|
+
|
|
445
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
446
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
447
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
448
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
449
|
+
click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
450
|
+
cli_util.render_response(result, ctx)
|
|
451
|
+
sys.exit(2)
|
|
452
|
+
except Exception:
|
|
453
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
454
|
+
cli_util.render_response(result, ctx)
|
|
455
|
+
raise
|
|
456
|
+
else:
|
|
457
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
458
|
+
cli_util.render_response(result, ctx)
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
@iot_domain_group.command(name=cli_util.override('iot.configure_iot_domain_data_access_ords_data_access_details.command_name', 'configure-iot-domain-data-access-ords-data-access-details'), help=u"""Updates an IoT domain Data Access. \n[Command Reference](configureIotDomainDataAccess)""")
|
|
462
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""")
|
|
463
|
+
@cli_util.option('--db-allowed-identity-domain-host', required=True, help=u"""Host name of identity domain that is used for authenticating connect to data host via ORDS.""")
|
|
464
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
465
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
466
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
467
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
468
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
469
|
+
@cli_util.help_option
|
|
470
|
+
@click.pass_context
|
|
471
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
472
|
+
@cli_util.wrap_exceptions
|
|
473
|
+
def configure_iot_domain_data_access_ords_data_access_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_id, db_allowed_identity_domain_host, if_match):
|
|
474
|
+
|
|
475
|
+
if isinstance(iot_domain_id, six.string_types) and len(iot_domain_id.strip()) == 0:
|
|
476
|
+
raise click.UsageError('Parameter --iot-domain-id cannot be whitespace or empty string')
|
|
477
|
+
|
|
478
|
+
kwargs = {}
|
|
479
|
+
if if_match is not None:
|
|
480
|
+
kwargs['if_match'] = if_match
|
|
481
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
482
|
+
|
|
483
|
+
_details = {}
|
|
484
|
+
_details['dbAllowedIdentityDomainHost'] = db_allowed_identity_domain_host
|
|
485
|
+
|
|
486
|
+
_details['type'] = 'ORDS'
|
|
487
|
+
|
|
488
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
489
|
+
result = client.configure_iot_domain_data_access(
|
|
490
|
+
iot_domain_id=iot_domain_id,
|
|
491
|
+
configure_iot_domain_data_access_details=_details,
|
|
492
|
+
**kwargs
|
|
493
|
+
)
|
|
494
|
+
if wait_for_state:
|
|
495
|
+
|
|
496
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
497
|
+
try:
|
|
498
|
+
wait_period_kwargs = {}
|
|
499
|
+
if max_wait_seconds is not None:
|
|
500
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
501
|
+
if wait_interval_seconds is not None:
|
|
502
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
503
|
+
if 'opc-work-request-id' not in result.headers:
|
|
504
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
505
|
+
cli_util.render_response(result, ctx)
|
|
506
|
+
return
|
|
507
|
+
|
|
508
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
509
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
510
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
511
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
512
|
+
click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
513
|
+
cli_util.render_response(result, ctx)
|
|
514
|
+
sys.exit(2)
|
|
515
|
+
except Exception:
|
|
516
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
517
|
+
cli_util.render_response(result, ctx)
|
|
518
|
+
raise
|
|
519
|
+
else:
|
|
520
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
521
|
+
cli_util.render_response(result, ctx)
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
@iot_domain_group_group.command(name=cli_util.override('iot.configure_iot_domain_group_data_access.command_name', 'configure-iot-domain-group-data-access'), help=u"""Updates an IoT domain Group Data Access. \n[Command Reference](configureIotDomainGroupDataAccess)""")
|
|
525
|
+
@cli_util.option('--iot-domain-group-id', required=True, help=u"""The [OCID] of an IoT Domain Group.""")
|
|
526
|
+
@cli_util.option('--db-allow-listed-vcn-ids', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""This is an array of VCN OCID (virtual cloud network Oracle Cloud ID) that is allowed to connect the data host.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
527
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
528
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
529
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
530
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
531
|
+
@json_skeleton_utils.get_cli_json_input_option({'db-allow-listed-vcn-ids': {'module': 'iot', 'class': 'list[string]'}})
|
|
532
|
+
@cli_util.help_option
|
|
533
|
+
@click.pass_context
|
|
534
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'db-allow-listed-vcn-ids': {'module': 'iot', 'class': 'list[string]'}})
|
|
535
|
+
@cli_util.wrap_exceptions
|
|
536
|
+
def configure_iot_domain_group_data_access(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_group_id, db_allow_listed_vcn_ids, if_match):
|
|
537
|
+
|
|
538
|
+
if isinstance(iot_domain_group_id, six.string_types) and len(iot_domain_group_id.strip()) == 0:
|
|
539
|
+
raise click.UsageError('Parameter --iot-domain-group-id cannot be whitespace or empty string')
|
|
540
|
+
|
|
541
|
+
kwargs = {}
|
|
542
|
+
if if_match is not None:
|
|
543
|
+
kwargs['if_match'] = if_match
|
|
544
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
545
|
+
|
|
546
|
+
_details = {}
|
|
547
|
+
_details['dbAllowListedVcnIds'] = cli_util.parse_json_parameter("db_allow_listed_vcn_ids", db_allow_listed_vcn_ids)
|
|
548
|
+
|
|
549
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
550
|
+
result = client.configure_iot_domain_group_data_access(
|
|
551
|
+
iot_domain_group_id=iot_domain_group_id,
|
|
552
|
+
configure_iot_domain_group_data_access_details=_details,
|
|
553
|
+
**kwargs
|
|
554
|
+
)
|
|
555
|
+
if wait_for_state:
|
|
556
|
+
|
|
557
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
558
|
+
try:
|
|
559
|
+
wait_period_kwargs = {}
|
|
560
|
+
if max_wait_seconds is not None:
|
|
561
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
562
|
+
if wait_interval_seconds is not None:
|
|
563
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
564
|
+
if 'opc-work-request-id' not in result.headers:
|
|
565
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
566
|
+
cli_util.render_response(result, ctx)
|
|
567
|
+
return
|
|
568
|
+
|
|
569
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
570
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
571
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
572
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
573
|
+
click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
574
|
+
cli_util.render_response(result, ctx)
|
|
575
|
+
sys.exit(2)
|
|
576
|
+
except Exception:
|
|
577
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
578
|
+
cli_util.render_response(result, ctx)
|
|
579
|
+
raise
|
|
580
|
+
else:
|
|
581
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
582
|
+
cli_util.render_response(result, ctx)
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
@digital_twin_adapter_group.command(name=cli_util.override('iot.create_digital_twin_adapter.command_name', 'create'), help=u"""Creates a new digital twin adapter. \n[Command Reference](createDigitalTwinAdapter)""")
|
|
586
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""")
|
|
587
|
+
@cli_util.option('--digital-twin-model-id', help=u"""The [OCID] of the digital twin model.""")
|
|
588
|
+
@cli_util.option('--digital-twin-model-spec-uri', help=u"""The URI of the digital twin model specification.""")
|
|
589
|
+
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""")
|
|
590
|
+
@cli_util.option('--description', help=u"""A short description of the resource.""")
|
|
591
|
+
@cli_util.option('--inbound-envelope', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
592
|
+
@cli_util.option('--inbound-routes', type=custom_types.CLI_COMPLEX_TYPE, help=u"""list of inbound routes
|
|
593
|
+
|
|
594
|
+
This option is a JSON list with items of type DigitalTwinAdapterInboundRoute. For documentation on DigitalTwinAdapterInboundRoute please see our API reference: https://docs.cloud.oracle.com/api/#/en/iot/20250531/datatypes/DigitalTwinAdapterInboundRoute.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
595
|
+
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
|
|
596
|
+
|
|
597
|
+
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
598
|
+
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
|
|
599
|
+
|
|
600
|
+
Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
601
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "DELETED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
602
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
603
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
604
|
+
@json_skeleton_utils.get_cli_json_input_option({'inbound-envelope': {'module': 'iot', 'class': 'DigitalTwinAdapterInboundEnvelope'}, 'inbound-routes': {'module': 'iot', 'class': 'list[DigitalTwinAdapterInboundRoute]'}, 'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}})
|
|
605
|
+
@cli_util.help_option
|
|
606
|
+
@click.pass_context
|
|
607
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'inbound-envelope': {'module': 'iot', 'class': 'DigitalTwinAdapterInboundEnvelope'}, 'inbound-routes': {'module': 'iot', 'class': 'list[DigitalTwinAdapterInboundRoute]'}, 'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'iot', 'class': 'DigitalTwinAdapter'})
|
|
608
|
+
@cli_util.wrap_exceptions
|
|
609
|
+
def create_digital_twin_adapter(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_id, digital_twin_model_id, digital_twin_model_spec_uri, display_name, description, inbound_envelope, inbound_routes, freeform_tags, defined_tags):
|
|
610
|
+
|
|
611
|
+
kwargs = {}
|
|
612
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
613
|
+
|
|
614
|
+
_details = {}
|
|
615
|
+
_details['iotDomainId'] = iot_domain_id
|
|
616
|
+
|
|
617
|
+
if digital_twin_model_id is not None:
|
|
618
|
+
_details['digitalTwinModelId'] = digital_twin_model_id
|
|
619
|
+
|
|
620
|
+
if digital_twin_model_spec_uri is not None:
|
|
621
|
+
_details['digitalTwinModelSpecUri'] = digital_twin_model_spec_uri
|
|
622
|
+
|
|
623
|
+
if display_name is not None:
|
|
624
|
+
_details['displayName'] = display_name
|
|
625
|
+
|
|
626
|
+
if description is not None:
|
|
627
|
+
_details['description'] = description
|
|
628
|
+
|
|
629
|
+
if inbound_envelope is not None:
|
|
630
|
+
_details['inboundEnvelope'] = cli_util.parse_json_parameter("inbound_envelope", inbound_envelope)
|
|
631
|
+
|
|
632
|
+
if inbound_routes is not None:
|
|
633
|
+
_details['inboundRoutes'] = cli_util.parse_json_parameter("inbound_routes", inbound_routes)
|
|
634
|
+
|
|
635
|
+
if freeform_tags is not None:
|
|
636
|
+
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
|
|
637
|
+
|
|
638
|
+
if defined_tags is not None:
|
|
639
|
+
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
|
|
640
|
+
|
|
641
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
642
|
+
result = client.create_digital_twin_adapter(
|
|
643
|
+
create_digital_twin_adapter_details=_details,
|
|
644
|
+
**kwargs
|
|
645
|
+
)
|
|
646
|
+
if wait_for_state:
|
|
647
|
+
|
|
648
|
+
if hasattr(client, 'get_digital_twin_adapter') and callable(getattr(client, 'get_digital_twin_adapter')):
|
|
649
|
+
try:
|
|
650
|
+
wait_period_kwargs = {}
|
|
651
|
+
if max_wait_seconds is not None:
|
|
652
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
653
|
+
if wait_interval_seconds is not None:
|
|
654
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
655
|
+
|
|
656
|
+
click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
657
|
+
result = oci.wait_until(client, client.get_digital_twin_adapter(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
|
|
658
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
659
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
660
|
+
click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
661
|
+
cli_util.render_response(result, ctx)
|
|
662
|
+
sys.exit(2)
|
|
663
|
+
except Exception:
|
|
664
|
+
click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
665
|
+
cli_util.render_response(result, ctx)
|
|
666
|
+
raise
|
|
667
|
+
else:
|
|
668
|
+
click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
|
|
669
|
+
cli_util.render_response(result, ctx)
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
@digital_twin_instance_group.command(name=cli_util.override('iot.create_digital_twin_instance.command_name', 'create'), help=u"""Creates a new digital twin instance. \n[Command Reference](createDigitalTwinInstance)""")
|
|
673
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""")
|
|
674
|
+
@cli_util.option('--auth-id', help=u"""The [OCID] of the resource (like VaultSecret, ClientCertificate etc.,) used to authenticate the digital twin instance.""")
|
|
675
|
+
@cli_util.option('--external-key', help=u"""A unique identifier for the physical entity (typically an IoT device) represented by the digital twin instance. This could be a Bluetooth address, Ethernet MAC address, or serial number, depending on the use case. If not provided, the system will automatically generate one.""")
|
|
676
|
+
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""")
|
|
677
|
+
@cli_util.option('--description', help=u"""A short description of the resource.""")
|
|
678
|
+
@cli_util.option('--digital-twin-adapter-id', help=u"""The [OCID] of the digital twin adapter.""")
|
|
679
|
+
@cli_util.option('--digital-twin-model-id', help=u"""The [OCID] of the digital twin model.""")
|
|
680
|
+
@cli_util.option('--digital-twin-model-spec-uri', help=u"""The URI of the digital twin model specification.""")
|
|
681
|
+
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
|
|
682
|
+
|
|
683
|
+
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
684
|
+
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
|
|
685
|
+
|
|
686
|
+
Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
687
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "DELETED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
688
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
689
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
690
|
+
@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}})
|
|
691
|
+
@cli_util.help_option
|
|
692
|
+
@click.pass_context
|
|
693
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'iot', 'class': 'DigitalTwinInstance'})
|
|
694
|
+
@cli_util.wrap_exceptions
|
|
695
|
+
def create_digital_twin_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_id, auth_id, external_key, display_name, description, digital_twin_adapter_id, digital_twin_model_id, digital_twin_model_spec_uri, freeform_tags, defined_tags):
|
|
696
|
+
|
|
697
|
+
kwargs = {}
|
|
698
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
699
|
+
|
|
700
|
+
_details = {}
|
|
701
|
+
_details['iotDomainId'] = iot_domain_id
|
|
702
|
+
|
|
703
|
+
if auth_id is not None:
|
|
704
|
+
_details['authId'] = auth_id
|
|
705
|
+
|
|
706
|
+
if external_key is not None:
|
|
707
|
+
_details['externalKey'] = external_key
|
|
708
|
+
|
|
709
|
+
if display_name is not None:
|
|
710
|
+
_details['displayName'] = display_name
|
|
711
|
+
|
|
712
|
+
if description is not None:
|
|
713
|
+
_details['description'] = description
|
|
714
|
+
|
|
715
|
+
if digital_twin_adapter_id is not None:
|
|
716
|
+
_details['digitalTwinAdapterId'] = digital_twin_adapter_id
|
|
717
|
+
|
|
718
|
+
if digital_twin_model_id is not None:
|
|
719
|
+
_details['digitalTwinModelId'] = digital_twin_model_id
|
|
720
|
+
|
|
721
|
+
if digital_twin_model_spec_uri is not None:
|
|
722
|
+
_details['digitalTwinModelSpecUri'] = digital_twin_model_spec_uri
|
|
723
|
+
|
|
724
|
+
if freeform_tags is not None:
|
|
725
|
+
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
|
|
726
|
+
|
|
727
|
+
if defined_tags is not None:
|
|
728
|
+
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
|
|
729
|
+
|
|
730
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
731
|
+
result = client.create_digital_twin_instance(
|
|
732
|
+
create_digital_twin_instance_details=_details,
|
|
733
|
+
**kwargs
|
|
734
|
+
)
|
|
735
|
+
if wait_for_state:
|
|
736
|
+
|
|
737
|
+
if hasattr(client, 'get_digital_twin_instance') and callable(getattr(client, 'get_digital_twin_instance')):
|
|
738
|
+
try:
|
|
739
|
+
wait_period_kwargs = {}
|
|
740
|
+
if max_wait_seconds is not None:
|
|
741
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
742
|
+
if wait_interval_seconds is not None:
|
|
743
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
744
|
+
|
|
745
|
+
click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
746
|
+
result = oci.wait_until(client, client.get_digital_twin_instance(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
|
|
747
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
748
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
749
|
+
click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
750
|
+
cli_util.render_response(result, ctx)
|
|
751
|
+
sys.exit(2)
|
|
752
|
+
except Exception:
|
|
753
|
+
click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
754
|
+
cli_util.render_response(result, ctx)
|
|
755
|
+
raise
|
|
756
|
+
else:
|
|
757
|
+
click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
|
|
758
|
+
cli_util.render_response(result, ctx)
|
|
759
|
+
|
|
760
|
+
|
|
761
|
+
@digital_twin_model_group.command(name=cli_util.override('iot.create_digital_twin_model.command_name', 'create'), help=u"""Creates a new digital twin model. \n[Command Reference](createDigitalTwinModel)""")
|
|
762
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""")
|
|
763
|
+
@cli_util.option('--spec', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The specification of the digital twin model (DTDL).""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
764
|
+
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. If left blank, the display name will be derived from the spec.""")
|
|
765
|
+
@cli_util.option('--description', help=u"""A short description of the resource. If left blank, the description will be derived from the spec.""")
|
|
766
|
+
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
|
|
767
|
+
|
|
768
|
+
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
769
|
+
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
|
|
770
|
+
|
|
771
|
+
Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
772
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "DELETED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
773
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
774
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
775
|
+
@json_skeleton_utils.get_cli_json_input_option({'spec': {'module': 'iot', 'class': 'dict(str, object)'}, 'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}})
|
|
776
|
+
@cli_util.help_option
|
|
777
|
+
@click.pass_context
|
|
778
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'spec': {'module': 'iot', 'class': 'dict(str, object)'}, 'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'iot', 'class': 'DigitalTwinModel'})
|
|
779
|
+
@cli_util.wrap_exceptions
|
|
780
|
+
def create_digital_twin_model(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_id, spec, display_name, description, freeform_tags, defined_tags):
|
|
781
|
+
|
|
782
|
+
kwargs = {}
|
|
783
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
784
|
+
|
|
785
|
+
_details = {}
|
|
786
|
+
_details['iotDomainId'] = iot_domain_id
|
|
787
|
+
_details['spec'] = cli_util.parse_json_parameter("spec", spec)
|
|
788
|
+
|
|
789
|
+
if display_name is not None:
|
|
790
|
+
_details['displayName'] = display_name
|
|
791
|
+
|
|
792
|
+
if description is not None:
|
|
793
|
+
_details['description'] = description
|
|
794
|
+
|
|
795
|
+
if freeform_tags is not None:
|
|
796
|
+
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
|
|
797
|
+
|
|
798
|
+
if defined_tags is not None:
|
|
799
|
+
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
|
|
800
|
+
|
|
801
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
802
|
+
result = client.create_digital_twin_model(
|
|
803
|
+
create_digital_twin_model_details=_details,
|
|
804
|
+
**kwargs
|
|
805
|
+
)
|
|
806
|
+
if wait_for_state:
|
|
807
|
+
|
|
808
|
+
if hasattr(client, 'get_digital_twin_model') and callable(getattr(client, 'get_digital_twin_model')):
|
|
809
|
+
try:
|
|
810
|
+
wait_period_kwargs = {}
|
|
811
|
+
if max_wait_seconds is not None:
|
|
812
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
813
|
+
if wait_interval_seconds is not None:
|
|
814
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
815
|
+
|
|
816
|
+
click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
817
|
+
result = oci.wait_until(client, client.get_digital_twin_model(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
|
|
818
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
819
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
820
|
+
click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
821
|
+
cli_util.render_response(result, ctx)
|
|
822
|
+
sys.exit(2)
|
|
823
|
+
except Exception:
|
|
824
|
+
click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
825
|
+
cli_util.render_response(result, ctx)
|
|
826
|
+
raise
|
|
827
|
+
else:
|
|
828
|
+
click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
|
|
829
|
+
cli_util.render_response(result, ctx)
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
@digital_twin_relationship_group.command(name=cli_util.override('iot.create_digital_twin_relationship.command_name', 'create'), help=u"""Creates a new digital twin relationship. \n[Command Reference](createDigitalTwinRelationship)""")
|
|
833
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""")
|
|
834
|
+
@cli_util.option('--content-path', required=True, help=u"""Its the name of the relationship that links two digital twin instances. Here, it is the relationship name of the source digital twin model.""")
|
|
835
|
+
@cli_util.option('--source-digital-twin-instance-id', required=True, help=u"""The [OCID] of source digital twin instance.""")
|
|
836
|
+
@cli_util.option('--target-digital-twin-instance-id', required=True, help=u"""The [OCID] of target digital twin instance.""")
|
|
837
|
+
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""")
|
|
838
|
+
@cli_util.option('--description', help=u"""A short description of the resource.""")
|
|
839
|
+
@cli_util.option('--content', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The value(s) of the relationship properties defined in the source digital twin model.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
840
|
+
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
|
|
841
|
+
|
|
842
|
+
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
843
|
+
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
|
|
844
|
+
|
|
845
|
+
Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
846
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "DELETED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
847
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
848
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
849
|
+
@json_skeleton_utils.get_cli_json_input_option({'content': {'module': 'iot', 'class': 'dict(str, object)'}, 'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}})
|
|
850
|
+
@cli_util.help_option
|
|
851
|
+
@click.pass_context
|
|
852
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'content': {'module': 'iot', 'class': 'dict(str, object)'}, 'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'iot', 'class': 'DigitalTwinRelationship'})
|
|
853
|
+
@cli_util.wrap_exceptions
|
|
854
|
+
def create_digital_twin_relationship(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_id, content_path, source_digital_twin_instance_id, target_digital_twin_instance_id, display_name, description, content, freeform_tags, defined_tags):
|
|
855
|
+
|
|
856
|
+
kwargs = {}
|
|
857
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
858
|
+
|
|
859
|
+
_details = {}
|
|
860
|
+
_details['iotDomainId'] = iot_domain_id
|
|
861
|
+
_details['contentPath'] = content_path
|
|
862
|
+
_details['sourceDigitalTwinInstanceId'] = source_digital_twin_instance_id
|
|
863
|
+
_details['targetDigitalTwinInstanceId'] = target_digital_twin_instance_id
|
|
864
|
+
|
|
865
|
+
if display_name is not None:
|
|
866
|
+
_details['displayName'] = display_name
|
|
867
|
+
|
|
868
|
+
if description is not None:
|
|
869
|
+
_details['description'] = description
|
|
870
|
+
|
|
871
|
+
if content is not None:
|
|
872
|
+
_details['content'] = cli_util.parse_json_parameter("content", content)
|
|
873
|
+
|
|
874
|
+
if freeform_tags is not None:
|
|
875
|
+
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
|
|
876
|
+
|
|
877
|
+
if defined_tags is not None:
|
|
878
|
+
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
|
|
879
|
+
|
|
880
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
881
|
+
result = client.create_digital_twin_relationship(
|
|
882
|
+
create_digital_twin_relationship_details=_details,
|
|
883
|
+
**kwargs
|
|
884
|
+
)
|
|
885
|
+
if wait_for_state:
|
|
886
|
+
|
|
887
|
+
if hasattr(client, 'get_digital_twin_relationship') and callable(getattr(client, 'get_digital_twin_relationship')):
|
|
888
|
+
try:
|
|
889
|
+
wait_period_kwargs = {}
|
|
890
|
+
if max_wait_seconds is not None:
|
|
891
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
892
|
+
if wait_interval_seconds is not None:
|
|
893
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
894
|
+
|
|
895
|
+
click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
896
|
+
result = oci.wait_until(client, client.get_digital_twin_relationship(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
|
|
897
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
898
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
899
|
+
click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
900
|
+
cli_util.render_response(result, ctx)
|
|
901
|
+
sys.exit(2)
|
|
902
|
+
except Exception:
|
|
903
|
+
click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
904
|
+
cli_util.render_response(result, ctx)
|
|
905
|
+
raise
|
|
906
|
+
else:
|
|
907
|
+
click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
|
|
908
|
+
cli_util.render_response(result, ctx)
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
@iot_domain_group.command(name=cli_util.override('iot.create_iot_domain.command_name', 'create'), help=u"""Creates a new IoT domain. \n[Command Reference](createIotDomain)""")
|
|
912
|
+
@cli_util.option('--iot-domain-group-id', required=True, help=u"""The [OCID] of the IoT domain group.""")
|
|
913
|
+
@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment corresponding to the resource.""")
|
|
914
|
+
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""")
|
|
915
|
+
@cli_util.option('--description', help=u"""A short description of the resource.""")
|
|
916
|
+
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
|
|
917
|
+
|
|
918
|
+
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
919
|
+
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
|
|
920
|
+
|
|
921
|
+
Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
922
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
923
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
924
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
925
|
+
@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}})
|
|
926
|
+
@cli_util.help_option
|
|
927
|
+
@click.pass_context
|
|
928
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'iot', 'class': 'IotDomain'})
|
|
929
|
+
@cli_util.wrap_exceptions
|
|
930
|
+
def create_iot_domain(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_group_id, compartment_id, display_name, description, freeform_tags, defined_tags):
|
|
931
|
+
|
|
932
|
+
kwargs = {}
|
|
933
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
934
|
+
|
|
935
|
+
_details = {}
|
|
936
|
+
_details['iotDomainGroupId'] = iot_domain_group_id
|
|
937
|
+
_details['compartmentId'] = compartment_id
|
|
938
|
+
|
|
939
|
+
if display_name is not None:
|
|
940
|
+
_details['displayName'] = display_name
|
|
941
|
+
|
|
942
|
+
if description is not None:
|
|
943
|
+
_details['description'] = description
|
|
944
|
+
|
|
945
|
+
if freeform_tags is not None:
|
|
946
|
+
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
|
|
947
|
+
|
|
948
|
+
if defined_tags is not None:
|
|
949
|
+
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
|
|
950
|
+
|
|
951
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
952
|
+
result = client.create_iot_domain(
|
|
953
|
+
create_iot_domain_details=_details,
|
|
954
|
+
**kwargs
|
|
955
|
+
)
|
|
956
|
+
if wait_for_state:
|
|
957
|
+
|
|
958
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
959
|
+
try:
|
|
960
|
+
wait_period_kwargs = {}
|
|
961
|
+
if max_wait_seconds is not None:
|
|
962
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
963
|
+
if wait_interval_seconds is not None:
|
|
964
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
965
|
+
if 'opc-work-request-id' not in result.headers:
|
|
966
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
967
|
+
cli_util.render_response(result, ctx)
|
|
968
|
+
return
|
|
969
|
+
|
|
970
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
971
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
972
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
973
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
974
|
+
click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
975
|
+
cli_util.render_response(result, ctx)
|
|
976
|
+
sys.exit(2)
|
|
977
|
+
except Exception:
|
|
978
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
979
|
+
cli_util.render_response(result, ctx)
|
|
980
|
+
raise
|
|
981
|
+
else:
|
|
982
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
983
|
+
cli_util.render_response(result, ctx)
|
|
984
|
+
|
|
985
|
+
|
|
986
|
+
@iot_domain_group_group.command(name=cli_util.override('iot.create_iot_domain_group.command_name', 'create'), help=u"""Creates a new IoT domain group. \n[Command Reference](createIotDomainGroup)""")
|
|
987
|
+
@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment corresponding to the resource.""")
|
|
988
|
+
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""")
|
|
989
|
+
@cli_util.option('--description', help=u"""A short description of the resource.""")
|
|
990
|
+
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
|
|
991
|
+
|
|
992
|
+
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
993
|
+
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
|
|
994
|
+
|
|
995
|
+
Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
996
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
997
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
998
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
999
|
+
@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}})
|
|
1000
|
+
@cli_util.help_option
|
|
1001
|
+
@click.pass_context
|
|
1002
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'iot', 'class': 'IotDomainGroup'})
|
|
1003
|
+
@cli_util.wrap_exceptions
|
|
1004
|
+
def create_iot_domain_group(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, display_name, description, freeform_tags, defined_tags):
|
|
1005
|
+
|
|
1006
|
+
kwargs = {}
|
|
1007
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1008
|
+
|
|
1009
|
+
_details = {}
|
|
1010
|
+
_details['compartmentId'] = compartment_id
|
|
1011
|
+
|
|
1012
|
+
if display_name is not None:
|
|
1013
|
+
_details['displayName'] = display_name
|
|
1014
|
+
|
|
1015
|
+
if description is not None:
|
|
1016
|
+
_details['description'] = description
|
|
1017
|
+
|
|
1018
|
+
if freeform_tags is not None:
|
|
1019
|
+
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
|
|
1020
|
+
|
|
1021
|
+
if defined_tags is not None:
|
|
1022
|
+
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
|
|
1023
|
+
|
|
1024
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1025
|
+
result = client.create_iot_domain_group(
|
|
1026
|
+
create_iot_domain_group_details=_details,
|
|
1027
|
+
**kwargs
|
|
1028
|
+
)
|
|
1029
|
+
if wait_for_state:
|
|
1030
|
+
|
|
1031
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
1032
|
+
try:
|
|
1033
|
+
wait_period_kwargs = {}
|
|
1034
|
+
if max_wait_seconds is not None:
|
|
1035
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
1036
|
+
if wait_interval_seconds is not None:
|
|
1037
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
1038
|
+
if 'opc-work-request-id' not in result.headers:
|
|
1039
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
1040
|
+
cli_util.render_response(result, ctx)
|
|
1041
|
+
return
|
|
1042
|
+
|
|
1043
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
1044
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
1045
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
1046
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
1047
|
+
click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
1048
|
+
cli_util.render_response(result, ctx)
|
|
1049
|
+
sys.exit(2)
|
|
1050
|
+
except Exception:
|
|
1051
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
1052
|
+
cli_util.render_response(result, ctx)
|
|
1053
|
+
raise
|
|
1054
|
+
else:
|
|
1055
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
1056
|
+
cli_util.render_response(result, ctx)
|
|
1057
|
+
|
|
1058
|
+
|
|
1059
|
+
@digital_twin_adapter_group.command(name=cli_util.override('iot.delete_digital_twin_adapter.command_name', 'delete'), help=u"""Deletes the digital twin adapter identified by the specified OCID. \n[Command Reference](deleteDigitalTwinAdapter)""")
|
|
1060
|
+
@cli_util.option('--digital-twin-adapter-id', required=True, help=u"""The [OCID] of the digital twin adapter.""")
|
|
1061
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
1062
|
+
@cli_util.confirm_delete_option
|
|
1063
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "DELETED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
1064
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
1065
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
1066
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1067
|
+
@cli_util.help_option
|
|
1068
|
+
@click.pass_context
|
|
1069
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
1070
|
+
@cli_util.wrap_exceptions
|
|
1071
|
+
def delete_digital_twin_adapter(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, digital_twin_adapter_id, if_match):
|
|
1072
|
+
|
|
1073
|
+
if isinstance(digital_twin_adapter_id, six.string_types) and len(digital_twin_adapter_id.strip()) == 0:
|
|
1074
|
+
raise click.UsageError('Parameter --digital-twin-adapter-id cannot be whitespace or empty string')
|
|
1075
|
+
|
|
1076
|
+
kwargs = {}
|
|
1077
|
+
if if_match is not None:
|
|
1078
|
+
kwargs['if_match'] = if_match
|
|
1079
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1080
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1081
|
+
result = client.delete_digital_twin_adapter(
|
|
1082
|
+
digital_twin_adapter_id=digital_twin_adapter_id,
|
|
1083
|
+
**kwargs
|
|
1084
|
+
)
|
|
1085
|
+
if wait_for_state:
|
|
1086
|
+
|
|
1087
|
+
if hasattr(client, 'get_digital_twin_adapter') and callable(getattr(client, 'get_digital_twin_adapter')):
|
|
1088
|
+
try:
|
|
1089
|
+
wait_period_kwargs = {}
|
|
1090
|
+
if max_wait_seconds is not None:
|
|
1091
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
1092
|
+
if wait_interval_seconds is not None:
|
|
1093
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
1094
|
+
|
|
1095
|
+
click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
1096
|
+
oci.wait_until(client, client.get_digital_twin_adapter(digital_twin_adapter_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
|
|
1097
|
+
except oci.exceptions.ServiceError as e:
|
|
1098
|
+
# We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
|
|
1099
|
+
# outcome of a delete operation it is possible that the resource is already gone and so the initial service call
|
|
1100
|
+
# will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
|
|
1101
|
+
# the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
|
|
1102
|
+
# succeed_on_not_found=True to the waiter).
|
|
1103
|
+
#
|
|
1104
|
+
# Any non-404 should still result in the exception being thrown.
|
|
1105
|
+
if e.status == 404:
|
|
1106
|
+
pass
|
|
1107
|
+
else:
|
|
1108
|
+
raise
|
|
1109
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
1110
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
1111
|
+
click.echo('Failed to wait until the resource entered the specified state. Please retrieve the resource to find its current state', file=sys.stderr)
|
|
1112
|
+
cli_util.render_response(result, ctx)
|
|
1113
|
+
sys.exit(2)
|
|
1114
|
+
except Exception:
|
|
1115
|
+
click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
1116
|
+
cli_util.render_response(result, ctx)
|
|
1117
|
+
raise
|
|
1118
|
+
else:
|
|
1119
|
+
click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
|
|
1120
|
+
cli_util.render_response(result, ctx)
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
@digital_twin_instance_group.command(name=cli_util.override('iot.delete_digital_twin_instance.command_name', 'delete'), help=u"""Deletes the digital twin instance identified by the specified OCID. \n[Command Reference](deleteDigitalTwinInstance)""")
|
|
1124
|
+
@cli_util.option('--digital-twin-instance-id', required=True, help=u"""The [OCID] of digital twin instance.""")
|
|
1125
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
1126
|
+
@cli_util.confirm_delete_option
|
|
1127
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "DELETED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
1128
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
1129
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
1130
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1131
|
+
@cli_util.help_option
|
|
1132
|
+
@click.pass_context
|
|
1133
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
1134
|
+
@cli_util.wrap_exceptions
|
|
1135
|
+
def delete_digital_twin_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, digital_twin_instance_id, if_match):
|
|
1136
|
+
|
|
1137
|
+
if isinstance(digital_twin_instance_id, six.string_types) and len(digital_twin_instance_id.strip()) == 0:
|
|
1138
|
+
raise click.UsageError('Parameter --digital-twin-instance-id cannot be whitespace or empty string')
|
|
1139
|
+
|
|
1140
|
+
kwargs = {}
|
|
1141
|
+
if if_match is not None:
|
|
1142
|
+
kwargs['if_match'] = if_match
|
|
1143
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1144
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1145
|
+
result = client.delete_digital_twin_instance(
|
|
1146
|
+
digital_twin_instance_id=digital_twin_instance_id,
|
|
1147
|
+
**kwargs
|
|
1148
|
+
)
|
|
1149
|
+
if wait_for_state:
|
|
1150
|
+
|
|
1151
|
+
if hasattr(client, 'get_digital_twin_instance') and callable(getattr(client, 'get_digital_twin_instance')):
|
|
1152
|
+
try:
|
|
1153
|
+
wait_period_kwargs = {}
|
|
1154
|
+
if max_wait_seconds is not None:
|
|
1155
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
1156
|
+
if wait_interval_seconds is not None:
|
|
1157
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
1158
|
+
|
|
1159
|
+
click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
1160
|
+
oci.wait_until(client, client.get_digital_twin_instance(digital_twin_instance_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
|
|
1161
|
+
except oci.exceptions.ServiceError as e:
|
|
1162
|
+
# We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
|
|
1163
|
+
# outcome of a delete operation it is possible that the resource is already gone and so the initial service call
|
|
1164
|
+
# will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
|
|
1165
|
+
# the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
|
|
1166
|
+
# succeed_on_not_found=True to the waiter).
|
|
1167
|
+
#
|
|
1168
|
+
# Any non-404 should still result in the exception being thrown.
|
|
1169
|
+
if e.status == 404:
|
|
1170
|
+
pass
|
|
1171
|
+
else:
|
|
1172
|
+
raise
|
|
1173
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
1174
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
1175
|
+
click.echo('Failed to wait until the resource entered the specified state. Please retrieve the resource to find its current state', file=sys.stderr)
|
|
1176
|
+
cli_util.render_response(result, ctx)
|
|
1177
|
+
sys.exit(2)
|
|
1178
|
+
except Exception:
|
|
1179
|
+
click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
1180
|
+
cli_util.render_response(result, ctx)
|
|
1181
|
+
raise
|
|
1182
|
+
else:
|
|
1183
|
+
click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
|
|
1184
|
+
cli_util.render_response(result, ctx)
|
|
1185
|
+
|
|
1186
|
+
|
|
1187
|
+
@digital_twin_model_group.command(name=cli_util.override('iot.delete_digital_twin_model.command_name', 'delete'), help=u"""Deletes the digital twin model identified by the specified OCID. \n[Command Reference](deleteDigitalTwinModel)""")
|
|
1188
|
+
@cli_util.option('--digital-twin-model-id', required=True, help=u"""The [OCID] of digital twin model.""")
|
|
1189
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
1190
|
+
@cli_util.confirm_delete_option
|
|
1191
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "DELETED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
1192
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
1193
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
1194
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1195
|
+
@cli_util.help_option
|
|
1196
|
+
@click.pass_context
|
|
1197
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
1198
|
+
@cli_util.wrap_exceptions
|
|
1199
|
+
def delete_digital_twin_model(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, digital_twin_model_id, if_match):
|
|
1200
|
+
|
|
1201
|
+
if isinstance(digital_twin_model_id, six.string_types) and len(digital_twin_model_id.strip()) == 0:
|
|
1202
|
+
raise click.UsageError('Parameter --digital-twin-model-id cannot be whitespace or empty string')
|
|
1203
|
+
|
|
1204
|
+
kwargs = {}
|
|
1205
|
+
if if_match is not None:
|
|
1206
|
+
kwargs['if_match'] = if_match
|
|
1207
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1208
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1209
|
+
result = client.delete_digital_twin_model(
|
|
1210
|
+
digital_twin_model_id=digital_twin_model_id,
|
|
1211
|
+
**kwargs
|
|
1212
|
+
)
|
|
1213
|
+
if wait_for_state:
|
|
1214
|
+
|
|
1215
|
+
if hasattr(client, 'get_digital_twin_model') and callable(getattr(client, 'get_digital_twin_model')):
|
|
1216
|
+
try:
|
|
1217
|
+
wait_period_kwargs = {}
|
|
1218
|
+
if max_wait_seconds is not None:
|
|
1219
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
1220
|
+
if wait_interval_seconds is not None:
|
|
1221
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
1222
|
+
|
|
1223
|
+
click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
1224
|
+
oci.wait_until(client, client.get_digital_twin_model(digital_twin_model_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
|
|
1225
|
+
except oci.exceptions.ServiceError as e:
|
|
1226
|
+
# We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
|
|
1227
|
+
# outcome of a delete operation it is possible that the resource is already gone and so the initial service call
|
|
1228
|
+
# will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
|
|
1229
|
+
# the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
|
|
1230
|
+
# succeed_on_not_found=True to the waiter).
|
|
1231
|
+
#
|
|
1232
|
+
# Any non-404 should still result in the exception being thrown.
|
|
1233
|
+
if e.status == 404:
|
|
1234
|
+
pass
|
|
1235
|
+
else:
|
|
1236
|
+
raise
|
|
1237
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
1238
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
1239
|
+
click.echo('Failed to wait until the resource entered the specified state. Please retrieve the resource to find its current state', file=sys.stderr)
|
|
1240
|
+
cli_util.render_response(result, ctx)
|
|
1241
|
+
sys.exit(2)
|
|
1242
|
+
except Exception:
|
|
1243
|
+
click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
1244
|
+
cli_util.render_response(result, ctx)
|
|
1245
|
+
raise
|
|
1246
|
+
else:
|
|
1247
|
+
click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
|
|
1248
|
+
cli_util.render_response(result, ctx)
|
|
1249
|
+
|
|
1250
|
+
|
|
1251
|
+
@digital_twin_relationship_group.command(name=cli_util.override('iot.delete_digital_twin_relationship.command_name', 'delete'), help=u"""Deletes the digital twin relationship identified by the specified OCID. \n[Command Reference](deleteDigitalTwinRelationship)""")
|
|
1252
|
+
@cli_util.option('--digital-twin-relationship-id', required=True, help=u"""The [OCID] of digital twin relationship.""")
|
|
1253
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
1254
|
+
@cli_util.confirm_delete_option
|
|
1255
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "DELETED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
1256
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
1257
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
1258
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1259
|
+
@cli_util.help_option
|
|
1260
|
+
@click.pass_context
|
|
1261
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
1262
|
+
@cli_util.wrap_exceptions
|
|
1263
|
+
def delete_digital_twin_relationship(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, digital_twin_relationship_id, if_match):
|
|
1264
|
+
|
|
1265
|
+
if isinstance(digital_twin_relationship_id, six.string_types) and len(digital_twin_relationship_id.strip()) == 0:
|
|
1266
|
+
raise click.UsageError('Parameter --digital-twin-relationship-id cannot be whitespace or empty string')
|
|
1267
|
+
|
|
1268
|
+
kwargs = {}
|
|
1269
|
+
if if_match is not None:
|
|
1270
|
+
kwargs['if_match'] = if_match
|
|
1271
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1272
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1273
|
+
result = client.delete_digital_twin_relationship(
|
|
1274
|
+
digital_twin_relationship_id=digital_twin_relationship_id,
|
|
1275
|
+
**kwargs
|
|
1276
|
+
)
|
|
1277
|
+
if wait_for_state:
|
|
1278
|
+
|
|
1279
|
+
if hasattr(client, 'get_digital_twin_relationship') and callable(getattr(client, 'get_digital_twin_relationship')):
|
|
1280
|
+
try:
|
|
1281
|
+
wait_period_kwargs = {}
|
|
1282
|
+
if max_wait_seconds is not None:
|
|
1283
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
1284
|
+
if wait_interval_seconds is not None:
|
|
1285
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
1286
|
+
|
|
1287
|
+
click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
1288
|
+
oci.wait_until(client, client.get_digital_twin_relationship(digital_twin_relationship_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
|
|
1289
|
+
except oci.exceptions.ServiceError as e:
|
|
1290
|
+
# We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
|
|
1291
|
+
# outcome of a delete operation it is possible that the resource is already gone and so the initial service call
|
|
1292
|
+
# will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
|
|
1293
|
+
# the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
|
|
1294
|
+
# succeed_on_not_found=True to the waiter).
|
|
1295
|
+
#
|
|
1296
|
+
# Any non-404 should still result in the exception being thrown.
|
|
1297
|
+
if e.status == 404:
|
|
1298
|
+
pass
|
|
1299
|
+
else:
|
|
1300
|
+
raise
|
|
1301
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
1302
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
1303
|
+
click.echo('Failed to wait until the resource entered the specified state. Please retrieve the resource to find its current state', file=sys.stderr)
|
|
1304
|
+
cli_util.render_response(result, ctx)
|
|
1305
|
+
sys.exit(2)
|
|
1306
|
+
except Exception:
|
|
1307
|
+
click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
1308
|
+
cli_util.render_response(result, ctx)
|
|
1309
|
+
raise
|
|
1310
|
+
else:
|
|
1311
|
+
click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
|
|
1312
|
+
cli_util.render_response(result, ctx)
|
|
1313
|
+
|
|
1314
|
+
|
|
1315
|
+
@iot_domain_group.command(name=cli_util.override('iot.delete_iot_domain.command_name', 'delete'), help=u"""Deletes the IoT domain identified by the specified OCID. \n[Command Reference](deleteIotDomain)""")
|
|
1316
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""")
|
|
1317
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
1318
|
+
@cli_util.confirm_delete_option
|
|
1319
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
1320
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
1321
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
1322
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1323
|
+
@cli_util.help_option
|
|
1324
|
+
@click.pass_context
|
|
1325
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
1326
|
+
@cli_util.wrap_exceptions
|
|
1327
|
+
def delete_iot_domain(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_id, if_match):
|
|
1328
|
+
|
|
1329
|
+
if isinstance(iot_domain_id, six.string_types) and len(iot_domain_id.strip()) == 0:
|
|
1330
|
+
raise click.UsageError('Parameter --iot-domain-id cannot be whitespace or empty string')
|
|
1331
|
+
|
|
1332
|
+
kwargs = {}
|
|
1333
|
+
if if_match is not None:
|
|
1334
|
+
kwargs['if_match'] = if_match
|
|
1335
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1336
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1337
|
+
result = client.delete_iot_domain(
|
|
1338
|
+
iot_domain_id=iot_domain_id,
|
|
1339
|
+
**kwargs
|
|
1340
|
+
)
|
|
1341
|
+
if wait_for_state:
|
|
1342
|
+
|
|
1343
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
1344
|
+
try:
|
|
1345
|
+
wait_period_kwargs = {}
|
|
1346
|
+
if max_wait_seconds is not None:
|
|
1347
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
1348
|
+
if wait_interval_seconds is not None:
|
|
1349
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
1350
|
+
if 'opc-work-request-id' not in result.headers:
|
|
1351
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
1352
|
+
cli_util.render_response(result, ctx)
|
|
1353
|
+
return
|
|
1354
|
+
|
|
1355
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
1356
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
1357
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
1358
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
1359
|
+
click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
|
|
1360
|
+
cli_util.render_response(result, ctx)
|
|
1361
|
+
sys.exit(2)
|
|
1362
|
+
except Exception:
|
|
1363
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
1364
|
+
cli_util.render_response(result, ctx)
|
|
1365
|
+
raise
|
|
1366
|
+
else:
|
|
1367
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
1368
|
+
cli_util.render_response(result, ctx)
|
|
1369
|
+
|
|
1370
|
+
|
|
1371
|
+
@iot_domain_group_group.command(name=cli_util.override('iot.delete_iot_domain_group.command_name', 'delete'), help=u"""Deletes the IoT domain group identified by the specified OCID. \n[Command Reference](deleteIotDomainGroup)""")
|
|
1372
|
+
@cli_util.option('--iot-domain-group-id', required=True, help=u"""The [OCID] of an IoT Domain Group.""")
|
|
1373
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
1374
|
+
@cli_util.confirm_delete_option
|
|
1375
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
1376
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
1377
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
1378
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1379
|
+
@cli_util.help_option
|
|
1380
|
+
@click.pass_context
|
|
1381
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
1382
|
+
@cli_util.wrap_exceptions
|
|
1383
|
+
def delete_iot_domain_group(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_group_id, if_match):
|
|
1384
|
+
|
|
1385
|
+
if isinstance(iot_domain_group_id, six.string_types) and len(iot_domain_group_id.strip()) == 0:
|
|
1386
|
+
raise click.UsageError('Parameter --iot-domain-group-id cannot be whitespace or empty string')
|
|
1387
|
+
|
|
1388
|
+
kwargs = {}
|
|
1389
|
+
if if_match is not None:
|
|
1390
|
+
kwargs['if_match'] = if_match
|
|
1391
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1392
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1393
|
+
result = client.delete_iot_domain_group(
|
|
1394
|
+
iot_domain_group_id=iot_domain_group_id,
|
|
1395
|
+
**kwargs
|
|
1396
|
+
)
|
|
1397
|
+
if wait_for_state:
|
|
1398
|
+
|
|
1399
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
1400
|
+
try:
|
|
1401
|
+
wait_period_kwargs = {}
|
|
1402
|
+
if max_wait_seconds is not None:
|
|
1403
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
1404
|
+
if wait_interval_seconds is not None:
|
|
1405
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
1406
|
+
if 'opc-work-request-id' not in result.headers:
|
|
1407
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
1408
|
+
cli_util.render_response(result, ctx)
|
|
1409
|
+
return
|
|
1410
|
+
|
|
1411
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
1412
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
1413
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
1414
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
1415
|
+
click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
|
|
1416
|
+
cli_util.render_response(result, ctx)
|
|
1417
|
+
sys.exit(2)
|
|
1418
|
+
except Exception:
|
|
1419
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
1420
|
+
cli_util.render_response(result, ctx)
|
|
1421
|
+
raise
|
|
1422
|
+
else:
|
|
1423
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
1424
|
+
cli_util.render_response(result, ctx)
|
|
1425
|
+
|
|
1426
|
+
|
|
1427
|
+
@digital_twin_adapter_group.command(name=cli_util.override('iot.get_digital_twin_adapter.command_name', 'get'), help=u"""Retrieves the digital twin adapter identified by the specified OCID. \n[Command Reference](getDigitalTwinAdapter)""")
|
|
1428
|
+
@cli_util.option('--digital-twin-adapter-id', required=True, help=u"""The [OCID] of the digital twin adapter.""")
|
|
1429
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1430
|
+
@cli_util.help_option
|
|
1431
|
+
@click.pass_context
|
|
1432
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'iot', 'class': 'DigitalTwinAdapter'})
|
|
1433
|
+
@cli_util.wrap_exceptions
|
|
1434
|
+
def get_digital_twin_adapter(ctx, from_json, digital_twin_adapter_id):
|
|
1435
|
+
|
|
1436
|
+
if isinstance(digital_twin_adapter_id, six.string_types) and len(digital_twin_adapter_id.strip()) == 0:
|
|
1437
|
+
raise click.UsageError('Parameter --digital-twin-adapter-id cannot be whitespace or empty string')
|
|
1438
|
+
|
|
1439
|
+
kwargs = {}
|
|
1440
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1441
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1442
|
+
result = client.get_digital_twin_adapter(
|
|
1443
|
+
digital_twin_adapter_id=digital_twin_adapter_id,
|
|
1444
|
+
**kwargs
|
|
1445
|
+
)
|
|
1446
|
+
cli_util.render_response(result, ctx)
|
|
1447
|
+
|
|
1448
|
+
|
|
1449
|
+
@digital_twin_instance_group.command(name=cli_util.override('iot.get_digital_twin_instance.command_name', 'get'), help=u"""Retrieves the digital twin instance identified by the specified OCID. \n[Command Reference](getDigitalTwinInstance)""")
|
|
1450
|
+
@cli_util.option('--digital-twin-instance-id', required=True, help=u"""The [OCID] of digital twin instance.""")
|
|
1451
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1452
|
+
@cli_util.help_option
|
|
1453
|
+
@click.pass_context
|
|
1454
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'iot', 'class': 'DigitalTwinInstance'})
|
|
1455
|
+
@cli_util.wrap_exceptions
|
|
1456
|
+
def get_digital_twin_instance(ctx, from_json, digital_twin_instance_id):
|
|
1457
|
+
|
|
1458
|
+
if isinstance(digital_twin_instance_id, six.string_types) and len(digital_twin_instance_id.strip()) == 0:
|
|
1459
|
+
raise click.UsageError('Parameter --digital-twin-instance-id cannot be whitespace or empty string')
|
|
1460
|
+
|
|
1461
|
+
kwargs = {}
|
|
1462
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1463
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1464
|
+
result = client.get_digital_twin_instance(
|
|
1465
|
+
digital_twin_instance_id=digital_twin_instance_id,
|
|
1466
|
+
**kwargs
|
|
1467
|
+
)
|
|
1468
|
+
cli_util.render_response(result, ctx)
|
|
1469
|
+
|
|
1470
|
+
|
|
1471
|
+
@digital_twin_instance_group.command(name=cli_util.override('iot.get_digital_twin_instance_content.command_name', 'get-digital-twin-instance-content'), help=u"""Retrieves the latest snapshot data of digital twin instance identified by the specified OCID. \n[Command Reference](getDigitalTwinInstanceContent)""")
|
|
1472
|
+
@cli_util.option('--digital-twin-instance-id', required=True, help=u"""The [OCID] of digital twin instance.""")
|
|
1473
|
+
@cli_util.option('--should-include-metadata', type=click.BOOL, help=u"""If set to true , digital twin instance metadata is included in the response.""")
|
|
1474
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1475
|
+
@cli_util.help_option
|
|
1476
|
+
@click.pass_context
|
|
1477
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
1478
|
+
@cli_util.wrap_exceptions
|
|
1479
|
+
def get_digital_twin_instance_content(ctx, from_json, digital_twin_instance_id, should_include_metadata):
|
|
1480
|
+
|
|
1481
|
+
if isinstance(digital_twin_instance_id, six.string_types) and len(digital_twin_instance_id.strip()) == 0:
|
|
1482
|
+
raise click.UsageError('Parameter --digital-twin-instance-id cannot be whitespace or empty string')
|
|
1483
|
+
|
|
1484
|
+
kwargs = {}
|
|
1485
|
+
if should_include_metadata is not None:
|
|
1486
|
+
kwargs['should_include_metadata'] = should_include_metadata
|
|
1487
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1488
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1489
|
+
result = client.get_digital_twin_instance_content(
|
|
1490
|
+
digital_twin_instance_id=digital_twin_instance_id,
|
|
1491
|
+
**kwargs
|
|
1492
|
+
)
|
|
1493
|
+
cli_util.render_response(result, ctx)
|
|
1494
|
+
|
|
1495
|
+
|
|
1496
|
+
@digital_twin_model_group.command(name=cli_util.override('iot.get_digital_twin_model.command_name', 'get'), help=u"""Retrieves the digital twin model identified by the specified OCID. \n[Command Reference](getDigitalTwinModel)""")
|
|
1497
|
+
@cli_util.option('--digital-twin-model-id', required=True, help=u"""The [OCID] of digital twin model.""")
|
|
1498
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1499
|
+
@cli_util.help_option
|
|
1500
|
+
@click.pass_context
|
|
1501
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'iot', 'class': 'DigitalTwinModel'})
|
|
1502
|
+
@cli_util.wrap_exceptions
|
|
1503
|
+
def get_digital_twin_model(ctx, from_json, digital_twin_model_id):
|
|
1504
|
+
|
|
1505
|
+
if isinstance(digital_twin_model_id, six.string_types) and len(digital_twin_model_id.strip()) == 0:
|
|
1506
|
+
raise click.UsageError('Parameter --digital-twin-model-id cannot be whitespace or empty string')
|
|
1507
|
+
|
|
1508
|
+
kwargs = {}
|
|
1509
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1510
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1511
|
+
result = client.get_digital_twin_model(
|
|
1512
|
+
digital_twin_model_id=digital_twin_model_id,
|
|
1513
|
+
**kwargs
|
|
1514
|
+
)
|
|
1515
|
+
cli_util.render_response(result, ctx)
|
|
1516
|
+
|
|
1517
|
+
|
|
1518
|
+
@digital_twin_model_group.command(name=cli_util.override('iot.get_digital_twin_model_spec.command_name', 'get-digital-twin-model-spec'), help=u"""Retrieves the spec of digital twin model identified by the specified OCID. \n[Command Reference](getDigitalTwinModelSpec)""")
|
|
1519
|
+
@cli_util.option('--digital-twin-model-id', required=True, help=u"""The [OCID] of digital twin model.""")
|
|
1520
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1521
|
+
@cli_util.help_option
|
|
1522
|
+
@click.pass_context
|
|
1523
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
1524
|
+
@cli_util.wrap_exceptions
|
|
1525
|
+
def get_digital_twin_model_spec(ctx, from_json, digital_twin_model_id):
|
|
1526
|
+
|
|
1527
|
+
if isinstance(digital_twin_model_id, six.string_types) and len(digital_twin_model_id.strip()) == 0:
|
|
1528
|
+
raise click.UsageError('Parameter --digital-twin-model-id cannot be whitespace or empty string')
|
|
1529
|
+
|
|
1530
|
+
kwargs = {}
|
|
1531
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1532
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1533
|
+
result = client.get_digital_twin_model_spec(
|
|
1534
|
+
digital_twin_model_id=digital_twin_model_id,
|
|
1535
|
+
**kwargs
|
|
1536
|
+
)
|
|
1537
|
+
cli_util.render_response(result, ctx)
|
|
1538
|
+
|
|
1539
|
+
|
|
1540
|
+
@digital_twin_relationship_group.command(name=cli_util.override('iot.get_digital_twin_relationship.command_name', 'get'), help=u"""Retrieves the digital twin relationship identified by the specified OCID. \n[Command Reference](getDigitalTwinRelationship)""")
|
|
1541
|
+
@cli_util.option('--digital-twin-relationship-id', required=True, help=u"""The [OCID] of digital twin relationship.""")
|
|
1542
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1543
|
+
@cli_util.help_option
|
|
1544
|
+
@click.pass_context
|
|
1545
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'iot', 'class': 'DigitalTwinRelationship'})
|
|
1546
|
+
@cli_util.wrap_exceptions
|
|
1547
|
+
def get_digital_twin_relationship(ctx, from_json, digital_twin_relationship_id):
|
|
1548
|
+
|
|
1549
|
+
if isinstance(digital_twin_relationship_id, six.string_types) and len(digital_twin_relationship_id.strip()) == 0:
|
|
1550
|
+
raise click.UsageError('Parameter --digital-twin-relationship-id cannot be whitespace or empty string')
|
|
1551
|
+
|
|
1552
|
+
kwargs = {}
|
|
1553
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1554
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1555
|
+
result = client.get_digital_twin_relationship(
|
|
1556
|
+
digital_twin_relationship_id=digital_twin_relationship_id,
|
|
1557
|
+
**kwargs
|
|
1558
|
+
)
|
|
1559
|
+
cli_util.render_response(result, ctx)
|
|
1560
|
+
|
|
1561
|
+
|
|
1562
|
+
@iot_domain_group.command(name=cli_util.override('iot.get_iot_domain.command_name', 'get'), help=u"""Retrieves the IoT domain identified by the specified OCID. \n[Command Reference](getIotDomain)""")
|
|
1563
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""")
|
|
1564
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1565
|
+
@cli_util.help_option
|
|
1566
|
+
@click.pass_context
|
|
1567
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'iot', 'class': 'IotDomain'})
|
|
1568
|
+
@cli_util.wrap_exceptions
|
|
1569
|
+
def get_iot_domain(ctx, from_json, iot_domain_id):
|
|
1570
|
+
|
|
1571
|
+
if isinstance(iot_domain_id, six.string_types) and len(iot_domain_id.strip()) == 0:
|
|
1572
|
+
raise click.UsageError('Parameter --iot-domain-id cannot be whitespace or empty string')
|
|
1573
|
+
|
|
1574
|
+
kwargs = {}
|
|
1575
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1576
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1577
|
+
result = client.get_iot_domain(
|
|
1578
|
+
iot_domain_id=iot_domain_id,
|
|
1579
|
+
**kwargs
|
|
1580
|
+
)
|
|
1581
|
+
cli_util.render_response(result, ctx)
|
|
1582
|
+
|
|
1583
|
+
|
|
1584
|
+
@iot_domain_group_group.command(name=cli_util.override('iot.get_iot_domain_group.command_name', 'get'), help=u"""Retrieves the IoT domain group identified by the specified OCID. \n[Command Reference](getIotDomainGroup)""")
|
|
1585
|
+
@cli_util.option('--iot-domain-group-id', required=True, help=u"""The [OCID] of an IoT Domain Group.""")
|
|
1586
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1587
|
+
@cli_util.help_option
|
|
1588
|
+
@click.pass_context
|
|
1589
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'iot', 'class': 'IotDomainGroup'})
|
|
1590
|
+
@cli_util.wrap_exceptions
|
|
1591
|
+
def get_iot_domain_group(ctx, from_json, iot_domain_group_id):
|
|
1592
|
+
|
|
1593
|
+
if isinstance(iot_domain_group_id, six.string_types) and len(iot_domain_group_id.strip()) == 0:
|
|
1594
|
+
raise click.UsageError('Parameter --iot-domain-group-id cannot be whitespace or empty string')
|
|
1595
|
+
|
|
1596
|
+
kwargs = {}
|
|
1597
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1598
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1599
|
+
result = client.get_iot_domain_group(
|
|
1600
|
+
iot_domain_group_id=iot_domain_group_id,
|
|
1601
|
+
**kwargs
|
|
1602
|
+
)
|
|
1603
|
+
cli_util.render_response(result, ctx)
|
|
1604
|
+
|
|
1605
|
+
|
|
1606
|
+
@work_request_group.command(name=cli_util.override('iot.get_work_request.command_name', 'get'), help=u"""Retrieves the status of the work request with the given ID. \n[Command Reference](getWorkRequest)""")
|
|
1607
|
+
@cli_util.option('--work-request-id', required=True, help=u"""The [OCID] of the asynchronous work request.""")
|
|
1608
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1609
|
+
@cli_util.help_option
|
|
1610
|
+
@click.pass_context
|
|
1611
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'iot', 'class': 'WorkRequest'})
|
|
1612
|
+
@cli_util.wrap_exceptions
|
|
1613
|
+
def get_work_request(ctx, from_json, work_request_id):
|
|
1614
|
+
|
|
1615
|
+
if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
|
|
1616
|
+
raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
|
|
1617
|
+
|
|
1618
|
+
kwargs = {}
|
|
1619
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1620
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1621
|
+
result = client.get_work_request(
|
|
1622
|
+
work_request_id=work_request_id,
|
|
1623
|
+
**kwargs
|
|
1624
|
+
)
|
|
1625
|
+
cli_util.render_response(result, ctx)
|
|
1626
|
+
|
|
1627
|
+
|
|
1628
|
+
@digital_twin_instance_group.command(name=cli_util.override('iot.invoke_raw_command.command_name', 'invoke-raw-command'), help=u"""Invokes the raw command on the specified digital twin instance. \n[Command Reference](invokeRawCommand)""")
|
|
1629
|
+
@cli_util.option('--digital-twin-instance-id', required=True, help=u"""The [OCID] of digital twin instance.""")
|
|
1630
|
+
@cli_util.option('--request-endpoint', required=True, help=u"""Device endpoint where request should be forwarded to.""")
|
|
1631
|
+
@cli_util.option('--request-data-format', required=True, type=custom_types.CliCaseInsensitiveChoice(["TEXT", "JSON", "BINARY"]), help=u"""data format: json, binary, text""")
|
|
1632
|
+
@cli_util.option('--request-duration', help=u"""Specified duration by which to send the request by.""")
|
|
1633
|
+
@cli_util.option('--response-duration', help=u"""Specified duration by which to receive the response by.""")
|
|
1634
|
+
@cli_util.option('--response-endpoint', help=u"""Device endpoint from which response is expected to come.""")
|
|
1635
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1636
|
+
@cli_util.help_option
|
|
1637
|
+
@click.pass_context
|
|
1638
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
1639
|
+
@cli_util.wrap_exceptions
|
|
1640
|
+
def invoke_raw_command(ctx, from_json, digital_twin_instance_id, request_endpoint, request_data_format, request_duration, response_duration, response_endpoint):
|
|
1641
|
+
|
|
1642
|
+
if isinstance(digital_twin_instance_id, six.string_types) and len(digital_twin_instance_id.strip()) == 0:
|
|
1643
|
+
raise click.UsageError('Parameter --digital-twin-instance-id cannot be whitespace or empty string')
|
|
1644
|
+
|
|
1645
|
+
kwargs = {}
|
|
1646
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1647
|
+
|
|
1648
|
+
_details = {}
|
|
1649
|
+
_details['requestEndpoint'] = request_endpoint
|
|
1650
|
+
_details['requestDataFormat'] = request_data_format
|
|
1651
|
+
|
|
1652
|
+
if request_duration is not None:
|
|
1653
|
+
_details['requestDuration'] = request_duration
|
|
1654
|
+
|
|
1655
|
+
if response_duration is not None:
|
|
1656
|
+
_details['responseDuration'] = response_duration
|
|
1657
|
+
|
|
1658
|
+
if response_endpoint is not None:
|
|
1659
|
+
_details['responseEndpoint'] = response_endpoint
|
|
1660
|
+
|
|
1661
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1662
|
+
result = client.invoke_raw_command(
|
|
1663
|
+
digital_twin_instance_id=digital_twin_instance_id,
|
|
1664
|
+
invoke_raw_command_details=_details,
|
|
1665
|
+
**kwargs
|
|
1666
|
+
)
|
|
1667
|
+
cli_util.render_response(result, ctx)
|
|
1668
|
+
|
|
1669
|
+
|
|
1670
|
+
@digital_twin_instance_group.command(name=cli_util.override('iot.invoke_raw_command_invoke_raw_binary_command_details.command_name', 'invoke-raw-command-invoke-raw-binary-command-details'), help=u"""Invokes the raw command on the specified digital twin instance. \n[Command Reference](invokeRawCommand)""")
|
|
1671
|
+
@cli_util.option('--digital-twin-instance-id', required=True, help=u"""The [OCID] of digital twin instance.""")
|
|
1672
|
+
@cli_util.option('--request-endpoint', required=True, help=u"""Device endpoint where request should be forwarded to.""")
|
|
1673
|
+
@cli_util.option('--request-duration', help=u"""Specified duration by which to send the request by.""")
|
|
1674
|
+
@cli_util.option('--response-duration', help=u"""Specified duration by which to receive the response by.""")
|
|
1675
|
+
@cli_util.option('--response-endpoint', help=u"""Device endpoint from which response is expected to come.""")
|
|
1676
|
+
@cli_util.option('--request-data-content-type', help=u"""Mime content type of data encoded using base64, default is application/octet-stream""")
|
|
1677
|
+
@cli_util.option('--request-data', help=u"""base 64 encoded request data""")
|
|
1678
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1679
|
+
@cli_util.help_option
|
|
1680
|
+
@click.pass_context
|
|
1681
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
1682
|
+
@cli_util.wrap_exceptions
|
|
1683
|
+
def invoke_raw_command_invoke_raw_binary_command_details(ctx, from_json, digital_twin_instance_id, request_endpoint, request_duration, response_duration, response_endpoint, request_data_content_type, request_data):
|
|
1684
|
+
|
|
1685
|
+
if isinstance(digital_twin_instance_id, six.string_types) and len(digital_twin_instance_id.strip()) == 0:
|
|
1686
|
+
raise click.UsageError('Parameter --digital-twin-instance-id cannot be whitespace or empty string')
|
|
1687
|
+
|
|
1688
|
+
kwargs = {}
|
|
1689
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1690
|
+
|
|
1691
|
+
_details = {}
|
|
1692
|
+
_details['requestEndpoint'] = request_endpoint
|
|
1693
|
+
|
|
1694
|
+
if request_duration is not None:
|
|
1695
|
+
_details['requestDuration'] = request_duration
|
|
1696
|
+
|
|
1697
|
+
if response_duration is not None:
|
|
1698
|
+
_details['responseDuration'] = response_duration
|
|
1699
|
+
|
|
1700
|
+
if response_endpoint is not None:
|
|
1701
|
+
_details['responseEndpoint'] = response_endpoint
|
|
1702
|
+
|
|
1703
|
+
if request_data_content_type is not None:
|
|
1704
|
+
_details['requestDataContentType'] = request_data_content_type
|
|
1705
|
+
|
|
1706
|
+
if request_data is not None:
|
|
1707
|
+
_details['requestData'] = request_data
|
|
1708
|
+
|
|
1709
|
+
_details['requestDataFormat'] = 'BINARY'
|
|
1710
|
+
|
|
1711
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1712
|
+
result = client.invoke_raw_command(
|
|
1713
|
+
digital_twin_instance_id=digital_twin_instance_id,
|
|
1714
|
+
invoke_raw_command_details=_details,
|
|
1715
|
+
**kwargs
|
|
1716
|
+
)
|
|
1717
|
+
cli_util.render_response(result, ctx)
|
|
1718
|
+
|
|
1719
|
+
|
|
1720
|
+
@digital_twin_instance_group.command(name=cli_util.override('iot.invoke_raw_command_invoke_raw_text_command_details.command_name', 'invoke-raw-command-invoke-raw-text-command-details'), help=u"""Invokes the raw command on the specified digital twin instance. \n[Command Reference](invokeRawCommand)""")
|
|
1721
|
+
@cli_util.option('--digital-twin-instance-id', required=True, help=u"""The [OCID] of digital twin instance.""")
|
|
1722
|
+
@cli_util.option('--request-endpoint', required=True, help=u"""Device endpoint where request should be forwarded to.""")
|
|
1723
|
+
@cli_util.option('--request-duration', help=u"""Specified duration by which to send the request by.""")
|
|
1724
|
+
@cli_util.option('--response-duration', help=u"""Specified duration by which to receive the response by.""")
|
|
1725
|
+
@cli_util.option('--response-endpoint', help=u"""Device endpoint from which response is expected to come.""")
|
|
1726
|
+
@cli_util.option('--request-data-content-type', help=u"""Mime content type of text data, default is text/plain""")
|
|
1727
|
+
@cli_util.option('--request-data', help=u"""Plain text request data""")
|
|
1728
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1729
|
+
@cli_util.help_option
|
|
1730
|
+
@click.pass_context
|
|
1731
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
1732
|
+
@cli_util.wrap_exceptions
|
|
1733
|
+
def invoke_raw_command_invoke_raw_text_command_details(ctx, from_json, digital_twin_instance_id, request_endpoint, request_duration, response_duration, response_endpoint, request_data_content_type, request_data):
|
|
1734
|
+
|
|
1735
|
+
if isinstance(digital_twin_instance_id, six.string_types) and len(digital_twin_instance_id.strip()) == 0:
|
|
1736
|
+
raise click.UsageError('Parameter --digital-twin-instance-id cannot be whitespace or empty string')
|
|
1737
|
+
|
|
1738
|
+
kwargs = {}
|
|
1739
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1740
|
+
|
|
1741
|
+
_details = {}
|
|
1742
|
+
_details['requestEndpoint'] = request_endpoint
|
|
1743
|
+
|
|
1744
|
+
if request_duration is not None:
|
|
1745
|
+
_details['requestDuration'] = request_duration
|
|
1746
|
+
|
|
1747
|
+
if response_duration is not None:
|
|
1748
|
+
_details['responseDuration'] = response_duration
|
|
1749
|
+
|
|
1750
|
+
if response_endpoint is not None:
|
|
1751
|
+
_details['responseEndpoint'] = response_endpoint
|
|
1752
|
+
|
|
1753
|
+
if request_data_content_type is not None:
|
|
1754
|
+
_details['requestDataContentType'] = request_data_content_type
|
|
1755
|
+
|
|
1756
|
+
if request_data is not None:
|
|
1757
|
+
_details['requestData'] = request_data
|
|
1758
|
+
|
|
1759
|
+
_details['requestDataFormat'] = 'TEXT'
|
|
1760
|
+
|
|
1761
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1762
|
+
result = client.invoke_raw_command(
|
|
1763
|
+
digital_twin_instance_id=digital_twin_instance_id,
|
|
1764
|
+
invoke_raw_command_details=_details,
|
|
1765
|
+
**kwargs
|
|
1766
|
+
)
|
|
1767
|
+
cli_util.render_response(result, ctx)
|
|
1768
|
+
|
|
1769
|
+
|
|
1770
|
+
@digital_twin_instance_group.command(name=cli_util.override('iot.invoke_raw_command_invoke_raw_json_command_details.command_name', 'invoke-raw-command-invoke-raw-json-command-details'), help=u"""Invokes the raw command on the specified digital twin instance. \n[Command Reference](invokeRawCommand)""")
|
|
1771
|
+
@cli_util.option('--digital-twin-instance-id', required=True, help=u"""The [OCID] of digital twin instance.""")
|
|
1772
|
+
@cli_util.option('--request-endpoint', required=True, help=u"""Device endpoint where request should be forwarded to.""")
|
|
1773
|
+
@cli_util.option('--request-duration', help=u"""Specified duration by which to send the request by.""")
|
|
1774
|
+
@cli_util.option('--response-duration', help=u"""Specified duration by which to receive the response by.""")
|
|
1775
|
+
@cli_util.option('--response-endpoint', help=u"""Device endpoint from which response is expected to come.""")
|
|
1776
|
+
@cli_util.option('--request-data-content-type', help=u"""Mime content type of json data, default is application/json""")
|
|
1777
|
+
@cli_util.option('--request-data', type=custom_types.CLI_COMPLEX_TYPE, help=u"""request data""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
1778
|
+
@json_skeleton_utils.get_cli_json_input_option({'request-data': {'module': 'iot', 'class': 'dict(str, object)'}})
|
|
1779
|
+
@cli_util.help_option
|
|
1780
|
+
@click.pass_context
|
|
1781
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'request-data': {'module': 'iot', 'class': 'dict(str, object)'}})
|
|
1782
|
+
@cli_util.wrap_exceptions
|
|
1783
|
+
def invoke_raw_command_invoke_raw_json_command_details(ctx, from_json, digital_twin_instance_id, request_endpoint, request_duration, response_duration, response_endpoint, request_data_content_type, request_data):
|
|
1784
|
+
|
|
1785
|
+
if isinstance(digital_twin_instance_id, six.string_types) and len(digital_twin_instance_id.strip()) == 0:
|
|
1786
|
+
raise click.UsageError('Parameter --digital-twin-instance-id cannot be whitespace or empty string')
|
|
1787
|
+
|
|
1788
|
+
kwargs = {}
|
|
1789
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1790
|
+
|
|
1791
|
+
_details = {}
|
|
1792
|
+
_details['requestEndpoint'] = request_endpoint
|
|
1793
|
+
|
|
1794
|
+
if request_duration is not None:
|
|
1795
|
+
_details['requestDuration'] = request_duration
|
|
1796
|
+
|
|
1797
|
+
if response_duration is not None:
|
|
1798
|
+
_details['responseDuration'] = response_duration
|
|
1799
|
+
|
|
1800
|
+
if response_endpoint is not None:
|
|
1801
|
+
_details['responseEndpoint'] = response_endpoint
|
|
1802
|
+
|
|
1803
|
+
if request_data_content_type is not None:
|
|
1804
|
+
_details['requestDataContentType'] = request_data_content_type
|
|
1805
|
+
|
|
1806
|
+
if request_data is not None:
|
|
1807
|
+
_details['requestData'] = cli_util.parse_json_parameter("request_data", request_data)
|
|
1808
|
+
|
|
1809
|
+
_details['requestDataFormat'] = 'JSON'
|
|
1810
|
+
|
|
1811
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1812
|
+
result = client.invoke_raw_command(
|
|
1813
|
+
digital_twin_instance_id=digital_twin_instance_id,
|
|
1814
|
+
invoke_raw_command_details=_details,
|
|
1815
|
+
**kwargs
|
|
1816
|
+
)
|
|
1817
|
+
cli_util.render_response(result, ctx)
|
|
1818
|
+
|
|
1819
|
+
|
|
1820
|
+
@digital_twin_adapter_group.command(name=cli_util.override('iot.list_digital_twin_adapters.command_name', 'list'), help=u"""Retrieves a list of digital twin adapters within the specified IoT domain. \n[Command Reference](listDigitalTwinAdapters)""")
|
|
1821
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain in which to list digital twin resources.""")
|
|
1822
|
+
@cli_util.option('--id', help=u"""Filter resources by [OCID]. Must be a valid OCID of the resource type.""")
|
|
1823
|
+
@cli_util.option('--digital-twin-model-spec-uri', help=u"""Filter resources that match the specified URI (DTMI) of the digital twin model.""")
|
|
1824
|
+
@cli_util.option('--digital-twin-model-id', help=u"""Filter resources that match the specified [OCID] of the digital twin model.""")
|
|
1825
|
+
@cli_util.option('--display-name', help=u"""Filter resources whose display name matches the specified value.""")
|
|
1826
|
+
@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "DELETED"]), help=u"""Filter resources whose lifecycleState matches the specified value.""")
|
|
1827
|
+
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination].""")
|
|
1828
|
+
@cli_util.option('--page', help=u"""Page representing the requested page of items.""")
|
|
1829
|
+
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order to use, either ASC (ascending) or DESC (descending).""")
|
|
1830
|
+
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending.""")
|
|
1831
|
+
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
|
|
1832
|
+
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
|
|
1833
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1834
|
+
@cli_util.help_option
|
|
1835
|
+
@click.pass_context
|
|
1836
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'iot', 'class': 'DigitalTwinAdapterCollection'})
|
|
1837
|
+
@cli_util.wrap_exceptions
|
|
1838
|
+
def list_digital_twin_adapters(ctx, from_json, all_pages, page_size, iot_domain_id, id, digital_twin_model_spec_uri, digital_twin_model_id, display_name, lifecycle_state, limit, page, sort_order, sort_by):
|
|
1839
|
+
|
|
1840
|
+
if all_pages and limit:
|
|
1841
|
+
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
|
|
1842
|
+
|
|
1843
|
+
kwargs = {}
|
|
1844
|
+
if id is not None:
|
|
1845
|
+
kwargs['id'] = id
|
|
1846
|
+
if digital_twin_model_spec_uri is not None:
|
|
1847
|
+
kwargs['digital_twin_model_spec_uri'] = digital_twin_model_spec_uri
|
|
1848
|
+
if digital_twin_model_id is not None:
|
|
1849
|
+
kwargs['digital_twin_model_id'] = digital_twin_model_id
|
|
1850
|
+
if display_name is not None:
|
|
1851
|
+
kwargs['display_name'] = display_name
|
|
1852
|
+
if lifecycle_state is not None:
|
|
1853
|
+
kwargs['lifecycle_state'] = lifecycle_state
|
|
1854
|
+
if limit is not None:
|
|
1855
|
+
kwargs['limit'] = limit
|
|
1856
|
+
if page is not None:
|
|
1857
|
+
kwargs['page'] = page
|
|
1858
|
+
if sort_order is not None:
|
|
1859
|
+
kwargs['sort_order'] = sort_order
|
|
1860
|
+
if sort_by is not None:
|
|
1861
|
+
kwargs['sort_by'] = sort_by
|
|
1862
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1863
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1864
|
+
if all_pages:
|
|
1865
|
+
if page_size:
|
|
1866
|
+
kwargs['limit'] = page_size
|
|
1867
|
+
|
|
1868
|
+
result = cli_util.list_call_get_all_results(
|
|
1869
|
+
client.list_digital_twin_adapters,
|
|
1870
|
+
iot_domain_id=iot_domain_id,
|
|
1871
|
+
**kwargs
|
|
1872
|
+
)
|
|
1873
|
+
elif limit is not None:
|
|
1874
|
+
result = cli_util.list_call_get_up_to_limit(
|
|
1875
|
+
client.list_digital_twin_adapters,
|
|
1876
|
+
limit,
|
|
1877
|
+
page_size,
|
|
1878
|
+
iot_domain_id=iot_domain_id,
|
|
1879
|
+
**kwargs
|
|
1880
|
+
)
|
|
1881
|
+
else:
|
|
1882
|
+
result = client.list_digital_twin_adapters(
|
|
1883
|
+
iot_domain_id=iot_domain_id,
|
|
1884
|
+
**kwargs
|
|
1885
|
+
)
|
|
1886
|
+
cli_util.render_response(result, ctx)
|
|
1887
|
+
|
|
1888
|
+
|
|
1889
|
+
@digital_twin_instance_group.command(name=cli_util.override('iot.list_digital_twin_instances.command_name', 'list'), help=u"""Retrieves a list of digital twin instances within the specified IoT domain. \n[Command Reference](listDigitalTwinInstances)""")
|
|
1890
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain in which to list digital twin resources.""")
|
|
1891
|
+
@cli_util.option('--display-name', help=u"""Filter resources whose display name matches the specified value.""")
|
|
1892
|
+
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination].""")
|
|
1893
|
+
@cli_util.option('--page', help=u"""Page representing the requested page of items.""")
|
|
1894
|
+
@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "DELETED"]), help=u"""Filter resources whose lifecycleState matches the specified value.""")
|
|
1895
|
+
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order to use, either ASC (ascending) or DESC (descending).""")
|
|
1896
|
+
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending.""")
|
|
1897
|
+
@cli_util.option('--digital-twin-model-id', help=u"""Filter resources that match the specified [OCID] of the digital twin model.""")
|
|
1898
|
+
@cli_util.option('--digital-twin-model-spec-uri', help=u"""Filter resources that match the specified URI (DTMI) of the digital twin model.""")
|
|
1899
|
+
@cli_util.option('--id', help=u"""Filter resources by [OCID]. Must be a valid OCID of the resource type.""")
|
|
1900
|
+
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
|
|
1901
|
+
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
|
|
1902
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1903
|
+
@cli_util.help_option
|
|
1904
|
+
@click.pass_context
|
|
1905
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'iot', 'class': 'DigitalTwinInstanceCollection'})
|
|
1906
|
+
@cli_util.wrap_exceptions
|
|
1907
|
+
def list_digital_twin_instances(ctx, from_json, all_pages, page_size, iot_domain_id, display_name, limit, page, lifecycle_state, sort_order, sort_by, digital_twin_model_id, digital_twin_model_spec_uri, id):
|
|
1908
|
+
|
|
1909
|
+
if all_pages and limit:
|
|
1910
|
+
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
|
|
1911
|
+
|
|
1912
|
+
kwargs = {}
|
|
1913
|
+
if display_name is not None:
|
|
1914
|
+
kwargs['display_name'] = display_name
|
|
1915
|
+
if limit is not None:
|
|
1916
|
+
kwargs['limit'] = limit
|
|
1917
|
+
if page is not None:
|
|
1918
|
+
kwargs['page'] = page
|
|
1919
|
+
if lifecycle_state is not None:
|
|
1920
|
+
kwargs['lifecycle_state'] = lifecycle_state
|
|
1921
|
+
if sort_order is not None:
|
|
1922
|
+
kwargs['sort_order'] = sort_order
|
|
1923
|
+
if sort_by is not None:
|
|
1924
|
+
kwargs['sort_by'] = sort_by
|
|
1925
|
+
if digital_twin_model_id is not None:
|
|
1926
|
+
kwargs['digital_twin_model_id'] = digital_twin_model_id
|
|
1927
|
+
if digital_twin_model_spec_uri is not None:
|
|
1928
|
+
kwargs['digital_twin_model_spec_uri'] = digital_twin_model_spec_uri
|
|
1929
|
+
if id is not None:
|
|
1930
|
+
kwargs['id'] = id
|
|
1931
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1932
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1933
|
+
if all_pages:
|
|
1934
|
+
if page_size:
|
|
1935
|
+
kwargs['limit'] = page_size
|
|
1936
|
+
|
|
1937
|
+
result = cli_util.list_call_get_all_results(
|
|
1938
|
+
client.list_digital_twin_instances,
|
|
1939
|
+
iot_domain_id=iot_domain_id,
|
|
1940
|
+
**kwargs
|
|
1941
|
+
)
|
|
1942
|
+
elif limit is not None:
|
|
1943
|
+
result = cli_util.list_call_get_up_to_limit(
|
|
1944
|
+
client.list_digital_twin_instances,
|
|
1945
|
+
limit,
|
|
1946
|
+
page_size,
|
|
1947
|
+
iot_domain_id=iot_domain_id,
|
|
1948
|
+
**kwargs
|
|
1949
|
+
)
|
|
1950
|
+
else:
|
|
1951
|
+
result = client.list_digital_twin_instances(
|
|
1952
|
+
iot_domain_id=iot_domain_id,
|
|
1953
|
+
**kwargs
|
|
1954
|
+
)
|
|
1955
|
+
cli_util.render_response(result, ctx)
|
|
1956
|
+
|
|
1957
|
+
|
|
1958
|
+
@digital_twin_model_group.command(name=cli_util.override('iot.list_digital_twin_models.command_name', 'list'), help=u"""Retrieves a list of digital twin models within the specified IoT domain. \n[Command Reference](listDigitalTwinModels)""")
|
|
1959
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain in which to list digital twin resources.""")
|
|
1960
|
+
@cli_util.option('--id', help=u"""Filter resources by [OCID]. Must be a valid OCID of the resource type.""")
|
|
1961
|
+
@cli_util.option('--display-name', help=u"""Filter resources whose display name matches the specified value.""")
|
|
1962
|
+
@cli_util.option('--spec-uri-starts-with', help=u"""Filters resources by spec URI prefix. For example, to search all versions of the `dtmi:example:device;1` model, pass the prefix without the version: `dtmi:example:device`.""")
|
|
1963
|
+
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination].""")
|
|
1964
|
+
@cli_util.option('--page', help=u"""Page representing the requested page of items.""")
|
|
1965
|
+
@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "DELETED"]), help=u"""Filter resources whose lifecycleState matches the specified value.""")
|
|
1966
|
+
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order to use, either ASC (ascending) or DESC (descending).""")
|
|
1967
|
+
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending.""")
|
|
1968
|
+
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
|
|
1969
|
+
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
|
|
1970
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
1971
|
+
@cli_util.help_option
|
|
1972
|
+
@click.pass_context
|
|
1973
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'iot', 'class': 'DigitalTwinModelCollection'})
|
|
1974
|
+
@cli_util.wrap_exceptions
|
|
1975
|
+
def list_digital_twin_models(ctx, from_json, all_pages, page_size, iot_domain_id, id, display_name, spec_uri_starts_with, limit, page, lifecycle_state, sort_order, sort_by):
|
|
1976
|
+
|
|
1977
|
+
if all_pages and limit:
|
|
1978
|
+
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
|
|
1979
|
+
|
|
1980
|
+
kwargs = {}
|
|
1981
|
+
if id is not None:
|
|
1982
|
+
kwargs['id'] = id
|
|
1983
|
+
if display_name is not None:
|
|
1984
|
+
kwargs['display_name'] = display_name
|
|
1985
|
+
if spec_uri_starts_with is not None:
|
|
1986
|
+
kwargs['spec_uri_starts_with'] = spec_uri_starts_with
|
|
1987
|
+
if limit is not None:
|
|
1988
|
+
kwargs['limit'] = limit
|
|
1989
|
+
if page is not None:
|
|
1990
|
+
kwargs['page'] = page
|
|
1991
|
+
if lifecycle_state is not None:
|
|
1992
|
+
kwargs['lifecycle_state'] = lifecycle_state
|
|
1993
|
+
if sort_order is not None:
|
|
1994
|
+
kwargs['sort_order'] = sort_order
|
|
1995
|
+
if sort_by is not None:
|
|
1996
|
+
kwargs['sort_by'] = sort_by
|
|
1997
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
1998
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
1999
|
+
if all_pages:
|
|
2000
|
+
if page_size:
|
|
2001
|
+
kwargs['limit'] = page_size
|
|
2002
|
+
|
|
2003
|
+
result = cli_util.list_call_get_all_results(
|
|
2004
|
+
client.list_digital_twin_models,
|
|
2005
|
+
iot_domain_id=iot_domain_id,
|
|
2006
|
+
**kwargs
|
|
2007
|
+
)
|
|
2008
|
+
elif limit is not None:
|
|
2009
|
+
result = cli_util.list_call_get_up_to_limit(
|
|
2010
|
+
client.list_digital_twin_models,
|
|
2011
|
+
limit,
|
|
2012
|
+
page_size,
|
|
2013
|
+
iot_domain_id=iot_domain_id,
|
|
2014
|
+
**kwargs
|
|
2015
|
+
)
|
|
2016
|
+
else:
|
|
2017
|
+
result = client.list_digital_twin_models(
|
|
2018
|
+
iot_domain_id=iot_domain_id,
|
|
2019
|
+
**kwargs
|
|
2020
|
+
)
|
|
2021
|
+
cli_util.render_response(result, ctx)
|
|
2022
|
+
|
|
2023
|
+
|
|
2024
|
+
@digital_twin_relationship_group.command(name=cli_util.override('iot.list_digital_twin_relationships.command_name', 'list'), help=u"""Retrieves a list of digital twin relationships within the specified IoT domain. \n[Command Reference](listDigitalTwinRelationships)""")
|
|
2025
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain in which to list digital twin resources.""")
|
|
2026
|
+
@cli_util.option('--display-name', help=u"""Filter resources whose display name matches the specified value.""")
|
|
2027
|
+
@cli_util.option('--content-path', help=u"""Filters resources that match the content path of the digital twin relationship.""")
|
|
2028
|
+
@cli_util.option('--source-digital-twin-instance-id', help=u"""Filter resources that match the specified [OCID] of source digital twin instance.""")
|
|
2029
|
+
@cli_util.option('--target-digital-twin-instance-id', help=u"""Filter resources that match the specified [OCID] of target digital twin instance.""")
|
|
2030
|
+
@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "DELETED"]), help=u"""Filter resources whose lifecycleState matches the specified value.""")
|
|
2031
|
+
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination].""")
|
|
2032
|
+
@cli_util.option('--page', help=u"""Page representing the requested page of items.""")
|
|
2033
|
+
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order to use, either ASC (ascending) or DESC (descending).""")
|
|
2034
|
+
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending.""")
|
|
2035
|
+
@cli_util.option('--id', help=u"""Filter resources by [OCID]. Must be a valid OCID of the resource type.""")
|
|
2036
|
+
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
|
|
2037
|
+
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
|
|
2038
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
2039
|
+
@cli_util.help_option
|
|
2040
|
+
@click.pass_context
|
|
2041
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'iot', 'class': 'DigitalTwinRelationshipCollection'})
|
|
2042
|
+
@cli_util.wrap_exceptions
|
|
2043
|
+
def list_digital_twin_relationships(ctx, from_json, all_pages, page_size, iot_domain_id, display_name, content_path, source_digital_twin_instance_id, target_digital_twin_instance_id, lifecycle_state, limit, page, sort_order, sort_by, id):
|
|
2044
|
+
|
|
2045
|
+
if all_pages and limit:
|
|
2046
|
+
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
|
|
2047
|
+
|
|
2048
|
+
kwargs = {}
|
|
2049
|
+
if display_name is not None:
|
|
2050
|
+
kwargs['display_name'] = display_name
|
|
2051
|
+
if content_path is not None:
|
|
2052
|
+
kwargs['content_path'] = content_path
|
|
2053
|
+
if source_digital_twin_instance_id is not None:
|
|
2054
|
+
kwargs['source_digital_twin_instance_id'] = source_digital_twin_instance_id
|
|
2055
|
+
if target_digital_twin_instance_id is not None:
|
|
2056
|
+
kwargs['target_digital_twin_instance_id'] = target_digital_twin_instance_id
|
|
2057
|
+
if lifecycle_state is not None:
|
|
2058
|
+
kwargs['lifecycle_state'] = lifecycle_state
|
|
2059
|
+
if limit is not None:
|
|
2060
|
+
kwargs['limit'] = limit
|
|
2061
|
+
if page is not None:
|
|
2062
|
+
kwargs['page'] = page
|
|
2063
|
+
if sort_order is not None:
|
|
2064
|
+
kwargs['sort_order'] = sort_order
|
|
2065
|
+
if sort_by is not None:
|
|
2066
|
+
kwargs['sort_by'] = sort_by
|
|
2067
|
+
if id is not None:
|
|
2068
|
+
kwargs['id'] = id
|
|
2069
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
2070
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
2071
|
+
if all_pages:
|
|
2072
|
+
if page_size:
|
|
2073
|
+
kwargs['limit'] = page_size
|
|
2074
|
+
|
|
2075
|
+
result = cli_util.list_call_get_all_results(
|
|
2076
|
+
client.list_digital_twin_relationships,
|
|
2077
|
+
iot_domain_id=iot_domain_id,
|
|
2078
|
+
**kwargs
|
|
2079
|
+
)
|
|
2080
|
+
elif limit is not None:
|
|
2081
|
+
result = cli_util.list_call_get_up_to_limit(
|
|
2082
|
+
client.list_digital_twin_relationships,
|
|
2083
|
+
limit,
|
|
2084
|
+
page_size,
|
|
2085
|
+
iot_domain_id=iot_domain_id,
|
|
2086
|
+
**kwargs
|
|
2087
|
+
)
|
|
2088
|
+
else:
|
|
2089
|
+
result = client.list_digital_twin_relationships(
|
|
2090
|
+
iot_domain_id=iot_domain_id,
|
|
2091
|
+
**kwargs
|
|
2092
|
+
)
|
|
2093
|
+
cli_util.render_response(result, ctx)
|
|
2094
|
+
|
|
2095
|
+
|
|
2096
|
+
@iot_domain_group_group.command(name=cli_util.override('iot.list_iot_domain_groups.command_name', 'list'), help=u"""Retrieves a list of IoT domain groups within the specified compartment. \n[Command Reference](listIotDomainGroups)""")
|
|
2097
|
+
@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment in which to list resources.""")
|
|
2098
|
+
@cli_util.option('--id', help=u"""Filter resources by [OCID]. Must be a valid OCID of the resource type.""")
|
|
2099
|
+
@cli_util.option('--display-name', help=u"""Filter resources whose display name matches the specified value.""")
|
|
2100
|
+
@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""Filter resources whose lifecycleState matches the specified value.""")
|
|
2101
|
+
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination].""")
|
|
2102
|
+
@cli_util.option('--page', help=u"""For list pagination: The value of the opc-next-page response header from the previous \"List\" call. For important details on how pagination works, see [List Pagination].""")
|
|
2103
|
+
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order to use, either ASC (ascending) or DESC (descending).""")
|
|
2104
|
+
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending.""")
|
|
2105
|
+
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
|
|
2106
|
+
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
|
|
2107
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
2108
|
+
@cli_util.help_option
|
|
2109
|
+
@click.pass_context
|
|
2110
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'iot', 'class': 'IotDomainGroupCollection'})
|
|
2111
|
+
@cli_util.wrap_exceptions
|
|
2112
|
+
def list_iot_domain_groups(ctx, from_json, all_pages, page_size, compartment_id, id, display_name, lifecycle_state, limit, page, sort_order, sort_by):
|
|
2113
|
+
|
|
2114
|
+
if all_pages and limit:
|
|
2115
|
+
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
|
|
2116
|
+
|
|
2117
|
+
kwargs = {}
|
|
2118
|
+
if id is not None:
|
|
2119
|
+
kwargs['id'] = id
|
|
2120
|
+
if display_name is not None:
|
|
2121
|
+
kwargs['display_name'] = display_name
|
|
2122
|
+
if lifecycle_state is not None:
|
|
2123
|
+
kwargs['lifecycle_state'] = lifecycle_state
|
|
2124
|
+
if limit is not None:
|
|
2125
|
+
kwargs['limit'] = limit
|
|
2126
|
+
if page is not None:
|
|
2127
|
+
kwargs['page'] = page
|
|
2128
|
+
if sort_order is not None:
|
|
2129
|
+
kwargs['sort_order'] = sort_order
|
|
2130
|
+
if sort_by is not None:
|
|
2131
|
+
kwargs['sort_by'] = sort_by
|
|
2132
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
2133
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
2134
|
+
if all_pages:
|
|
2135
|
+
if page_size:
|
|
2136
|
+
kwargs['limit'] = page_size
|
|
2137
|
+
|
|
2138
|
+
result = cli_util.list_call_get_all_results(
|
|
2139
|
+
client.list_iot_domain_groups,
|
|
2140
|
+
compartment_id=compartment_id,
|
|
2141
|
+
**kwargs
|
|
2142
|
+
)
|
|
2143
|
+
elif limit is not None:
|
|
2144
|
+
result = cli_util.list_call_get_up_to_limit(
|
|
2145
|
+
client.list_iot_domain_groups,
|
|
2146
|
+
limit,
|
|
2147
|
+
page_size,
|
|
2148
|
+
compartment_id=compartment_id,
|
|
2149
|
+
**kwargs
|
|
2150
|
+
)
|
|
2151
|
+
else:
|
|
2152
|
+
result = client.list_iot_domain_groups(
|
|
2153
|
+
compartment_id=compartment_id,
|
|
2154
|
+
**kwargs
|
|
2155
|
+
)
|
|
2156
|
+
cli_util.render_response(result, ctx)
|
|
2157
|
+
|
|
2158
|
+
|
|
2159
|
+
@iot_domain_group.command(name=cli_util.override('iot.list_iot_domains.command_name', 'list'), help=u"""Retrieves a list of IoT domains within the specified compartment. \n[Command Reference](listIotDomains)""")
|
|
2160
|
+
@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment in which to list resources.""")
|
|
2161
|
+
@cli_util.option('--id', help=u"""Filter resources by [OCID]. Must be a valid OCID of the resource type.""")
|
|
2162
|
+
@cli_util.option('--iot-domain-group-id', help=u"""Filter resources that match the specified [OCID] of the IoT domain group.""")
|
|
2163
|
+
@cli_util.option('--display-name', help=u"""Filter resources whose display name matches the specified value.""")
|
|
2164
|
+
@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""Filter resources whose lifecycleState matches the specified value.""")
|
|
2165
|
+
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination].""")
|
|
2166
|
+
@cli_util.option('--page', help=u"""For list pagination: The value of the opc-next-page response header from the previous \"List\" call. For important details on how pagination works, see [List Pagination].""")
|
|
2167
|
+
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order to use, either ASC (ascending) or DESC (descending).""")
|
|
2168
|
+
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending.""")
|
|
2169
|
+
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
|
|
2170
|
+
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
|
|
2171
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
2172
|
+
@cli_util.help_option
|
|
2173
|
+
@click.pass_context
|
|
2174
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'iot', 'class': 'IotDomainCollection'})
|
|
2175
|
+
@cli_util.wrap_exceptions
|
|
2176
|
+
def list_iot_domains(ctx, from_json, all_pages, page_size, compartment_id, id, iot_domain_group_id, display_name, lifecycle_state, limit, page, sort_order, sort_by):
|
|
2177
|
+
|
|
2178
|
+
if all_pages and limit:
|
|
2179
|
+
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
|
|
2180
|
+
|
|
2181
|
+
kwargs = {}
|
|
2182
|
+
if id is not None:
|
|
2183
|
+
kwargs['id'] = id
|
|
2184
|
+
if iot_domain_group_id is not None:
|
|
2185
|
+
kwargs['iot_domain_group_id'] = iot_domain_group_id
|
|
2186
|
+
if display_name is not None:
|
|
2187
|
+
kwargs['display_name'] = display_name
|
|
2188
|
+
if lifecycle_state is not None:
|
|
2189
|
+
kwargs['lifecycle_state'] = lifecycle_state
|
|
2190
|
+
if limit is not None:
|
|
2191
|
+
kwargs['limit'] = limit
|
|
2192
|
+
if page is not None:
|
|
2193
|
+
kwargs['page'] = page
|
|
2194
|
+
if sort_order is not None:
|
|
2195
|
+
kwargs['sort_order'] = sort_order
|
|
2196
|
+
if sort_by is not None:
|
|
2197
|
+
kwargs['sort_by'] = sort_by
|
|
2198
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
2199
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
2200
|
+
if all_pages:
|
|
2201
|
+
if page_size:
|
|
2202
|
+
kwargs['limit'] = page_size
|
|
2203
|
+
|
|
2204
|
+
result = cli_util.list_call_get_all_results(
|
|
2205
|
+
client.list_iot_domains,
|
|
2206
|
+
compartment_id=compartment_id,
|
|
2207
|
+
**kwargs
|
|
2208
|
+
)
|
|
2209
|
+
elif limit is not None:
|
|
2210
|
+
result = cli_util.list_call_get_up_to_limit(
|
|
2211
|
+
client.list_iot_domains,
|
|
2212
|
+
limit,
|
|
2213
|
+
page_size,
|
|
2214
|
+
compartment_id=compartment_id,
|
|
2215
|
+
**kwargs
|
|
2216
|
+
)
|
|
2217
|
+
else:
|
|
2218
|
+
result = client.list_iot_domains(
|
|
2219
|
+
compartment_id=compartment_id,
|
|
2220
|
+
**kwargs
|
|
2221
|
+
)
|
|
2222
|
+
cli_util.render_response(result, ctx)
|
|
2223
|
+
|
|
2224
|
+
|
|
2225
|
+
@work_request_group.command(name=cli_util.override('iot.list_work_request_errors.command_name', 'list-work-request-errors'), help=u"""Lists errors associated with the specified work request. \n[Command Reference](listWorkRequestErrors)""")
|
|
2226
|
+
@cli_util.option('--work-request-id', required=True, help=u"""The [OCID] of the asynchronous work request.""")
|
|
2227
|
+
@cli_util.option('--page', help=u"""For list pagination: The value of the opc-next-page response header from the previous \"List\" call. For important details on how pagination works, see [List Pagination].""")
|
|
2228
|
+
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination].""")
|
|
2229
|
+
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated"]), help=u"""The field to sort by. Only one sort order can be specified. The default order for `timeCreated` is descending.""")
|
|
2230
|
+
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order to use, either ASC (ascending) or DESC (descending).""")
|
|
2231
|
+
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
|
|
2232
|
+
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
|
|
2233
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
2234
|
+
@cli_util.help_option
|
|
2235
|
+
@click.pass_context
|
|
2236
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'iot', 'class': 'WorkRequestErrorCollection'})
|
|
2237
|
+
@cli_util.wrap_exceptions
|
|
2238
|
+
def list_work_request_errors(ctx, from_json, all_pages, page_size, work_request_id, page, limit, sort_by, sort_order):
|
|
2239
|
+
|
|
2240
|
+
if all_pages and limit:
|
|
2241
|
+
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
|
|
2242
|
+
|
|
2243
|
+
if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
|
|
2244
|
+
raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
|
|
2245
|
+
|
|
2246
|
+
kwargs = {}
|
|
2247
|
+
if page is not None:
|
|
2248
|
+
kwargs['page'] = page
|
|
2249
|
+
if limit is not None:
|
|
2250
|
+
kwargs['limit'] = limit
|
|
2251
|
+
if sort_by is not None:
|
|
2252
|
+
kwargs['sort_by'] = sort_by
|
|
2253
|
+
if sort_order is not None:
|
|
2254
|
+
kwargs['sort_order'] = sort_order
|
|
2255
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
2256
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
2257
|
+
if all_pages:
|
|
2258
|
+
if page_size:
|
|
2259
|
+
kwargs['limit'] = page_size
|
|
2260
|
+
|
|
2261
|
+
result = cli_util.list_call_get_all_results(
|
|
2262
|
+
client.list_work_request_errors,
|
|
2263
|
+
work_request_id=work_request_id,
|
|
2264
|
+
**kwargs
|
|
2265
|
+
)
|
|
2266
|
+
elif limit is not None:
|
|
2267
|
+
result = cli_util.list_call_get_up_to_limit(
|
|
2268
|
+
client.list_work_request_errors,
|
|
2269
|
+
limit,
|
|
2270
|
+
page_size,
|
|
2271
|
+
work_request_id=work_request_id,
|
|
2272
|
+
**kwargs
|
|
2273
|
+
)
|
|
2274
|
+
else:
|
|
2275
|
+
result = client.list_work_request_errors(
|
|
2276
|
+
work_request_id=work_request_id,
|
|
2277
|
+
**kwargs
|
|
2278
|
+
)
|
|
2279
|
+
cli_util.render_response(result, ctx)
|
|
2280
|
+
|
|
2281
|
+
|
|
2282
|
+
@work_request_group.command(name=cli_util.override('iot.list_work_request_logs.command_name', 'list-work-request-logs'), help=u"""Lists the logs associated with the specified work request. \n[Command Reference](listWorkRequestLogs)""")
|
|
2283
|
+
@cli_util.option('--work-request-id', required=True, help=u"""The [OCID] of the asynchronous work request.""")
|
|
2284
|
+
@cli_util.option('--page', help=u"""For list pagination: The value of the opc-next-page response header from the previous \"List\" call. For important details on how pagination works, see [List Pagination].""")
|
|
2285
|
+
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination].""")
|
|
2286
|
+
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated"]), help=u"""The field to sort by. Only one sort order can be specified. The default order for `timeCreated` is descending.""")
|
|
2287
|
+
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order to use, either ASC (ascending) or DESC (descending).""")
|
|
2288
|
+
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
|
|
2289
|
+
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
|
|
2290
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
2291
|
+
@cli_util.help_option
|
|
2292
|
+
@click.pass_context
|
|
2293
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'iot', 'class': 'WorkRequestLogEntryCollection'})
|
|
2294
|
+
@cli_util.wrap_exceptions
|
|
2295
|
+
def list_work_request_logs(ctx, from_json, all_pages, page_size, work_request_id, page, limit, sort_by, sort_order):
|
|
2296
|
+
|
|
2297
|
+
if all_pages and limit:
|
|
2298
|
+
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
|
|
2299
|
+
|
|
2300
|
+
if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
|
|
2301
|
+
raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
|
|
2302
|
+
|
|
2303
|
+
kwargs = {}
|
|
2304
|
+
if page is not None:
|
|
2305
|
+
kwargs['page'] = page
|
|
2306
|
+
if limit is not None:
|
|
2307
|
+
kwargs['limit'] = limit
|
|
2308
|
+
if sort_by is not None:
|
|
2309
|
+
kwargs['sort_by'] = sort_by
|
|
2310
|
+
if sort_order is not None:
|
|
2311
|
+
kwargs['sort_order'] = sort_order
|
|
2312
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
2313
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
2314
|
+
if all_pages:
|
|
2315
|
+
if page_size:
|
|
2316
|
+
kwargs['limit'] = page_size
|
|
2317
|
+
|
|
2318
|
+
result = cli_util.list_call_get_all_results(
|
|
2319
|
+
client.list_work_request_logs,
|
|
2320
|
+
work_request_id=work_request_id,
|
|
2321
|
+
**kwargs
|
|
2322
|
+
)
|
|
2323
|
+
elif limit is not None:
|
|
2324
|
+
result = cli_util.list_call_get_up_to_limit(
|
|
2325
|
+
client.list_work_request_logs,
|
|
2326
|
+
limit,
|
|
2327
|
+
page_size,
|
|
2328
|
+
work_request_id=work_request_id,
|
|
2329
|
+
**kwargs
|
|
2330
|
+
)
|
|
2331
|
+
else:
|
|
2332
|
+
result = client.list_work_request_logs(
|
|
2333
|
+
work_request_id=work_request_id,
|
|
2334
|
+
**kwargs
|
|
2335
|
+
)
|
|
2336
|
+
cli_util.render_response(result, ctx)
|
|
2337
|
+
|
|
2338
|
+
|
|
2339
|
+
@work_request_group.command(name=cli_util.override('iot.list_work_requests.command_name', 'list'), help=u"""Lists work requests in the specified compartment. \n[Command Reference](listWorkRequests)""")
|
|
2340
|
+
@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment in which to list resources.""")
|
|
2341
|
+
@cli_util.option('--id', help=u"""The [OCID] of the asynchronous work request.""")
|
|
2342
|
+
@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED"]), help=u"""A filter to return only the resources that match the given lifecycle state.""")
|
|
2343
|
+
@cli_util.option('--resource-id', help=u"""The [OCID] of the resource affected by the work request.""")
|
|
2344
|
+
@cli_util.option('--page', help=u"""For list pagination: The value of the opc-next-page response header from the previous \"List\" call. For important details on how pagination works, see [List Pagination].""")
|
|
2345
|
+
@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination].""")
|
|
2346
|
+
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order to use, either ASC (ascending) or DESC (descending).""")
|
|
2347
|
+
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeAccepted"]), help=u"""The field to sort by. Only one sort order can be specified. Default order for `timeAccepted` is descending.""")
|
|
2348
|
+
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
|
|
2349
|
+
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
|
|
2350
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
2351
|
+
@cli_util.help_option
|
|
2352
|
+
@click.pass_context
|
|
2353
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'iot', 'class': 'WorkRequestSummaryCollection'})
|
|
2354
|
+
@cli_util.wrap_exceptions
|
|
2355
|
+
def list_work_requests(ctx, from_json, all_pages, page_size, compartment_id, id, status, resource_id, page, limit, sort_order, sort_by):
|
|
2356
|
+
|
|
2357
|
+
if all_pages and limit:
|
|
2358
|
+
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
|
|
2359
|
+
|
|
2360
|
+
kwargs = {}
|
|
2361
|
+
if id is not None:
|
|
2362
|
+
kwargs['id'] = id
|
|
2363
|
+
if status is not None:
|
|
2364
|
+
kwargs['status'] = status
|
|
2365
|
+
if resource_id is not None:
|
|
2366
|
+
kwargs['resource_id'] = resource_id
|
|
2367
|
+
if page is not None:
|
|
2368
|
+
kwargs['page'] = page
|
|
2369
|
+
if limit is not None:
|
|
2370
|
+
kwargs['limit'] = limit
|
|
2371
|
+
if sort_order is not None:
|
|
2372
|
+
kwargs['sort_order'] = sort_order
|
|
2373
|
+
if sort_by is not None:
|
|
2374
|
+
kwargs['sort_by'] = sort_by
|
|
2375
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
2376
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
2377
|
+
if all_pages:
|
|
2378
|
+
if page_size:
|
|
2379
|
+
kwargs['limit'] = page_size
|
|
2380
|
+
|
|
2381
|
+
result = cli_util.list_call_get_all_results(
|
|
2382
|
+
client.list_work_requests,
|
|
2383
|
+
compartment_id=compartment_id,
|
|
2384
|
+
**kwargs
|
|
2385
|
+
)
|
|
2386
|
+
elif limit is not None:
|
|
2387
|
+
result = cli_util.list_call_get_up_to_limit(
|
|
2388
|
+
client.list_work_requests,
|
|
2389
|
+
limit,
|
|
2390
|
+
page_size,
|
|
2391
|
+
compartment_id=compartment_id,
|
|
2392
|
+
**kwargs
|
|
2393
|
+
)
|
|
2394
|
+
else:
|
|
2395
|
+
result = client.list_work_requests(
|
|
2396
|
+
compartment_id=compartment_id,
|
|
2397
|
+
**kwargs
|
|
2398
|
+
)
|
|
2399
|
+
cli_util.render_response(result, ctx)
|
|
2400
|
+
|
|
2401
|
+
|
|
2402
|
+
@digital_twin_adapter_group.command(name=cli_util.override('iot.update_digital_twin_adapter.command_name', 'update'), help=u"""Updates the details of digital twin adapter identified by the specified OCID. \n[Command Reference](updateDigitalTwinAdapter)""")
|
|
2403
|
+
@cli_util.option('--digital-twin-adapter-id', required=True, help=u"""The [OCID] of the digital twin adapter.""")
|
|
2404
|
+
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""")
|
|
2405
|
+
@cli_util.option('--description', help=u"""A short description of the resource.""")
|
|
2406
|
+
@cli_util.option('--inbound-envelope', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
2407
|
+
@cli_util.option('--inbound-routes', type=custom_types.CLI_COMPLEX_TYPE, help=u"""list of routes
|
|
2408
|
+
|
|
2409
|
+
This option is a JSON list with items of type DigitalTwinAdapterInboundRoute. For documentation on DigitalTwinAdapterInboundRoute please see our API reference: https://docs.cloud.oracle.com/api/#/en/iot/20250531/datatypes/DigitalTwinAdapterInboundRoute.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
2410
|
+
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
|
|
2411
|
+
|
|
2412
|
+
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
2413
|
+
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
|
|
2414
|
+
|
|
2415
|
+
Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
2416
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
2417
|
+
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
|
|
2418
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "DELETED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
2419
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
2420
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
2421
|
+
@json_skeleton_utils.get_cli_json_input_option({'inbound-envelope': {'module': 'iot', 'class': 'DigitalTwinAdapterInboundEnvelope'}, 'inbound-routes': {'module': 'iot', 'class': 'list[DigitalTwinAdapterInboundRoute]'}, 'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}})
|
|
2422
|
+
@cli_util.help_option
|
|
2423
|
+
@click.pass_context
|
|
2424
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'inbound-envelope': {'module': 'iot', 'class': 'DigitalTwinAdapterInboundEnvelope'}, 'inbound-routes': {'module': 'iot', 'class': 'list[DigitalTwinAdapterInboundRoute]'}, 'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'iot', 'class': 'DigitalTwinAdapter'})
|
|
2425
|
+
@cli_util.wrap_exceptions
|
|
2426
|
+
def update_digital_twin_adapter(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, digital_twin_adapter_id, display_name, description, inbound_envelope, inbound_routes, freeform_tags, defined_tags, if_match):
|
|
2427
|
+
|
|
2428
|
+
if isinstance(digital_twin_adapter_id, six.string_types) and len(digital_twin_adapter_id.strip()) == 0:
|
|
2429
|
+
raise click.UsageError('Parameter --digital-twin-adapter-id cannot be whitespace or empty string')
|
|
2430
|
+
if not force:
|
|
2431
|
+
if inbound_envelope or inbound_routes or freeform_tags or defined_tags:
|
|
2432
|
+
if not click.confirm("WARNING: Updates to inbound-envelope and inbound-routes and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
|
|
2433
|
+
ctx.abort()
|
|
2434
|
+
|
|
2435
|
+
kwargs = {}
|
|
2436
|
+
if if_match is not None:
|
|
2437
|
+
kwargs['if_match'] = if_match
|
|
2438
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
2439
|
+
|
|
2440
|
+
_details = {}
|
|
2441
|
+
|
|
2442
|
+
if display_name is not None:
|
|
2443
|
+
_details['displayName'] = display_name
|
|
2444
|
+
|
|
2445
|
+
if description is not None:
|
|
2446
|
+
_details['description'] = description
|
|
2447
|
+
|
|
2448
|
+
if inbound_envelope is not None:
|
|
2449
|
+
_details['inboundEnvelope'] = cli_util.parse_json_parameter("inbound_envelope", inbound_envelope)
|
|
2450
|
+
|
|
2451
|
+
if inbound_routes is not None:
|
|
2452
|
+
_details['inboundRoutes'] = cli_util.parse_json_parameter("inbound_routes", inbound_routes)
|
|
2453
|
+
|
|
2454
|
+
if freeform_tags is not None:
|
|
2455
|
+
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
|
|
2456
|
+
|
|
2457
|
+
if defined_tags is not None:
|
|
2458
|
+
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
|
|
2459
|
+
|
|
2460
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
2461
|
+
result = client.update_digital_twin_adapter(
|
|
2462
|
+
digital_twin_adapter_id=digital_twin_adapter_id,
|
|
2463
|
+
update_digital_twin_adapter_details=_details,
|
|
2464
|
+
**kwargs
|
|
2465
|
+
)
|
|
2466
|
+
if wait_for_state:
|
|
2467
|
+
|
|
2468
|
+
if hasattr(client, 'get_digital_twin_adapter') and callable(getattr(client, 'get_digital_twin_adapter')):
|
|
2469
|
+
try:
|
|
2470
|
+
wait_period_kwargs = {}
|
|
2471
|
+
if max_wait_seconds is not None:
|
|
2472
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
2473
|
+
if wait_interval_seconds is not None:
|
|
2474
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
2475
|
+
|
|
2476
|
+
click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
2477
|
+
result = oci.wait_until(client, client.get_digital_twin_adapter(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
|
|
2478
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
2479
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
2480
|
+
click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
2481
|
+
cli_util.render_response(result, ctx)
|
|
2482
|
+
sys.exit(2)
|
|
2483
|
+
except Exception:
|
|
2484
|
+
click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
2485
|
+
cli_util.render_response(result, ctx)
|
|
2486
|
+
raise
|
|
2487
|
+
else:
|
|
2488
|
+
click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
|
|
2489
|
+
cli_util.render_response(result, ctx)
|
|
2490
|
+
|
|
2491
|
+
|
|
2492
|
+
@digital_twin_instance_group.command(name=cli_util.override('iot.update_digital_twin_instance.command_name', 'update'), help=u"""Updates the details of digital twin instance identified by the specified OCID. \n[Command Reference](updateDigitalTwinInstance)""")
|
|
2493
|
+
@cli_util.option('--digital-twin-instance-id', required=True, help=u"""The [OCID] of digital twin instance.""")
|
|
2494
|
+
@cli_util.option('--auth-id', help=u"""The [OCID] of the resource (like VaultSecret, ClientCertificate etc.,) used to authenticate the digital twin instance.""")
|
|
2495
|
+
@cli_util.option('--external-key', help=u"""A unique identifier for the physical entity (typically an IoT device) represented by the digital twin instance. This could be a Bluetooth address, Ethernet MAC address, or serial number, depending on the use case. If not provided, the system will automatically generate one.""")
|
|
2496
|
+
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""")
|
|
2497
|
+
@cli_util.option('--description', help=u"""A short description of the resource.""")
|
|
2498
|
+
@cli_util.option('--digital-twin-adapter-id', help=u"""The [OCID] of the digital twin adapter.""")
|
|
2499
|
+
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
|
|
2500
|
+
|
|
2501
|
+
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
2502
|
+
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
|
|
2503
|
+
|
|
2504
|
+
Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
2505
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
2506
|
+
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
|
|
2507
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "DELETED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
2508
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
2509
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
2510
|
+
@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}})
|
|
2511
|
+
@cli_util.help_option
|
|
2512
|
+
@click.pass_context
|
|
2513
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'iot', 'class': 'DigitalTwinInstance'})
|
|
2514
|
+
@cli_util.wrap_exceptions
|
|
2515
|
+
def update_digital_twin_instance(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, digital_twin_instance_id, auth_id, external_key, display_name, description, digital_twin_adapter_id, freeform_tags, defined_tags, if_match):
|
|
2516
|
+
|
|
2517
|
+
if isinstance(digital_twin_instance_id, six.string_types) and len(digital_twin_instance_id.strip()) == 0:
|
|
2518
|
+
raise click.UsageError('Parameter --digital-twin-instance-id cannot be whitespace or empty string')
|
|
2519
|
+
if not force:
|
|
2520
|
+
if freeform_tags or defined_tags:
|
|
2521
|
+
if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
|
|
2522
|
+
ctx.abort()
|
|
2523
|
+
|
|
2524
|
+
kwargs = {}
|
|
2525
|
+
if if_match is not None:
|
|
2526
|
+
kwargs['if_match'] = if_match
|
|
2527
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
2528
|
+
|
|
2529
|
+
_details = {}
|
|
2530
|
+
|
|
2531
|
+
if auth_id is not None:
|
|
2532
|
+
_details['authId'] = auth_id
|
|
2533
|
+
|
|
2534
|
+
if external_key is not None:
|
|
2535
|
+
_details['externalKey'] = external_key
|
|
2536
|
+
|
|
2537
|
+
if display_name is not None:
|
|
2538
|
+
_details['displayName'] = display_name
|
|
2539
|
+
|
|
2540
|
+
if description is not None:
|
|
2541
|
+
_details['description'] = description
|
|
2542
|
+
|
|
2543
|
+
if digital_twin_adapter_id is not None:
|
|
2544
|
+
_details['digitalTwinAdapterId'] = digital_twin_adapter_id
|
|
2545
|
+
|
|
2546
|
+
if freeform_tags is not None:
|
|
2547
|
+
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
|
|
2548
|
+
|
|
2549
|
+
if defined_tags is not None:
|
|
2550
|
+
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
|
|
2551
|
+
|
|
2552
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
2553
|
+
result = client.update_digital_twin_instance(
|
|
2554
|
+
digital_twin_instance_id=digital_twin_instance_id,
|
|
2555
|
+
update_digital_twin_instance_details=_details,
|
|
2556
|
+
**kwargs
|
|
2557
|
+
)
|
|
2558
|
+
if wait_for_state:
|
|
2559
|
+
|
|
2560
|
+
if hasattr(client, 'get_digital_twin_instance') and callable(getattr(client, 'get_digital_twin_instance')):
|
|
2561
|
+
try:
|
|
2562
|
+
wait_period_kwargs = {}
|
|
2563
|
+
if max_wait_seconds is not None:
|
|
2564
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
2565
|
+
if wait_interval_seconds is not None:
|
|
2566
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
2567
|
+
|
|
2568
|
+
click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
2569
|
+
result = oci.wait_until(client, client.get_digital_twin_instance(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
|
|
2570
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
2571
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
2572
|
+
click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
2573
|
+
cli_util.render_response(result, ctx)
|
|
2574
|
+
sys.exit(2)
|
|
2575
|
+
except Exception:
|
|
2576
|
+
click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
2577
|
+
cli_util.render_response(result, ctx)
|
|
2578
|
+
raise
|
|
2579
|
+
else:
|
|
2580
|
+
click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
|
|
2581
|
+
cli_util.render_response(result, ctx)
|
|
2582
|
+
|
|
2583
|
+
|
|
2584
|
+
@digital_twin_model_group.command(name=cli_util.override('iot.update_digital_twin_model.command_name', 'update'), help=u"""Updates the details of the digital twin model identified by the specified OCID. \n[Command Reference](updateDigitalTwinModel)""")
|
|
2585
|
+
@cli_util.option('--digital-twin-model-id', required=True, help=u"""The [OCID] of digital twin model.""")
|
|
2586
|
+
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. If left blank, the display name will be derived from the spec.""")
|
|
2587
|
+
@cli_util.option('--description', help=u"""A short description of the resource. If left blank, the description will be derived from the spec.""")
|
|
2588
|
+
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
|
|
2589
|
+
|
|
2590
|
+
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
2591
|
+
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
|
|
2592
|
+
|
|
2593
|
+
Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
2594
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
2595
|
+
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
|
|
2596
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "DELETED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
2597
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
2598
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
2599
|
+
@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}})
|
|
2600
|
+
@cli_util.help_option
|
|
2601
|
+
@click.pass_context
|
|
2602
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'iot', 'class': 'DigitalTwinModel'})
|
|
2603
|
+
@cli_util.wrap_exceptions
|
|
2604
|
+
def update_digital_twin_model(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, digital_twin_model_id, display_name, description, freeform_tags, defined_tags, if_match):
|
|
2605
|
+
|
|
2606
|
+
if isinstance(digital_twin_model_id, six.string_types) and len(digital_twin_model_id.strip()) == 0:
|
|
2607
|
+
raise click.UsageError('Parameter --digital-twin-model-id cannot be whitespace or empty string')
|
|
2608
|
+
if not force:
|
|
2609
|
+
if freeform_tags or defined_tags:
|
|
2610
|
+
if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
|
|
2611
|
+
ctx.abort()
|
|
2612
|
+
|
|
2613
|
+
kwargs = {}
|
|
2614
|
+
if if_match is not None:
|
|
2615
|
+
kwargs['if_match'] = if_match
|
|
2616
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
2617
|
+
|
|
2618
|
+
_details = {}
|
|
2619
|
+
|
|
2620
|
+
if display_name is not None:
|
|
2621
|
+
_details['displayName'] = display_name
|
|
2622
|
+
|
|
2623
|
+
if description is not None:
|
|
2624
|
+
_details['description'] = description
|
|
2625
|
+
|
|
2626
|
+
if freeform_tags is not None:
|
|
2627
|
+
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
|
|
2628
|
+
|
|
2629
|
+
if defined_tags is not None:
|
|
2630
|
+
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
|
|
2631
|
+
|
|
2632
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
2633
|
+
result = client.update_digital_twin_model(
|
|
2634
|
+
digital_twin_model_id=digital_twin_model_id,
|
|
2635
|
+
update_digital_twin_model_details=_details,
|
|
2636
|
+
**kwargs
|
|
2637
|
+
)
|
|
2638
|
+
if wait_for_state:
|
|
2639
|
+
|
|
2640
|
+
if hasattr(client, 'get_digital_twin_model') and callable(getattr(client, 'get_digital_twin_model')):
|
|
2641
|
+
try:
|
|
2642
|
+
wait_period_kwargs = {}
|
|
2643
|
+
if max_wait_seconds is not None:
|
|
2644
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
2645
|
+
if wait_interval_seconds is not None:
|
|
2646
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
2647
|
+
|
|
2648
|
+
click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
2649
|
+
result = oci.wait_until(client, client.get_digital_twin_model(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
|
|
2650
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
2651
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
2652
|
+
click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
2653
|
+
cli_util.render_response(result, ctx)
|
|
2654
|
+
sys.exit(2)
|
|
2655
|
+
except Exception:
|
|
2656
|
+
click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
2657
|
+
cli_util.render_response(result, ctx)
|
|
2658
|
+
raise
|
|
2659
|
+
else:
|
|
2660
|
+
click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
|
|
2661
|
+
cli_util.render_response(result, ctx)
|
|
2662
|
+
|
|
2663
|
+
|
|
2664
|
+
@digital_twin_relationship_group.command(name=cli_util.override('iot.update_digital_twin_relationship.command_name', 'update'), help=u"""Updates the details of digital twin relationship identified by the specified OCID. \n[Command Reference](updateDigitalTwinRelationship)""")
|
|
2665
|
+
@cli_util.option('--digital-twin-relationship-id', required=True, help=u"""The [OCID] of digital twin relationship.""")
|
|
2666
|
+
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""")
|
|
2667
|
+
@cli_util.option('--description', help=u"""A short description of the resource.""")
|
|
2668
|
+
@cli_util.option('--content', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The value(s) of the relationship properties defined in the source digital twin model.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
2669
|
+
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
|
|
2670
|
+
|
|
2671
|
+
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
2672
|
+
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
|
|
2673
|
+
|
|
2674
|
+
Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
2675
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
2676
|
+
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
|
|
2677
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "DELETED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
2678
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
2679
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
2680
|
+
@json_skeleton_utils.get_cli_json_input_option({'content': {'module': 'iot', 'class': 'dict(str, object)'}, 'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}})
|
|
2681
|
+
@cli_util.help_option
|
|
2682
|
+
@click.pass_context
|
|
2683
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'content': {'module': 'iot', 'class': 'dict(str, object)'}, 'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'iot', 'class': 'DigitalTwinRelationship'})
|
|
2684
|
+
@cli_util.wrap_exceptions
|
|
2685
|
+
def update_digital_twin_relationship(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, digital_twin_relationship_id, display_name, description, content, freeform_tags, defined_tags, if_match):
|
|
2686
|
+
|
|
2687
|
+
if isinstance(digital_twin_relationship_id, six.string_types) and len(digital_twin_relationship_id.strip()) == 0:
|
|
2688
|
+
raise click.UsageError('Parameter --digital-twin-relationship-id cannot be whitespace or empty string')
|
|
2689
|
+
if not force:
|
|
2690
|
+
if content or freeform_tags or defined_tags:
|
|
2691
|
+
if not click.confirm("WARNING: Updates to content and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
|
|
2692
|
+
ctx.abort()
|
|
2693
|
+
|
|
2694
|
+
kwargs = {}
|
|
2695
|
+
if if_match is not None:
|
|
2696
|
+
kwargs['if_match'] = if_match
|
|
2697
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
2698
|
+
|
|
2699
|
+
_details = {}
|
|
2700
|
+
|
|
2701
|
+
if display_name is not None:
|
|
2702
|
+
_details['displayName'] = display_name
|
|
2703
|
+
|
|
2704
|
+
if description is not None:
|
|
2705
|
+
_details['description'] = description
|
|
2706
|
+
|
|
2707
|
+
if content is not None:
|
|
2708
|
+
_details['content'] = cli_util.parse_json_parameter("content", content)
|
|
2709
|
+
|
|
2710
|
+
if freeform_tags is not None:
|
|
2711
|
+
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
|
|
2712
|
+
|
|
2713
|
+
if defined_tags is not None:
|
|
2714
|
+
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
|
|
2715
|
+
|
|
2716
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
2717
|
+
result = client.update_digital_twin_relationship(
|
|
2718
|
+
digital_twin_relationship_id=digital_twin_relationship_id,
|
|
2719
|
+
update_digital_twin_relationship_details=_details,
|
|
2720
|
+
**kwargs
|
|
2721
|
+
)
|
|
2722
|
+
if wait_for_state:
|
|
2723
|
+
|
|
2724
|
+
if hasattr(client, 'get_digital_twin_relationship') and callable(getattr(client, 'get_digital_twin_relationship')):
|
|
2725
|
+
try:
|
|
2726
|
+
wait_period_kwargs = {}
|
|
2727
|
+
if max_wait_seconds is not None:
|
|
2728
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
2729
|
+
if wait_interval_seconds is not None:
|
|
2730
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
2731
|
+
|
|
2732
|
+
click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
2733
|
+
result = oci.wait_until(client, client.get_digital_twin_relationship(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
|
|
2734
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
2735
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
2736
|
+
click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
2737
|
+
cli_util.render_response(result, ctx)
|
|
2738
|
+
sys.exit(2)
|
|
2739
|
+
except Exception:
|
|
2740
|
+
click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
2741
|
+
cli_util.render_response(result, ctx)
|
|
2742
|
+
raise
|
|
2743
|
+
else:
|
|
2744
|
+
click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
|
|
2745
|
+
cli_util.render_response(result, ctx)
|
|
2746
|
+
|
|
2747
|
+
|
|
2748
|
+
@iot_domain_group.command(name=cli_util.override('iot.update_iot_domain.command_name', 'update'), help=u"""Updates the details of IoT domain identified by the specified OCID. \n[Command Reference](updateIotDomain)""")
|
|
2749
|
+
@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""")
|
|
2750
|
+
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""")
|
|
2751
|
+
@cli_util.option('--description', help=u"""A short description of the resource.""")
|
|
2752
|
+
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
|
|
2753
|
+
|
|
2754
|
+
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
2755
|
+
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
|
|
2756
|
+
|
|
2757
|
+
Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
2758
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
2759
|
+
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
|
|
2760
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
2761
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
2762
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
2763
|
+
@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}})
|
|
2764
|
+
@cli_util.help_option
|
|
2765
|
+
@click.pass_context
|
|
2766
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}})
|
|
2767
|
+
@cli_util.wrap_exceptions
|
|
2768
|
+
def update_iot_domain(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_id, display_name, description, freeform_tags, defined_tags, if_match):
|
|
2769
|
+
|
|
2770
|
+
if isinstance(iot_domain_id, six.string_types) and len(iot_domain_id.strip()) == 0:
|
|
2771
|
+
raise click.UsageError('Parameter --iot-domain-id cannot be whitespace or empty string')
|
|
2772
|
+
if not force:
|
|
2773
|
+
if freeform_tags or defined_tags:
|
|
2774
|
+
if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
|
|
2775
|
+
ctx.abort()
|
|
2776
|
+
|
|
2777
|
+
kwargs = {}
|
|
2778
|
+
if if_match is not None:
|
|
2779
|
+
kwargs['if_match'] = if_match
|
|
2780
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
2781
|
+
|
|
2782
|
+
_details = {}
|
|
2783
|
+
|
|
2784
|
+
if display_name is not None:
|
|
2785
|
+
_details['displayName'] = display_name
|
|
2786
|
+
|
|
2787
|
+
if description is not None:
|
|
2788
|
+
_details['description'] = description
|
|
2789
|
+
|
|
2790
|
+
if freeform_tags is not None:
|
|
2791
|
+
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
|
|
2792
|
+
|
|
2793
|
+
if defined_tags is not None:
|
|
2794
|
+
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
|
|
2795
|
+
|
|
2796
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
2797
|
+
result = client.update_iot_domain(
|
|
2798
|
+
iot_domain_id=iot_domain_id,
|
|
2799
|
+
update_iot_domain_details=_details,
|
|
2800
|
+
**kwargs
|
|
2801
|
+
)
|
|
2802
|
+
if wait_for_state:
|
|
2803
|
+
|
|
2804
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
2805
|
+
try:
|
|
2806
|
+
wait_period_kwargs = {}
|
|
2807
|
+
if max_wait_seconds is not None:
|
|
2808
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
2809
|
+
if wait_interval_seconds is not None:
|
|
2810
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
2811
|
+
if 'opc-work-request-id' not in result.headers:
|
|
2812
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
2813
|
+
cli_util.render_response(result, ctx)
|
|
2814
|
+
return
|
|
2815
|
+
|
|
2816
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
2817
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
2818
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
2819
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
2820
|
+
click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
2821
|
+
cli_util.render_response(result, ctx)
|
|
2822
|
+
sys.exit(2)
|
|
2823
|
+
except Exception:
|
|
2824
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
2825
|
+
cli_util.render_response(result, ctx)
|
|
2826
|
+
raise
|
|
2827
|
+
else:
|
|
2828
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
2829
|
+
cli_util.render_response(result, ctx)
|
|
2830
|
+
|
|
2831
|
+
|
|
2832
|
+
@iot_domain_group_group.command(name=cli_util.override('iot.update_iot_domain_group.command_name', 'update'), help=u"""Updates the details of IoT domain group identified by the specified OCID. \n[Command Reference](updateIotDomainGroup)""")
|
|
2833
|
+
@cli_util.option('--iot-domain-group-id', required=True, help=u"""The [OCID] of an IoT Domain Group.""")
|
|
2834
|
+
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""")
|
|
2835
|
+
@cli_util.option('--description', help=u"""A short description of the resource.""")
|
|
2836
|
+
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
|
|
2837
|
+
|
|
2838
|
+
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
2839
|
+
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
|
|
2840
|
+
|
|
2841
|
+
Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
2842
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
|
|
2843
|
+
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
|
|
2844
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
|
|
2845
|
+
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
|
|
2846
|
+
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
|
|
2847
|
+
@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}})
|
|
2848
|
+
@cli_util.help_option
|
|
2849
|
+
@click.pass_context
|
|
2850
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}})
|
|
2851
|
+
@cli_util.wrap_exceptions
|
|
2852
|
+
def update_iot_domain_group(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_group_id, display_name, description, freeform_tags, defined_tags, if_match):
|
|
2853
|
+
|
|
2854
|
+
if isinstance(iot_domain_group_id, six.string_types) and len(iot_domain_group_id.strip()) == 0:
|
|
2855
|
+
raise click.UsageError('Parameter --iot-domain-group-id cannot be whitespace or empty string')
|
|
2856
|
+
if not force:
|
|
2857
|
+
if freeform_tags or defined_tags:
|
|
2858
|
+
if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
|
|
2859
|
+
ctx.abort()
|
|
2860
|
+
|
|
2861
|
+
kwargs = {}
|
|
2862
|
+
if if_match is not None:
|
|
2863
|
+
kwargs['if_match'] = if_match
|
|
2864
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
2865
|
+
|
|
2866
|
+
_details = {}
|
|
2867
|
+
|
|
2868
|
+
if display_name is not None:
|
|
2869
|
+
_details['displayName'] = display_name
|
|
2870
|
+
|
|
2871
|
+
if description is not None:
|
|
2872
|
+
_details['description'] = description
|
|
2873
|
+
|
|
2874
|
+
if freeform_tags is not None:
|
|
2875
|
+
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
|
|
2876
|
+
|
|
2877
|
+
if defined_tags is not None:
|
|
2878
|
+
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
|
|
2879
|
+
|
|
2880
|
+
client = cli_util.build_client('iot', 'iot', ctx)
|
|
2881
|
+
result = client.update_iot_domain_group(
|
|
2882
|
+
iot_domain_group_id=iot_domain_group_id,
|
|
2883
|
+
update_iot_domain_group_details=_details,
|
|
2884
|
+
**kwargs
|
|
2885
|
+
)
|
|
2886
|
+
if wait_for_state:
|
|
2887
|
+
|
|
2888
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
2889
|
+
try:
|
|
2890
|
+
wait_period_kwargs = {}
|
|
2891
|
+
if max_wait_seconds is not None:
|
|
2892
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
2893
|
+
if wait_interval_seconds is not None:
|
|
2894
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
2895
|
+
if 'opc-work-request-id' not in result.headers:
|
|
2896
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
2897
|
+
cli_util.render_response(result, ctx)
|
|
2898
|
+
return
|
|
2899
|
+
|
|
2900
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
2901
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
2902
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
2903
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
2904
|
+
click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
2905
|
+
cli_util.render_response(result, ctx)
|
|
2906
|
+
sys.exit(2)
|
|
2907
|
+
except Exception:
|
|
2908
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
2909
|
+
cli_util.render_response(result, ctx)
|
|
2910
|
+
raise
|
|
2911
|
+
else:
|
|
2912
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
2913
|
+
cli_util.render_response(result, ctx)
|