oci-cli 3.63.0__py3-none-any.whl → 3.63.2__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.
Files changed (187) hide show
  1. oci_cli/bin/devops.psm1 +5 -4
  2. oci_cli/bin/psql.psm1 +4 -4
  3. oci_cli/bin/vault.psm1 +3 -3
  4. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/api/add-lock.txt +141 -0
  5. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/api/change-compartment.txt +4 -0
  6. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/api/create.txt +17 -0
  7. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/api/delete.txt +4 -0
  8. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/api/remove-lock.txt +136 -0
  9. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/api/update.txt +4 -0
  10. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/api.txt +4 -0
  11. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/certificate/add-lock.txt +143 -0
  12. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/certificate/change-compartment.txt +4 -0
  13. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/certificate/create.txt +17 -0
  14. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/certificate/delete.txt +4 -0
  15. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/certificate/remove-lock.txt +138 -0
  16. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/certificate/update.txt +4 -0
  17. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/certificate.txt +4 -0
  18. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/deployment/add-lock.txt +150 -0
  19. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/deployment/change-compartment.txt +4 -0
  20. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/deployment/create.txt +17 -0
  21. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/deployment/delete.txt +4 -0
  22. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/deployment/remove-lock.txt +145 -0
  23. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/deployment/update.txt +4 -0
  24. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/deployment.txt +4 -0
  25. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/gateway/add-lock.txt +142 -0
  26. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/gateway/change-compartment.txt +4 -0
  27. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/gateway/create.txt +18 -1
  28. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/gateway/delete.txt +4 -0
  29. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/gateway/remove-lock.txt +137 -0
  30. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/gateway/update.txt +5 -1
  31. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/gateway.txt +4 -0
  32. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/sdk/add-lock.txt +144 -0
  33. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/sdk/create.txt +17 -0
  34. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/sdk/delete.txt +4 -0
  35. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/sdk/list.txt +4 -2
  36. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/sdk/remove-lock.txt +139 -0
  37. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/sdk/update.txt +4 -0
  38. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/sdk.txt +4 -0
  39. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/subscriber/add-lock.txt +147 -0
  40. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/subscriber/change-compartment.txt +4 -0
  41. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/subscriber/create.txt +17 -0
  42. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/subscriber/delete.txt +4 -0
  43. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/subscriber/remove-lock.txt +142 -0
  44. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/subscriber/update.txt +4 -0
  45. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/subscriber.txt +4 -0
  46. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/usage-plan/add-lock.txt +146 -0
  47. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/usage-plan/change-compartment.txt +4 -0
  48. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/usage-plan/create.txt +17 -0
  49. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/usage-plan/delete.txt +4 -0
  50. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/usage-plan/remove-lock.txt +141 -0
  51. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/usage-plan/update.txt +4 -0
  52. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway/usage-plan.txt +4 -0
  53. oci_cli/help_text_producer/data_files/text/cmdref/api-gateway.txt +28 -0
  54. oci_cli/help_text_producer/data_files/text/cmdref/api-platform/api-platform-instance/change-compartment.txt +108 -0
  55. oci_cli/help_text_producer/data_files/text/cmdref/api-platform/api-platform-instance/create.txt +153 -0
  56. oci_cli/help_text_producer/data_files/text/cmdref/api-platform/api-platform-instance/delete.txt +132 -0
  57. oci_cli/help_text_producer/data_files/text/cmdref/api-platform/api-platform-instance/get.txt +94 -0
  58. oci_cli/help_text_producer/data_files/text/cmdref/api-platform/api-platform-instance/update.txt +162 -0
  59. oci_cli/help_text_producer/data_files/text/cmdref/api-platform/api-platform-instance-collection/list-api-platform-instances.txt +141 -0
  60. oci_cli/help_text_producer/data_files/text/cmdref/api-platform/api-platform-instance-collection.txt +15 -0
  61. oci_cli/help_text_producer/data_files/text/cmdref/api-platform/api-platform-instance.txt +23 -0
  62. oci_cli/help_text_producer/data_files/text/cmdref/api-platform/work-request/get.txt +91 -0
  63. oci_cli/help_text_producer/data_files/text/cmdref/api-platform/work-request/list.txt +140 -0
  64. oci_cli/help_text_producer/data_files/text/cmdref/api-platform/work-request-error/list.txt +131 -0
  65. oci_cli/help_text_producer/data_files/text/cmdref/api-platform/work-request-error.txt +15 -0
  66. oci_cli/help_text_producer/data_files/text/cmdref/api-platform/work-request-log-entry/list-work-request-logs.txt +131 -0
  67. oci_cli/help_text_producer/data_files/text/cmdref/api-platform/work-request-log-entry.txt +15 -0
  68. oci_cli/help_text_producer/data_files/text/cmdref/api-platform/work-request.txt +21 -0
  69. oci_cli/help_text_producer/data_files/text/cmdref/api-platform.txt +42 -0
  70. oci_cli/help_text_producer/data_files/text/cmdref/apm-config/config/create-agent.txt +153 -0
  71. oci_cli/help_text_producer/data_files/text/cmdref/apm-config/config/create-macs-extension.txt +171 -0
  72. oci_cli/help_text_producer/data_files/text/cmdref/apm-config/config/update-agent.txt +162 -0
  73. oci_cli/help_text_producer/data_files/text/cmdref/apm-config/config/update-macs-extension.txt +174 -0
  74. oci_cli/help_text_producer/data_files/text/cmdref/apm-config/config-collection/list.txt +2 -1
  75. oci_cli/help_text_producer/data_files/text/cmdref/apm-config/config.txt +8 -0
  76. oci_cli/help_text_producer/data_files/text/cmdref/apm-config/match-agents-with-attribute-key/get.txt +91 -0
  77. oci_cli/help_text_producer/data_files/text/cmdref/apm-config/match-agents-with-attribute-key/update.txt +107 -0
  78. oci_cli/help_text_producer/data_files/text/cmdref/apm-config/match-agents-with-attribute-key.txt +16 -0
  79. oci_cli/help_text_producer/data_files/text/cmdref/apm-config.txt +14 -0
  80. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-deployment/create-model-deployment-model-group-deployment-configuration-details.txt +215 -0
  81. 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
  82. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-deployment-model-state/list.txt +167 -0
  83. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-deployment-model-state.txt +14 -0
  84. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-deployment.txt +5 -0
  85. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/activate.txt +130 -0
  86. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/change-compartment.txt +108 -0
  87. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/create-model-group-artifact.txt +123 -0
  88. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/create-model-group-clone-model-group-details.txt +139 -0
  89. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/create-model-group-create-model-group-details.txt +197 -0
  90. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/create.txt +132 -0
  91. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/deactivate.txt +130 -0
  92. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/delete.txt +134 -0
  93. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/get-model-group-artifact-content.txt +107 -0
  94. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/get.txt +97 -0
  95. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/head-model-group-artifact.txt +96 -0
  96. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/list-model-group-models.txt +171 -0
  97. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/list.txt +169 -0
  98. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group/update.txt +180 -0
  99. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group-version-history/change-compartment.txt +108 -0
  100. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group-version-history/create.txt +166 -0
  101. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group-version-history/delete.txt +133 -0
  102. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group-version-history/get.txt +95 -0
  103. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group-version-history/list.txt +165 -0
  104. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group-version-history/update.txt +172 -0
  105. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group-version-history.txt +25 -0
  106. oci_cli/help_text_producer/data_files/text/cmdref/data-science/model-group.txt +41 -0
  107. oci_cli/help_text_producer/data_files/text/cmdref/data-science/work-request/list.txt +1 -1
  108. oci_cli/help_text_producer/data_files/text/cmdref/data-science.txt +54 -0
  109. oci_cli/help_text_producer/data_files/text/cmdref/devops/{protected-branch → protected-branch-collection}/list-protected-branches.txt +2 -2
  110. oci_cli/help_text_producer/data_files/text/cmdref/devops/protected-branch-collection.txt +14 -0
  111. oci_cli/help_text_producer/data_files/text/cmdref/devops/protected-branch.txt +0 -2
  112. oci_cli/help_text_producer/data_files/text/cmdref/devops.txt +2 -0
  113. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-amazon-s3-connection.txt +9 -9
  114. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/{create-connection-create-iceberg-connection-details.txt → create-iceberg-connection.txt} +9 -9
  115. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-amazon-s3-connection.txt +9 -9
  116. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/{update-connection-update-iceberg-connection-details.txt → update-iceberg-connection.txt} +5 -5
  117. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection.txt +4 -4
  118. oci_cli/help_text_producer/data_files/text/cmdref/goldengate.txt +4 -4
  119. oci_cli/help_text_producer/data_files/text/cmdref/lfs/lustre-file-system.txt +1 -1
  120. oci_cli/help_text_producer/data_files/text/cmdref/lfs.txt +1 -2
  121. oci_cli/help_text_producer/data_files/text/cmdref/management-dashboard/dashboard/get-oob.txt +3 -2
  122. oci_cli/help_text_producer/data_files/text/cmdref/management-dashboard/dashboard/import.txt +24 -0
  123. oci_cli/help_text_producer/data_files/text/cmdref/management-dashboard/dashboard/list-oob.txt +2 -2
  124. oci_cli/help_text_producer/data_files/text/cmdref/management-dashboard/saved-search/get-oob.txt +1 -1
  125. oci_cli/help_text_producer/data_files/text/cmdref/management-dashboard/saved-search/list-oob.txt +1 -1
  126. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/work-request-error/{list.txt → list-errors.txt} +5 -5
  127. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/work-request-error.txt +1 -1
  128. oci_cli/help_text_producer/data_files/text/cmdref/ocvs.txt +1 -1
  129. oci_cli/help_text_producer/data_files/text/cmdref/organizations/work-request-error/{list.txt → list-errors.txt} +5 -5
  130. oci_cli/help_text_producer/data_files/text/cmdref/organizations/work-request-error.txt +1 -1
  131. oci_cli/help_text_producer/data_files/text/cmdref/organizations/{work-request-log-entry → work-request-log}/list.txt +19 -1
  132. oci_cli/help_text_producer/data_files/text/cmdref/organizations/{work-request-log-entry.txt → work-request-log.txt} +2 -2
  133. oci_cli/help_text_producer/data_files/text/cmdref/organizations.txt +2 -2
  134. oci_cli/help_text_producer/data_files/text/cmdref/psql/configuration/change-compartment.txt +1 -2
  135. oci_cli/help_text_producer/data_files/text/cmdref/psql/configuration/create.txt +21 -7
  136. oci_cli/help_text_producer/data_files/text/cmdref/psql/configuration/delete.txt +1 -2
  137. oci_cli/help_text_producer/data_files/text/cmdref/psql/configuration/get.txt +1 -2
  138. oci_cli/help_text_producer/data_files/text/cmdref/psql/configuration/update.txt +13 -2
  139. oci_cli/help_text_producer/data_files/text/cmdref/psql/configuration-collection/list-configurations.txt +9 -2
  140. oci_cli/help_text_producer/data_files/text/cmdref/psql/default-configuration-collection/list-default-configurations.txt +9 -2
  141. oci_cli/help_text_producer/data_files/text/cmdref/session/authenticate.txt +8 -8
  142. oci_cli/help_text_producer/data_files/text/cmdref/speech/voice/list.txt +6 -1
  143. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/create.txt +4 -4
  144. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/get.txt +2 -2
  145. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/list.txt +1 -1
  146. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/update.txt +4 -4
  147. oci_cli/help_text_producer/data_files/text/cmdref/support/incident-resource-type/list.txt +3 -3
  148. oci_cli/help_text_producer/data_files/text/cmdref/support/validation-response/validate-user.txt +1 -1
  149. oci_cli/help_text_producer/data_files/text/cmdref/vault/secret/create-base64.txt +11 -0
  150. oci_cli/help_text_producer/data_files/text/cmdref/vault/secret/update-base64.txt +11 -0
  151. oci_cli/help_text_producer/data_files/text/cmdref/vault/secret/update.txt +11 -0
  152. oci_cli/help_text_producer/data_files/text/index.txt +2 -0
  153. oci_cli/service_mapping.py +5 -0
  154. oci_cli/version.py +1 -1
  155. {oci_cli-3.63.0.dist-info → oci_cli-3.63.2.dist-info}/METADATA +2 -2
  156. {oci_cli-3.63.0.dist-info → oci_cli-3.63.2.dist-info}/RECORD +187 -116
  157. services/ai_speech/src/oci_cli_ai_service_speech/generated/aiservicespeech_cli.py +5 -2
  158. services/api_platform/__init__.py +4 -0
  159. services/api_platform/src/__init__.py +4 -0
  160. services/api_platform/src/oci_cli_api_platform/__init__.py +4 -0
  161. services/api_platform/src/oci_cli_api_platform/generated/__init__.py +4 -0
  162. services/api_platform/src/oci_cli_api_platform/generated/apiplatform_cli.py +567 -0
  163. services/api_platform/src/oci_cli_api_platform/generated/client_mappings.py +14 -0
  164. services/api_platform/tests/__init__.py +4 -0
  165. services/apigateway/src/oci_cli_api_gateway/api_gateway_cli_extended.py +24 -0
  166. services/apigateway/src/oci_cli_api_gateway/generated/apigateway_cli.py +415 -19
  167. services/apigateway/src/oci_cli_deployment/apigateway_deployment_extended.py +8 -0
  168. services/apigateway/src/oci_cli_deployment/generated/deployment_cli.py +139 -6
  169. services/apigateway/src/oci_cli_gateway/apigateway_gateway_extended.py +9 -1
  170. services/apigateway/src/oci_cli_gateway/generated/gateway_cli.py +171 -20
  171. services/apigateway/src/oci_cli_subscribers/generated/subscribers_cli.py +139 -6
  172. services/apigateway/src/oci_cli_subscribers/subscribers_cli_extended.py +9 -0
  173. services/apigateway/src/oci_cli_usage_plans/generated/usageplans_cli.py +139 -6
  174. services/apigateway/src/oci_cli_usage_plans/usageplans_cli_extended.py +9 -0
  175. services/apm_config/src/oci_cli_config/config_cli_extended.py +16 -0
  176. services/apm_config/src/oci_cli_config/generated/config_cli.py +289 -3
  177. services/data_science/src/oci_cli_data_science/generated/datascience_cli.py +1477 -98
  178. services/devops/src/oci_cli_devops/devops_cli_extended.py +11 -11
  179. services/golden_gate/src/oci_cli_golden_gate/golden_gate_cli_extended.py +44 -0
  180. services/management_dashboard/src/oci_cli_dashx_apis/generated/dashxapis_cli.py +18 -6
  181. services/psql/src/oci_cli_postgresql/generated/postgresql_cli.py +38 -14
  182. services/vault/src/oci_cli_vaults/generated/vaults_cli.py +80 -40
  183. {oci_cli-3.63.0.dist-info → oci_cli-3.63.2.dist-info}/LICENSE.txt +0 -0
  184. {oci_cli-3.63.0.dist-info → oci_cli-3.63.2.dist-info}/THIRD_PARTY_LICENSES.txt +0 -0
  185. {oci_cli-3.63.0.dist-info → oci_cli-3.63.2.dist-info}/WHEEL +0 -0
  186. {oci_cli-3.63.0.dist-info → oci_cli-3.63.2.dist-info}/entry_points.txt +0 -0
  187. {oci_cli-3.63.0.dist-info → oci_cli-3.63.2.dist-info}/top_level.txt +0 -0
