oci-cli 3.72.0__py3-none-any.whl → 3.72.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 (107) hide show
  1. oci_cli/bin/iot.psm1 +2 -2
  2. oci_cli/help_text_producer/data_files/text/cmdref/db/action-param-values-summary/list-params-for-action-type.txt +1 -1
  3. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-container-database/create-autonomous-container-database-aws-encryption-key-details.txt +396 -0
  4. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-container-database/create-autonomous-container-database-azure-encryption-key-details.txt +396 -0
  5. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-container-database/create-autonomous-container-database-create-autonomous-container-database-details.txt +11 -0
  6. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-container-database/create-autonomous-container-database-create-autonomous-container-database-from-backup-details.txt +11 -0
  7. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-container-database/create-autonomous-container-database-external-hsm-encryption-details.txt +396 -0
  8. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-container-database/create-autonomous-container-database-google-cloud-provider-encryption-key-details.txt +396 -0
  9. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-container-database/create.txt +11 -0
  10. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-container-database.txt +9 -0
  11. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/change-disaster-recovery-configuration.txt +1 -1
  12. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/configure-saas-admin-user.txt +1 -1
  13. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/create-adb-cross-region-data-guard-details.txt +18 -2
  14. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/create-autonomous-database-create-cross-region-disaster-recovery-details.txt +18 -2
  15. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/create-autonomous-database-gcp-key-details.txt +18 -2
  16. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/create-autonomous-database-undelete-autonomous-database-details.txt +18 -2
  17. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/create-cross-tenancy-disaster-recovery-details.txt +18 -2
  18. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/create-from-backup-id.txt +18 -2
  19. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/create-from-backup-timestamp.txt +18 -2
  20. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/create-from-clone.txt +18 -2
  21. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/create-refreshable-clone.txt +18 -2
  22. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/create.txt +18 -2
  23. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/fail-over.txt +1 -1
  24. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/import-transportable-tablespace.txt +142 -0
  25. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/list-clones.txt +1 -1
  26. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/list.txt +2 -2
  27. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/manual-refresh.txt +1 -1
  28. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/restart.txt +1 -1
  29. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/restore.txt +1 -1
  30. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/rotate-key.txt +1 -1
  31. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/shrink.txt +1 -1
  32. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/start.txt +1 -1
  33. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/stop.txt +1 -1
  34. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/switchover.txt +1 -1
  35. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/update-autonomous-database-gcp-key-details.txt +9 -4
  36. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/update.txt +9 -4
  37. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database.txt +2 -0
  38. oci_cli/help_text_producer/data_files/text/cmdref/db/cloud-autonomous-vm-cluster/register-cloud-autonomous-vm-cluster-pkcs.txt +140 -0
  39. oci_cli/help_text_producer/data_files/text/cmdref/db/cloud-autonomous-vm-cluster/unregister-cloud-autonomous-vm-cluster-pkcs.txt +140 -0
  40. oci_cli/help_text_producer/data_files/text/cmdref/db/cloud-autonomous-vm-cluster.txt +4 -0
  41. oci_cli/help_text_producer/data_files/text/cmdref/db/database/run-data-patch.txt +165 -0
  42. oci_cli/help_text_producer/data_files/text/cmdref/db/database/update.txt +11 -0
  43. oci_cli/help_text_producer/data_files/text/cmdref/db/database.txt +2 -0
  44. oci_cli/help_text_producer/data_files/text/cmdref/db/db-connection-bundle/download.txt +114 -0
  45. oci_cli/help_text_producer/data_files/text/cmdref/db/db-connection-bundle/get.txt +92 -0
  46. oci_cli/help_text_producer/data_files/text/cmdref/db/db-connection-bundle/list.txt +157 -0
  47. oci_cli/help_text_producer/data_files/text/cmdref/db/db-connection-bundle.txt +18 -0
  48. oci_cli/help_text_producer/data_files/text/cmdref/db/exascale-db-storage-vault/create.txt +3 -2
  49. oci_cli/help_text_producer/data_files/text/cmdref/db/exascale-db-storage-vault/update.txt +3 -2
  50. oci_cli/help_text_producer/data_files/text/cmdref/db/maintenance-run/create.txt +1 -1
  51. oci_cli/help_text_producer/data_files/text/cmdref/db/maintenance-run/list.txt +1 -1
  52. oci_cli/help_text_producer/data_files/text/cmdref/db/maintenance-run/update.txt +1 -1
  53. oci_cli/help_text_producer/data_files/text/cmdref/db/maintenance-run-history/list.txt +1 -1
  54. oci_cli/help_text_producer/data_files/text/cmdref/db/scheduled-action/create.txt +1 -1
  55. oci_cli/help_text_producer/data_files/text/cmdref/db.txt +26 -0
  56. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/work-request-error/{list.txt → list-errors.txt} +5 -5
  57. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/work-request-error.txt +1 -1
  58. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/{work-request-log-entry/list-work-request-logs.txt → work-request-log/list-logs.txt} +5 -5
  59. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/{work-request-log-entry.txt → work-request-log.txt} +3 -3
  60. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request.txt +3 -3
  61. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control.txt +3 -3
  62. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/api-key/change-compartment.txt +114 -0
  63. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/api-key/create.txt +181 -0
  64. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/api-key/delete.txt +138 -0
  65. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/api-key/get.txt +100 -0
  66. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/api-key/renew.txt +184 -0
  67. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/api-key/set-api-key-state.txt +181 -0
  68. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/api-key/update.txt +183 -0
  69. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/api-key-collection/list-api-keys.txt +150 -0
  70. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/api-key-collection.txt +14 -0
  71. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/api-key.txt +30 -0
  72. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/dedicated-ai-cluster/create.txt +6 -5
  73. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/endpoint/create.txt +22 -0
  74. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/endpoint/update.txt +22 -0
  75. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/generative-ai-private-endpoint/create.txt +5 -0
  76. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/generative-ai-private-endpoint/update.txt +5 -0
  77. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/model-collection/list-models.txt +1 -1
  78. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-inference/chat-result/chat-cohere-chat-request-v2.txt +350 -0
  79. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-inference/chat-result/chat-generic-chat-request.txt +1 -1
  80. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-inference/chat-result.txt +2 -0
  81. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-inference/embed-text-result/embed-text.txt +16 -0
  82. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-inference/rerank-text-result/rerank-text-dedicated-serving-mode.txt +4 -0
  83. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-inference/rerank-text-result/rerank-text-on-demand-serving-mode.txt +4 -0
  84. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-inference/rerank-text-result/rerank-text.txt +4 -0
  85. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-inference.txt +2 -0
  86. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai.txt +20 -0
  87. oci_cli/help_text_producer/data_files/text/cmdref/iot/digital-twin-instance/get-content.txt +3 -2
  88. oci_cli/help_text_producer/data_files/text/cmdref/iot/domain-group/create.txt +10 -0
  89. oci_cli/help_text_producer/data_files/text/cmdref/iot/domain-group/list.txt +8 -0
  90. oci_cli/help_text_producer/data_files/text/cmdref/organizations/work-request-error/{list.txt → list-errors.txt} +5 -5
  91. oci_cli/help_text_producer/data_files/text/cmdref/organizations/work-request-error.txt +1 -1
  92. oci_cli/help_text_producer/data_files/text/cmdref/organizations/{work-request-log-entry → work-request-log}/list.txt +19 -1
  93. oci_cli/help_text_producer/data_files/text/cmdref/organizations/{work-request-log-entry.txt → work-request-log.txt} +2 -2
  94. oci_cli/help_text_producer/data_files/text/cmdref/organizations.txt +2 -2
  95. oci_cli/version.py +1 -1
  96. {oci_cli-3.72.0.dist-info → oci_cli-3.72.1.dist-info}/METADATA +2 -2
  97. {oci_cli-3.72.0.dist-info → oci_cli-3.72.1.dist-info}/RECORD +107 -84
  98. services/database/src/oci_cli_database/generated/database_cli.py +1446 -140
  99. services/generative_ai/src/oci_cli_generative_ai/generated/generativeai_cli.py +519 -12
  100. services/generative_ai_inference/src/oci_cli_generative_ai_inference/generated/generativeaiinference_cli.py +169 -7
  101. services/identity/src/oci_cli_identity/identity_cli_extended.py +2 -0
  102. services/iot/src/oci_cli_iot/generated/iot_cli.py +10 -3
  103. {oci_cli-3.72.0.dist-info → oci_cli-3.72.1.dist-info}/LICENSE.txt +0 -0
  104. {oci_cli-3.72.0.dist-info → oci_cli-3.72.1.dist-info}/THIRD_PARTY_LICENSES.txt +0 -0
  105. {oci_cli-3.72.0.dist-info → oci_cli-3.72.1.dist-info}/WHEEL +0 -0
  106. {oci_cli-3.72.0.dist-info → oci_cli-3.72.1.dist-info}/entry_points.txt +0 -0
  107. {oci_cli-3.72.0.dist-info → oci_cli-3.72.1.dist-info}/top_level.txt +0 -0
