oci-cli 3.72.1__py3-none-any.whl → 3.73.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. oci_cli/bin/dif.psm1 +3 -3
  2. oci_cli/bin/mysql.psm1 +6 -2
  3. oci_cli/bin/opensearch.psm1 +2 -2
  4. oci_cli/bin/queue.psm1 +23 -11
  5. oci_cli/help_text_producer/data_files/text/cmdref/certificates/ca-bundle/get.txt +1 -1
  6. oci_cli/help_text_producer/data_files/text/cmdref/certificates/certificate-authority-bundle/get.txt +5 -5
  7. oci_cli/help_text_producer/data_files/text/cmdref/certificates/certificate-authority-bundle-version/list.txt +1 -2
  8. oci_cli/help_text_producer/data_files/text/cmdref/certificates/certificate-bundle/get.txt +6 -5
  9. oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/create-root-ca-by-generating-config-details.txt +12 -8
  10. oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/create-root-ca-managed-externally.txt +206 -0
  11. oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/create-subordinate-ca-issued-by-internal-ca.txt +12 -8
  12. oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/create-subordinate-ca-managed-internally-issued-by-external-ca.txt +229 -0
  13. oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/list.txt +1 -1
  14. oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/update-root-ca-by-generating-config-details.txt +8 -2
  15. oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/update-root-ca-managed-externally.txt +222 -0
  16. oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/update-subordinate-ca-issued-by-internal-ca.txt +8 -2
  17. oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority/update-subordinate-ca-managed-internally-issued-by-external-ca.txt +233 -0
  18. oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt/certificate-authority.txt +8 -0
  19. oci_cli/help_text_producer/data_files/text/cmdref/certs-mgmt.txt +8 -0
  20. oci_cli/help_text_producer/data_files/text/cmdref/compute/compute-host/apply-host-configuration.txt +0 -26
  21. oci_cli/help_text_producer/data_files/text/cmdref/compute/compute-host/attach.txt +0 -26
  22. oci_cli/help_text_producer/data_files/text/cmdref/compute/compute-host/check-host-configuration.txt +0 -26
  23. oci_cli/help_text_producer/data_files/text/cmdref/compute/dedicated-vm-host/create-dedicated-vm-host-compute-bare-metal-host-placement-constraint-details.txt +12 -0
  24. oci_cli/help_text_producer/data_files/text/cmdref/compute/dedicated-vm-host/create-dedicated-vm-host-host-group-placement-constraint-details.txt +12 -0
  25. oci_cli/help_text_producer/data_files/text/cmdref/compute/dedicated-vm-host/create.txt +12 -0
  26. oci_cli/help_text_producer/data_files/text/cmdref/compute/dedicated-vm-host/list.txt +5 -0
  27. oci_cli/help_text_producer/data_files/text/cmdref/compute/dedicated-vm-host-instance/list.txt +5 -0
  28. oci_cli/help_text_producer/data_files/text/cmdref/compute-management/instance-configuration/launch-compute-instance.txt +4 -0
  29. oci_cli/help_text_producer/data_files/text/cmdref/compute-management/instance-pool/create.txt +5 -4
  30. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/restart.txt +4 -0
  31. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/work-request-error/{list-errors.txt → list.txt} +5 -5
  32. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/work-request-error.txt +1 -1
  33. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/work-request-log/{list-logs.txt → list.txt} +5 -5
  34. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/work-request-log.txt +1 -1
  35. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request.txt +2 -2
  36. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control.txt +2 -2
  37. oci_cli/help_text_producer/data_files/text/cmdref/dif/stack/add.txt +51 -2
  38. oci_cli/help_text_producer/data_files/text/cmdref/dif/stack/create.txt +50 -2
  39. oci_cli/help_text_producer/data_files/text/cmdref/dif/stack/deploy-artifacts.txt +36 -4
  40. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/agent-endpoint/create.txt +11 -0
  41. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/agent-endpoint/update.txt +11 -0
  42. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/provisioned-capacity/change-compartment.txt +136 -0
  43. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/provisioned-capacity/create.txt +170 -0
  44. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/provisioned-capacity/delete.txt +134 -0
  45. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/provisioned-capacity/get.txt +96 -0
  46. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/provisioned-capacity/list.txt +143 -0
  47. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/provisioned-capacity/update.txt +184 -0
  48. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/provisioned-capacity.txt +31 -0
  49. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/tool/create-tool-rag-tool-config.txt +37 -0
  50. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/tool/create-tool-sql-tool-config.txt +4 -0
  51. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/tool/update-tool-rag-tool-config.txt +37 -0
  52. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent/tool/update-tool-sql-tool-config.txt +4 -0
  53. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-agent.txt +14 -0
  54. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request/{work-request-log-entry/list-work-request-logs.txt → work-request-log/list.txt} +5 -5
  55. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request/{work-request-log-entry.txt → work-request-log.txt} +3 -3
  56. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request.txt +2 -2
  57. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane.txt +2 -2
  58. oci_cli/help_text_producer/data_files/text/cmdref/kafka/cluster/list-node-shapes.txt +129 -0
  59. oci_cli/help_text_producer/data_files/text/cmdref/kafka/cluster.txt +2 -0
  60. oci_cli/help_text_producer/data_files/text/cmdref/kafka.txt +2 -0
  61. oci_cli/help_text_producer/data_files/text/cmdref/mysql/backup/export.txt +154 -0
  62. oci_cli/help_text_producer/data_files/text/cmdref/mysql/backup.txt +2 -0
  63. oci_cli/help_text_producer/data_files/text/cmdref/mysql/work-request/cancel.txt +104 -0
  64. oci_cli/help_text_producer/data_files/text/cmdref/mysql/work-request.txt +2 -0
  65. oci_cli/help_text_producer/data_files/text/cmdref/mysql.txt +4 -0
  66. oci_cli/help_text_producer/data_files/text/cmdref/network/vcn/create.txt +1 -1
  67. oci_cli/help_text_producer/data_files/text/cmdref/network/vcn/update.txt +1 -1
  68. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/management-appliance/management-appliance/create.txt +205 -0
  69. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/management-appliance/management-appliance/delete.txt +146 -0
  70. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/management-appliance/management-appliance/get.txt +108 -0
  71. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/management-appliance/management-appliance/list.txt +160 -0
  72. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/management-appliance/management-appliance/update.txt +217 -0
  73. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/management-appliance/management-appliance.txt +22 -0
  74. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/management-appliance.txt +25 -0
  75. oci_cli/help_text_producer/data_files/text/cmdref/ocvs.txt +14 -0
  76. oci_cli/help_text_producer/data_files/text/cmdref/opensearch/cluster/create.txt +11 -0
  77. oci_cli/help_text_producer/data_files/text/cmdref/opensearch/cluster/update.txt +11 -0
  78. oci_cli/help_text_producer/data_files/text/cmdref/organizations/work-request-error/{list-errors.txt → list.txt} +5 -5
  79. oci_cli/help_text_producer/data_files/text/cmdref/organizations/work-request-error.txt +1 -1
  80. oci_cli/help_text_producer/data_files/text/cmdref/organizations.txt +1 -1
  81. oci_cli/help_text_producer/data_files/text/cmdref/queue/channels/list-channels.txt +4 -0
  82. oci_cli/help_text_producer/data_files/text/cmdref/queue/messages/delete-message.txt +4 -0
  83. oci_cli/help_text_producer/data_files/text/cmdref/queue/messages/delete-messages.txt +4 -0
  84. oci_cli/help_text_producer/data_files/text/cmdref/queue/messages/get-messages.txt +4 -0
  85. oci_cli/help_text_producer/data_files/text/cmdref/queue/messages/get-stats.txt +4 -0
  86. oci_cli/help_text_producer/data_files/text/cmdref/queue/messages/update-message.txt +4 -0
  87. oci_cli/help_text_producer/data_files/text/cmdref/queue/messages/update-messages.txt +4 -0
  88. oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/consumer-group/create.txt +169 -0
  89. oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/consumer-group/delete.txt +135 -0
  90. oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/consumer-group/get.txt +97 -0
  91. oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/consumer-group/update.txt +185 -0
  92. oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/consumer-group-collection/list-consumer-groups.txt +142 -0
  93. oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/consumer-group-collection.txt +15 -0
  94. oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/consumer-group.txt +20 -0
  95. oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/queue/create.txt +18 -2
  96. oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/queue/purge.txt +19 -6
  97. oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin/queue/update.txt +16 -0
  98. oci_cli/help_text_producer/data_files/text/cmdref/queue/queue-admin.txt +14 -0
  99. oci_cli/help_text_producer/data_files/text/cmdref/queue.txt +14 -0
  100. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/create.txt +6 -6
  101. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/get.txt +2 -2
  102. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/list.txt +1 -1
  103. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/update.txt +4 -4
  104. oci_cli/help_text_producer/data_files/text/cmdref/support/incident-resource-type/list.txt +3 -3
  105. oci_cli/help_text_producer/data_files/text/cmdref/support/validation-response/validate-user.txt +1 -1
  106. oci_cli/version.py +1 -1
  107. {oci_cli-3.72.1.dist-info → oci_cli-3.73.1.dist-info}/METADATA +2 -2
  108. {oci_cli-3.72.1.dist-info → oci_cli-3.73.1.dist-info}/RECORD +134 -102
  109. services/certificates/src/oci_cli_certificates/generated/certificates_cli.py +6 -6
  110. services/certificates_management/src/oci_cli_certificates_management/certificatesmanagement_cli_extended.py +126 -0
  111. services/certificates_management/src/oci_cli_certificates_management/generated/certificatesmanagement_cli.py +447 -25
  112. services/core/src/oci_cli_compute/generated/compute_cli.py +126 -174
  113. services/core/src/oci_cli_compute_management/generated/computemanagement_cli.py +13 -4
  114. services/core/src/oci_cli_virtual_network/generated/virtualnetwork_cli.py +2 -2
  115. services/database/src/oci_cli_database/generated/database_cli.py +4 -1
  116. services/dif/src/oci_cli_stack/generated/stack_cli.py +65 -17
  117. services/dif/src/oci_cli_stack/stack_cli_extended.py +9 -9
  118. services/generative_ai_agent/src/oci_cli_generative_ai_agent/generated/generativeaiagent_cli.py +435 -16
  119. services/managed_kafka/src/oci_cli_kafka_cluster/generated/kafkacluster_cli.py +56 -0
  120. services/mysql/src/oci_cli_db_backups/generated/dbbackups_cli.py +70 -0
  121. services/mysql/src/oci_cli_work_requests/generated/workrequests_cli.py +26 -0
  122. services/ocvp/src/oci_cli_management_appliance/__init__.py +4 -0
  123. services/ocvp/src/oci_cli_management_appliance/generated/__init__.py +4 -0
  124. services/ocvp/src/oci_cli_management_appliance/generated/client_mappings.py +14 -0
  125. services/ocvp/src/oci_cli_management_appliance/generated/managementappliance_cli.py +341 -0
  126. services/opensearch/src/oci_cli_opensearch_cluster/generated/opensearchcluster_cli.py +16 -8
  127. services/queue/src/oci_cli_queue/generated/queue_cli.py +28 -7
  128. services/queue/src/oci_cli_queue_admin/generated/queueadmin_cli.py +343 -10
  129. services/queue/src/oci_cli_queue_admin/queueadmin_cli_extended.py +54 -7
  130. {oci_cli-3.72.1.dist-info → oci_cli-3.73.1.dist-info}/LICENSE.txt +0 -0
  131. {oci_cli-3.72.1.dist-info → oci_cli-3.73.1.dist-info}/THIRD_PARTY_LICENSES.txt +0 -0
  132. {oci_cli-3.72.1.dist-info → oci_cli-3.73.1.dist-info}/WHEEL +0 -0
  133. {oci_cli-3.72.1.dist-info → oci_cli-3.73.1.dist-info}/entry_points.txt +0 -0
  134. {oci_cli-3.72.1.dist-info → oci_cli-3.73.1.dist-info}/top_level.txt +0 -0