@@ -77,10 +77,194 @@ api_gateway_service_cli.api_gateway_service_group.add_command(api_group)
77
77
  api_gateway_service_cli.api_gateway_service_group.add_command(sdk_group)
78
78
 
79
79
 
80
+ @api_group.command(name=cli_util.override('api_gateway.add_api_lock.command_name', 'add'), help=u"""Adds a lock to a Api resource. \n[Command Reference](addApiLock)""")
81
+ @cli_util.option('--api-id', required=True, help=u"""The ocid of the API.""")
82
+ @cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL", "DELETE"]), help=u"""Type of the lock.""")
83
+ @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.""")
84
+ @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.""")
85
+ @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.""")
86
+ @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.""")
87
+ @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.""")
88
+ @json_skeleton_utils.get_cli_json_input_option({})
89
+ @cli_util.help_option
90
+ @click.pass_context
91
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'apigateway', 'class': 'Api'})
92
+ @cli_util.wrap_exceptions
93
+ def add_api_lock(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, api_id, type, message, if_match):
94
+
95
+ if isinstance(api_id, six.string_types) and len(api_id.strip()) == 0:
96
+ raise click.UsageError('Parameter --api-id cannot be whitespace or empty string')
97
+
98
+ kwargs = {}
99
+ if if_match is not None:
100
+ kwargs['if_match'] = if_match
101
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
102
+
103
+ _details = {}
104
+ _details['type'] = type
105
+
106
+ if message is not None:
107
+ _details['message'] = message
108
+
109
+ client = cli_util.build_client('apigateway', 'api_gateway', ctx)
110
+ result = client.add_api_lock(
111
+ api_id=api_id,
112
+ add_resource_lock_details=_details,
113
+ **kwargs
114
+ )
115
+ if wait_for_state:
116
+
117
+ if hasattr(client, 'get_api') and callable(getattr(client, 'get_api')):
118
+ try:
119
+ wait_period_kwargs = {}
120
+ if max_wait_seconds is not None:
121
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
122
+ if wait_interval_seconds is not None:
123
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
124
+
125
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
126
+ result = oci.wait_until(client, client.get_api(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
127
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
128
+ # If we fail, we should show an error, but we should still provide the information to the customer
129
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
130
+ cli_util.render_response(result, ctx)
131
+ sys.exit(2)
132
+ except Exception:
133
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
134
+ cli_util.render_response(result, ctx)
135
+ raise
136
+ else:
137
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
138
+ cli_util.render_response(result, ctx)
139
+
140
+
141
+ @certificate_group.command(name=cli_util.override('api_gateway.add_certificate_lock.command_name', 'add'), help=u"""Adds a lock to a Certificate resource. \n[Command Reference](addCertificateLock)""")
142
+ @cli_util.option('--certificate-id', required=True, help=u"""The ocid of the certificate.""")
143
+ @cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL", "DELETE"]), help=u"""Type of the lock.""")
144
+ @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.""")
145
+ @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.""")
146
+ @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.""")
147
+ @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.""")
148
+ @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.""")
149
+ @json_skeleton_utils.get_cli_json_input_option({})
150
+ @cli_util.help_option
151
+ @click.pass_context
152
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'apigateway', 'class': 'Certificate'})
153
+ @cli_util.wrap_exceptions
154
+ def add_certificate_lock(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, certificate_id, type, message, if_match):
155
+
156
+ if isinstance(certificate_id, six.string_types) and len(certificate_id.strip()) == 0:
157
+ raise click.UsageError('Parameter --certificate-id cannot be whitespace or empty string')
158
+
159
+ kwargs = {}
160
+ if if_match is not None:
161
+ kwargs['if_match'] = if_match
162
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
163
+
164
+ _details = {}
165
+ _details['type'] = type
166
+
167
+ if message is not None:
168
+ _details['message'] = message
169
+
170
+ client = cli_util.build_client('apigateway', 'api_gateway', ctx)
171
+ result = client.add_certificate_lock(
172
+ certificate_id=certificate_id,
173
+ add_resource_lock_details=_details,
174
+ **kwargs
175
+ )
176
+ if wait_for_state:
177
+
178
+ if hasattr(client, 'get_certificate') and callable(getattr(client, 'get_certificate')):
179
+ try:
180
+ wait_period_kwargs = {}
181
+ if max_wait_seconds is not None:
182
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
183
+ if wait_interval_seconds is not None:
184
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
185
+
186
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
187
+ result = oci.wait_until(client, client.get_certificate(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
188
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
189
+ # If we fail, we should show an error, but we should still provide the information to the customer
190
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
191
+ cli_util.render_response(result, ctx)
192
+ sys.exit(2)
193
+ except Exception:
194
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
195
+ cli_util.render_response(result, ctx)
196
+ raise
197
+ else:
198
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
199
+ cli_util.render_response(result, ctx)
200
+
201
+
202
+ @sdk_group.command(name=cli_util.override('api_gateway.add_sdk_lock.command_name', 'add'), help=u"""Adds a lock to a Sdk resource. \n[Command Reference](addSdkLock)""")
203
+ @cli_util.option('--sdk-id', required=True, help=u"""The ocid of the SDK.""")
204
+ @cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL", "DELETE"]), help=u"""Type of the lock.""")
205
+ @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.""")
206
+ @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.""")
207
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "FAILED", "DELETING", "DELETED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
208
+ @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.""")
209
+ @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.""")
210
+ @json_skeleton_utils.get_cli_json_input_option({})
211
+ @cli_util.help_option
212
+ @click.pass_context
213
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'apigateway', 'class': 'Sdk'})
214
+ @cli_util.wrap_exceptions
215
+ def add_sdk_lock(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sdk_id, type, message, if_match):
216
+
217
+ if isinstance(sdk_id, six.string_types) and len(sdk_id.strip()) == 0:
218
+ raise click.UsageError('Parameter --sdk-id cannot be whitespace or empty string')
219
+
220
+ kwargs = {}
221
+ if if_match is not None:
222
+ kwargs['if_match'] = if_match
223
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
224
+
225
+ _details = {}
226
+ _details['type'] = type
227
+
228
+ if message is not None:
229
+ _details['message'] = message
230
+
231
+ client = cli_util.build_client('apigateway', 'api_gateway', ctx)
232
+ result = client.add_sdk_lock(
233
+ sdk_id=sdk_id,
234
+ add_resource_lock_details=_details,
235
+ **kwargs
236
+ )
237
+ if wait_for_state:
238
+
239
+ if hasattr(client, 'get_sdk') and callable(getattr(client, 'get_sdk')):
240
+ try:
241
+ wait_period_kwargs = {}
242
+ if max_wait_seconds is not None:
243
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
244
+ if wait_interval_seconds is not None:
245
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
246
+
247
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
248
+ result = oci.wait_until(client, client.get_sdk(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
249
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
250
+ # If we fail, we should show an error, but we should still provide the information to the customer
251
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
252
+ cli_util.render_response(result, ctx)
253
+ sys.exit(2)
254
+ except Exception:
255
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
256
+ cli_util.render_response(result, ctx)
257
+ raise
258
+ else:
259
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
260
+ cli_util.render_response(result, ctx)
261
+
262
+
80
263
  @api_group.command(name=cli_util.override('api_gateway.change_api_compartment.command_name', 'change-compartment'), help=u"""Changes the API compartment. \n[Command Reference](changeApiCompartment)""")
81
264
  @cli_util.option('--api-id', required=True, help=u"""The ocid of the API.""")
82
265
  @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment in which the resource is created.""")