@@ -40,6 +40,12 @@ def work_request_log_entry_group():
40
40
  pass
41
41
 
42
42
 
43
+ @click.command(cli_util.override('generative_ai.api_key_collection_group.command_name', 'api-key-collection'), cls=CommandGroupWithAlias, help="""Results of a ApiKey search.""")
44
+ @cli_util.help_option_group
45
+ def api_key_collection_group():
46
+ pass
47
+
48
+
43
49
  @click.command(cli_util.override('generative_ai.work_request_group.command_name', 'work-request'), cls=CommandGroupWithAlias, help="""An asynchronous work request. When you start a long-running operation, the service creates a work request. Work requests help you monitor long-running operations.
44
50
 
45
51
  A work request is an activity log that lets you track each step in the operation's progress. Each work request has an OCID that lets you interact with it programmatically and use it for automation.""")
@@ -68,6 +74,12 @@ def endpoint_group():
68
74
  pass
69
75
 
70
76
 
77
+ @click.command(cli_util.override('generative_ai.api_key_group.command_name', 'api-key'), cls=CommandGroupWithAlias, help="""ApiKeys are resources used to access GenAI models. You must be authorized through an IAM policy to use any API operations. If you're not authorized, contact an administrator who manages OCI resource access. See [Getting Started with Policies] and [Getting Access to Generative AI Resources].""")
78
+ @cli_util.help_option_group
79
+ def api_key_group():
80
+ pass
81
+
82
+
71
83
  @click.command(cli_util.override('generative_ai.work_request_error_group.command_name', 'work-request-error'), cls=CommandGroupWithAlias, help="""An error encountered while performing an operation that is tracked by this work request.""")
72
84
  @cli_util.help_option_group
73
85
  def work_request_error_group():
@@ -118,10 +130,12 @@ def imported_model_group():
118
130
 
119
131
  generative_ai_root_group.add_command(endpoint_collection_group)
120
132
  generative_ai_root_group.add_command(work_request_log_entry_group)
133
+ generative_ai_root_group.add_command(api_key_collection_group)
121
134
  generative_ai_root_group.add_command(work_request_group)
122
135
  generative_ai_root_group.add_command(model_collection_group)
123
136
  generative_ai_root_group.add_command(generative_ai_private_endpoint_group)
124
137
  generative_ai_root_group.add_command(endpoint_group)
138
+ generative_ai_root_group.add_command(api_key_group)
125
139
  generative_ai_root_group.add_command(work_request_error_group)
126
140
  generative_ai_root_group.add_command(model_group)
127
141
  generative_ai_root_group.add_command(dedicated_ai_cluster_collection_group)
@@ -131,6 +145,37 @@ generative_ai_root_group.add_command(imported_model_collection_group)
131
145
  generative_ai_root_group.add_command(imported_model_group)
132
146
 
133
147
 
