oci-cli 3.72.1__py3-none-any.whl → 3.73.1__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.
- oci_cli/bin/dif.psm1 +3 -3
- oci_cli/bin/mysql.psm1 +6 -2
- oci_cli/bin/opensearch.psm1 +2 -2
- oci_cli/bin/queue.psm1 +23 -11
- oci_cli/help_text_producer/data_files/text/cmdref/certificates/ca-bundle/get.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/certificates/certificate-authority-bundle/get.txt +5 -5
- oci_cli/help_text_producer/data_files/text/cmdref/certificates/certificate-authority-bundle-version/list.txt +1 -2
- oci_cli/help_text_producer/data_files/text/cmdref/certificates/certificate-bundle/get.txt +6 -5
- oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/create-root-ca-by-generating-config-details.txt +12 -8
- oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/create-root-ca-managed-externally.txt +206 -0
- oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/create-subordinate-ca-issued-by-internal-ca.txt +12 -8
- oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/create-subordinate-ca-managed-internally-issued-by-external-ca.txt +229 -0
- oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/list.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/update-root-ca-by-generating-config-details.txt +8 -2
- oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/update-root-ca-managed-externally.txt +222 -0
- oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/update-subordinate-ca-issued-by-internal-ca.txt +8 -2
- oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/update-subordinate-ca-managed-internally-issued-by-external-ca.txt +233 -0
- oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority.txt +8 -0
- oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt.txt +8 -0
- oci_cli/help_text_producer/data_files/text/cmdref/compute/compute-host/apply-host-configuration.txt +0 -26
- oci_cli/help_text_producer/data_files/text/cmdref/compute/compute-host/attach.txt +0 -26
- oci_cli/help_text_producer/data_files/text/cmdref/compute/compute-host/check-host-configuration.txt +0 -26
- oci_cli/help_text_producer/data_files/text/cmdref/compute/dedicated-vm-host/create-dedicated-vm-host-compute-bare-metal-host-placement-constraint-details.txt +12 -0
- oci_cli/help_text_producer/data_files/text/cmdref/compute/dedicated-vm-host/create-dedicated-vm-host-host-group-placement-constraint-details.txt +12 -0
- oci_cli/help_text_producer/data_files/text/cmdref/compute/dedicated-vm-host/create.txt +12 -0
- oci_cli/help_text_producer/data_files/text/cmdref/compute/dedicated-vm-host/list.txt +5 -0
- oci_cli/help_text_producer/data_files/text/cmdref/compute/dedicated-vm-host-instance/list.txt +5 -0
- oci_cli/help_text_producer/data_files/text/cmdref/compute-management/instance-configuration/launch-compute-instance.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/compute-management/instance-pool/create.txt +5 -4
- oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/restart.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/work-request-error/{list-errors.txt → list.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/{list-logs.txt → list.txt} +5 -5
- oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/work-request-log.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request.txt +2 -2
- oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control.txt +2 -2
- oci_cli/help_text_producer/data_files/text/cmdref/dif/stack/add.txt +51 -2
- oci_cli/help_text_producer/data_files/text/cmdref/dif/stack/create.txt +50 -2
- oci_cli/help_text_producer/data_files/text/cmdref/dif/stack/deploy-artifacts.txt +36 -4
- oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/agent-endpoint/create.txt +11 -0
- oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/agent-endpoint/update.txt +11 -0
- oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/provisioned-capacity/change-compartment.txt +136 -0
- oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/provisioned-capacity/create.txt +170 -0
- oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/provisioned-capacity/delete.txt +134 -0
- oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/provisioned-capacity/get.txt +96 -0
- oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/provisioned-capacity/list.txt +143 -0
- oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/provisioned-capacity/update.txt +184 -0
- oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/provisioned-capacity.txt +31 -0
- oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/tool/create-tool-rag-tool-config.txt +37 -0
- oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/tool/create-tool-sql-tool-config.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/tool/update-tool-rag-tool-config.txt +37 -0
- oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/tool/update-tool-sql-tool-config.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent.txt +14 -0
- oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request/{work-request-log-entry/list-work-request-logs.txt → work-request-log/list.txt} +5 -5
- oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request/{work-request-log-entry.txt → work-request-log.txt} +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request.txt +2 -2
- oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane.txt +2 -2
- oci_cli/help_text_producer/data_files/text/cmdref/kafka/cluster/list-node-shapes.txt +129 -0
- oci_cli/help_text_producer/data_files/text/cmdref/kafka/cluster.txt +2 -0
- oci_cli/help_text_producer/data_files/text/cmdref/kafka.txt +2 -0
- oci_cli/help_text_producer/data_files/text/cmdref/mysql/backup/export.txt +154 -0
- oci_cli/help_text_producer/data_files/text/cmdref/mysql/backup.txt +2 -0
- oci_cli/help_text_producer/data_files/text/cmdref/mysql/work-request/cancel.txt +104 -0
- oci_cli/help_text_producer/data_files/text/cmdref/mysql/work-request.txt +2 -0
- oci_cli/help_text_producer/data_files/text/cmdref/mysql.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/network/vcn/create.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/network/vcn/update.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/ocvs/management-appliance/management-appliance/create.txt +205 -0
- oci_cli/help_text_producer/data_files/text/cmdref/ocvs/management-appliance/management-appliance/delete.txt +146 -0
- oci_cli/help_text_producer/data_files/text/cmdref/ocvs/management-appliance/management-appliance/get.txt +108 -0
- oci_cli/help_text_producer/data_files/text/cmdref/ocvs/management-appliance/management-appliance/list.txt +160 -0
- oci_cli/help_text_producer/data_files/text/cmdref/ocvs/management-appliance/management-appliance/update.txt +217 -0
- oci_cli/help_text_producer/data_files/text/cmdref/ocvs/management-appliance/management-appliance.txt +22 -0
- oci_cli/help_text_producer/data_files/text/cmdref/ocvs/management-appliance.txt +25 -0
- oci_cli/help_text_producer/data_files/text/cmdref/ocvs.txt +14 -0
- oci_cli/help_text_producer/data_files/text/cmdref/opensearch/cluster/create.txt +11 -0
- oci_cli/help_text_producer/data_files/text/cmdref/opensearch/cluster/update.txt +11 -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/queue/channels/list-channels.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/queue/messages/delete-message.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/queue/messages/delete-messages.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/queue/messages/get-messages.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/queue/messages/get-stats.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/queue/messages/update-message.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/queue/messages/update-messages.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/consumer-group/create.txt +169 -0
- oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/consumer-group/delete.txt +135 -0
- oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/consumer-group/get.txt +97 -0
- oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/consumer-group/update.txt +185 -0
- oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/consumer-group-collection/list-consumer-groups.txt +142 -0
- oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/consumer-group-collection.txt +15 -0
- oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/consumer-group.txt +20 -0
- oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/queue/create.txt +18 -2
- oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/queue/purge.txt +19 -6
- oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/queue/update.txt +16 -0
- oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin.txt +14 -0
- oci_cli/help_text_producer/data_files/text/cmdref/queue.txt +14 -0
- 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/version.py +1 -1
- {oci_cli-3.72.1.dist-info → oci_cli-3.73.1.dist-info}/METADATA +2 -2
- {oci_cli-3.72.1.dist-info → oci_cli-3.73.1.dist-info}/RECORD +134 -102
- services/certificates/src/oci_cli_certificates/generated/certificates_cli.py +6 -6
- services/certificates_management/src/oci_cli_certificates_management/certificatesmanagement_cli_extended.py +126 -0
- services/certificates_management/src/oci_cli_certificates_management/generated/certificatesmanagement_cli.py +447 -25
- services/core/src/oci_cli_compute/generated/compute_cli.py +126 -174
- services/core/src/oci_cli_compute_management/generated/computemanagement_cli.py +13 -4
- services/core/src/oci_cli_virtual_network/generated/virtualnetwork_cli.py +2 -2
- services/database/src/oci_cli_database/generated/database_cli.py +4 -1
- services/dif/src/oci_cli_stack/generated/stack_cli.py +65 -17
- services/dif/src/oci_cli_stack/stack_cli_extended.py +9 -9
- services/generative_ai_agent/src/oci_cli_generative_ai_agent/generated/generativeaiagent_cli.py +435 -16
- services/managed_kafka/src/oci_cli_kafka_cluster/generated/kafkacluster_cli.py +56 -0
- services/mysql/src/oci_cli_db_backups/generated/dbbackups_cli.py +70 -0
- services/mysql/src/oci_cli_work_requests/generated/workrequests_cli.py +26 -0
- services/ocvp/src/oci_cli_management_appliance/__init__.py +4 -0
- services/ocvp/src/oci_cli_management_appliance/generated/__init__.py +4 -0
- services/ocvp/src/oci_cli_management_appliance/generated/client_mappings.py +14 -0
- services/ocvp/src/oci_cli_management_appliance/generated/managementappliance_cli.py +341 -0
- services/opensearch/src/oci_cli_opensearch_cluster/generated/opensearchcluster_cli.py +16 -8
- services/queue/src/oci_cli_queue/generated/queue_cli.py +28 -7
- services/queue/src/oci_cli_queue_admin/generated/queueadmin_cli.py +343 -10
- services/queue/src/oci_cli_queue_admin/queueadmin_cli_extended.py +54 -7
- {oci_cli-3.72.1.dist-info → oci_cli-3.73.1.dist-info}/LICENSE.txt +0 -0
- {oci_cli-3.72.1.dist-info → oci_cli-3.73.1.dist-info}/THIRD_PARTY_LICENSES.txt +0 -0
- {oci_cli-3.72.1.dist-info → oci_cli-3.73.1.dist-info}/WHEEL +0 -0
- {oci_cli-3.72.1.dist-info → oci_cli-3.73.1.dist-info}/entry_points.txt +0 -0
- {oci_cli-3.72.1.dist-info → oci_cli-3.73.1.dist-info}/top_level.txt +0 -0
|
@@ -892,6 +892,62 @@ def list_kafka_clusters(ctx, from_json, all_pages, page_size, compartment_id, li
|
|
|
892
892
|
cli_util.render_response(result, ctx)
|
|
893
893
|
|
|
894
894
|
|
|
895
|
+
@kafka_cluster_group.command(name=cli_util.override('kafka.list_node_shapes.command_name', 'list-node-shapes'), help=u"""Returns the list of shapes allowed in the region. \n[Command Reference](listNodeShapes)""")
|
|
896
|
+
@cli_util.option('--compartment-id', help=u"""The [OCID] of the compartment in which to list resources.""")
|
|
897
|
+
@cli_util.option('--name', help=u"""The name to filter on.""")
|
|
898
|
+
@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].""")
|
|
899
|
+
@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 about how pagination works, see [List Pagination].""")
|
|
900
|
+
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (`ASC`) or descending (`DESC`).""")
|
|
901
|
+
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. You can provide only one sort order. Default order for `timeCreated` is descending. Default order for `displayName` is ascending.""")
|
|
902
|
+
@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.""")
|
|
903
|
+
@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.""")
|
|
904
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
905
|
+
@cli_util.help_option
|
|
906
|
+
@click.pass_context
|
|
907
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'managed_kafka', 'class': 'NodeShapeCollection'})
|
|
908
|
+
@cli_util.wrap_exceptions
|
|
909
|
+
def list_node_shapes(ctx, from_json, all_pages, page_size, compartment_id, name, limit, page, sort_order, sort_by):
|
|
910
|
+
|
|
911
|
+
if all_pages and limit:
|
|
912
|
+
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
|
|
913
|
+
|
|
914
|
+
kwargs = {}
|
|
915
|
+
if compartment_id is not None:
|
|
916
|
+
kwargs['compartment_id'] = compartment_id
|
|
917
|
+
if name is not None:
|
|
918
|
+
kwargs['name'] = name
|
|
919
|
+
if limit is not None:
|
|
920
|
+
kwargs['limit'] = limit
|
|
921
|
+
if page is not None:
|
|
922
|
+
kwargs['page'] = page
|
|
923
|
+
if sort_order is not None:
|
|
924
|
+
kwargs['sort_order'] = sort_order
|
|
925
|
+
if sort_by is not None:
|
|
926
|
+
kwargs['sort_by'] = sort_by
|
|
927
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
928
|
+
client = cli_util.build_client('managed_kafka', 'kafka_cluster', ctx)
|
|
929
|
+
if all_pages:
|
|
930
|
+
if page_size:
|
|
931
|
+
kwargs['limit'] = page_size
|
|
932
|
+
|
|
933
|
+
result = cli_util.list_call_get_all_results(
|
|
934
|
+
client.list_node_shapes,
|
|
935
|
+
**kwargs
|
|
936
|
+
)
|
|
937
|
+
elif limit is not None:
|
|
938
|
+
result = cli_util.list_call_get_up_to_limit(
|
|
939
|
+
client.list_node_shapes,
|
|
940
|
+
limit,
|
|
941
|
+
page_size,
|
|
942
|
+
**kwargs
|
|
943
|
+
)
|
|
944
|
+
else:
|
|
945
|
+
result = client.list_node_shapes(
|
|
946
|
+
**kwargs
|
|
947
|
+
)
|
|
948
|
+
cli_util.render_response(result, ctx)
|
|
949
|
+
|
|
950
|
+
|
|
895
951
|
@work_request_error_group.command(name=cli_util.override('kafka.list_work_request_errors.command_name', 'list'), help=u"""Lists the errors for a work request. \n[Command Reference](listWorkRequestErrors)""")
|
|
896
952
|
@cli_util.option('--work-request-id', required=True, help=u"""The [OCID] of the asynchronous work request.""")
|
|
897
953
|
@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 about how pagination works, see [List Pagination].""")
|
|
@@ -377,6 +377,76 @@ def delete_backup(ctx, from_json, wait_for_state, max_wait_seconds, wait_interva
|
|
|
377
377
|
cli_util.render_response(result, ctx)
|
|
378
378
|
|
|
379
379
|
|
|
380
|
+
@backup_group.command(name=cli_util.override('db_backups.export_backup.command_name', 'export'), help=u"""Export logical data from a DB system backup to an Object Storage bucket. \n[Command Reference](exportBackup)""")
|
|
381
|
+
@cli_util.option('--backup-id', required=True, help=u"""The OCID of the Backup""")
|
|
382
|
+
@cli_util.option('--bucket-name', required=True, help=u"""The Object Storage bucket name.""")
|
|
383
|
+
@cli_util.option('--namespace-name', required=True, help=u"""The Object Storage namespace.""")
|
|
384
|
+
@cli_util.option('--export-options', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
385
|
+
@cli_util.option('--subnet-id', help=u"""The OCID of the subnet which the temporary MySQL instance is associated with. If not specified, the subnet OCID of the DB system from which the backup is taken will be used by default. To export a backup copied from another region, it is mandatory to specify a valid subnet OCID in the current region.""")
|
|
386
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"]), 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.""")
|
|
387
|
+
@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.""")
|
|
388
|
+
@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.""")
|
|
389
|
+
@json_skeleton_utils.get_cli_json_input_option({'export-options': {'module': 'mysql', 'class': 'ExportOptions'}})
|
|
390
|
+
@cli_util.help_option
|
|
391
|
+
@click.pass_context
|
|
392
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'export-options': {'module': 'mysql', 'class': 'ExportOptions'}})
|
|
393
|
+
@cli_util.wrap_exceptions
|
|
394
|
+
def export_backup(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, backup_id, bucket_name, namespace_name, export_options, subnet_id):
|
|
395
|
+
|
|
396
|
+
if isinstance(backup_id, six.string_types) and len(backup_id.strip()) == 0:
|
|
397
|
+
raise click.UsageError('Parameter --backup-id cannot be whitespace or empty string')
|
|
398
|
+
|
|
399
|
+
kwargs = {}
|
|
400
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
401
|
+
|
|
402
|
+
_details = {}
|
|
403
|
+
_details['bucketName'] = bucket_name
|
|
404
|
+
_details['namespaceName'] = namespace_name
|
|
405
|
+
|
|
406
|
+
if export_options is not None:
|
|
407
|
+
_details['exportOptions'] = cli_util.parse_json_parameter("export_options", export_options)
|
|
408
|
+
|
|
409
|
+
if subnet_id is not None:
|
|
410
|
+
_details['subnetId'] = subnet_id
|
|
411
|
+
|
|
412
|
+
client = cli_util.build_client('mysql', 'db_backups', ctx)
|
|
413
|
+
result = client.export_backup(
|
|
414
|
+
backup_id=backup_id,
|
|
415
|
+
export_backup_details=_details,
|
|
416
|
+
**kwargs
|
|
417
|
+
)
|
|
418
|
+
if wait_for_state:
|
|
419
|
+
|
|
420
|
+
client = cli_util.build_client('mysql', 'work_requests', ctx)
|
|
421
|
+
|
|
422
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
423
|
+
try:
|
|
424
|
+
wait_period_kwargs = {}
|
|
425
|
+
if max_wait_seconds is not None:
|
|
426
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
427
|
+
if wait_interval_seconds is not None:
|
|
428
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
429
|
+
if 'opc-work-request-id' not in result.headers:
|
|
430
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
431
|
+
cli_util.render_response(result, ctx)
|
|
432
|
+
return
|
|
433
|
+
|
|
434
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
435
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
436
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
437
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
438
|
+
click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
439
|
+
cli_util.render_response(result, ctx)
|
|
440
|
+
sys.exit(2)
|
|
441
|
+
except Exception:
|
|
442
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
443
|
+
cli_util.render_response(result, ctx)
|
|
444
|
+
raise
|
|
445
|
+
else:
|
|
446
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
447
|
+
cli_util.render_response(result, ctx)
|
|
448
|
+
|
|
449
|
+
|
|
380
450
|
@backup_group.command(name=cli_util.override('db_backups.get_backup.command_name', 'get'), help=u"""Get information about the specified Backup \n[Command Reference](getBackup)""")
|
|
381
451
|
@cli_util.option('--backup-id', required=True, help=u"""The OCID of the Backup""")
|
|
382
452
|
@cli_util.option('--if-none-match', help=u"""For conditional requests. In the GET call for a resource, set the `If-None-Match` header to the value of the ETag from a previous GET (or POST or PUT) response for that resource. The server will return with either a 304 Not Modified response if the resource has not changed, or a 200 OK response with the updated representation.""")
|
|
@@ -46,6 +46,32 @@ work_requests_root_group.add_command(work_request_log_entry_group)
|
|
|
46
46
|
work_requests_root_group.add_command(work_request_group)
|
|
47
47
|
|
|
48
48
|
|
|
49
|
+
@work_request_group.command(name=cli_util.override('work_requests.cancel_work_request.command_name', 'cancel'), help=u"""Cancels a work request. \n[Command Reference](cancelWorkRequest)""")
|
|
50
|
+
@cli_util.option('--work-request-id', required=True, help=u"""the ID of the WorkRequest""")
|
|
51
|
+
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `If-Match` header 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.""")
|
|
52
|
+
@cli_util.confirm_delete_option
|
|
53
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
54
|
+
@cli_util.help_option
|
|
55
|
+
@click.pass_context
|
|
56
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
57
|
+
@cli_util.wrap_exceptions
|
|
58
|
+
def cancel_work_request(ctx, from_json, work_request_id, if_match):
|
|
59
|
+
|
|
60
|
+
if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
|
|
61
|
+
raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
|
|
62
|
+
|
|
63
|
+
kwargs = {}
|
|
64
|
+
if if_match is not None:
|
|
65
|
+
kwargs['if_match'] = if_match
|
|
66
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
67
|
+
client = cli_util.build_client('mysql', 'work_requests', ctx)
|
|
68
|
+
result = client.cancel_work_request(
|
|
69
|
+
work_request_id=work_request_id,
|
|
70
|
+
**kwargs
|
|
71
|
+
)
|
|
72
|
+
cli_util.render_response(result, ctx)
|
|
73
|
+
|
|
74
|
+
|
|
49
75
|
@work_request_group.command(name=cli_util.override('work_requests.get_work_request.command_name', 'get'), help=u"""Gets the status of the work request with the given ID. \n[Command Reference](getWorkRequest)""")
|
|
50
76
|
@cli_util.option('--work-request-id', required=True, help=u"""the ID of the WorkRequest""")
|
|
51
77
|
@cli_util.option('--if-none-match', help=u"""For conditional requests. In the GET call for a resource, set the `If-None-Match` header to the value of the ETag from a previous GET (or POST or PUT) response for that resource. The server will return with either a 304 Not Modified response if the resource has not changed, or a 200 OK response with the updated representation.""")
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
# Copyright (c) 2016, 2026, 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: 20230701
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
# Copyright (c) 2016, 2026, 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: 20230701
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
# Copyright (c) 2016, 2026, 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: 20230701
|
|
5
|
+
|
|
6
|
+
import oci
|
|
7
|
+
from oci_cli.cli_clients import CLIENT_MAP
|
|
8
|
+
from oci_cli.cli_clients import MODULE_TO_TYPE_MAPPINGS
|
|
9
|
+
from oci.ocvp import ManagementApplianceClient
|
|
10
|
+
|
|
11
|
+
MODULE_TO_TYPE_MAPPINGS["ocvp"] = oci.ocvp.models.ocvp_type_mapping
|
|
12
|
+
if CLIENT_MAP.get("ocvp") is None:
|
|
13
|
+
CLIENT_MAP["ocvp"] = {}
|
|
14
|
+
CLIENT_MAP["ocvp"]["management_appliance"] = ManagementApplianceClient
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
# Copyright (c) 2016, 2026, 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: 20230701
|
|
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 import cli_constants # noqa: F401
|
|
12
|
+
from oci_cli import cli_util
|
|
13
|
+
from oci_cli import json_skeleton_utils
|
|
14
|
+
from oci_cli import custom_types # noqa: F401
|
|
15
|
+
from oci_cli.aliasing import CommandGroupWithAlias
|
|
16
|
+
from services.ocvp.src.oci_cli_ocvp.generated import ocvs_service_cli
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@click.command(cli_util.override('management_appliance.management_appliance_root_group.command_name', 'management-appliance'), cls=CommandGroupWithAlias, help=cli_util.override('management_appliance.management_appliance_root_group.help', """Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software.
|
|
20
|
+
For more information, see [Oracle Cloud VMware Solution]."""), short_help=cli_util.override('management_appliance.management_appliance_root_group.short_help', """Oracle Cloud VMware Solution API"""))
|
|
21
|
+
@cli_util.help_option_group
|
|
22
|
+
def management_appliance_root_group():
|
|
23
|
+
pass
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@click.command(cli_util.override('management_appliance.management_appliance_group.command_name', 'management-appliance'), cls=CommandGroupWithAlias, help="""Information about management appliance.""")
|
|
27
|
+
@cli_util.help_option_group
|
|
28
|
+
def management_appliance_group():
|
|
29
|
+
pass
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
ocvs_service_cli.ocvs_service_group.add_command(management_appliance_root_group)
|
|
33
|
+
management_appliance_root_group.add_command(management_appliance_group)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@management_appliance_group.command(name=cli_util.override('management_appliance.create_management_appliance.command_name', 'create'), help=u"""Creates a management appliance. \n[Command Reference](createManagementAppliance)""")
|
|
37
|
+
@cli_util.option('--sddc-id', required=True, help=u"""The [OCID] of SDDC in OCI, that this appliance is going to be registered in.""")
|
|
38
|
+
@cli_util.option('--display-name', required=True, help=u"""A descriptive name for the management appliance. It must be unique, start with a letter, and contain only letters, digits, whitespaces, dashes and underscores. Avoid entering confidential information.""")
|
|
39
|
+
@cli_util.option('--configuration', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
40
|
+
@cli_util.option('--connections', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Array of connections for management appliance.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
41
|
+
@cli_util.option('--public-ssh-keys', help=u"""One or more public SSH keys to be included in `~/.ssh/authorized_keys` file for Management Appliance compute instance. Several public SSH keys must be separate by newline character.""")
|
|
42
|
+
@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].
|
|
43
|
+
|
|
44
|
+
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
45
|
+
@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].
|
|
46
|
+
|
|
47
|
+
Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
48
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"]), 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.""")
|
|
49
|
+
@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.""")
|
|
50
|
+
@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.""")
|
|
51
|
+
@json_skeleton_utils.get_cli_json_input_option({'configuration': {'module': 'ocvp', 'class': 'ManagementApplianceConfiguration'}, 'connections': {'module': 'ocvp', 'class': 'list[ManagementApplianceConnection]'}, 'freeform-tags': {'module': 'ocvp', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ocvp', 'class': 'dict(str, dict(str, object))'}})
|
|
52
|
+
@cli_util.help_option
|
|
53
|
+
@click.pass_context
|
|
54
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'configuration': {'module': 'ocvp', 'class': 'ManagementApplianceConfiguration'}, 'connections': {'module': 'ocvp', 'class': 'list[ManagementApplianceConnection]'}, 'freeform-tags': {'module': 'ocvp', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ocvp', 'class': 'dict(str, dict(str, object))'}})
|
|
55
|
+
@cli_util.wrap_exceptions
|
|
56
|
+
def create_management_appliance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sddc_id, display_name, configuration, connections, public_ssh_keys, freeform_tags, defined_tags):
|
|
57
|
+
|
|
58
|
+
kwargs = {}
|
|
59
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
60
|
+
|
|
61
|
+
_details = {}
|
|
62
|
+
_details['sddcId'] = sddc_id
|
|
63
|
+
_details['displayName'] = display_name
|
|
64
|
+
_details['configuration'] = cli_util.parse_json_parameter("configuration", configuration)
|
|
65
|
+
_details['connections'] = cli_util.parse_json_parameter("connections", connections)
|
|
66
|
+
|
|
67
|
+
if public_ssh_keys is not None:
|
|
68
|
+
_details['publicSshKeys'] = public_ssh_keys
|
|
69
|
+
|
|
70
|
+
if freeform_tags is not None:
|
|
71
|
+
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
|
|
72
|
+
|
|
73
|
+
if defined_tags is not None:
|
|
74
|
+
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
|
|
75
|
+
|
|
76
|
+
client = cli_util.build_client('ocvp', 'management_appliance', ctx)
|
|
77
|
+
result = client.create_management_appliance(
|
|
78
|
+
create_management_appliance_details=_details,
|
|
79
|
+
**kwargs
|
|
80
|
+
)
|
|
81
|
+
if wait_for_state:
|
|
82
|
+
|
|
83
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
84
|
+
try:
|
|
85
|
+
wait_period_kwargs = {}
|
|
86
|
+
if max_wait_seconds is not None:
|
|
87
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
88
|
+
if wait_interval_seconds is not None:
|
|
89
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
90
|
+
if 'opc-work-request-id' not in result.headers:
|
|
91
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
92
|
+
cli_util.render_response(result, ctx)
|
|
93
|
+
return
|
|
94
|
+
|
|
95
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
96
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
97
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
98
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
99
|
+
click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
100
|
+
cli_util.render_response(result, ctx)
|
|
101
|
+
sys.exit(2)
|
|
102
|
+
except Exception:
|
|
103
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
104
|
+
cli_util.render_response(result, ctx)
|
|
105
|
+
raise
|
|
106
|
+
else:
|
|
107
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
108
|
+
cli_util.render_response(result, ctx)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
@management_appliance_group.command(name=cli_util.override('management_appliance.delete_management_appliance.command_name', 'delete'), help=u"""Deletes management appliance specified. \n[Command Reference](deleteManagementAppliance)""")
|
|
112
|
+
@cli_util.option('--management-appliance-id', required=True, help=u"""The [OCID] of the management appliance.""")
|
|
113
|
+
@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.""")
|
|
114
|
+
@cli_util.confirm_delete_option
|
|
115
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"]), 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.""")
|
|
116
|
+
@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.""")
|
|
117
|
+
@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.""")
|
|
118
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
119
|
+
@cli_util.help_option
|
|
120
|
+
@click.pass_context
|
|
121
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
122
|
+
@cli_util.wrap_exceptions
|
|
123
|
+
def delete_management_appliance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, management_appliance_id, if_match):
|
|
124
|
+
|
|
125
|
+
if isinstance(management_appliance_id, six.string_types) and len(management_appliance_id.strip()) == 0:
|
|
126
|
+
raise click.UsageError('Parameter --management-appliance-id cannot be whitespace or empty string')
|
|
127
|
+
|
|
128
|
+
kwargs = {}
|
|
129
|
+
if if_match is not None:
|
|
130
|
+
kwargs['if_match'] = if_match
|
|
131
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
132
|
+
client = cli_util.build_client('ocvp', 'management_appliance', ctx)
|
|
133
|
+
result = client.delete_management_appliance(
|
|
134
|
+
management_appliance_id=management_appliance_id,
|
|
135
|
+
**kwargs
|
|
136
|
+
)
|
|
137
|
+
if wait_for_state:
|
|
138
|
+
|
|
139
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
140
|
+
try:
|
|
141
|
+
wait_period_kwargs = {}
|
|
142
|
+
if max_wait_seconds is not None:
|
|
143
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
144
|
+
if wait_interval_seconds is not None:
|
|
145
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
146
|
+
if 'opc-work-request-id' not in result.headers:
|
|
147
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
148
|
+
cli_util.render_response(result, ctx)
|
|
149
|
+
return
|
|
150
|
+
|
|
151
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
152
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
153
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
154
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
155
|
+
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)
|
|
156
|
+
cli_util.render_response(result, ctx)
|
|
157
|
+
sys.exit(2)
|
|
158
|
+
except Exception:
|
|
159
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
160
|
+
cli_util.render_response(result, ctx)
|
|
161
|
+
raise
|
|
162
|
+
else:
|
|
163
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
164
|
+
cli_util.render_response(result, ctx)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
@management_appliance_group.command(name=cli_util.override('management_appliance.get_management_appliance.command_name', 'get'), help=u"""Get the specified management appliance information. \n[Command Reference](getManagementAppliance)""")
|
|
168
|
+
@cli_util.option('--management-appliance-id', required=True, help=u"""The [OCID] of the management appliance.""")
|
|
169
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
170
|
+
@cli_util.help_option
|
|
171
|
+
@click.pass_context
|
|
172
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ocvp', 'class': 'ManagementAppliance'})
|
|
173
|
+
@cli_util.wrap_exceptions
|
|
174
|
+
def get_management_appliance(ctx, from_json, management_appliance_id):
|
|
175
|
+
|
|
176
|
+
if isinstance(management_appliance_id, six.string_types) and len(management_appliance_id.strip()) == 0:
|
|
177
|
+
raise click.UsageError('Parameter --management-appliance-id cannot be whitespace or empty string')
|
|
178
|
+
|
|
179
|
+
kwargs = {}
|
|
180
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
181
|
+
client = cli_util.build_client('ocvp', 'management_appliance', ctx)
|
|
182
|
+
result = client.get_management_appliance(
|
|
183
|
+
management_appliance_id=management_appliance_id,
|
|
184
|
+
**kwargs
|
|
185
|
+
)
|
|
186
|
+
cli_util.render_response(result, ctx)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
@management_appliance_group.command(name=cli_util.override('management_appliance.list_management_appliances.command_name', 'list'), help=u"""Lists management appliances in compartment specified. List can be filtered by management appliance, compartment, name and lifecycle state. \n[Command Reference](listManagementAppliances)""")
|
|
190
|
+
@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment.""")
|
|
191
|
+
@cli_util.option('--management-appliance-id', help=u"""The [OCID] of the management appliance.""")
|
|
192
|
+
@cli_util.option('--display-name', help=u"""A filter to return only resources that match the given display name exactly.""")
|
|
193
|
+
@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "NEEDS_ATTENTION", "DELETING", "DELETED", "FAILED"]), help=u"""The lifecycle state of the management appliance.""")
|
|
194
|
+
@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].""")
|
|
195
|
+
@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 about how pagination works, see [List Pagination].""")
|
|
196
|
+
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order is case sensitive.""")
|
|
197
|
+
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.
|
|
198
|
+
|
|
199
|
+
**Note:** In general, some \"List\" operations (for example, `ListInstances`) let you optionally filter by availability domain if the scope of the resource type is within a single availability domain. If you call one of these \"List\" operations without specifying an availability domain, the resources are grouped by availability domain, then sorted.""")
|
|
200
|
+
@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.""")
|
|
201
|
+
@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.""")
|
|
202
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
203
|
+
@cli_util.help_option
|
|
204
|
+
@click.pass_context
|
|
205
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ocvp', 'class': 'ManagementApplianceCollection'})
|
|
206
|
+
@cli_util.wrap_exceptions
|
|
207
|
+
def list_management_appliances(ctx, from_json, all_pages, page_size, compartment_id, management_appliance_id, display_name, lifecycle_state, limit, page, sort_order, sort_by):
|
|
208
|
+
|
|
209
|
+
if all_pages and limit:
|
|
210
|
+
raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
|
|
211
|
+
|
|
212
|
+
kwargs = {}
|
|
213
|
+
if management_appliance_id is not None:
|
|
214
|
+
kwargs['management_appliance_id'] = management_appliance_id
|
|
215
|
+
if display_name is not None:
|
|
216
|
+
kwargs['display_name'] = display_name
|
|
217
|
+
if lifecycle_state is not None:
|
|
218
|
+
kwargs['lifecycle_state'] = lifecycle_state
|
|
219
|
+
if limit is not None:
|
|
220
|
+
kwargs['limit'] = limit
|
|
221
|
+
if page is not None:
|
|
222
|
+
kwargs['page'] = page
|
|
223
|
+
if sort_order is not None:
|
|
224
|
+
kwargs['sort_order'] = sort_order
|
|
225
|
+
if sort_by is not None:
|
|
226
|
+
kwargs['sort_by'] = sort_by
|
|
227
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
228
|
+
client = cli_util.build_client('ocvp', 'management_appliance', ctx)
|
|
229
|
+
if all_pages:
|
|
230
|
+
if page_size:
|
|
231
|
+
kwargs['limit'] = page_size
|
|
232
|
+
|
|
233
|
+
result = cli_util.list_call_get_all_results(
|
|
234
|
+
client.list_management_appliances,
|
|
235
|
+
compartment_id=compartment_id,
|
|
236
|
+
**kwargs
|
|
237
|
+
)
|
|
238
|
+
elif limit is not None:
|
|
239
|
+
result = cli_util.list_call_get_up_to_limit(
|
|
240
|
+
client.list_management_appliances,
|
|
241
|
+
limit,
|
|
242
|
+
page_size,
|
|
243
|
+
compartment_id=compartment_id,
|
|
244
|
+
**kwargs
|
|
245
|
+
)
|
|
246
|
+
else:
|
|
247
|
+
result = client.list_management_appliances(
|
|
248
|
+
compartment_id=compartment_id,
|
|
249
|
+
**kwargs
|
|
250
|
+
)
|
|
251
|
+
cli_util.render_response(result, ctx)
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
@management_appliance_group.command(name=cli_util.override('management_appliance.update_management_appliance.command_name', 'update'), help=u"""Updates management appliance specified. \n[Command Reference](updateManagementAppliance)""")
|
|
255
|
+
@cli_util.option('--management-appliance-id', required=True, help=u"""The [OCID] of the management appliance.""")
|
|
256
|
+
@cli_util.option('--display-name', help=u"""A descriptive name for the management appliance. It must be unique, start with a letter, and contain only letters, digits, whitespaces, dashes and underscores. Avoid entering confidential information.""")
|
|
257
|
+
@cli_util.option('--configuration', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
258
|
+
@cli_util.option('--connections', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Array of connections for management appliance.
|
|
259
|
+
|
|
260
|
+
This option is a JSON list with items of type ManagementApplianceConnection. For documentation on ManagementApplianceConnection please see our API reference: https://docs.cloud.oracle.com/api/#/en/managementappliance/20230701/datatypes/ManagementApplianceConnection.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
261
|
+
@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].
|
|
262
|
+
|
|
263
|
+
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
264
|
+
@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].
|
|
265
|
+
|
|
266
|
+
Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
267
|
+
@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.""")
|
|
268
|
+
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
|
|
269
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"]), 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.""")
|
|
270
|
+
@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.""")
|
|
271
|
+
@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.""")
|
|
272
|
+
@json_skeleton_utils.get_cli_json_input_option({'configuration': {'module': 'ocvp', 'class': 'ManagementApplianceConfiguration'}, 'connections': {'module': 'ocvp', 'class': 'list[ManagementApplianceConnection]'}, 'freeform-tags': {'module': 'ocvp', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ocvp', 'class': 'dict(str, dict(str, object))'}})
|
|
273
|
+
@cli_util.help_option
|
|
274
|
+
@click.pass_context
|
|
275
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'configuration': {'module': 'ocvp', 'class': 'ManagementApplianceConfiguration'}, 'connections': {'module': 'ocvp', 'class': 'list[ManagementApplianceConnection]'}, 'freeform-tags': {'module': 'ocvp', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ocvp', 'class': 'dict(str, dict(str, object))'}})
|
|
276
|
+
@cli_util.wrap_exceptions
|
|
277
|
+
def update_management_appliance(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, management_appliance_id, display_name, configuration, connections, freeform_tags, defined_tags, if_match):
|
|
278
|
+
|
|
279
|
+
if isinstance(management_appliance_id, six.string_types) and len(management_appliance_id.strip()) == 0:
|
|
280
|
+
raise click.UsageError('Parameter --management-appliance-id cannot be whitespace or empty string')
|
|
281
|
+
if not force:
|
|
282
|
+
if configuration or connections or freeform_tags or defined_tags:
|
|
283
|
+
if not click.confirm("WARNING: Updates to configuration and connections and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
|
|
284
|
+
ctx.abort()
|
|
285
|
+
|
|
286
|
+
kwargs = {}
|
|
287
|
+
if if_match is not None:
|
|
288
|
+
kwargs['if_match'] = if_match
|
|
289
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
290
|
+
|
|
291
|
+
_details = {}
|
|
292
|
+
|
|
293
|
+
if display_name is not None:
|
|
294
|
+
_details['displayName'] = display_name
|
|
295
|
+
|
|
296
|
+
if configuration is not None:
|
|
297
|
+
_details['configuration'] = cli_util.parse_json_parameter("configuration", configuration)
|
|
298
|
+
|
|
299
|
+
if connections is not None:
|
|
300
|
+
_details['connections'] = cli_util.parse_json_parameter("connections", connections)
|
|
301
|
+
|
|
302
|
+
if freeform_tags is not None:
|
|
303
|
+
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
|
|
304
|
+
|
|
305
|
+
if defined_tags is not None:
|
|
306
|
+
_details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
|
|
307
|
+
|
|
308
|
+
client = cli_util.build_client('ocvp', 'management_appliance', ctx)
|
|
309
|
+
result = client.update_management_appliance(
|
|
310
|
+
management_appliance_id=management_appliance_id,
|
|
311
|
+
update_management_appliance_details=_details,
|
|
312
|
+
**kwargs
|
|
313
|
+
)
|
|
314
|
+
if wait_for_state:
|
|
315
|
+
|
|
316
|
+
if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
|
|
317
|
+
try:
|
|
318
|
+
wait_period_kwargs = {}
|
|
319
|
+
if max_wait_seconds is not None:
|
|
320
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
321
|
+
if wait_interval_seconds is not None:
|
|
322
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
323
|
+
if 'opc-work-request-id' not in result.headers:
|
|
324
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
|
|
325
|
+
cli_util.render_response(result, ctx)
|
|
326
|
+
return
|
|
327
|
+
|
|
328
|
+
click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
329
|
+
result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
|
|
330
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
331
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
332
|
+
click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
333
|
+
cli_util.render_response(result, ctx)
|
|
334
|
+
sys.exit(2)
|
|
335
|
+
except Exception:
|
|
336
|
+
click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
337
|
+
cli_util.render_response(result, ctx)
|
|
338
|
+
raise
|
|
339
|
+
else:
|
|
340
|
+
click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
|
|
341
|
+
cli_util.render_response(result, ctx)
|