83
266
  @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.""")
267
+ @cli_util.option('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""")
84
268
  @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.""")
85
269
  @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.""")
86
270
  @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.""")
@@ -89,7 +273,7 @@ api_gateway_service_cli.api_gateway_service_group.add_command(sdk_group)
89
273
  @click.pass_context
90
274
  @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
91
275
  @cli_util.wrap_exceptions
92
- def change_api_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, api_id, compartment_id, if_match):
276
+ def change_api_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, api_id, compartment_id, if_match, is_lock_override):
93
277
 
94
278
  if isinstance(api_id, six.string_types) and len(api_id.strip()) == 0:
95
279
  raise click.UsageError('Parameter --api-id cannot be whitespace or empty string')
@@ -97,6 +281,8 @@ def change_api_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wai
97
281
  kwargs = {}
98
282
  if if_match is not None:
99
283
  kwargs['if_match'] = if_match
284
+ if is_lock_override is not None:
285
+ kwargs['is_lock_override'] = is_lock_override
100
286
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
101
287
 
102
288
  _details = {}
@@ -144,12 +330,13 @@ def change_api_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wai
144
330
  @cli_util.option('--certificate-id', required=True, help=u"""The ocid of the certificate.""")
145
331
  @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment in which the resource is created.""")
146
332
  @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.""")
333
+ @cli_util.option('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""")
147
334
  @json_skeleton_utils.get_cli_json_input_option({})