148
+ @api_key_group.command(name=cli_util.override('generative_ai.change_api_key_compartment.command_name', 'change-compartment'), help=u"""Moves an API key into a different compartment within the same tenancy. For information about moving resources between compartments, see [Moving Resources to a Different Compartment]. \n[Command Reference](changeApiKeyCompartment)""")
149
+ @cli_util.option('--api-key-id', required=True, help=u"""The [OCID] of the APIKey.""")
150
+ @cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment to move the APIKey to.""")
151
+ @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.""")
152
+ @json_skeleton_utils.get_cli_json_input_option({})
153
+ @cli_util.help_option
154
+ @click.pass_context
155
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
156
+ @cli_util.wrap_exceptions
157
+ def change_api_key_compartment(ctx, from_json, api_key_id, compartment_id, if_match):
158
+
159
+ if isinstance(api_key_id, six.string_types) and len(api_key_id.strip()) == 0:
160
+ raise click.UsageError('Parameter --api-key-id cannot be whitespace or empty string')
161
+
162
+ kwargs = {}
163
+ if if_match is not None:
164
+ kwargs['if_match'] = if_match
165
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
166
+
167
+ _details = {}
168
+ _details['compartmentId'] = compartment_id
169
+
170
+ client = cli_util.build_client('generative_ai', 'generative_ai', ctx)
171
+ result = client.change_api_key_compartment(
172
+ api_key_id=api_key_id,
173
+ change_api_key_compartment_details=_details,
174
+ **kwargs
175
+ )
176
+ cli_util.render_response(result, ctx)
177
+
178
+
134
179
  @dedicated_ai_cluster_group.command(name=cli_util.override('generative_ai.change_dedicated_ai_cluster_compartment.command_name', 'change-compartment'), help=u"""Moves a dedicated AI cluster into a different compartment within the same tenancy. For information about moving resources between compartments, see [Moving Resources to a Different Compartment]. \n[Command Reference](changeDedicatedAiClusterCompartment)""")
135
180
  @cli_util.option('--dedicated-ai-cluster-id', required=True, help=u"""The [OCID] of the dedicated AI cluster.""")
136
181
  @cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment to move the dedicated AI cluster to.""")
@@ -316,6 +361,75 @@ def change_model_compartment(ctx, from_json, model_id, compartment_id, if_match)
316
361
  cli_util.render_response(result, ctx)
317
362
 
318
363
 
364
+ @api_key_group.command(name=cli_util.override('generative_ai.create_api_key.command_name', 'create'), help=u"""Creates a new API key in the specified compartment. \n[Command Reference](createApiKey)""")
365
+ @cli_util.option('--display-name', required=True, help=u"""A user-friendly name. Does not have to be unique, and it's changeable.""")
366
+ @cli_util.option('--compartment-id', required=True, help=u"""The compartment OCID to create the apiKey in.""")
367
+ @cli_util.option('--key-details', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of key details for creation.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
368
+ @cli_util.option('--description', help=u"""An optional description of the Api key.""")
369
+ @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].
370
+
371
+ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
372
+ @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].
373
+
374
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
375
+ @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.""")
376
+ @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.""")
377
+ @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.""")
378
+ @json_skeleton_utils.get_cli_json_input_option({'key-details': {'module': 'generative_ai', 'class': 'list[KeyDetails]'}, 'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}})
379
+ @cli_util.help_option
380
+ @click.pass_context
381
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'key-details': {'module': 'generative_ai', 'class': 'list[KeyDetails]'}, 'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'generative_ai', 'class': 'ApiKey'})
382
+ @cli_util.wrap_exceptions
383
+ def create_api_key(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, compartment_id, key_details, description, freeform_tags, defined_tags):
384
+
385
+ kwargs = {}
386
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
387
+
388
+ _details = {}
389
+ _details['displayName'] = display_name
390
+ _details['compartmentId'] = compartment_id
391
+ _details['keyDetails'] = cli_util.parse_json_parameter("key_details", key_details)
392
+
393
+ if description is not None:
394
+ _details['description'] = description
395
+
396
+ if freeform_tags is not None:
397
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
398
+
399
+ if defined_tags is not None:
400
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
401
+
402
+ client = cli_util.build_client('generative_ai', 'generative_ai', ctx)
403
+ result = client.create_api_key(
404
+ create_api_key_details=_details,
405
+ **kwargs
406
+ )
407
+ if wait_for_state:
408
+
409
+ if hasattr(client, 'get_api_key') and callable(getattr(client, 'get_api_key')):
410
+ try:
411
+ wait_period_kwargs = {}
412
+ if max_wait_seconds is not None:
413
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
414
+ if wait_interval_seconds is not None:
415
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
416
+
417
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
418
+ result = oci.wait_until(client, client.get_api_key(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
419
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
420
+ # If we fail, we should show an error, but we should still provide the information to the customer
421
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
422
+ cli_util.render_response(result, ctx)
423
+ sys.exit(2)
424
+ except Exception:
425
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
426
+ cli_util.render_response(result, ctx)
427
+ raise
428
+ else:
429
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
430
+ cli_util.render_response(result, ctx)
431
+
432
+
319
433
  @dedicated_ai_cluster_group.command(name=cli_util.override('generative_ai.create_dedicated_ai_cluster.command_name', 'create'), help=u"""Creates a dedicated AI cluster. \n[Command Reference](createDedicatedAiCluster)""")
320
434
  @cli_util.option('--type', required=True, help=u"""The dedicated AI cluster type indicating whether this is a fine-tuning/training processor or hosting/inference processor.
321
435
 
@@ -324,7 +438,7 @@ Allowed values are: - HOSTING - FINE_TUNING""")
324
438
  @cli_util.option('--unit-count', required=True, type=click.INT, help=u"""The number of dedicated units in this AI cluster.""")
325
439
  @cli_util.option('--unit-shape', required=True, help=u"""The shape of dedicated unit in this AI cluster. The underlying hardware configuration is hidden from customers.
326
440
 
327
- Allowed values are: - LARGE_COHERE - LARGE_COHERE_V2 - SMALL_COHERE - SMALL_COHERE_V2 - SMALL_COHERE_4 - EMBED_COHERE - LLAMA2_70 - LARGE_GENERIC - LARGE_COHERE_V2_2 - LARGE_GENERIC_4 - SMALL_GENERIC_V2 - LARGE_GENERIC_2 - LARGE_COHERE_V3 - RERANK_COHERE - SMALL_GENERIC_V1 - MEDIUM_GENERIC_V1 - LARGE_GENERIC_V1 - A10_X1 - A10_X2 - A10_X4 - A100_40G_X1 - A100_40G_X2 - A100_40G_X4 - A100_40G_X8 - A100_80G_X1 - A100_80G_X2 - A100_80G_X4 - A100_80G_X8 - H100_X1 - H100_X2 - H100_X4 - H100_X8 - H200_X1 - H200_X2 - H200_X4 - H200_X8
441
+ Allowed values are: - LARGE_COHERE - LARGE_COHERE_V2 - SMALL_COHERE - SMALL_COHERE_V2 - SMALL_COHERE_4 - EMBED_COHERE - LLAMA2_70 - LARGE_GENERIC - LARGE_COHERE_V2_2 - LARGE_GENERIC_4 - SMALL_GENERIC_V2 - LARGE_GENERIC_2 - LARGE_GENERIC_V3 - LARGE_COHERE_V3 - RERANK_COHERE - SMALL_GENERIC_V1 - MEDIUM_GENERIC_V1 - LARGE_GENERIC_V1 - A10_X1 - A10_X2 - A10_X4 - A100_40G_X1 - A100_40G_X2 - A100_40G_X4 - A100_40G_X8 - A100_80G_X1 - A100_80G_X2 - A100_80G_X4 - A100_80G_X8 - H100_X1 - H100_X2 - H100_X4 - H100_X8 - H200_X1 - H200_X2 - H200_X4 - H200_X8
328
442
 