@@ -22,6 +22,18 @@ def queue_admin_root_group():
22
22
  pass
23
23
 
24
24
 
25
+ @click.command(cli_util.override('queue_admin.consumer_group_group.command_name', 'consumer-group'), cls=CommandGroupWithAlias, help="""A detailed representation of a consumer group.""")
26
+ @cli_util.help_option_group
27
+ def consumer_group_group():
28
+ pass
29
+
30
+
31
+ @click.command(cli_util.override('queue_admin.consumer_group_collection_group.command_name', 'consumer-group-collection'), cls=CommandGroupWithAlias, help="""Results of a consumer group search. Contains both ConsumerGroupSummary items and other information, such as metadata.""")
32
+ @cli_util.help_option_group
33
+ def consumer_group_collection_group():
34
+ pass
35
+
36
+
25
37
  @click.command(cli_util.override('queue_admin.work_request_error_collection_group.command_name', 'work-request-error-collection'), cls=CommandGroupWithAlias, help="""Results of a workRequestError search. Contains both WorkRequestError items and other information, such as metadata.""")
26
38
  @cli_util.help_option_group
27
39
  def work_request_error_collection_group():
@@ -59,6 +71,8 @@ def work_request_log_entry_collection_group():
59
71
 
60
72
 
61
73
  queue_service_cli.queue_service_group.add_command(queue_admin_root_group)