148
335
  @cli_util.help_option
149
336
  @click.pass_context
150
337
  @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
151
338
  @cli_util.wrap_exceptions
152
- def change_certificate_compartment(ctx, from_json, certificate_id, compartment_id, if_match):
339
+ def change_certificate_compartment(ctx, from_json, certificate_id, compartment_id, if_match, is_lock_override):
153
340
 
154
341
  if isinstance(certificate_id, six.string_types) and len(certificate_id.strip()) == 0:
155
342
  raise click.UsageError('Parameter --certificate-id cannot be whitespace or empty string')
@@ -157,6 +344,8 @@ def change_certificate_compartment(ctx, from_json, certificate_id, compartment_i
157
344
  kwargs = {}
158
345
  if if_match is not None:
159
346
  kwargs['if_match'] = if_match
347
+ if is_lock_override is not None:
348
+ kwargs['is_lock_override'] = is_lock_override
160
349
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
161
350
 
162
351
  _details = {}
@@ -182,16 +371,19 @@ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMP
182
371
  @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].
183
372
 
184
373
  Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
374
+ @cli_util.option('--locks', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Locks associated with this resource.
375
+
376
+ 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/apigateway/20190501/datatypes/AddResourceLockDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
185
377
  @cli_util.option('--content', help=u"""API Specification content in json or yaml format""")
186
378
  @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.""")
187
379
  @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.""")