329
443
  The following shapes can only be used to deploy imported models: - A10_X1, A10_X2, A10_X4 - A100_40G_X1, A100_40G_X2, A100_40G_X4, A100_40G_X8 - A100_80G_X1, A100_80G_X2, A100_80G_X4, A100_80G_X8 - H100_X1, H100_X2, H100_X4, H100_X8 - H200_X1, H200_X2, H200_X4, H200_X8 - OAI_A10_X2 - OAI_H100_X1 - OAI_H100_X2 - OAI_H200_X1 - OAI_A100_80G_X1 - OAI_A100_80G_X2 - OAI_A100_40G_X1 - OAI_A100_40G_X4""")
330
444
  @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.""")
@@ -411,6 +525,8 @@ The header contains an opc-work-request-id, which is the id for the WorkRequest
411
525
  @cli_util.option('--description', help=u"""An optional description of the endpoint.""")
412
526
  @cli_util.option('--generative-ai-private-endpoint-id', help=u"""The OCID of the Generative AI private endpoint to which this endpoint is attached to.""")
413
527
  @cli_util.option('--content-moderation-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
528
+ @cli_util.option('--prompt-injection-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
529
+ @cli_util.option('--pii-detection-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
414
530
  @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].
415
531
 
416
532
  Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@@ -420,12 +536,12 @@ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_comp
420
536
  @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "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.""")
421
537
  @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
538
  @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.""")
423
- @json_skeleton_utils.get_cli_json_input_option({'content-moderation-config': {'module': 'generative_ai', 'class': 'ContentModerationConfig'}, 'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}})
539
+ @json_skeleton_utils.get_cli_json_input_option({'content-moderation-config': {'module': 'generative_ai', 'class': 'ContentModerationConfig'}, 'prompt-injection-config': {'module': 'generative_ai', 'class': 'PromptInjectionConfig'}, 'pii-detection-config': {'module': 'generative_ai', 'class': 'PiiDetectionConfig'}, 'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}})
424
540
  @cli_util.help_option
425
541
  @click.pass_context
426
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'content-moderation-config': {'module': 'generative_ai', 'class': 'ContentModerationConfig'}, 'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'generative_ai', 'class': 'Endpoint'})
542
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'content-moderation-config': {'module': 'generative_ai', 'class': 'ContentModerationConfig'}, 'prompt-injection-config': {'module': 'generative_ai', 'class': 'PromptInjectionConfig'}, 'pii-detection-config': {'module': 'generative_ai', 'class': 'PiiDetectionConfig'}, 'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'generative_ai', 'class': 'Endpoint'})
427
543
  @cli_util.wrap_exceptions
428
- def create_endpoint(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, model_id, dedicated_ai_cluster_id, display_name, description, generative_ai_private_endpoint_id, content_moderation_config, freeform_tags, defined_tags):
544
+ def create_endpoint(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, model_id, dedicated_ai_cluster_id, display_name, description, generative_ai_private_endpoint_id, content_moderation_config, prompt_injection_config, pii_detection_config, freeform_tags, defined_tags):
429
545
 
430
546
  kwargs = {}
431
547
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
@@ -447,6 +563,12 @@ def create_endpoint(ctx, from_json, wait_for_state, max_wait_seconds, wait_inter
447
563
  if content_moderation_config is not None:
448
564
  _details['contentModerationConfig'] = cli_util.parse_json_parameter("content_moderation_config", content_moderation_config)
449
565
 
566
+ if prompt_injection_config is not None:
567
+ _details['promptInjectionConfig'] = cli_util.parse_json_parameter("prompt_injection_config", prompt_injection_config)
568
+
569
+ if pii_detection_config is not None:
570
+ _details['piiDetectionConfig'] = cli_util.parse_json_parameter("pii_detection_config", pii_detection_config)
571
+
450
572
  if freeform_tags is not None:
451
573
  _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
452
574
 
@@ -495,6 +617,7 @@ def create_endpoint(ctx, from_json, wait_for_state, max_wait_seconds, wait_inter
495
617
  @cli_util.option('--description', help=u"""A description of this private endpoint.""")
496
618
  @cli_util.option('--display-name', help=u"""A user friendly name. It doesn't have to be unique. Avoid entering confidential information.""")
497
619
  @cli_util.option('--nsg-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A list of the OCIDs of the network security groups (NSGs) to add the private endpoint's VNIC to.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
620
+ @cli_util.option('--is-allow-on-demand', type=click.BOOL, help=u"""Flag that allows access to on-demand models using this private endpoint.""")
498
621
  @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].
499
622
 
500
623
  Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@@ -509,7 +632,7 @@ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_comp
509
632
  @click.pass_context
510
633
  @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'nsg-ids': {'module': 'generative_ai', 'class': 'list[string]'}, 'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'generative_ai', 'class': 'GenerativeAiPrivateEndpoint'})
511
634
  @cli_util.wrap_exceptions
512
- def create_generative_ai_private_endpoint(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, subnet_id, dns_prefix, description, display_name, nsg_ids, freeform_tags, defined_tags):
635
+ def create_generative_ai_private_endpoint(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, subnet_id, dns_prefix, description, display_name, nsg_ids, is_allow_on_demand, freeform_tags, defined_tags):
513
636
 
514
637
  kwargs = {}
515
638
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
@@ -528,6 +651,9 @@ def create_generative_ai_private_endpoint(ctx, from_json, wait_for_state, max_wa
528
651
  if nsg_ids is not None:
529
652
  _details['nsgIds'] = cli_util.parse_json_parameter("nsg_ids", nsg_ids)
530
653
 
654
+ if is_allow_on_demand is not None:
655
+ _details['isAllowOnDemand'] = is_allow_on_demand
656
+
531
657
  if freeform_tags is not None:
532
658
  _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
533
659
 
@@ -949,6 +1075,70 @@ def create_model(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval
949
1075
  cli_util.render_response(result, ctx)
950
1076
 
951
1077
 
1078
+ @api_key_group.command(name=cli_util.override('generative_ai.delete_api_key.command_name', 'delete'), help=u"""Deletes an API key. \n[Command Reference](deleteApiKey)""")
1079
+ @cli_util.option('--api-key-id', required=True, help=u"""The [OCID] of the APIKey.""")
1080
+ @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.""")
1081
+ @cli_util.confirm_delete_option
1082
+ @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.""")
1083
+ @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.""")
1084
+ @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.""")
1085
+ @json_skeleton_utils.get_cli_json_input_option({})
1086
+ @cli_util.help_option
1087
+ @click.pass_context
1088
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
1089
+ @cli_util.wrap_exceptions
1090
+ def delete_api_key(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, api_key_id, if_match):
1091
+
1092
+ if isinstance(api_key_id, six.string_types) and len(api_key_id.strip()) == 0:
1093
+ raise click.UsageError('Parameter --api-key-id cannot be whitespace or empty string')
1094
+
1095
+ kwargs = {}
1096
+ if if_match is not None:
1097
+ kwargs['if_match'] = if_match
1098
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1099
+ client = cli_util.build_client('generative_ai', 'generative_ai', ctx)
1100
+ result = client.delete_api_key(
1101
+ api_key_id=api_key_id,
1102
+ **kwargs
1103
+ )
1104
+ if wait_for_state:
1105
+
1106
+ if hasattr(client, 'get_api_key') and callable(getattr(client, 'get_api_key')):
1107
+ try:
1108
+ wait_period_kwargs = {}
1109
+ if max_wait_seconds is not None:
1110
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1111
+ if wait_interval_seconds is not None:
1112
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1113
+
1114
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
1115
+ oci.wait_until(client, client.get_api_key(api_key_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
1116
+ except oci.exceptions.ServiceError as e:
1117
+ # We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
1118
+ # outcome of a delete operation it is possible that the resource is already gone and so the initial service call
1119
+ # will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
1120
+ # the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
1121
+ # succeed_on_not_found=True to the waiter).
1122
+ #
1123
+ # Any non-404 should still result in the exception being thrown.
1124
+ if e.status == 404:
1125
+ pass
1126
+ else:
1127
+ raise
1128
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1129
+ # If we fail, we should show an error, but we should still provide the information to the customer
1130
+ click.echo('Failed to wait until the resource entered the specified state. Please retrieve the resource to find its current state', file=sys.stderr)
1131
+ cli_util.render_response(result, ctx)
1132
+ sys.exit(2)
1133
+ except Exception:
1134
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
1135
+ cli_util.render_response(result, ctx)
1136
+ raise
1137
+ else:
1138
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1139
+ cli_util.render_response(result, ctx)
1140
+
1141
+
952
1142
  @dedicated_ai_cluster_group.command(name=cli_util.override('generative_ai.delete_dedicated_ai_cluster.command_name', 'delete'), help=u"""Deletes a dedicated AI cluster.
953
1143
 
954
1144
  You can only delete clusters without attached resources. Before you delete a hosting dedicated AI cluster, you must delete the endpoints associated to that cluster. Before you delete a fine-tuning dedicated AI cluster, you must delete the custom model on that cluster. The delete action permanently deletes the cluster. This action can't be undone. \n[Command Reference](deleteDedicatedAiCluster)""")
@@ -1231,6 +1421,28 @@ def delete_model(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval
1231
1421
  cli_util.render_response(result, ctx)
1232
1422
 
1233
1423
 
1424
+ @api_key_group.command(name=cli_util.override('generative_ai.get_api_key.command_name', 'get'), help=u"""Gets information about an API key. \n[Command Reference](getApiKey)""")
1425
+ @cli_util.option('--api-key-id', required=True, help=u"""The [OCID] of the APIKey.""")
1426
+ @json_skeleton_utils.get_cli_json_input_option({})
1427
+ @cli_util.help_option
1428
+ @click.pass_context
1429
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'generative_ai', 'class': 'ApiKey'})
1430
+ @cli_util.wrap_exceptions
1431
+ def get_api_key(ctx, from_json, api_key_id):
1432
+
1433
+ if isinstance(api_key_id, six.string_types) and len(api_key_id.strip()) == 0:
1434
+ raise click.UsageError('Parameter --api-key-id cannot be whitespace or empty string')
1435
+
1436
+ kwargs = {}
1437
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1438
+ client = cli_util.build_client('generative_ai', 'generative_ai', ctx)
1439
+ result = client.get_api_key(
1440
+ api_key_id=api_key_id,
1441
+ **kwargs
1442
+ )
1443
+ cli_util.render_response(result, ctx)
1444
+
1445
+
1234
1446
  @dedicated_ai_cluster_group.command(name=cli_util.override('generative_ai.get_dedicated_ai_cluster.command_name', 'get'), help=u"""Gets information about a dedicated AI cluster. \n[Command Reference](getDedicatedAiCluster)""")
1235
1447
  @cli_util.option('--dedicated-ai-cluster-id', required=True, help=u"""The [OCID] of the dedicated AI cluster.""")
1236
1448
  @json_skeleton_utils.get_cli_json_input_option({})
@@ -1363,6 +1575,69 @@ def get_work_request(ctx, from_json, work_request_id):
1363
1575
  cli_util.render_response(result, ctx)
1364
1576
 
1365
1577
 
1578
+ @api_key_collection_group.command(name=cli_util.override('generative_ai.list_api_keys.command_name', 'list-api-keys'), help=u"""Lists the ApiKeys of a specific compartment. \n[Command Reference](listApiKeys)""")
1579
+ @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment in which to list resources.""")
1580
+ @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only resources that their lifecycle state matches the given lifecycle state.""")
1581
+ @cli_util.option('--display-name', help=u"""A filter to return only resources that match the given display name exactly.""")
1582
+ @cli_util.option('--id', help=u"""The [OCID] of the APIKey.""")
1583
+ @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].""")
1584
+ @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].""")
1585
+ @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""")
1586
+ @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["displayName", "timeCreated"]), help=u"""The field to sort by. You can provide only one sort order. Default order for `timeCreated` is descending. Default order for `displayName` is ascending.""")
1587
+ @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.""")
1588
+ @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.""")
1589
+ @json_skeleton_utils.get_cli_json_input_option({})
1590
+ @cli_util.help_option
1591
+ @click.pass_context
1592
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'generative_ai', 'class': 'ApiKeyCollection'})
1593
+ @cli_util.wrap_exceptions
1594
+ def list_api_keys(ctx, from_json, all_pages, page_size, compartment_id, lifecycle_state, display_name, id, limit, page, sort_order, sort_by):
1595
+
1596
+ if all_pages and limit:
1597
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
1598
+
1599
+ kwargs = {}
1600
+ if lifecycle_state is not None:
1601
+ kwargs['lifecycle_state'] = lifecycle_state
1602
+ if display_name is not None:
1603
+ kwargs['display_name'] = display_name
1604
+ if id is not None:
1605
+ kwargs['id'] = id
1606
+ if limit is not None:
1607
+ kwargs['limit'] = limit
1608
+ if page is not None:
1609
+ kwargs['page'] = page
1610
+ if sort_order is not None:
1611
+ kwargs['sort_order'] = sort_order
1612
+ if sort_by is not None:
1613
+ kwargs['sort_by'] = sort_by
1614
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1615
+ client = cli_util.build_client('generative_ai', 'generative_ai', ctx)
1616
+ if all_pages:
1617
+ if page_size:
1618
+ kwargs['limit'] = page_size
1619
+
1620
+ result = cli_util.list_call_get_all_results(
1621
+ client.list_api_keys,
1622
+ compartment_id=compartment_id,
1623
+ **kwargs
1624
+ )
1625
+ elif limit is not None:
1626
+ result = cli_util.list_call_get_up_to_limit(
1627
+ client.list_api_keys,
1628
+ limit,
1629
+ page_size,
1630
+ compartment_id=compartment_id,
1631
+ **kwargs
1632
+ )
1633
+ else:
1634
+ result = client.list_api_keys(
1635
+ compartment_id=compartment_id,
1636
+ **kwargs
1637
+ )
1638
+ cli_util.render_response(result, ctx)
1639
+
1640
+
1366
1641
  @dedicated_ai_cluster_collection_group.command(name=cli_util.override('generative_ai.list_dedicated_ai_clusters.command_name', 'list-dedicated-ai-clusters'), help=u"""Lists the dedicated AI clusters in a specific compartment. \n[Command Reference](listDedicatedAiClusters)""")
1367
1642
  @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment in which to list resources.""")
