oci-cli 3.63.0__py3-none-any.whl → 3.63.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/devops.psm1 +5 -4
- oci_cli/bin/psql.psm1 +4 -4
- oci_cli/bin/vault.psm1 +3 -3
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/api/add-lock.txt +141 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/api/change-compartment.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/api/create.txt +17 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/api/delete.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/api/remove-lock.txt +136 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/api/update.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/api.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/certificate/add-lock.txt +143 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/certificate/change-compartment.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/certificate/create.txt +17 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/certificate/delete.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/certificate/remove-lock.txt +138 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/certificate/update.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/certificate.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/deployment/add-lock.txt +150 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/deployment/change-compartment.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/deployment/create.txt +17 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/deployment/delete.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/deployment/remove-lock.txt +145 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/deployment/update.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/deployment.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/gateway/add-lock.txt +142 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/gateway/change-compartment.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/gateway/create.txt +18 -1
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/gateway/delete.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/gateway/remove-lock.txt +137 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/gateway/update.txt +5 -1
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/gateway.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/sdk/add-lock.txt +144 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/sdk/create.txt +17 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/sdk/delete.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/sdk/list.txt +4 -2
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/sdk/remove-lock.txt +139 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/sdk/update.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/sdk.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/subscriber/add-lock.txt +147 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/subscriber/change-compartment.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/subscriber/create.txt +17 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/subscriber/delete.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/subscriber/remove-lock.txt +142 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/subscriber/update.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/subscriber.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/usage-plan/add-lock.txt +146 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/usage-plan/change-compartment.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/usage-plan/create.txt +17 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/usage-plan/delete.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/usage-plan/remove-lock.txt +141 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/usage-plan/update.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/usage-plan.txt +4 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-gateway.txt +28 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-platform/api-platform-instance/change-compartment.txt +108 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-platform/api-platform-instance/create.txt +153 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-platform/api-platform-instance/delete.txt +132 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-platform/api-platform-instance/get.txt +94 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-platform/api-platform-instance/update.txt +162 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-platform/api-platform-instance-collection/list-api-platform-instances.txt +141 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-platform/api-platform-instance-collection.txt +15 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-platform/api-platform-instance.txt +23 -0
- oci_cli/help_text_producer/data_files/text/cmdref/{organizations/work-request-log-entry/list.txt → api-platform/work-request/get.txt} +23 -32
- oci_cli/help_text_producer/data_files/text/cmdref/api-platform/work-request/list.txt +140 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-platform/work-request-error/list.txt +131 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-platform/work-request-error.txt +15 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-platform/work-request-log-entry/list-work-request-logs.txt +131 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-platform/work-request-log-entry.txt +15 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-platform/work-request.txt +21 -0
- oci_cli/help_text_producer/data_files/text/cmdref/api-platform.txt +42 -0
- oci_cli/help_text_producer/data_files/text/cmdref/apm-config/config/create-agent.txt +153 -0
- oci_cli/help_text_producer/data_files/text/cmdref/apm-config/config/create-macs-extension.txt +171 -0
- oci_cli/help_text_producer/data_files/text/cmdref/apm-config/config/update-agent.txt +162 -0
- oci_cli/help_text_producer/data_files/text/cmdref/apm-config/config/update-macs-extension.txt +174 -0
- oci_cli/help_text_producer/data_files/text/cmdref/apm-config/config-collection/list.txt +2 -1
- oci_cli/help_text_producer/data_files/text/cmdref/apm-config/config.txt +8 -0
- oci_cli/help_text_producer/data_files/text/cmdref/apm-config/match-agents-with-attribute-key/get.txt +91 -0
- oci_cli/help_text_producer/data_files/text/cmdref/apm-config/match-agents-with-attribute-key/update.txt +107 -0
- oci_cli/help_text_producer/data_files/text/cmdref/apm-config/match-agents-with-attribute-key.txt +16 -0
- oci_cli/help_text_producer/data_files/text/cmdref/apm-config.txt +14 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-deployment/create-model-deployment-model-group-deployment-configuration-details.txt +215 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-deployment/update-model-deployment-update-model-group-deployment-configuration-details.txt +235 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-deployment-model-state/list.txt +167 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-deployment-model-state.txt +14 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-deployment.txt +5 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/activate.txt +130 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/change-compartment.txt +108 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/create-model-group-artifact.txt +123 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/create-model-group-clone-model-group-details.txt +139 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/create-model-group-create-model-group-details.txt +197 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/create.txt +132 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/deactivate.txt +130 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/delete.txt +134 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/get-model-group-artifact-content.txt +107 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/get.txt +97 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/head-model-group-artifact.txt +96 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/list-model-group-models.txt +171 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/list.txt +169 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/update.txt +180 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group-version-history/change-compartment.txt +108 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group-version-history/create.txt +166 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group-version-history/delete.txt +133 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group-version-history/get.txt +95 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group-version-history/list.txt +165 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group-version-history/update.txt +172 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group-version-history.txt +25 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group.txt +41 -0
- oci_cli/help_text_producer/data_files/text/cmdref/data-science/work-request/list.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/data-science.txt +54 -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.txt → work-request-log-entry/list-work-request-logs.txt} +5 -5
- oci_cli/help_text_producer/data_files/text/cmdref/{governance-rules-control-plane/work-request/work-request-log.txt → delegate-access-control/work-request/work-request-log-entry.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/devops/{protected-branch → protected-branch-collection}/list-protected-branches.txt +2 -2
- oci_cli/help_text_producer/data_files/text/cmdref/devops/protected-branch-collection.txt +14 -0
- oci_cli/help_text_producer/data_files/text/cmdref/devops/protected-branch.txt +0 -2
- oci_cli/help_text_producer/data_files/text/cmdref/devops.txt +2 -0
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-amazon-s3-connection.txt +9 -9
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/{create-connection-create-iceberg-connection-details.txt → create-iceberg-connection.txt} +9 -9
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-amazon-s3-connection.txt +9 -9
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/{update-connection-update-iceberg-connection-details.txt → update-iceberg-connection.txt} +5 -5
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection.txt +4 -4
- oci_cli/help_text_producer/data_files/text/cmdref/goldengate.txt +4 -4
- oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request/{work-request-log/list.txt → work-request-log-entry/list-logs.txt} +5 -5
- oci_cli/help_text_producer/data_files/text/cmdref/{organizations → governance-rules-control-plane/work-request}/work-request-log-entry.txt +1 -1
- 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/management-dashboard/dashboard/get-oob.txt +3 -2
- oci_cli/help_text_producer/data_files/text/cmdref/management-dashboard/dashboard/import.txt +24 -0
- oci_cli/help_text_producer/data_files/text/cmdref/management-dashboard/dashboard/list-oob.txt +2 -2
- oci_cli/help_text_producer/data_files/text/cmdref/management-dashboard/saved-search/get-oob.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/management-dashboard/saved-search/list-oob.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/ocvs/work-request-error/{list.txt → list-errors.txt} +5 -5
- oci_cli/help_text_producer/data_files/text/cmdref/ocvs/work-request-error.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/ocvs.txt +1 -1
- oci_cli/help_text_producer/data_files/text/cmdref/organizations/work-request-error/{list.txt → list-errors.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/work-request-log/list.txt +118 -0
- oci_cli/help_text_producer/data_files/text/cmdref/organizations.txt +2 -2
- oci_cli/help_text_producer/data_files/text/cmdref/psql/configuration/change-compartment.txt +1 -2
- oci_cli/help_text_producer/data_files/text/cmdref/psql/configuration/create.txt +21 -7
- oci_cli/help_text_producer/data_files/text/cmdref/psql/configuration/delete.txt +1 -2
- oci_cli/help_text_producer/data_files/text/cmdref/psql/configuration/get.txt +1 -2
- oci_cli/help_text_producer/data_files/text/cmdref/psql/configuration/update.txt +13 -2
- oci_cli/help_text_producer/data_files/text/cmdref/psql/configuration-collection/list-configurations.txt +9 -2
- oci_cli/help_text_producer/data_files/text/cmdref/psql/default-configuration-collection/list-default-configurations.txt +9 -2
- oci_cli/help_text_producer/data_files/text/cmdref/session/authenticate.txt +8 -8
- oci_cli/help_text_producer/data_files/text/cmdref/speech/voice/list.txt +6 -1
- oci_cli/help_text_producer/data_files/text/cmdref/vault/secret/create-base64.txt +11 -0
- oci_cli/help_text_producer/data_files/text/cmdref/vault/secret/update-base64.txt +11 -0
- oci_cli/help_text_producer/data_files/text/cmdref/vault/secret/update.txt +11 -0
- 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.63.0.dist-info → oci_cli-3.63.1.dist-info}/METADATA +2 -2
- {oci_cli-3.63.0.dist-info → oci_cli-3.63.1.dist-info}/RECORD +189 -118
- services/ai_speech/src/oci_cli_ai_service_speech/generated/aiservicespeech_cli.py +5 -2
- services/api_platform/__init__.py +4 -0
- services/api_platform/src/__init__.py +4 -0
- services/api_platform/src/oci_cli_api_platform/__init__.py +4 -0
- services/api_platform/src/oci_cli_api_platform/generated/__init__.py +4 -0
- services/api_platform/src/oci_cli_api_platform/generated/apiplatform_cli.py +567 -0
- services/api_platform/src/oci_cli_api_platform/generated/client_mappings.py +14 -0
- services/api_platform/tests/__init__.py +4 -0
- services/apigateway/src/oci_cli_api_gateway/api_gateway_cli_extended.py +24 -0
- services/apigateway/src/oci_cli_api_gateway/generated/apigateway_cli.py +415 -19
- services/apigateway/src/oci_cli_deployment/apigateway_deployment_extended.py +8 -0
- services/apigateway/src/oci_cli_deployment/generated/deployment_cli.py +139 -6
- services/apigateway/src/oci_cli_gateway/apigateway_gateway_extended.py +9 -1
- services/apigateway/src/oci_cli_gateway/generated/gateway_cli.py +171 -20
- services/apigateway/src/oci_cli_subscribers/generated/subscribers_cli.py +139 -6
- services/apigateway/src/oci_cli_subscribers/subscribers_cli_extended.py +9 -0
- services/apigateway/src/oci_cli_usage_plans/generated/usageplans_cli.py +139 -6
- services/apigateway/src/oci_cli_usage_plans/usageplans_cli_extended.py +9 -0
- services/apm_config/src/oci_cli_config/config_cli_extended.py +16 -0
- services/apm_config/src/oci_cli_config/generated/config_cli.py +289 -3
- services/data_science/src/oci_cli_data_science/generated/datascience_cli.py +1477 -98
- services/devops/src/oci_cli_devops/devops_cli_extended.py +11 -11
- services/golden_gate/src/oci_cli_golden_gate/golden_gate_cli_extended.py +44 -0
- services/management_dashboard/src/oci_cli_dashx_apis/generated/dashxapis_cli.py +18 -6
- services/psql/src/oci_cli_postgresql/generated/postgresql_cli.py +38 -14
- services/vault/src/oci_cli_vaults/generated/vaults_cli.py +80 -40
- /oci_cli/help_text_producer/data_files/text/cmdref/{delegate-access-control/work-request → organizations}/work-request-log.txt +0 -0
- {oci_cli-3.63.0.dist-info → oci_cli-3.63.1.dist-info}/LICENSE.txt +0 -0
- {oci_cli-3.63.0.dist-info → oci_cli-3.63.1.dist-info}/THIRD_PARTY_LICENSES.txt +0 -0
- {oci_cli-3.63.0.dist-info → oci_cli-3.63.1.dist-info}/WHEEL +0 -0
- {oci_cli-3.63.0.dist-info → oci_cli-3.63.1.dist-info}/entry_points.txt +0 -0
- {oci_cli-3.63.0.dist-info → oci_cli-3.63.1.dist-info}/top_level.txt +0 -0
|
@@ -34,10 +34,72 @@ api_gateway_service_cli.api_gateway_service_group.add_command(subscribers_root_g
|
|
|
34
34
|
subscribers_root_group.add_command(subscriber_group)
|
|
35
35
|
|
|
36
36
|
|
|
37
|
+
@subscriber_group.command(name=cli_util.override('subscribers.add_subscriber_lock.command_name', 'add'), help=u"""Adds a lock to a Subscriber resource. \n[Command Reference](addSubscriberLock)""")
|
|
38
|
+
@cli_util.option('--subscriber-id', required=True, help=u"""The ocid of the subscriber.""")
|
|
39
|
+
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL", "DELETE"]), help=u"""Type of the lock.""")
|
|
40
|
+
@cli_util.option('--message', help=u"""A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked.""")
|
|
41
|
+
@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.""")
|
|
42
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), 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.""")
|
|
43
|
+
@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.""")
|
|
44
|
+
@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.""")
|
|
45
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
46
|
+
@cli_util.help_option
|
|
47
|
+
@click.pass_context
|
|
48
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'apigateway', 'class': 'Subscriber'})
|
|
49
|
+
@cli_util.wrap_exceptions
|
|
50
|
+
def add_subscriber_lock(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subscriber_id, type, message, if_match):
|
|
51
|
+
|
|
52
|
+
if isinstance(subscriber_id, six.string_types) and len(subscriber_id.strip()) == 0:
|
|
53
|
+
raise click.UsageError('Parameter --subscriber-id cannot be whitespace or empty string')
|
|
54
|
+
|
|
55
|
+
kwargs = {}
|
|
56
|
+
if if_match is not None:
|
|
57
|
+
kwargs['if_match'] = if_match
|
|
58
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
59
|
+
|
|
60
|
+
_details = {}
|
|
61
|
+
_details['type'] = type
|
|
62
|
+
|
|
63
|
+
if message is not None:
|
|
64
|
+
_details['message'] = message
|
|
65
|
+
|
|
66
|
+
client = cli_util.build_client('apigateway', 'subscribers', ctx)
|
|
67
|
+
result = client.add_subscriber_lock(
|
|
68
|
+
subscriber_id=subscriber_id,
|
|
69
|
+
add_resource_lock_details=_details,
|
|
70
|
+
**kwargs
|
|
71
|
+
)
|
|
72
|
+
if wait_for_state:
|
|
73
|
+
|
|
74
|
+
if hasattr(client, 'get_subscriber') and callable(getattr(client, 'get_subscriber')):
|
|
75
|
+
try:
|
|
76
|
+
wait_period_kwargs = {}
|
|
77
|
+
if max_wait_seconds is not None:
|
|
78
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
79
|
+
if wait_interval_seconds is not None:
|
|
80
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
81
|
+
|
|
82
|
+
click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
83
|
+
result = oci.wait_until(client, client.get_subscriber(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
|
|
84
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
85
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
86
|
+
click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
87
|
+
cli_util.render_response(result, ctx)
|
|
88
|
+
sys.exit(2)
|
|
89
|
+
except Exception:
|
|
90
|
+
click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
91
|
+
cli_util.render_response(result, ctx)
|
|
92
|
+
raise
|
|
93
|
+
else:
|
|
94
|
+
click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
|
|
95
|
+
cli_util.render_response(result, ctx)
|
|
96
|
+
|
|
97
|
+
|
|
37
98
|
@subscriber_group.command(name=cli_util.override('subscribers.change_subscriber_compartment.command_name', 'change-compartment'), help=u"""Changes the subscriber compartment. \n[Command Reference](changeSubscriberCompartment)""")
|
|
38
99
|
@cli_util.option('--subscriber-id', required=True, help=u"""The ocid of the subscriber.""")
|
|
39
100
|
@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment in which the resource is created.""")
|
|
40
101
|
@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.""")
|
|
102
|
+
@cli_util.option('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""")
|
|
41
103
|
@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.""")
|
|
42
104
|
@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.""")
|
|
43
105
|
@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.""")
|
|
@@ -46,7 +108,7 @@ subscribers_root_group.add_command(subscriber_group)
|
|
|
46
108
|
@click.pass_context
|
|
47
109
|
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
48
110
|
@cli_util.wrap_exceptions
|
|
49
|
-
def change_subscriber_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subscriber_id, compartment_id, if_match):
|
|
111
|
+
def change_subscriber_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subscriber_id, compartment_id, if_match, is_lock_override):
|
|
50
112
|
|
|
51
113
|
if isinstance(subscriber_id, six.string_types) and len(subscriber_id.strip()) == 0:
|
|
52
114
|
raise click.UsageError('Parameter --subscriber-id cannot be whitespace or empty string')
|
|
@@ -54,6 +116,8 @@ def change_subscriber_compartment(ctx, from_json, wait_for_state, max_wait_secon
|
|
|
54
116
|
kwargs = {}
|
|
55
117
|
if if_match is not None:
|
|
56
118
|
kwargs['if_match'] = if_match
|
|
119
|
+
if is_lock_override is not None:
|
|
120
|
+
kwargs['is_lock_override'] = is_lock_override
|
|
57
121
|
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
58
122
|
|
|
59
123
|
_details = {}
|
|
@@ -104,6 +168,9 @@ def change_subscriber_compartment(ctx, from_json, wait_for_state, max_wait_secon
|
|
|
104
168
|
@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.
|
|
105
169
|
|
|
106
170
|
Example: `My new resource`""")
|
|
171
|
+
@cli_util.option('--locks', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Locks associated with this resource.
|
|
172
|
+
|
|
173
|
+
This option is a JSON list with items of type AddResourceLockDetails. For documentation on AddResourceLockDetails please see our API reference: https://docs.cloud.oracle.com/api/#/en/subscribers/20190501/datatypes/AddResourceLockDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
107
174
|
@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].
|
|
108
175
|
|
|
109
176
|
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
@@ -113,12 +180,12 @@ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_comp
|
|
|
113
180
|
@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.""")
|
|
114
181
|
@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.""")
|
|
115
182
|
@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.""")
|
|
116
|
-
@json_skeleton_utils.get_cli_json_input_option({'clients': {'module': 'apigateway', 'class': 'list[Client]'}, 'usage-plans': {'module': 'apigateway', 'class': 'list[string]'}, 'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}})
|
|
183
|
+
@json_skeleton_utils.get_cli_json_input_option({'clients': {'module': 'apigateway', 'class': 'list[Client]'}, 'usage-plans': {'module': 'apigateway', 'class': 'list[string]'}, 'locks': {'module': 'apigateway', 'class': 'list[AddResourceLockDetails]'}, 'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}})
|
|
117
184
|
@cli_util.help_option
|
|
118
185
|
@click.pass_context
|
|
119
|
-
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'clients': {'module': 'apigateway', 'class': 'list[Client]'}, 'usage-plans': {'module': 'apigateway', 'class': 'list[string]'}, 'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'apigateway', 'class': 'Subscriber'})
|
|
186
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'clients': {'module': 'apigateway', 'class': 'list[Client]'}, 'usage-plans': {'module': 'apigateway', 'class': 'list[string]'}, 'locks': {'module': 'apigateway', 'class': 'list[AddResourceLockDetails]'}, 'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'apigateway', 'class': 'Subscriber'})
|
|
120
187
|
@cli_util.wrap_exceptions
|
|
121
|
-
def create_subscriber(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, clients, usage_plans, display_name, freeform_tags, defined_tags):
|
|
188
|
+
def create_subscriber(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, clients, usage_plans, display_name, locks, freeform_tags, defined_tags):
|
|
122
189
|
|
|
123
190
|
kwargs = {}
|
|
124
191
|
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
@@ -131,6 +198,9 @@ def create_subscriber(ctx, from_json, wait_for_state, max_wait_seconds, wait_int
|
|
|
131
198
|
if display_name is not None:
|
|
132
199
|
_details['displayName'] = display_name
|
|
133
200
|
|
|
201
|
+
if locks is not None:
|
|
202
|
+
_details['locks'] = cli_util.parse_json_parameter("locks", locks)
|
|
203
|
+
|
|
134
204
|
if freeform_tags is not None:
|
|
135
205
|
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
|
|
136
206
|
|
|
@@ -177,6 +247,7 @@ def create_subscriber(ctx, from_json, wait_for_state, max_wait_seconds, wait_int
|
|
|
177
247
|
@subscriber_group.command(name=cli_util.override('subscribers.delete_subscriber.command_name', 'delete'), help=u"""Deletes the subscriber with the given identifier. \n[Command Reference](deleteSubscriber)""")
|
|
178
248
|
@cli_util.option('--subscriber-id', required=True, help=u"""The ocid of the subscriber.""")
|
|
179
249
|
@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.""")
|
|
250
|
+
@cli_util.option('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""")
|
|
180
251
|
@cli_util.confirm_delete_option
|
|
181
252
|
@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.""")
|
|
182
253
|
@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.""")
|
|
@@ -186,7 +257,7 @@ def create_subscriber(ctx, from_json, wait_for_state, max_wait_seconds, wait_int
|
|
|
186
257
|
@click.pass_context
|
|
187
258
|
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
188
259
|
@cli_util.wrap_exceptions
|
|
189
|
-
def delete_subscriber(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subscriber_id, if_match):
|
|
260
|
+
def delete_subscriber(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subscriber_id, if_match, is_lock_override):
|
|
190
261
|
|
|
191
262
|
if isinstance(subscriber_id, six.string_types) and len(subscriber_id.strip()) == 0:
|
|
192
263
|
raise click.UsageError('Parameter --subscriber-id cannot be whitespace or empty string')
|
|
@@ -194,6 +265,8 @@ def delete_subscriber(ctx, from_json, wait_for_state, max_wait_seconds, wait_int
|
|
|
194
265
|
kwargs = {}
|
|
195
266
|
if if_match is not None:
|
|
196
267
|
kwargs['if_match'] = if_match
|
|
268
|
+
if is_lock_override is not None:
|
|
269
|
+
kwargs['is_lock_override'] = is_lock_override
|
|
197
270
|
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
198
271
|
client = cli_util.build_client('apigateway', 'subscribers', ctx)
|
|
199
272
|
result = client.delete_subscriber(
|
|
@@ -316,6 +389,63 @@ def list_subscribers(ctx, from_json, all_pages, page_size, compartment_id, displ
|
|
|
316
389
|
cli_util.render_response(result, ctx)
|
|
317
390
|
|
|
318
391
|
|
|
392
|
+
@subscriber_group.command(name=cli_util.override('subscribers.remove_subscriber_lock.command_name', 'remove'), help=u"""Removes a lock from a Subscriber resource. \n[Command Reference](removeSubscriberLock)""")
|
|
393
|
+
@cli_util.option('--subscriber-id', required=True, help=u"""The ocid of the subscriber.""")
|
|
394
|
+
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL", "DELETE"]), help=u"""Type of the lock.""")
|
|
395
|
+
@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.""")
|
|
396
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), 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.""")
|
|
397
|
+
@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.""")
|
|
398
|
+
@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.""")
|
|
399
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
400
|
+
@cli_util.help_option
|
|
401
|
+
@click.pass_context
|
|
402
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'apigateway', 'class': 'Subscriber'})
|
|
403
|
+
@cli_util.wrap_exceptions
|
|
404
|
+
def remove_subscriber_lock(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subscriber_id, type, if_match):
|
|
405
|
+
|
|
406
|
+
if isinstance(subscriber_id, six.string_types) and len(subscriber_id.strip()) == 0:
|
|
407
|
+
raise click.UsageError('Parameter --subscriber-id cannot be whitespace or empty string')
|
|
408
|
+
|
|
409
|
+
kwargs = {}
|
|
410
|
+
if if_match is not None:
|
|
411
|
+
kwargs['if_match'] = if_match
|
|
412
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
413
|
+
|
|
414
|
+
_details = {}
|
|
415
|
+
_details['type'] = type
|
|
416
|
+
|
|
417
|
+
client = cli_util.build_client('apigateway', 'subscribers', ctx)
|
|
418
|
+
result = client.remove_subscriber_lock(
|
|
419
|
+
subscriber_id=subscriber_id,
|
|
420
|
+
remove_resource_lock_details=_details,
|
|
421
|
+
**kwargs
|
|
422
|
+
)
|
|
423
|
+
if wait_for_state:
|
|
424
|
+
|
|
425
|
+
if hasattr(client, 'get_subscriber') and callable(getattr(client, 'get_subscriber')):
|
|
426
|
+
try:
|
|
427
|
+
wait_period_kwargs = {}
|
|
428
|
+
if max_wait_seconds is not None:
|
|
429
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
430
|
+
if wait_interval_seconds is not None:
|
|
431
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
432
|
+
|
|
433
|
+
click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
434
|
+
result = oci.wait_until(client, client.get_subscriber(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
|
|
435
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
436
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
437
|
+
click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
438
|
+
cli_util.render_response(result, ctx)
|
|
439
|
+
sys.exit(2)
|
|
440
|
+
except Exception:
|
|
441
|
+
click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
442
|
+
cli_util.render_response(result, ctx)
|
|
443
|
+
raise
|
|
444
|
+
else:
|
|
445
|
+
click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
|
|
446
|
+
cli_util.render_response(result, ctx)
|
|
447
|
+
|
|
448
|
+
|
|
319
449
|
@subscriber_group.command(name=cli_util.override('subscribers.update_subscriber.command_name', 'update'), help=u"""Updates the subscriber with the given identifier. \n[Command Reference](updateSubscriber)""")
|
|
320
450
|
@cli_util.option('--subscriber-id', required=True, help=u"""The ocid of the subscriber.""")
|
|
321
451
|
@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.
|
|
@@ -332,6 +462,7 @@ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMP
|
|
|
332
462
|
|
|
333
463
|
Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
334
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('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""")
|
|
335
466
|
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
|
|
336
467
|
@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.""")
|
|
337
468
|
@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,7 +472,7 @@ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_comp
|
|
|
341
472
|
@click.pass_context
|
|
342
473
|
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'clients': {'module': 'apigateway', 'class': 'list[Client]'}, 'usage-plans': {'module': 'apigateway', 'class': 'list[string]'}, 'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}})
|
|
343
474
|
@cli_util.wrap_exceptions
|
|
344
|
-
def update_subscriber(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, subscriber_id, display_name, clients, usage_plans, freeform_tags, defined_tags, if_match):
|
|
475
|
+
def update_subscriber(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, subscriber_id, display_name, clients, usage_plans, freeform_tags, defined_tags, if_match, is_lock_override):
|
|
345
476
|
|
|
346
477
|
if isinstance(subscriber_id, six.string_types) and len(subscriber_id.strip()) == 0:
|
|
347
478
|
raise click.UsageError('Parameter --subscriber-id cannot be whitespace or empty string')
|
|
@@ -353,6 +484,8 @@ def update_subscriber(ctx, from_json, force, wait_for_state, max_wait_seconds, w
|
|
|
353
484
|
kwargs = {}
|
|
354
485
|
if if_match is not None:
|
|
355
486
|
kwargs['if_match'] = if_match
|
|
487
|
+
if is_lock_override is not None:
|
|
488
|
+
kwargs['is_lock_override'] = is_lock_override
|
|
356
489
|
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
357
490
|
|
|
358
491
|
_details = {}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
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
4
|
|
|
5
5
|
from __future__ import print_function
|
|
6
|
+
from oci_cli import cli_util # noqa: F401
|
|
6
7
|
|
|
7
8
|
from services.apigateway.src.oci_cli_apigateway.generated import api_gateway_service_cli
|
|
8
9
|
from services.apigateway.src.oci_cli_subscribers.generated import subscribers_cli
|
|
@@ -15,3 +16,11 @@ from services.apigateway.src.oci_cli_subscribers.generated import subscribers_cl
|
|
|
15
16
|
|
|
16
17
|
api_gateway_service_cli.api_gateway_service_group.commands.pop(subscribers_cli.subscribers_root_group.name)
|
|
17
18
|
api_gateway_service_cli.api_gateway_service_group.add_command(subscribers_cli.subscriber_group)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# oci api-gateway subscriber add -> oci api-gateway subscriber add-lock
|
|
22
|
+
cli_util.rename_command(subscribers_cli, subscribers_cli.subscriber_group, subscribers_cli.add_subscriber_lock, "add-lock")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# oci api-gateway subscriber remove -> oci api-gateway subscriber remove-lock
|
|
26
|
+
cli_util.rename_command(subscribers_cli, subscribers_cli.subscriber_group, subscribers_cli.remove_subscriber_lock, "remove-lock")
|
|
@@ -34,10 +34,72 @@ api_gateway_service_cli.api_gateway_service_group.add_command(usage_plans_root_g
|
|
|
34
34
|
usage_plans_root_group.add_command(usage_plan_group)
|
|
35
35
|
|
|
36
36
|
|
|
37
|
+
@usage_plan_group.command(name=cli_util.override('usage_plans.add_usage_plan_lock.command_name', 'add'), help=u"""Adds a lock to a UsagePlan resource. \n[Command Reference](addUsagePlanLock)""")
|
|
38
|
+
@cli_util.option('--usage-plan-id', required=True, help=u"""The ocid of the usage plan.""")
|
|
39
|
+
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL", "DELETE"]), help=u"""Type of the lock.""")
|
|
40
|
+
@cli_util.option('--message', help=u"""A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked.""")
|
|
41
|
+
@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.""")
|
|
42
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), 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.""")
|
|
43
|
+
@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.""")
|
|
44
|
+
@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.""")
|
|
45
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
46
|
+
@cli_util.help_option
|
|
47
|
+
@click.pass_context
|
|
48
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'apigateway', 'class': 'UsagePlan'})
|
|
49
|
+
@cli_util.wrap_exceptions
|
|
50
|
+
def add_usage_plan_lock(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, usage_plan_id, type, message, if_match):
|
|
51
|
+
|
|
52
|
+
if isinstance(usage_plan_id, six.string_types) and len(usage_plan_id.strip()) == 0:
|
|
53
|
+
raise click.UsageError('Parameter --usage-plan-id cannot be whitespace or empty string')
|
|
54
|
+
|
|
55
|
+
kwargs = {}
|
|
56
|
+
if if_match is not None:
|
|
57
|
+
kwargs['if_match'] = if_match
|
|
58
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
59
|
+
|
|
60
|
+
_details = {}
|
|
61
|
+
_details['type'] = type
|
|
62
|
+
|
|
63
|
+
if message is not None:
|
|
64
|
+
_details['message'] = message
|
|
65
|
+
|
|
66
|
+
client = cli_util.build_client('apigateway', 'usage_plans', ctx)
|
|
67
|
+
result = client.add_usage_plan_lock(
|
|
68
|
+
usage_plan_id=usage_plan_id,
|
|
69
|
+
add_resource_lock_details=_details,
|
|
70
|
+
**kwargs
|
|
71
|
+
)
|
|
72
|
+
if wait_for_state:
|
|
73
|
+
|
|
74
|
+
if hasattr(client, 'get_usage_plan') and callable(getattr(client, 'get_usage_plan')):
|
|
75
|
+
try:
|
|
76
|
+
wait_period_kwargs = {}
|
|
77
|
+
if max_wait_seconds is not None:
|
|
78
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
79
|
+
if wait_interval_seconds is not None:
|
|
80
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
81
|
+
|
|
82
|
+
click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
83
|
+
result = oci.wait_until(client, client.get_usage_plan(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
|
|
84
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
85
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
86
|
+
click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
87
|
+
cli_util.render_response(result, ctx)
|
|
88
|
+
sys.exit(2)
|
|
89
|
+
except Exception:
|
|
90
|
+
click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
91
|
+
cli_util.render_response(result, ctx)
|
|
92
|
+
raise
|
|
93
|
+
else:
|
|
94
|
+
click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
|
|
95
|
+
cli_util.render_response(result, ctx)
|
|
96
|
+
|
|
97
|
+
|
|
37
98
|
@usage_plan_group.command(name=cli_util.override('usage_plans.change_usage_plan_compartment.command_name', 'change-compartment'), help=u"""Changes the usage plan compartment. \n[Command Reference](changeUsagePlanCompartment)""")
|
|
38
99
|
@cli_util.option('--usage-plan-id', required=True, help=u"""The ocid of the usage plan.""")
|
|
39
100
|
@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment in which the resource is created.""")
|
|
40
101
|
@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.""")
|
|
102
|
+
@cli_util.option('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""")
|
|
41
103
|
@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.""")
|
|
42
104
|
@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.""")
|
|
43
105
|
@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.""")
|
|
@@ -46,7 +108,7 @@ usage_plans_root_group.add_command(usage_plan_group)
|
|
|
46
108
|
@click.pass_context
|
|
47
109
|
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
48
110
|
@cli_util.wrap_exceptions
|
|
49
|
-
def change_usage_plan_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, usage_plan_id, compartment_id, if_match):
|
|
111
|
+
def change_usage_plan_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, usage_plan_id, compartment_id, if_match, is_lock_override):
|
|
50
112
|
|
|
51
113
|
if isinstance(usage_plan_id, six.string_types) and len(usage_plan_id.strip()) == 0:
|
|
52
114
|
raise click.UsageError('Parameter --usage-plan-id cannot be whitespace or empty string')
|
|
@@ -54,6 +116,8 @@ def change_usage_plan_compartment(ctx, from_json, wait_for_state, max_wait_secon
|
|
|
54
116
|
kwargs = {}
|
|
55
117
|
if if_match is not None:
|
|
56
118
|
kwargs['if_match'] = if_match
|
|
119
|
+
if is_lock_override is not None:
|
|
120
|
+
kwargs['is_lock_override'] = is_lock_override
|
|
57
121
|
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
58
122
|
|
|
59
123
|
_details = {}
|
|
@@ -103,6 +167,9 @@ def change_usage_plan_compartment(ctx, from_json, wait_for_state, max_wait_secon
|
|
|
103
167
|
@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.
|
|
104
168
|
|
|
105
169
|
Example: `My new resource`""")
|
|
170
|
+
@cli_util.option('--locks', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Locks associated with this resource.
|
|
171
|
+
|
|
172
|
+
This option is a JSON list with items of type AddResourceLockDetails. For documentation on AddResourceLockDetails please see our API reference: https://docs.cloud.oracle.com/api/#/en/usageplans/20190501/datatypes/AddResourceLockDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
106
173
|
@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].
|
|
107
174
|
|
|
108
175
|
Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
@@ -112,12 +179,12 @@ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_comp
|
|
|
112
179
|
@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.""")
|
|
113
180
|
@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.""")
|
|
114
181
|
@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.""")
|
|
115
|
-
@json_skeleton_utils.get_cli_json_input_option({'entitlements': {'module': 'apigateway', 'class': 'list[Entitlement]'}, 'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}})
|
|
182
|
+
@json_skeleton_utils.get_cli_json_input_option({'entitlements': {'module': 'apigateway', 'class': 'list[Entitlement]'}, 'locks': {'module': 'apigateway', 'class': 'list[AddResourceLockDetails]'}, 'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}})
|
|
116
183
|
@cli_util.help_option
|
|
117
184
|
@click.pass_context
|
|
118
|
-
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'entitlements': {'module': 'apigateway', 'class': 'list[Entitlement]'}, 'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'apigateway', 'class': 'UsagePlan'})
|
|
185
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'entitlements': {'module': 'apigateway', 'class': 'list[Entitlement]'}, 'locks': {'module': 'apigateway', 'class': 'list[AddResourceLockDetails]'}, 'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'apigateway', 'class': 'UsagePlan'})
|
|
119
186
|
@cli_util.wrap_exceptions
|
|
120
|
-
def create_usage_plan(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, entitlements, compartment_id, display_name, freeform_tags, defined_tags):
|
|
187
|
+
def create_usage_plan(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, entitlements, compartment_id, display_name, locks, freeform_tags, defined_tags):
|
|
121
188
|
|
|
122
189
|
kwargs = {}
|
|
123
190
|
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
@@ -129,6 +196,9 @@ def create_usage_plan(ctx, from_json, wait_for_state, max_wait_seconds, wait_int
|
|
|
129
196
|
if display_name is not None:
|
|
130
197
|
_details['displayName'] = display_name
|
|
131
198
|
|
|
199
|
+
if locks is not None:
|
|
200
|
+
_details['locks'] = cli_util.parse_json_parameter("locks", locks)
|
|
201
|
+
|
|
132
202
|
if freeform_tags is not None:
|
|
133
203
|
_details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
|
|
134
204
|
|
|
@@ -175,6 +245,7 @@ def create_usage_plan(ctx, from_json, wait_for_state, max_wait_seconds, wait_int
|
|
|
175
245
|
@usage_plan_group.command(name=cli_util.override('usage_plans.delete_usage_plan.command_name', 'delete'), help=u"""Deletes the usage plan with the given identifier. \n[Command Reference](deleteUsagePlan)""")
|
|
176
246
|
@cli_util.option('--usage-plan-id', required=True, help=u"""The ocid of the usage plan.""")
|
|
177
247
|
@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.""")
|
|
248
|
+
@cli_util.option('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""")
|
|
178
249
|
@cli_util.confirm_delete_option
|
|
179
250
|
@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.""")
|
|
180
251
|
@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.""")
|
|
@@ -184,7 +255,7 @@ def create_usage_plan(ctx, from_json, wait_for_state, max_wait_seconds, wait_int
|
|
|
184
255
|
@click.pass_context
|
|
185
256
|
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
|
|
186
257
|
@cli_util.wrap_exceptions
|
|
187
|
-
def delete_usage_plan(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, usage_plan_id, if_match):
|
|
258
|
+
def delete_usage_plan(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, usage_plan_id, if_match, is_lock_override):
|
|
188
259
|
|
|
189
260
|
if isinstance(usage_plan_id, six.string_types) and len(usage_plan_id.strip()) == 0:
|
|
190
261
|
raise click.UsageError('Parameter --usage-plan-id cannot be whitespace or empty string')
|
|
@@ -192,6 +263,8 @@ def delete_usage_plan(ctx, from_json, wait_for_state, max_wait_seconds, wait_int
|
|
|
192
263
|
kwargs = {}
|
|
193
264
|
if if_match is not None:
|
|
194
265
|
kwargs['if_match'] = if_match
|
|
266
|
+
if is_lock_override is not None:
|
|
267
|
+
kwargs['is_lock_override'] = is_lock_override
|
|
195
268
|
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
196
269
|
client = cli_util.build_client('apigateway', 'usage_plans', ctx)
|
|
197
270
|
result = client.delete_usage_plan(
|
|
@@ -314,6 +387,63 @@ def list_usage_plans(ctx, from_json, all_pages, page_size, compartment_id, displ
|
|
|
314
387
|
cli_util.render_response(result, ctx)
|
|
315
388
|
|
|
316
389
|
|
|
390
|
+
@usage_plan_group.command(name=cli_util.override('usage_plans.remove_usage_plan_lock.command_name', 'remove'), help=u"""Removes a lock from a UsagePlan resource. \n[Command Reference](removeUsagePlanLock)""")
|
|
391
|
+
@cli_util.option('--usage-plan-id', required=True, help=u"""The ocid of the usage plan.""")
|
|
392
|
+
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL", "DELETE"]), help=u"""Type of the lock.""")
|
|
393
|
+
@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.""")
|
|
394
|
+
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), 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.""")
|
|
395
|
+
@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.""")
|
|
396
|
+
@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.""")
|
|
397
|
+
@json_skeleton_utils.get_cli_json_input_option({})
|
|
398
|
+
@cli_util.help_option
|
|
399
|
+
@click.pass_context
|
|
400
|
+
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'apigateway', 'class': 'UsagePlan'})
|
|
401
|
+
@cli_util.wrap_exceptions
|
|
402
|
+
def remove_usage_plan_lock(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, usage_plan_id, type, if_match):
|
|
403
|
+
|
|
404
|
+
if isinstance(usage_plan_id, six.string_types) and len(usage_plan_id.strip()) == 0:
|
|
405
|
+
raise click.UsageError('Parameter --usage-plan-id cannot be whitespace or empty string')
|
|
406
|
+
|
|
407
|
+
kwargs = {}
|
|
408
|
+
if if_match is not None:
|
|
409
|
+
kwargs['if_match'] = if_match
|
|
410
|
+
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
411
|
+
|
|
412
|
+
_details = {}
|
|
413
|
+
_details['type'] = type
|
|
414
|
+
|
|
415
|
+
client = cli_util.build_client('apigateway', 'usage_plans', ctx)
|
|
416
|
+
result = client.remove_usage_plan_lock(
|
|
417
|
+
usage_plan_id=usage_plan_id,
|
|
418
|
+
remove_resource_lock_details=_details,
|
|
419
|
+
**kwargs
|
|
420
|
+
)
|
|
421
|
+
if wait_for_state:
|
|
422
|
+
|
|
423
|
+
if hasattr(client, 'get_usage_plan') and callable(getattr(client, 'get_usage_plan')):
|
|
424
|
+
try:
|
|
425
|
+
wait_period_kwargs = {}
|
|
426
|
+
if max_wait_seconds is not None:
|
|
427
|
+
wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
|
|
428
|
+
if wait_interval_seconds is not None:
|
|
429
|
+
wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
|
|
430
|
+
|
|
431
|
+
click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
|
|
432
|
+
result = oci.wait_until(client, client.get_usage_plan(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
|
|
433
|
+
except oci.exceptions.MaximumWaitTimeExceeded as e:
|
|
434
|
+
# If we fail, we should show an error, but we should still provide the information to the customer
|
|
435
|
+
click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
|
|
436
|
+
cli_util.render_response(result, ctx)
|
|
437
|
+
sys.exit(2)
|
|
438
|
+
except Exception:
|
|
439
|
+
click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
|
|
440
|
+
cli_util.render_response(result, ctx)
|
|
441
|
+
raise
|
|
442
|
+
else:
|
|
443
|
+
click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
|
|
444
|
+
cli_util.render_response(result, ctx)
|
|
445
|
+
|
|
446
|
+
|
|
317
447
|
@usage_plan_group.command(name=cli_util.override('usage_plans.update_usage_plan.command_name', 'update'), help=u"""Updates the usage plan with the given identifier. \n[Command Reference](updateUsagePlan)""")
|
|
318
448
|
@cli_util.option('--usage-plan-id', required=True, help=u"""The ocid of the usage plan.""")
|
|
319
449
|
@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.
|
|
@@ -329,6 +459,7 @@ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMP
|
|
|
329
459
|
|
|
330
460
|
Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
|
|
331
461
|
@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.""")
|
|
462
|
+
@cli_util.option('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""")
|
|
332
463
|
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
|
|
333
464
|
@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.""")
|
|
334
465
|
@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.""")
|
|
@@ -338,7 +469,7 @@ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_comp
|
|
|
338
469
|
@click.pass_context
|
|
339
470
|
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'entitlements': {'module': 'apigateway', 'class': 'list[Entitlement]'}, 'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}})
|
|
340
471
|
@cli_util.wrap_exceptions
|
|
341
|
-
def update_usage_plan(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, usage_plan_id, display_name, entitlements, freeform_tags, defined_tags, if_match):
|
|
472
|
+
def update_usage_plan(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, usage_plan_id, display_name, entitlements, freeform_tags, defined_tags, if_match, is_lock_override):
|
|
342
473
|
|
|
343
474
|
if isinstance(usage_plan_id, six.string_types) and len(usage_plan_id.strip()) == 0:
|
|
344
475
|
raise click.UsageError('Parameter --usage-plan-id cannot be whitespace or empty string')
|
|
@@ -350,6 +481,8 @@ def update_usage_plan(ctx, from_json, force, wait_for_state, max_wait_seconds, w
|
|
|
350
481
|
kwargs = {}
|
|
351
482
|
if if_match is not None:
|
|
352
483
|
kwargs['if_match'] = if_match
|
|
484
|
+
if is_lock_override is not None:
|
|
485
|
+
kwargs['is_lock_override'] = is_lock_override
|
|
353
486
|
kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
|
|
354
487
|
|
|
355
488
|
_details = {}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
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
4
|
|
|
5
5
|
from __future__ import print_function
|
|
6
|
+
from oci_cli import cli_util # noqa: F401
|
|
6
7
|
|
|
7
8
|
from services.apigateway.src.oci_cli_apigateway.generated import api_gateway_service_cli
|
|
8
9
|
from services.apigateway.src.oci_cli_usage_plans.generated import usageplans_cli
|
|
@@ -15,3 +16,11 @@ from services.apigateway.src.oci_cli_usage_plans.generated import usageplans_cli
|
|
|
15
16
|
|
|
16
17
|
api_gateway_service_cli.api_gateway_service_group.commands.pop(usageplans_cli.usage_plans_root_group.name)
|
|
17
18
|
api_gateway_service_cli.api_gateway_service_group.add_command(usageplans_cli.usage_plan_group)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# oci api-gateway usage-plan add -> oci api-gateway usage-plan add-lock
|
|
22
|
+
cli_util.rename_command(usageplans_cli, usageplans_cli.usage_plan_group, usageplans_cli.add_usage_plan_lock, "add-lock")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# oci api-gateway usage-plan remove -> oci api-gateway usage-plan remove-lock
|
|
26
|
+
cli_util.rename_command(usageplans_cli, usageplans_cli.usage_plan_group, usageplans_cli.remove_usage_plan_lock, "remove-lock")
|
|
@@ -96,3 +96,19 @@ cli_util.rename_command(config_cli, config_cli.apm_config_root_group, config_cli
|
|
|
96
96
|
|
|
97
97
|
# oci apm-config import-configuration-details -> oci apm-config import-configuration
|
|
98
98
|
cli_util.rename_command(config_cli, config_cli.apm_config_root_group, config_cli.import_configuration_details_group, "import-configuration")
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
# oci apm-config config create-config-create-agent-config-details -> oci apm-config config create-agent
|
|
102
|
+
cli_util.rename_command(config_cli, config_cli.config_group, config_cli.create_config_create_agent_config_details, "create-agent")
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
# oci apm-config config create-config-create-macs-apm-extension-details -> oci apm-config config create-macs-extension
|
|
106
|
+
cli_util.rename_command(config_cli, config_cli.config_group, config_cli.create_config_create_macs_apm_extension_details, "create-macs-extension")
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
# oci apm-config config update-config-update-agent-config-details -> oci apm-config config update-agent
|
|
110
|
+
cli_util.rename_command(config_cli, config_cli.config_group, config_cli.update_config_update_agent_config_details, "update-agent")
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
# oci apm-config config update-config-update-macs-apm-extension-details -> oci apm-config config update-macs-extension
|
|
114
|
+
cli_util.rename_command(config_cli, config_cli.config_group, config_cli.update_config_update_macs_apm_extension_details, "update-macs-extension")
|