188
380
  @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.""")
189
- @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}})
381
+ @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}, 'locks': {'module': 'apigateway', 'class': 'list[AddResourceLockDetails]'}})
190
382
  @cli_util.help_option
191
383
  @click.pass_context
192
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'apigateway', 'class': 'Api'})
384
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}, 'locks': {'module': 'apigateway', 'class': 'list[AddResourceLockDetails]'}}, output_type={'module': 'apigateway', 'class': 'Api'})
193
385
  @cli_util.wrap_exceptions
194
- def create_api(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, display_name, freeform_tags, defined_tags, content):
386
+ def create_api(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, display_name, freeform_tags, defined_tags, locks, content):
195
387
 
196
388
  kwargs = {}
197
389
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
@@ -208,6 +400,9 @@ def create_api(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_s
208
400
  if defined_tags is not None:
209
401
  _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
210
402
 
403
+ if locks is not None:
404
+ _details['locks'] = cli_util.parse_json_parameter("locks", locks)
405
+
211
406
  if content is not None:
212
407
  _details['content'] = content
213
408
 
@@ -262,15 +457,18 @@ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMP
262
457
  @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].
263
458
 
264
459
  Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
460
+ @cli_util.option('--locks', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Locks associated with this resource.
461
+
462
+ 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/apigateway/20190501/datatypes/AddResourceLockDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
265
463
  @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.""")
266
464
  @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.""")
267
465
  @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.""")
268
- @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}})
466
+ @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}, 'locks': {'module': 'apigateway', 'class': 'list[AddResourceLockDetails]'}})
269
467
  @cli_util.help_option
270
468
  @click.pass_context
271
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'apigateway', 'class': 'Certificate'})
469
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}, 'locks': {'module': 'apigateway', 'class': 'list[AddResourceLockDetails]'}}, output_type={'module': 'apigateway', 'class': 'Certificate'})
272
470
  @cli_util.wrap_exceptions
273
- def create_certificate(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, private_key, certificate, display_name, intermediate_certificates, freeform_tags, defined_tags):
471
+ def create_certificate(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, private_key, certificate, display_name, intermediate_certificates, freeform_tags, defined_tags, locks):
274
472
 
275
473
  kwargs = {}