1368
1643
  @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED", "NEEDS_ATTENTION"]), help=u"""A filter to return only the dedicated AI clusters that their lifecycle state matches the given lifecycle state.""")
@@ -1627,7 +1902,7 @@ def list_imported_models(ctx, from_json, all_pages, page_size, compartment_id, v
1627
1902
  @model_collection_group.command(name=cli_util.override('generative_ai.list_models.command_name', 'list-models'), help=u"""Lists the models in a specific compartment. Includes pretrained base models and fine-tuned custom models. \n[Command Reference](listModels)""")
1628
1903
  @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment in which to list resources.""")
1629
1904
  @cli_util.option('--vendor', help=u"""A filter to return only resources that match the entire vendor given.""")
1630
- @cli_util.option('--capability', type=custom_types.CliCaseInsensitiveChoice(["TEXT_TO_TEXT", "IMAGE_TEXT_TO_TEXT", "EMBEDDING", "RERANK"]), multiple=True, help=u"""A filter to return only resources their capability matches the given capability.""")
1905
+ @cli_util.option('--capability', type=custom_types.CliCaseInsensitiveChoice(["TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE", "CHAT", "TEXT_RERANK"]), multiple=True, help=u"""A filter to return only resources their capability matches the given capability.""")
1631
1906
  @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "CREATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only resources their lifecycleState matches the given lifecycleState.""")