74
+ queue_admin_root_group.add_command(consumer_group_group)
75
+ queue_admin_root_group.add_command(consumer_group_collection_group)
62
76
  queue_admin_root_group.add_command(work_request_error_collection_group)
63
77
  queue_admin_root_group.add_command(work_request_summary_collection_group)
64
78
  queue_admin_root_group.add_command(queue_collection_group)
@@ -128,6 +142,81 @@ def change_queue_compartment(ctx, from_json, wait_for_state, max_wait_seconds, w
128
142
  cli_util.render_response(result, ctx)
129
143
 
130
144
 
145
+ @consumer_group_group.command(name=cli_util.override('queue_admin.create_consumer_group.command_name', 'create'), help=u"""Creates a new consumer group. \n[Command Reference](createConsumerGroup)""")
146
+ @cli_util.option('--display-name', required=True, help=u"""The user-friendly name of the consumer group.""")
147
+ @cli_util.option('--queue-id', required=True, help=u"""The OCID of the associated queue.""")
148
+ @cli_util.option('--filter', help=u"""The filter used by the consumer group. Only messages matching the filter will be available by consumers of the group.""")
149
+ @cli_util.option('--is-enabled', type=click.BOOL, help=u"""Used to enable or disable the consumer group. An enabled consumer group will have a lifecycle state of ACTIVE, while a disabled will have its state as INACTIVE.""")
150
+ @cli_util.option('--dead-letter-queue-delivery-count', type=click.INT, help=u"""The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. If the value isn't specified, it will be using the value defined at the queue level.""")
151
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
152
+ @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. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
153
+ @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.""")
154
+ @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.""")
155
+ @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.""")
156
+ @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
157
+ @cli_util.help_option
158
+ @click.pass_context
159
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
160
+ @cli_util.wrap_exceptions
161
+ def create_consumer_group(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, queue_id, filter, is_enabled, dead_letter_queue_delivery_count, freeform_tags, defined_tags):
162
+
163
+ kwargs = {}
164
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
165
+
166
+ _details = {}
167
+ _details['displayName'] = display_name
168
+ _details['queueId'] = queue_id
169
+
170
+ if filter is not None:
171
+ _details['filter'] = filter
172
+
173
+ if is_enabled is not None:
174
+ _details['isEnabled'] = is_enabled
175
+
176
+ if dead_letter_queue_delivery_count is not None:
177
+ _details['deadLetterQueueDeliveryCount'] = dead_letter_queue_delivery_count
178
+
179
+ if freeform_tags is not None:
180
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
181
+
182
+ if defined_tags is not None:
183
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
184
+
185
+ client = cli_util.build_client('queue', 'queue_admin', ctx)
186
+ result = client.create_consumer_group(
187
+ create_consumer_group_details=_details,
188
+ **kwargs
189
+ )
190
+ if wait_for_state:
191
+
192
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
193
+ try:
194
+ wait_period_kwargs = {}
195
+ if max_wait_seconds is not None:
196
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
197
+ if wait_interval_seconds is not None:
198
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
199
+ if 'opc-work-request-id' not in result.headers:
200
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
201
+ cli_util.render_response(result, ctx)
202
+ return
203
+
204
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
205
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
206
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
207
+ # If we fail, we should show an error, but we should still provide the information to the customer
208
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
209
+ cli_util.render_response(result, ctx)
210
+ sys.exit(2)
211
+ except Exception:
212
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
213
+ cli_util.render_response(result, ctx)
214
+ raise
215
+ else:
216
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
217
+ cli_util.render_response(result, ctx)
218
+
219
+
131
220
  @queue_group.command(name=cli_util.override('queue_admin.create_queue.command_name', 'create'), help=u"""Creates a new queue. \n[Command Reference](createQueue)""")
132
221
  @cli_util.option('--display-name', required=True, help=u"""The user-friendly name of the queue.""")
133
222
  @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment containing the queue.""")