276
474
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
@@ -292,6 +490,9 @@ def create_certificate(ctx, from_json, wait_for_state, max_wait_seconds, wait_in
292
490
  if defined_tags is not None:
293
491
  _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
294
492
 
493
+ if locks is not None:
494
+ _details['locks'] = cli_util.parse_json_parameter("locks", locks)
495
+
295
496
  client = cli_util.build_client('apigateway', 'api_gateway', ctx)
296
497
  result = client.create_certificate(
297
498
  create_certificate_details=_details,
@@ -335,6 +536,9 @@ def create_certificate(ctx, from_json, wait_for_state, max_wait_seconds, wait_in
335
536
  @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.
336
537
 
337
538
  Example: `My new resource`""")
539
+ @cli_util.option('--locks', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Locks associated with this resource.
540
+
541
+ 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/apigateway/20190501/datatypes/AddResourceLockDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
338
542
  @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].
339
543
 
340
544
  Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@@ -347,12 +551,12 @@ Example: `{\"configName\": \"configValue\"}`""" + custom_types.cli_complex_type.
347
551
  @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.""")
348
552
  @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.""")
349
553
  @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.""")
350
- @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}, 'parameters': {'module': 'apigateway', 'class': 'dict(str, string)'}})
554
+ @json_skeleton_utils.get_cli_json_input_option({'locks': {'module': 'apigateway', 'class': 'list[AddResourceLockDetails]'}, 'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}, 'parameters': {'module': 'apigateway', 'class': 'dict(str, string)'}})
351
555
  @cli_util.help_option
352
556
  @click.pass_context
353
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}, 'parameters': {'module': 'apigateway', 'class': 'dict(str, string)'}}, output_type={'module': 'apigateway', 'class': 'Sdk'})
557
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'locks': {'module': 'apigateway', 'class': 'list[AddResourceLockDetails]'}, 'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}, 'parameters': {'module': 'apigateway', 'class': 'dict(str, string)'}}, output_type={'module': 'apigateway', 'class': 'Sdk'})
354
558
  @cli_util.wrap_exceptions
355
- def create_sdk(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, target_language, api_id, display_name, freeform_tags, defined_tags, parameters):
559
+ def create_sdk(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, target_language, api_id, display_name, locks, freeform_tags, defined_tags, parameters):
356
560
 
357
561
  kwargs = {}
358
562
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
@@ -364,6 +568,9 @@ def create_sdk(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_s
364
568
  if display_name is not None:
365
569
  _details['displayName'] = display_name
366
570
 
571
+ if locks is not None:
572
+ _details['locks'] = cli_util.parse_json_parameter("locks", locks)
573
+
367
574
  if freeform_tags is not None:
368
575
  _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
369
576
 
@@ -413,6 +620,7 @@ def create_sdk(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_s
413
620
  @api_group.command(name=cli_util.override('api_gateway.delete_api.command_name', 'delete'), help=u"""Deletes the API with the given identifier. \n[Command Reference](deleteApi)""")
414
621
  @cli_util.option('--api-id', required=True, help=u"""The ocid of the API.""")
415
622
  @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.""")
623
+ @cli_util.option('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""")
416
624
  @cli_util.confirm_delete_option
417
625
  @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.""")
418
626
  @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.""")
@@ -422,7 +630,7 @@ def create_sdk(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_s
422
630
  @click.pass_context
423
631
  @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
424
632
  @cli_util.wrap_exceptions
425
- def delete_api(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, api_id, if_match):
633
+ def delete_api(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, api_id, if_match, is_lock_override):
426
634
 
427
635
  if isinstance(api_id, six.string_types) and len(api_id.strip()) == 0:
428
636
  raise click.UsageError('Parameter --api-id cannot be whitespace or empty string')
@@ -430,6 +638,8 @@ def delete_api(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_s
430
638
  kwargs = {}
431
639
  if if_match is not None:
432
640
  kwargs['if_match'] = if_match
641
+ if is_lock_override is not None:
642
+ kwargs['is_lock_override'] = is_lock_override
433
643
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
434
644
  client = cli_util.build_client('apigateway', 'api_gateway', ctx)
435
645
  result = client.delete_api(
@@ -471,6 +681,7 @@ def delete_api(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_s
471
681
  @certificate_group.command(name=cli_util.override('api_gateway.delete_certificate.command_name', 'delete'), help=u"""Deletes the certificate with the given identifier. \n[Command Reference](deleteCertificate)""")
472
682
  @cli_util.option('--certificate-id', required=True, help=u"""The ocid of the certificate.""")
473
683
  @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.""")
684
+ @cli_util.option('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""")
474
685
  @cli_util.confirm_delete_option
475
686
  @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.""")
476
687
  @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.""")
@@ -480,7 +691,7 @@ def delete_api(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_s
480
691
  @click.pass_context
481
692
  @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
482
693
  @cli_util.wrap_exceptions
483
- def delete_certificate(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, certificate_id, if_match):
694
+ def delete_certificate(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, certificate_id, if_match, is_lock_override):
484
695
 
485
696
  if isinstance(certificate_id, six.string_types) and len(certificate_id.strip()) == 0:
486
697
  raise click.UsageError('Parameter --certificate-id cannot be whitespace or empty string')
@@ -488,6 +699,8 @@ def delete_certificate(ctx, from_json, wait_for_state, max_wait_seconds, wait_in
488
699
  kwargs = {}
489
700
  if if_match is not None:
490
701
  kwargs['if_match'] = if_match
702
+ if is_lock_override is not None:
703
+ kwargs['is_lock_override'] = is_lock_override
491
704
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
492
705
  client = cli_util.build_client('apigateway', 'api_gateway', ctx)
493
706
  result = client.delete_certificate(
@@ -529,6 +742,7 @@ def delete_certificate(ctx, from_json, wait_for_state, max_wait_seconds, wait_in
529
742
  @sdk_group.command(name=cli_util.override('api_gateway.delete_sdk.command_name', 'delete'), help=u"""Deletes provided SDK. \n[Command Reference](deleteSdk)""")
530
743
  @cli_util.option('--sdk-id', required=True, help=u"""The ocid of the SDK.""")
531
744
  @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.""")
745
+ @cli_util.option('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""")
532
746
  @cli_util.confirm_delete_option
533
747
  @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.""")
534
748
  @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.""")
@@ -538,7 +752,7 @@ def delete_certificate(ctx, from_json, wait_for_state, max_wait_seconds, wait_in
538
752
  @click.pass_context
539
753
  @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
540
754
  @cli_util.wrap_exceptions
541
- def delete_sdk(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sdk_id, if_match):
755
+ def delete_sdk(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sdk_id, if_match, is_lock_override):
542
756
 
543
757
  if isinstance(sdk_id, six.string_types) and len(sdk_id.strip()) == 0:
544
758
  raise click.UsageError('Parameter --sdk-id cannot be whitespace or empty string')
@@ -546,6 +760,8 @@ def delete_sdk(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_s
546
760
  kwargs = {}
547
761
  if if_match is not None:
548
762
  kwargs['if_match'] = if_match
763
+ if is_lock_override is not None:
764
+ kwargs['is_lock_override'] = is_lock_override
549
765
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
550
766
  client = cli_util.build_client('apigateway', 'api_gateway', ctx)
551
767
  result = client.delete_sdk(
@@ -939,7 +1155,7 @@ def list_sdk_language_types(ctx, from_json, all_pages, page_size, compartment_id
939
1155
 
940
1156
 
941
1157
  @sdk_group.command(name=cli_util.override('api_gateway.list_sdks.command_name', 'list'), help=u"""Returns list of generated SDKs. \n[Command Reference](listSdks)""")
942
- @cli_util.option('--sdk-id', help=u"""The ocid of the SDK.""")
1158
+ @cli_util.option('--sdk-id', help=u"""The ocid of the SDK. This value must be present unless apiId is present.""")
943
1159
  @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
944
1160
 
945
1161
  Example: `My new resource`""")
@@ -950,7 +1166,7 @@ Example: `ACTIVE` or `DELETED`""")
950
1166
  @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
951
1167
  @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'. The default order depends on the sortBy value.""")
952
1168
  @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.""")
953
- @cli_util.option('--api-id', help=u"""The ocid of the API.""")
1169
+ @cli_util.option('--api-id', help=u"""The ocid of the API. This value must be present unless sdkId is present.""")
954
1170
  @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.""")
955
1171
  @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.""")
956
1172
  @json_skeleton_utils.get_cli_json_input_option({})
@@ -1004,6 +1220,177 @@ def list_sdks(ctx, from_json, all_pages, page_size, sdk_id, display_name, lifecy
1004
1220
  cli_util.render_response(result, ctx)
1005
1221
 
1006
1222
 
1223
+ @api_group.command(name=cli_util.override('api_gateway.remove_api_lock.command_name', 'remove'), help=u"""Removes a lock from a Api resource. \n[Command Reference](removeApiLock)""")
1224
+ @cli_util.option('--api-id', required=True, help=u"""The ocid of the API.""")
1225
+ @cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL", "DELETE"]), help=u"""Type of the lock.""")
1226
+ @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.""")
1227
+ @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.""")
1228
+ @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.""")
1229
+ @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.""")
1230
+ @json_skeleton_utils.get_cli_json_input_option({})
1231
+ @cli_util.help_option
1232
+ @click.pass_context
1233
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'apigateway', 'class': 'Api'})
1234
+ @cli_util.wrap_exceptions
1235
+ def remove_api_lock(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, api_id, type, if_match):
1236
+
1237
+ if isinstance(api_id, six.string_types) and len(api_id.strip()) == 0:
1238
+ raise click.UsageError('Parameter --api-id cannot be whitespace or empty string')
1239
+
1240
+ kwargs = {}
1241
+ if if_match is not None:
1242
+ kwargs['if_match'] = if_match
1243
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1244
+
1245
+ _details = {}
1246
+ _details['type'] = type
1247
+
1248
+ client = cli_util.build_client('apigateway', 'api_gateway', ctx)
1249
+ result = client.remove_api_lock(
1250
+ api_id=api_id,
1251
+ remove_resource_lock_details=_details,
1252
+ **kwargs
1253
+ )
1254
+ if wait_for_state:
1255
+
1256
+ if hasattr(client, 'get_api') and callable(getattr(client, 'get_api')):
1257
+ try:
1258
+ wait_period_kwargs = {}
1259
+ if max_wait_seconds is not None:
1260
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1261
+ if wait_interval_seconds is not None:
1262
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1263
+
1264
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
1265
+ result = oci.wait_until(client, client.get_api(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
1266
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1267
+ # If we fail, we should show an error, but we should still provide the information to the customer
1268
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
1269
+ cli_util.render_response(result, ctx)
1270
+ sys.exit(2)
1271
+ except Exception:
1272
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
1273
+ cli_util.render_response(result, ctx)
1274
+ raise
1275
+ else:
1276
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1277
+ cli_util.render_response(result, ctx)
1278
+
1279
+
1280
+ @certificate_group.command(name=cli_util.override('api_gateway.remove_certificate_lock.command_name', 'remove'), help=u"""Removes a lock from a Certificate resource. \n[Command Reference](removeCertificateLock)""")
1281
+ @cli_util.option('--certificate-id', required=True, help=u"""The ocid of the certificate.""")
1282
+ @cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL", "DELETE"]), help=u"""Type of the lock.""")
1283
+ @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.""")
1284
+ @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.""")
1285
+ @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.""")
1286
+ @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.""")
1287
+ @json_skeleton_utils.get_cli_json_input_option({})
1288
+ @cli_util.help_option
1289
+ @click.pass_context
1290
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'apigateway', 'class': 'Certificate'})
1291
+ @cli_util.wrap_exceptions
1292
+ def remove_certificate_lock(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, certificate_id, type, if_match):
1293
+
1294
+ if isinstance(certificate_id, six.string_types) and len(certificate_id.strip()) == 0:
1295
+ raise click.UsageError('Parameter --certificate-id cannot be whitespace or empty string')
1296
+
1297
+ kwargs = {}
1298
+ if if_match is not None:
1299
+ kwargs['if_match'] = if_match
1300
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1301
+
1302
+ _details = {}
1303
+ _details['type'] = type
1304
+
1305
+ client = cli_util.build_client('apigateway', 'api_gateway', ctx)
1306
+ result = client.remove_certificate_lock(
1307
+ certificate_id=certificate_id,
1308
+ remove_resource_lock_details=_details,
1309
+ **kwargs
1310
+ )
1311
+ if wait_for_state:
1312
+
1313
+ if hasattr(client, 'get_certificate') and callable(getattr(client, 'get_certificate')):
1314
+ try:
1315
+ wait_period_kwargs = {}
1316
+ if max_wait_seconds is not None:
1317
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1318
+ if wait_interval_seconds is not None:
1319
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1320
+
1321
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
1322
+ result = oci.wait_until(client, client.get_certificate(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
1323
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1324
+ # If we fail, we should show an error, but we should still provide the information to the customer
1325
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
1326
+ cli_util.render_response(result, ctx)
1327
+ sys.exit(2)
1328
+ except Exception:
1329
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
1330
+ cli_util.render_response(result, ctx)
1331
+ raise
1332
+ else:
1333
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1334
+ cli_util.render_response(result, ctx)
1335
+
1336
+
1337
+ @sdk_group.command(name=cli_util.override('api_gateway.remove_sdk_lock.command_name', 'remove'), help=u"""Removes a lock from a Sdk resource. \n[Command Reference](removeSdkLock)""")
1338
+ @cli_util.option('--sdk-id', required=True, help=u"""The ocid of the SDK.""")
1339
+ @cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL", "DELETE"]), help=u"""Type of the lock.""")
1340
+ @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.""")
1341
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "FAILED", "DELETING", "DELETED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1342
+ @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.""")
1343
+ @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.""")
1344
+ @json_skeleton_utils.get_cli_json_input_option({})
1345
+ @cli_util.help_option
1346
+ @click.pass_context
1347
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'apigateway', 'class': 'Sdk'})
1348
+ @cli_util.wrap_exceptions
1349
+ def remove_sdk_lock(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, sdk_id, type, if_match):
1350
+
1351
+ if isinstance(sdk_id, six.string_types) and len(sdk_id.strip()) == 0:
1352
+ raise click.UsageError('Parameter --sdk-id cannot be whitespace or empty string')
1353
+
1354
+ kwargs = {}
1355
+ if if_match is not None:
1356
+ kwargs['if_match'] = if_match
1357
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1358
+
1359
+ _details = {}
1360
+ _details['type'] = type
1361
+
1362
+ client = cli_util.build_client('apigateway', 'api_gateway', ctx)
1363
+ result = client.remove_sdk_lock(
1364
+ sdk_id=sdk_id,
1365
+ remove_resource_lock_details=_details,
1366
+ **kwargs
1367
+ )
1368
+ if wait_for_state:
1369
+
1370
+ if hasattr(client, 'get_sdk') and callable(getattr(client, 'get_sdk')):
1371
+ try:
1372
+ wait_period_kwargs = {}
1373
+ if max_wait_seconds is not None:
1374
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1375
+ if wait_interval_seconds is not None:
1376
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1377
+
1378
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
1379
+ result = oci.wait_until(client, client.get_sdk(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
1380
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1381
+ # If we fail, we should show an error, but we should still provide the information to the customer
1382
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
1383
+ cli_util.render_response(result, ctx)
1384
+ sys.exit(2)
1385
+ except Exception:
1386
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
1387
+ cli_util.render_response(result, ctx)
1388
+ raise
1389
+ else:
1390
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1391
+ cli_util.render_response(result, ctx)
1392
+
1393
+
1007
1394
  @api_group.command(name=cli_util.override('api_gateway.update_api.command_name', 'update'), help=u"""Updates the API with the given identifier. \n[Command Reference](updateApi)""")
1008
1395
  @cli_util.option('--api-id', required=True, help=u"""The ocid of the API.""")
1009
1396
  @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.
@@ -1017,6 +1404,7 @@ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMP
1017
1404
  Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1018
1405
  @cli_util.option('--content', help=u"""API Specification content in json or yaml format""")
1019
1406
  @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.""")
1407
+ @cli_util.option('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""")
1020
1408
  @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
1021
1409
  @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.""")
1022
1410
  @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.""")