1632
1907
  @cli_util.option('--display-name', help=u"""A filter to return only resources that match the given display name exactly.""")
1633
1908
  @cli_util.option('--id', help=u"""The ID of the model.""")
@@ -1870,6 +2145,226 @@ def list_work_requests(ctx, from_json, all_pages, page_size, compartment_id, wor
1870
2145
  cli_util.render_response(result, ctx)
1871
2146
 
1872
2147
 
2148
+ @api_key_group.command(name=cli_util.override('generative_ai.renew_api_key.command_name', 'renew'), help=u"""Renew the primary or secondary key. \n[Command Reference](renewApiKey)""")
2149
+ @cli_util.option('--api-key-id', required=True, help=u"""The [OCID] of the APIKey.""")
2150
+ @cli_util.option('--details', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2151
+ @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].
2152
+
2153
+ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2154
+ @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].
2155
+
2156
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2157
+ @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.""")
2158
+ @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.""")
2159
+ @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.""")
2160
+ @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.""")
2161
+ @json_skeleton_utils.get_cli_json_input_option({'details': {'module': 'generative_ai', 'class': 'KeyDetails'}, 'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}})
2162
+ @cli_util.help_option
2163
+ @click.pass_context
2164
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'details': {'module': 'generative_ai', 'class': 'KeyDetails'}, 'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'generative_ai', 'class': 'ApiKey'})
2165
+ @cli_util.wrap_exceptions
2166
+ def renew_api_key(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, api_key_id, details, freeform_tags, defined_tags, if_match):
2167
+
2168
+ if isinstance(api_key_id, six.string_types) and len(api_key_id.strip()) == 0:
2169
+ raise click.UsageError('Parameter --api-key-id cannot be whitespace or empty string')
2170
+
2171
+ kwargs = {}
2172
+ if if_match is not None:
2173
+ kwargs['if_match'] = if_match
2174
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2175
+
2176
+ _details = {}
2177
+ _details['details'] = cli_util.parse_json_parameter("details", details)
2178
+
2179
+ if freeform_tags is not None:
2180
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
2181
+
2182
+ if defined_tags is not None:
2183
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
2184
+
2185
+ client = cli_util.build_client('generative_ai', 'generative_ai', ctx)
2186
+ result = client.renew_api_key(
2187
+ api_key_id=api_key_id,
2188
+ renew_api_key_details=_details,
2189
+ **kwargs
2190
+ )
2191
+ if wait_for_state:
2192
+
2193
+ if hasattr(client, 'get_api_key') and callable(getattr(client, 'get_api_key')):
2194
+ try:
2195
+ wait_period_kwargs = {}
2196
+ if max_wait_seconds is not None:
2197
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2198
+ if wait_interval_seconds is not None:
2199
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2200
+
2201
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
2202
+ result = oci.wait_until(client, client.get_api_key(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
2203
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
2204
+ # If we fail, we should show an error, but we should still provide the information to the customer
2205
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
2206
+ cli_util.render_response(result, ctx)
2207
+ sys.exit(2)
2208
+ except Exception:
2209
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
2210
+ cli_util.render_response(result, ctx)
2211
+ raise
2212
+ else:
2213
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
2214
+ cli_util.render_response(result, ctx)
2215
+
2216
+
2217
+ @api_key_group.command(name=cli_util.override('generative_ai.set_api_key_state.command_name', 'set-api-key-state'), help=u"""Set state of the key. \n[Command Reference](setApiKeyState)""")
2218
+ @cli_util.option('--api-key-id', required=True, help=u"""The [OCID] of the APIKey.""")
2219
+ @cli_util.option('--key-name', required=True, help=u"""The key to set state.""")
2220
+ @cli_util.option('--state', required=True, help=u"""The target state of the API key item.""")
2221
+ @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].
2222
+
2223
+ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2224
+ @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].
2225
+
2226
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2227
+ @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.""")
2228
+ @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.""")
2229
+ @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.""")
2230
+ @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.""")
2231
+ @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}})
2232
+ @cli_util.help_option
2233
+ @click.pass_context
2234
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'generative_ai', 'class': 'ApiKey'})
2235
+ @cli_util.wrap_exceptions
2236
+ def set_api_key_state(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, api_key_id, key_name, state, freeform_tags, defined_tags, if_match):
2237
+
2238
+ if isinstance(api_key_id, six.string_types) and len(api_key_id.strip()) == 0:
2239
+ raise click.UsageError('Parameter --api-key-id cannot be whitespace or empty string')
2240
+
2241
+ kwargs = {}
2242
+ if if_match is not None:
2243
+ kwargs['if_match'] = if_match
2244
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2245
+
2246
+ _details = {}
2247
+ _details['keyName'] = key_name
2248
+ _details['state'] = state
2249
+
2250
+ if freeform_tags is not None:
2251
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
2252
+
2253
+ if defined_tags is not None:
2254
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
2255
+
2256
+ client = cli_util.build_client('generative_ai', 'generative_ai', ctx)
2257
+ result = client.set_api_key_state(
2258
+ api_key_id=api_key_id,
2259
+ set_api_key_state_details=_details,
2260
+ **kwargs
2261
+ )
2262
+ if wait_for_state:
2263
+
2264
+ if hasattr(client, 'get_api_key') and callable(getattr(client, 'get_api_key')):
2265
+ try:
2266
+ wait_period_kwargs = {}
2267
+ if max_wait_seconds is not None:
2268
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2269
+ if wait_interval_seconds is not None:
2270
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2271
+
2272
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
2273
+ result = oci.wait_until(client, client.get_api_key(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
2274
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
2275
+ # If we fail, we should show an error, but we should still provide the information to the customer
2276
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
2277
+ cli_util.render_response(result, ctx)
2278
+ sys.exit(2)
2279
+ except Exception:
2280
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
2281
+ cli_util.render_response(result, ctx)
2282
+ raise
2283
+ else:
2284
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
2285
+ cli_util.render_response(result, ctx)
2286
+
2287
+
2288
+ @api_key_group.command(name=cli_util.override('generative_ai.update_api_key.command_name', 'update'), help=u"""Updates the properties of an apiKey. \n[Command Reference](updateApiKey)""")
2289
+ @cli_util.option('--api-key-id', required=True, help=u"""The [OCID] of the APIKey.""")
2290
+ @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.""")
2291
+ @cli_util.option('--description', help=u"""An optional description of the Api key.""")
2292
+ @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].
2293
+
2294
+ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2295
+ @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].
2296
+
2297
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2298
+ @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.""")
2299
+ @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
2300
+ @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.""")
2301
+ @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.""")
2302
+ @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.""")
2303
+ @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}})
2304
+ @cli_util.help_option
2305
+ @click.pass_context
2306
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'generative_ai', 'class': 'ApiKey'})
2307
+ @cli_util.wrap_exceptions
2308
+ def update_api_key(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, api_key_id, display_name, description, freeform_tags, defined_tags, if_match):
2309
+
2310
+ if isinstance(api_key_id, six.string_types) and len(api_key_id.strip()) == 0:
2311
+ raise click.UsageError('Parameter --api-key-id cannot be whitespace or empty string')
2312
+ if not force:
2313
+ if freeform_tags or defined_tags:
2314
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
2315
+ ctx.abort()
2316
+
2317
+ kwargs = {}
2318
+ if if_match is not None:
2319
+ kwargs['if_match'] = if_match
2320
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2321
+
2322
+ _details = {}
2323
+
2324
+ if display_name is not None:
2325
+ _details['displayName'] = display_name
2326
+
2327
+ if description is not None:
2328
+ _details['description'] = description
2329
+
2330
+ if freeform_tags is not None:
2331
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
2332
+
2333
+ if defined_tags is not None:
2334
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
2335
+
2336
+ client = cli_util.build_client('generative_ai', 'generative_ai', ctx)
2337
+ result = client.update_api_key(
2338
+ api_key_id=api_key_id,
2339
+ update_api_key_details=_details,
2340
+ **kwargs
2341
+ )
2342
+ if wait_for_state:
2343
+
2344
+ if hasattr(client, 'get_api_key') and callable(getattr(client, 'get_api_key')):
2345
+ try:
2346
+ wait_period_kwargs = {}
2347
+ if max_wait_seconds is not None:
2348
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2349
+ if wait_interval_seconds is not None:
2350
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2351
+
2352
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
2353
+ result = oci.wait_until(client, client.get_api_key(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
2354
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
2355
+ # If we fail, we should show an error, but we should still provide the information to the customer
2356
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
2357
+ cli_util.render_response(result, ctx)
2358
+ sys.exit(2)
2359
+ except Exception:
2360
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
2361
+ cli_util.render_response(result, ctx)
2362
+ raise
2363
+ else:
2364
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
2365
+ cli_util.render_response(result, ctx)
2366
+
2367
+
1873
2368
  @dedicated_ai_cluster_group.command(name=cli_util.override('generative_ai.update_dedicated_ai_cluster.command_name', 'update'), help=u"""Updates a dedicated AI cluster. \n[Command Reference](updateDedicatedAiCluster)""")
1874
2369
  @cli_util.option('--dedicated-ai-cluster-id', required=True, help=u"""The [OCID] of the dedicated AI cluster.""")
1875
2370
  @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.""")