@@ -137,17 +226,20 @@ def change_queue_compartment(ctx, from_json, wait_for_state, max_wait_seconds, w
137
226
  @cli_util.option('--channel-consumption-limit', type=click.INT, help=u"""The percentage of allocated queue resources that can be consumed by a single channel. For example, if a queue has a storage limit of 2Gb, and a single channel consumption limit is 0.1 (10%), that means data size of a single channel can't exceed 200Mb. Consumption limit of 100% (default) means that a single channel can consume up-to all allocated queue's resources.""")
138
227
  @cli_util.option('--dead-letter-queue-delivery-count', type=click.INT, help=u"""The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used.""")
139
228
  @cli_util.option('--custom-encryption-key-id', help=u"""The [OCID] of the custom encryption key to be used to encrypt messages content.""")
229
+ @cli_util.option('--capabilities', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The capability to add on the queue
230
+
231
+ This option is a JSON list with items of type CapabilityDetails. For documentation on CapabilityDetails please see our API reference: https://docs.cloud.oracle.com/api/#/en/queueadmin/20210201/datatypes/CapabilityDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
140
232
  @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
141
233
  @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. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
142
234
  @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.""")
143
235
  @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.""")
144
236
  @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.""")
145
- @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
237
+ @json_skeleton_utils.get_cli_json_input_option({'capabilities': {'module': 'queue', 'class': 'list[CapabilityDetails]'}, 'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
146
238
  @cli_util.help_option
147
239
  @click.pass_context
148
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
240
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'capabilities': {'module': 'queue', 'class': 'list[CapabilityDetails]'}, 'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
149
241
  @cli_util.wrap_exceptions
150
- def create_queue(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, compartment_id, retention_in_seconds, visibility_in_seconds, timeout_in_seconds, channel_consumption_limit, dead_letter_queue_delivery_count, custom_encryption_key_id, freeform_tags, defined_tags):
242
+ def create_queue(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, compartment_id, retention_in_seconds, visibility_in_seconds, timeout_in_seconds, channel_consumption_limit, dead_letter_queue_delivery_count, custom_encryption_key_id, capabilities, freeform_tags, defined_tags):
151
243
 
152
244
  kwargs = {}
153
245
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
@@ -174,6 +266,9 @@ def create_queue(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval
174
266
  if custom_encryption_key_id is not None:
175
267
  _details['customEncryptionKeyId'] = custom_encryption_key_id
176
268
 
269
+ if capabilities is not None:
270
+ _details['capabilities'] = cli_util.parse_json_parameter("capabilities", capabilities)
271
+
177
272
  if freeform_tags is not None:
178
273
  _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
179
274
 
@@ -215,6 +310,62 @@ def create_queue(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval
215
310
  cli_util.render_response(result, ctx)
216
311
 
217
312
 
313
+ @consumer_group_group.command(name=cli_util.override('queue_admin.delete_consumer_group.command_name', 'delete'), help=u"""Deletes a consumer group resource by identifier. \n[Command Reference](deleteConsumerGroup)""")
314
+ @cli_util.option('--consumer-group-id', required=True, help=u"""The unique consumer group identifier.""")
315
+ @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.""")
316
+ @cli_util.confirm_delete_option
317
+ @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.""")
318
+ @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.""")
319
+ @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.""")
320
+ @json_skeleton_utils.get_cli_json_input_option({})
321
+ @cli_util.help_option
322
+ @click.pass_context
323
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
324
+ @cli_util.wrap_exceptions
325
+ def delete_consumer_group(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, consumer_group_id, if_match):
326
+
327
+ if isinstance(consumer_group_id, six.string_types) and len(consumer_group_id.strip()) == 0:
328
+ raise click.UsageError('Parameter --consumer-group-id cannot be whitespace or empty string')
329
+
330
+ kwargs = {}
331
+ if if_match is not None:
332
+ kwargs['if_match'] = if_match
333
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
334
+ client = cli_util.build_client('queue', 'queue_admin', ctx)
335
+ result = client.delete_consumer_group(
336
+ consumer_group_id=consumer_group_id,
337
+ **kwargs
338
+ )
339
+ if wait_for_state:
340
+
341
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
342
+ try:
343
+ wait_period_kwargs = {}
344
+ if max_wait_seconds is not None:
345
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
346
+ if wait_interval_seconds is not None:
347
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
348
+ if 'opc-work-request-id' not in result.headers:
349
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
350
+ cli_util.render_response(result, ctx)
351
+ return
352
+
353
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
354
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
355
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
356
+ # If we fail, we should show an error, but we should still provide the information to the customer
357
+ click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr)
358
+ cli_util.render_response(result, ctx)
359
+ sys.exit(2)
360
+ except Exception:
361
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
362
+ cli_util.render_response(result, ctx)
363
+ raise
364
+ else:
365
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
366
+ cli_util.render_response(result, ctx)
367
+
368
+
218
369
  @queue_group.command(name=cli_util.override('queue_admin.delete_queue.command_name', 'delete'), help=u"""Deletes a queue resource by identifier. \n[Command Reference](deleteQueue)""")
219
370
  @cli_util.option('--queue-id', required=True, help=u"""The unique queue identifier.""")
220
371
  @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.""")