@@ -1026,7 +1414,7 @@ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_comp
1026
1414
  @click.pass_context
1027
1415
  @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}})
1028
1416
  @cli_util.wrap_exceptions
1029
- def update_api(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, api_id, display_name, freeform_tags, defined_tags, content, if_match):
1417
+ def update_api(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, api_id, display_name, freeform_tags, defined_tags, content, if_match, is_lock_override):
1030
1418
 
1031
1419
  if isinstance(api_id, six.string_types) and len(api_id.strip()) == 0:
1032
1420
  raise click.UsageError('Parameter --api-id cannot be whitespace or empty string')
@@ -1038,6 +1426,8 @@ def update_api(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_int
1038
1426
  kwargs = {}
1039
1427
  if if_match is not None:
1040
1428
  kwargs['if_match'] = if_match
1429
+ if is_lock_override is not None:
1430
+ kwargs['is_lock_override'] = is_lock_override
1041
1431
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1042
1432
 
1043
1433
  _details = {}
@@ -1104,6 +1494,7 @@ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMP
1104
1494
 
1105
1495
  Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1106
1496
  @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.""")
1497
+ @cli_util.option('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""")
1107
1498
  @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
1108
1499
  @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.""")
1109
1500
  @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.""")
@@ -1113,7 +1504,7 @@ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_comp
1113
1504
  @click.pass_context