@@ -1964,6 +2459,8 @@ def update_dedicated_ai_cluster(ctx, from_json, force, wait_for_state, max_wait_
1964
2459
  @cli_util.option('--description', help=u"""An optional description of the endpoint.""")
1965
2460
  @cli_util.option('--generative-ai-private-endpoint-id', help=u"""The OCID of the Generative AI private endpoint to which this endpoint will be attached.""")
1966
2461
  @cli_util.option('--content-moderation-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2462
+ @cli_util.option('--prompt-injection-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2463
+ @cli_util.option('--pii-detection-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1967
2464
  @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].
1968
2465
 
1969
2466
  Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@@ -1975,18 +2472,18 @@ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_comp
1975
2472
  @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "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.""")
1976
2473
  @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.""")
1977
2474
  @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.""")
1978
- @json_skeleton_utils.get_cli_json_input_option({'content-moderation-config': {'module': 'generative_ai', 'class': 'ContentModerationConfig'}, 'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}})
2475
+ @json_skeleton_utils.get_cli_json_input_option({'content-moderation-config': {'module': 'generative_ai', 'class': 'ContentModerationConfig'}, 'prompt-injection-config': {'module': 'generative_ai', 'class': 'PromptInjectionConfig'}, 'pii-detection-config': {'module': 'generative_ai', 'class': 'PiiDetectionConfig'}, 'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}})
1979
2476
  @cli_util.help_option
1980
2477
  @click.pass_context
1981
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'content-moderation-config': {'module': 'generative_ai', 'class': 'ContentModerationConfig'}, 'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'generative_ai', 'class': 'Endpoint'})
2478
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'content-moderation-config': {'module': 'generative_ai', 'class': 'ContentModerationConfig'}, 'prompt-injection-config': {'module': 'generative_ai', 'class': 'PromptInjectionConfig'}, 'pii-detection-config': {'module': 'generative_ai', 'class': 'PiiDetectionConfig'}, 'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'generative_ai', 'class': 'Endpoint'})
1982
2479
  @cli_util.wrap_exceptions
1983
- def update_endpoint(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, endpoint_id, display_name, description, generative_ai_private_endpoint_id, content_moderation_config, freeform_tags, defined_tags, if_match):
2480
+ def update_endpoint(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, endpoint_id, display_name, description, generative_ai_private_endpoint_id, content_moderation_config, prompt_injection_config, pii_detection_config, freeform_tags, defined_tags, if_match):
1984
2481
 
1985
2482
  if isinstance(endpoint_id, six.string_types) and len(endpoint_id.strip()) == 0:
1986
2483
  raise click.UsageError('Parameter --endpoint-id cannot be whitespace or empty string')
1987
2484
  if not force:
1988
- if content_moderation_config or freeform_tags or defined_tags:
1989
- if not click.confirm("WARNING: Updates to content-moderation-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
2485
+ if content_moderation_config or prompt_injection_config or pii_detection_config or freeform_tags or defined_tags:
2486
+ if not click.confirm("WARNING: Updates to content-moderation-config and prompt-injection-config and pii-detection-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
1990
2487
  ctx.abort()
1991
2488
 
1992
2489
  kwargs = {}
@@ -2008,6 +2505,12 @@ def update_endpoint(ctx, from_json, force, wait_for_state, max_wait_seconds, wai
2008
2505
  if content_moderation_config is not None:
2009
2506
  _details['contentModerationConfig'] = cli_util.parse_json_parameter("content_moderation_config", content_moderation_config)
2010
2507
 
2508
+ if prompt_injection_config is not None:
2509
+ _details['promptInjectionConfig'] = cli_util.parse_json_parameter("prompt_injection_config", prompt_injection_config)
2510
+
2511
+ if pii_detection_config is not None:
2512
+ _details['piiDetectionConfig'] = cli_util.parse_json_parameter("pii_detection_config", pii_detection_config)
2513
+
2011
2514
  if freeform_tags is not None:
2012
2515
  _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
2013
2516
 
@@ -2056,6 +2559,7 @@ def update_endpoint(ctx, from_json, force, wait_for_state, max_wait_seconds, wai
2056
2559
  @cli_util.option('--display-name', help=u"""A user friendly name. It doesn't have to be unique. Avoid entering confidential information.""")
2057
2560
  @cli_util.option('--dns-prefix', help=u"""dnsPrefix of the private endpoint FQDN.""")
2058
2561
  @cli_util.option('--nsg-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A list of the OCIDs of the network security groups (NSGs) to add the private endpoint's VNIC to.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2562
+ @cli_util.option('--is-allow-on-demand', type=click.BOOL, help=u"""Flag that allows access to on-demand models using this private endpoint.""")
2059
2563
  @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].
2060
2564
 
2061
2565
  Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@@ -2072,7 +2576,7 @@ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_comp
2072
2576
  @click.pass_context
2073
2577
  @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'nsg-ids': {'module': 'generative_ai', 'class': 'list[string]'}, 'freeform-tags': {'module': 'generative_ai', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'generative_ai', 'class': 'GenerativeAiPrivateEndpoint'})
2074
2578
  @cli_util.wrap_exceptions
2075
- def update_generative_ai_private_endpoint(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, generative_ai_private_endpoint_id, description, display_name, dns_prefix, nsg_ids, freeform_tags, defined_tags, if_match):
2579
+ def update_generative_ai_private_endpoint(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, generative_ai_private_endpoint_id, description, display_name, dns_prefix, nsg_ids, is_allow_on_demand, freeform_tags, defined_tags, if_match):
2076
2580
 
2077
2581
  if isinstance(generative_ai_private_endpoint_id, six.string_types) and len(generative_ai_private_endpoint_id.strip()) == 0:
2078
2582
  raise click.UsageError('Parameter --generative-ai-private-endpoint-id cannot be whitespace or empty string')
@@ -2100,6 +2604,9 @@ def update_generative_ai_private_endpoint(ctx, from_json, force, wait_for_state,
2100
2604
  if nsg_ids is not None:
2101
2605
  _details['nsgIds'] = cli_util.parse_json_parameter("nsg_ids", nsg_ids)
2102
2606
 
2607
+ if is_allow_on_demand is not None:
2608
+ _details['isAllowOnDemand'] = is_allow_on_demand
2609
+
2103
2610
  if freeform_tags is not None:
2104
2611
  _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
2105
2612