@@ -271,6 +422,28 @@ def delete_queue(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval
271
422
  cli_util.render_response(result, ctx)
272
423
 
273
424
 
425
+ @consumer_group_group.command(name=cli_util.override('queue_admin.get_consumer_group.command_name', 'get'), help=u"""Gets a consumer group by identifier. \n[Command Reference](getConsumerGroup)""")
426
+ @cli_util.option('--consumer-group-id', required=True, help=u"""The unique consumer group identifier.""")
427
+ @json_skeleton_utils.get_cli_json_input_option({})
428
+ @cli_util.help_option
429
+ @click.pass_context
430
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'queue', 'class': 'ConsumerGroup'})
431
+ @cli_util.wrap_exceptions
432
+ def get_consumer_group(ctx, from_json, consumer_group_id):
433
+
434
+ if isinstance(consumer_group_id, six.string_types) and len(consumer_group_id.strip()) == 0:
435
+ raise click.UsageError('Parameter --consumer-group-id cannot be whitespace or empty string')
436
+
437
+ kwargs = {}
438
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
439
+ client = cli_util.build_client('queue', 'queue_admin', ctx)
440
+ result = client.get_consumer_group(
441
+ consumer_group_id=consumer_group_id,
442
+ **kwargs
443
+ )
444
+ cli_util.render_response(result, ctx)
445
+
446
+
274
447
  @queue_group.command(name=cli_util.override('queue_admin.get_queue.command_name', 'get'), help=u"""Gets a queue by identifier. \n[Command Reference](getQueue)""")
275
448
  @cli_util.option('--queue-id', required=True, help=u"""The unique queue identifier.""")
276
449
  @json_skeleton_utils.get_cli_json_input_option({})
@@ -315,6 +488,68 @@ def get_work_request(ctx, from_json, work_request_id):
315
488
  cli_util.render_response(result, ctx)
316
489
 
317
490
 
491
+ @consumer_group_collection_group.command(name=cli_util.override('queue_admin.list_consumer_groups.command_name', 'list-consumer-groups'), help=u"""Returns a list of consumer groups. \n[Command Reference](listConsumerGroups)""")
492
+ @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "INACTIVE"]), help=u"""A filter to return only resources their lifecycleState matches the given lifecycleState.""")
493
+ @cli_util.option('--display-name', help=u"""A filter to return only resources that match the entire display name given.""")
494
+ @cli_util.option('--id', help=u"""The unique consumer group identifier.""")
495
+ @cli_util.option('--queue-id', help=u"""The unique queue identifier.""")
496
+ @cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination].""")
497
+ @cli_util.option('--page', help=u"""For list pagination. The value of the opc-next-page response header from the previous \"List\" call. For important details about how pagination works, see [List Pagination].""")
498
+ @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
499
+ @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default.""")
500
+ @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.""")
501
+ @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.""")
502
+ @json_skeleton_utils.get_cli_json_input_option({})
503
+ @cli_util.help_option
504
+ @click.pass_context
505
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'queue', 'class': 'ConsumerGroupCollection'})
506
+ @cli_util.wrap_exceptions
507
+ def list_consumer_groups(ctx, from_json, all_pages, page_size, lifecycle_state, display_name, id, queue_id, limit, page, sort_order, sort_by):
508
+
509
+ if all_pages and limit:
510
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
511
+
512
+ kwargs = {}
513
+ if lifecycle_state is not None:
514
+ kwargs['lifecycle_state'] = lifecycle_state
515
+ if display_name is not None:
516
+ kwargs['display_name'] = display_name
517
+ if id is not None:
518
+ kwargs['id'] = id
519
+ if queue_id is not None:
520
+ kwargs['queue_id'] = queue_id
521
+ if limit is not None:
522
+ kwargs['limit'] = limit
523
+ if page is not None:
524
+ kwargs['page'] = page
525
+ if sort_order is not None:
526
+ kwargs['sort_order'] = sort_order
527
+ if sort_by is not None:
528
+ kwargs['sort_by'] = sort_by
529
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
530
+ client = cli_util.build_client('queue', 'queue_admin', ctx)
531
+ if all_pages:
532
+ if page_size:
533
+ kwargs['limit'] = page_size
534
+
535
+ result = cli_util.list_call_get_all_results(
536
+ client.list_consumer_groups,
537
+ **kwargs
538
+ )
539
+ elif limit is not None:
540
+ result = cli_util.list_call_get_up_to_limit(
541
+ client.list_consumer_groups,
542
+ limit,
543
+ page_size,
544
+ **kwargs
545
+ )
546
+ else:
547
+ result = client.list_consumer_groups(
548
+ **kwargs
549
+ )
550
+ cli_util.render_response(result, ctx)
551
+
552
+
318
553
  @queue_collection_group.command(name=cli_util.override('queue_admin.list_queues.command_name', 'list-queues'), help=u"""Returns a list of queues. \n[Command Reference](listQueues)""")
319
554
  @cli_util.option('--compartment-id', help=u"""The [OCID] of the compartment in which to list resources.""")
320
555
  @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "INACTIVE"]), help=u"""A filter to return only resources their lifecycleState matches the given lifecycleState.""")
@@ -529,10 +764,11 @@ def list_work_requests(ctx, from_json, all_pages, page_size, compartment_id, wor
529
764
  cli_util.render_response(result, ctx)
530
765
 
531
766
 
532
- @queue_group.command(name=cli_util.override('queue_admin.purge_queue.command_name', 'purge'), help=u"""Deletes all messages present in the queue, or deletes all the messages in the specific channel at the time of invocation. Only one concurrent purge operation is supported for any given queue. However multiple concurrent purge operations are supported for different queues. Purge request without specification of target channels will clean up all messages in the queue and in the child channels. \n[Command Reference](purgeQueue)""")
767
+ @queue_group.command(name=cli_util.override('queue_admin.purge_queue.command_name', 'purge'), help=u"""Deletes all messages present in the queue or in the specified consumer group, or deletes all the messages in the specific channel at the time of invocation. Only one concurrent purge operation is supported for any given queue. However multiple concurrent purge operations are supported for different queues. Purge request without specification of target channels will clean up all messages in the queue and in the child channels. Purge request without specification of consumer group will either clean up all messages in the queue or in the primary consumer group, depending on the presence of the CONSUMER_GROUPS capability on the queue. To purge all consumer groups, the special value 'all' can be used. \n[Command Reference](purgeQueue)""")
533
768
  @cli_util.option('--queue-id', required=True, help=u"""The unique queue identifier.""")
534
769
  @cli_util.option('--purge-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["NORMAL", "DLQ", "BOTH"]), help=u"""Type of the purge to perform: - NORMAL - purge only the normal queue - DLQ - purge only the dead letter queue - BOTH - purge both the normal queue and the dead letter queue""")
535
770
  @cli_util.option('--channel-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Optional parameter to specify the destination of purge operation. If the channel ID is specified, the purge operation will delete all the messages in the specific channels. If the channel ID is not specified, the purge operation will delete all the messages in the queue and in the child channels.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
771
+ @cli_util.option('--consumer-group-id', help=u"""The consumer group ID to purge. If the CONSUMER_GROUPS capability is enabled on the queue, omitting that field will purge the \"Primary Consumer Group\", otherwise it will purge the queue. If you wish to purge all consumer groups in the queue, you can pass the special value 'all'.""")
536
772
  @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.""")
537
773
  @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.""")