1114
1505
  @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}})
1115
1506
  @cli_util.wrap_exceptions
1116
- def update_certificate(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, certificate_id, display_name, freeform_tags, defined_tags, if_match):
1507
+ def update_certificate(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, certificate_id, display_name, freeform_tags, defined_tags, if_match, is_lock_override):
1117
1508
 
1118
1509
  if isinstance(certificate_id, six.string_types) and len(certificate_id.strip()) == 0:
1119
1510
  raise click.UsageError('Parameter --certificate-id cannot be whitespace or empty string')
@@ -1125,6 +1516,8 @@ def update_certificate(ctx, from_json, force, wait_for_state, max_wait_seconds,
1125
1516
  kwargs = {}
1126
1517
  if if_match is not None:
1127
1518
  kwargs['if_match'] = if_match
1519
+ if is_lock_override is not None:
1520
+ kwargs['is_lock_override'] = is_lock_override
1128
1521
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1129
1522
 
1130
1523
  _details = {}
@@ -1188,13 +1581,14 @@ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMP
1188
1581
 
1189
1582
  Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1190
1583
  @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.""")
1584
+ @cli_util.option('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""")
1191
1585
  @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
1192
1586
  @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}})
1193
1587
  @cli_util.help_option
1194
1588
  @click.pass_context
1195
1589
  @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'apigateway', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'apigateway', 'class': 'dict(str, dict(str, object))'}})
1196
1590
  @cli_util.wrap_exceptions
1197
- def update_sdk(ctx, from_json, force, sdk_id, display_name, freeform_tags, defined_tags, if_match):
1591
+ def update_sdk(ctx, from_json, force, sdk_id, display_name, freeform_tags, defined_tags, if_match, is_lock_override):
1198
1592
 
1199
1593
  if isinstance(sdk_id, six.string_types) and len(sdk_id.strip()) == 0:
1200
1594
  raise click.UsageError('Parameter --sdk-id cannot be whitespace or empty string')
@@ -1206,6 +1600,8 @@ def update_sdk(ctx, from_json, force, sdk_id, display_name, freeform_tags, defin
1206
1600
  kwargs = {}
1207
1601
  if if_match is not None:
1208
1602
  kwargs['if_match'] = if_match
1603
+ if is_lock_override is not None:
1604
+ kwargs['is_lock_override'] = is_lock_override
1209
1605
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1210
1606
 
1211
1607
  _details = {}