538
774
  @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.""")
@@ -542,7 +778,7 @@ def list_work_requests(ctx, from_json, all_pages, page_size, compartment_id, wor
542
778
  @click.pass_context
543
779
  @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'channel-ids': {'module': 'queue', 'class': 'list[string]'}})
544
780
  @cli_util.wrap_exceptions
545
- def purge_queue(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, queue_id, purge_type, channel_ids, if_match):
781
+ def purge_queue(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, queue_id, purge_type, channel_ids, consumer_group_id, if_match):
546
782
 
547
783
  if isinstance(queue_id, six.string_types) and len(queue_id.strip()) == 0:
548
784
  raise click.UsageError('Parameter --queue-id cannot be whitespace or empty string')
@@ -558,6 +794,9 @@ def purge_queue(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_
558
794
  if channel_ids is not None:
559
795
  _details['channelIds'] = cli_util.parse_json_parameter("channel_ids", channel_ids)
560
796
 
797
+ if consumer_group_id is not None:
798
+ _details['consumerGroupId'] = consumer_group_id
799
+
561
800
  client = cli_util.build_client('queue', 'queue_admin', ctx)
562
801
  result = client.purge_queue(
563
802
  queue_id=queue_id,
@@ -594,6 +833,94 @@ def purge_queue(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_
594
833
  cli_util.render_response(result, ctx)
595
834
 
596
835
 
836
+ @consumer_group_group.command(name=cli_util.override('queue_admin.update_consumer_group.command_name', 'update'), help=u"""Updates the specified consumer group. \n[Command Reference](updateConsumerGroup)""")
837
+ @cli_util.option('--consumer-group-id', required=True, help=u"""The unique consumer group identifier.""")
838
+ @cli_util.option('--display-name', help=u"""The [OCID] of the consumer group.""")
839
+ @cli_util.option('--filter', help=u"""The filter used by the consumer group. Only messages matching the filter will be available by consumers of the group.""")
840
+ @cli_util.option('--is-enabled', type=click.BOOL, help=u"""Used to enable or disable the consumer group. An enabled consumer group will have a lifecycle state of ACTIVE, while a disabled will have its state as INACTIVE.""")
841
+ @cli_util.option('--dead-letter-queue-delivery-count', type=click.INT, help=u"""The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. Changing that value to a lower threshold does not retroactively move in-flight messages in the dead letter queue. A value of -1 unsets the delivery count for the consumer group (i.e. it will now be using the value set at the queue level).""")
842
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
843
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
844
+ @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.""")
845
+ @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
846
+ @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.""")
847
+ @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.""")
848
+ @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.""")
849
+ @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
850
+ @cli_util.help_option
851
+ @click.pass_context
852
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
853
+ @cli_util.wrap_exceptions
854
+ def update_consumer_group(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, consumer_group_id, display_name, filter, is_enabled, dead_letter_queue_delivery_count, freeform_tags, defined_tags, if_match):
855
+
856
+ if isinstance(consumer_group_id, six.string_types) and len(consumer_group_id.strip()) == 0:
857
+ raise click.UsageError('Parameter --consumer-group-id cannot be whitespace or empty string')
858
+ if not force:
859
+ if freeform_tags or defined_tags:
860
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
861
+ ctx.abort()
862
+
863
+ kwargs = {}
864
+ if if_match is not None:
865
+ kwargs['if_match'] = if_match
866
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
867
+
868
+ _details = {}
869
+
870
+ if display_name is not None:
871
+ _details['displayName'] = display_name
872
+
873
+ if filter is not None:
874
+ _details['filter'] = filter
875
+
876
+ if is_enabled is not None:
877
+ _details['isEnabled'] = is_enabled
878
+
879
+ if dead_letter_queue_delivery_count is not None:
880
+ _details['deadLetterQueueDeliveryCount'] = dead_letter_queue_delivery_count
881
+
882
+ if freeform_tags is not None:
883
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
884
+
885
+ if defined_tags is not None:
886
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
887
+
888
+ client = cli_util.build_client('queue', 'queue_admin', ctx)
889
+ result = client.update_consumer_group(
890
+ consumer_group_id=consumer_group_id,
891
+ update_consumer_group_details=_details,
892
+ **kwargs
893
+ )
894
+ if wait_for_state:
895
+
896
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
897
+ try:
898
+ wait_period_kwargs = {}
899
+ if max_wait_seconds is not None:
900
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
901
+ if wait_interval_seconds is not None:
902
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
903
+ if 'opc-work-request-id' not in result.headers:
904
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
905
+ cli_util.render_response(result, ctx)
906
+ return
907
+
908
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
909
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
910
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
911
+ # If we fail, we should show an error, but we should still provide the information to the customer
912
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
913
+ cli_util.render_response(result, ctx)
914
+ sys.exit(2)
915
+ except Exception:
916
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
917
+ cli_util.render_response(result, ctx)
918
+ raise
919
+ else:
920
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
921
+ cli_util.render_response(result, ctx)
922
+
923
+
597
924
  @queue_group.command(name=cli_util.override('queue_admin.update_queue.command_name', 'update'), help=u"""Updates the specified queue. \n[Command Reference](updateQueue)""")
598
925
  @cli_util.option('--queue-id', required=True, help=u"""The unique queue identifier.""")
599
926
  @cli_util.option('--display-name', help=u"""The [OCID] of the queue.""")
@@ -602,6 +929,9 @@ def purge_queue(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_
602
929
  @cli_util.option('--channel-consumption-limit', type=click.INT, help=u"""The percentage of allocated queue resources that can be consumed by a single channel. For example, if a queue has a storage limit of 2Gb, and a single channel consumption limit is 0.1 (10%), that means data size of a single channel can't exceed 200Mb. Consumption limit of 100% (default) means that a single channel can consume up-to all allocated queue's resources.""")
603
930
  @cli_util.option('--dead-letter-queue-delivery-count', type=click.INT, help=u"""The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. Changing that value to a lower threshold does not retroactively move in-flight messages in the dead letter queue.""")
604
931
  @cli_util.option('--custom-encryption-key-id', help=u"""The [OCID] of the custom encryption key to be used to encrypt messages content. A string with a length of 0 means the custom key should be removed from queue.""")
932
+ @cli_util.option('--capabilities', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of capabilities enabled on the queue
933
+
934
+ This option is a JSON list with items of type CapabilityDetails. For documentation on CapabilityDetails please see our API reference: https://docs.cloud.oracle.com/api/#/en/queueadmin/20210201/datatypes/CapabilityDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
605
935
  @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
606
936
  @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. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
607
937
  @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.""")
@@ -609,18 +939,18 @@ def purge_queue(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_
609
939
  @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.""")
610
940
  @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.""")
611
941
  @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.""")
612
- @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
942
+ @json_skeleton_utils.get_cli_json_input_option({'capabilities': {'module': 'queue', 'class': 'list[CapabilityDetails]'}, 'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
613
943
  @cli_util.help_option
614
944
  @click.pass_context
615
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
945
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'capabilities': {'module': 'queue', 'class': 'list[CapabilityDetails]'}, 'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
616
946
  @cli_util.wrap_exceptions
617
- def update_queue(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, queue_id, display_name, visibility_in_seconds, timeout_in_seconds, channel_consumption_limit, dead_letter_queue_delivery_count, custom_encryption_key_id, freeform_tags, defined_tags, if_match):
947
+ def update_queue(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, queue_id, display_name, visibility_in_seconds, timeout_in_seconds, channel_consumption_limit, dead_letter_queue_delivery_count, custom_encryption_key_id, capabilities, freeform_tags, defined_tags, if_match):
618
948
 
619
949
  if isinstance(queue_id, six.string_types) and len(queue_id.strip()) == 0:
620
950
  raise click.UsageError('Parameter --queue-id cannot be whitespace or empty string')
621
951
  if not force:
622
- if freeform_tags or defined_tags:
623
- if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
952
+ if capabilities or freeform_tags or defined_tags:
953
+ if not click.confirm("WARNING: Updates to capabilities and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
624
954
  ctx.abort()
625
955
 
626
956
  kwargs = {}
@@ -648,6 +978,9 @@ def update_queue(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_i
648
978
  if custom_encryption_key_id is not None:
649
979
  _details['customEncryptionKeyId'] = custom_encryption_key_id
650
980
 
981
+ if capabilities is not None:
982
+ _details['capabilities'] = cli_util.parse_json_parameter("capabilities", capabilities)
983
+
651
984
  if freeform_tags is not None:
652
985
  _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
653
986
 
@@ -1,7 +1,25 @@
1
+ # Copyright (c) 2016, 2023, Oracle and/or its affiliates.
2
+ #
3
+ # This software is dual-licensed to you under the Universal Permissive License
4
+ # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
5
+ # 2.0 as shown at https://www.apache.org/licenses/LICENSE-2.0. You may choose
6
+ # either license.
7
+ #
8
+ # If you elect to accept the software under the Apache License, Version 2.0,
9
+ # the following applies:
10
+ #
11
+ # Licensed under the Apache License, Version 2.0 (the "License");
12
+ # you may not use this file except in compliance with the License.
13
+ # You may obtain a copy of the License at
14
+ #
15
+ # https://www.apache.org/licenses/LICENSE-2.0
16
+ #
17
+ # Unless required by applicable law or agreed to in writing, software
18
+ # distributed under the License is distributed on an "AS IS" BASIS,
19
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
+ # See the License for the specific language governing permissions and
21
+ # limitations under the License.
1
22
  # coding: utf-8
2
- # Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
3
- # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
4
-
5
23
  import click # noqa: F401
6
24
  import json # noqa: F401
7
25
  from services.queue.src.oci_cli_queue_admin.generated import queueadmin_cli
@@ -54,10 +72,10 @@ queueadmin_cli.work_request_group.add_command(queueadmin_cli.list_work_requests)
54
72
 
55
73
  @cli_util.copy_params_from_generated_command(queueadmin_cli.create_queue, params_to_exclude=['dead_letter_queue_delivery_count', 'custom_encryption_key_id'])
56
74
  @queueadmin_cli.queue_group.command(name=queueadmin_cli.create_queue.name, help=queueadmin_cli.create_queue.help)
57
- @cli_util.option('--custom-key', help="""Id of the custom master encryption key which will be used to encrypt messages content""")
58
- @cli_util.option('--dlq-delivery-count', type=click.INT, help=u"""The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used.""")
75
+ @cli_util.option('--custom-key', help="""The [OCID] of the custom encryption key to be used to encrypt messages content.""")
76
+ @cli_util.option('--dlq-delivery-count', type=click.INT, help="""The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used.""")
59
77
  @click.pass_context
60
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
78
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'capabilities': {'module': 'queue', 'class': 'list[CapabilityDetails]'}, 'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
61
79
  @cli_util.wrap_exceptions
62
80
  def create_queue_extended(ctx, **kwargs):
63
81
 
@@ -77,7 +95,7 @@ def create_queue_extended(ctx, **kwargs):
77
95
  @cli_util.option('--custom-key', help="""Id of the custom master encryption key which will be used to encrypt messages content. String of length 0 means the custom key should be removed from queue""")
78
96
  @cli_util.option('--dlq-delivery-count', type=click.INT, help=u"""The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. Changing that value to a lower threshold does not retro-actively move in-flight messages in the dead letter queue.""")
79
97
  @click.pass_context
80
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
98
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'capabilities': {'module': 'queue', 'class': 'list[CapabilityDetails]'}, 'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
81
99
  @cli_util.wrap_exceptions
82
100
  def update_queue_extended(ctx, **kwargs):
83
101
 
@@ -90,3 +108,32 @@ def update_queue_extended(ctx, **kwargs):
90
108
  kwargs.pop('dlq_delivery_count')
91
109
 
92
110
  ctx.invoke(queueadmin_cli.update_queue, **kwargs)
111
+
112
+
113
+ @cli_util.copy_params_from_generated_command(queueadmin_cli.create_consumer_group, params_to_exclude=['dead_letter_queue_delivery_count'])
114
+ @queueadmin_cli.consumer_group_group.command(name=queueadmin_cli.create_consumer_group.name, help=queueadmin_cli.create_consumer_group.help)
115
+ @cli_util.option('--dlq-delivery-count', type=click.INT, help=u"""The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. If the value isn't specified, it will be using the value defined at the queue level.""")
116
+ @click.pass_context
117
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
118
+ @cli_util.wrap_exceptions
119
+ def create_consumer_group_extended(ctx, **kwargs):
120
+
121
+ if 'dlq_delivery_count' in kwargs:
122
+ kwargs['dead_letter_queue_delivery_count'] = kwargs['dlq_delivery_count']
123
+ kwargs.pop('dlq_delivery_count')
124
+
125
+ ctx.invoke(queueadmin_cli.create_consumer_group, **kwargs)
126
+
127
+
128
+ @cli_util.copy_params_from_generated_command(queueadmin_cli.update_consumer_group, params_to_exclude=['dead_letter_queue_delivery_count'])
129
+ @queueadmin_cli.consumer_group_group.command(name=queueadmin_cli.update_consumer_group.name, help=queueadmin_cli.update_consumer_group.help)
130
+ @cli_util.option('--dlq-delivery-count', type=click.INT, help=u"""The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. Changing that value to a lower threshold does not retroactively move in-flight messages in the dead letter queue. A value of -1 unsets the delivery count for the consumer group (i.e. it will now be using the value set at the queue level).""")
131
+ @click.pass_context
132
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'queue', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'queue', 'class': 'dict(str, dict(str, object))'}})
133
+ @cli_util.wrap_exceptions
134
+ def update_consumer_group_extended(ctx, **kwargs):
135
+
136
+ if 'dlq_delivery_count' in kwargs:
137
+ kwargs['dead_letter_queue_delivery_count'] = kwargs['dlq_delivery_count']
138
+ kwargs.pop('dlq_delivery_count')
139
+ ctx.invoke(queueadmin_cli.update_consumer_group, **kwargs)