oci-cli 3.63.3__py3-none-any.whl → 3.64.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 (289) hide show
  1. oci_cli/bin/devops.psm1 +5 -1
  2. oci_cli/bin/redis.psm1 +28 -3
  3. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-group/change-compartment.txt +133 -0
  4. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-group/create.txt +180 -0
  5. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-group/delete.txt +131 -0
  6. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-group/get.txt +93 -0
  7. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-group/update.txt +194 -0
  8. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-group-collection/list-stream-groups.txt +129 -0
  9. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-group-collection.txt +14 -0
  10. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-group.txt +22 -0
  11. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-job/change-compartment.txt +142 -0
  12. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-job/create-stream-job-object-storage-output-location.txt +187 -0
  13. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-job/create.txt +184 -0
  14. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-job/delete.txt +141 -0
  15. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-job/get.txt +103 -0
  16. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-job/start.txt +137 -0
  17. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-job/stop.txt +137 -0
  18. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-job/update-stream-job-object-storage-output-location.txt +206 -0
  19. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-job/update.txt +202 -0
  20. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-job-collection/list-stream-jobs.txt +137 -0
  21. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-job-collection.txt +14 -0
  22. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-job.txt +30 -0
  23. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-source/change-compartment.txt +138 -0
  24. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-source/create-stream-source-rtsp-source-details.txt +173 -0
  25. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-source/create.txt +163 -0
  26. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-source/delete.txt +136 -0
  27. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-source/get.txt +98 -0
  28. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-source/update-stream-source-rtsp-source-details.txt +189 -0
  29. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-source/update.txt +177 -0
  30. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-source-collection/list-stream-sources.txt +137 -0
  31. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-source-collection.txt +14 -0
  32. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/stream-source.txt +26 -0
  33. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/vision-private-endpoint/change-compartment.txt +108 -0
  34. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/vision-private-endpoint/create.txt +157 -0
  35. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/vision-private-endpoint/delete.txt +132 -0
  36. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/vision-private-endpoint/get.txt +94 -0
  37. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/vision-private-endpoint/update.txt +167 -0
  38. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/vision-private-endpoint-collection/list-vision-private-endpoints.txt +137 -0
  39. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/vision-private-endpoint-collection.txt +14 -0
  40. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision/vision-private-endpoint.txt +22 -0
  41. oci_cli/help_text_producer/data_files/text/cmdref/ai-vision.txt +76 -0
  42. oci_cli/help_text_producer/data_files/text/cmdref/compute/{compute-gpu-memory-cluster-collection/list-compute-gpu-memory-clusters.txt → compute-gpu-memory-cluster/list.txt} +5 -5
  43. oci_cli/help_text_producer/data_files/text/cmdref/compute/compute-gpu-memory-cluster.txt +2 -0
  44. oci_cli/help_text_producer/data_files/text/cmdref/compute/instance/launch-instance-compute-bare-metal-host-placement-constraint-details.txt +0 -5
  45. oci_cli/help_text_producer/data_files/text/cmdref/compute/instance/launch-instance-host-group-placement-constraint-details.txt +0 -5
  46. oci_cli/help_text_producer/data_files/text/cmdref/compute/instance/launch.txt +0 -5
  47. oci_cli/help_text_producer/data_files/text/cmdref/compute/instance/terminate.txt +11 -0
  48. oci_cli/help_text_producer/data_files/text/cmdref/compute.txt +2 -4
  49. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/alert-summary/list-alert-analytics.txt +2 -2
  50. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/alert-summary/list-alerts.txt +2 -2
  51. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/attribute-set/change-compartment.txt +140 -0
  52. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/attribute-set/create.txt +182 -0
  53. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/attribute-set/delete.txt +138 -0
  54. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/attribute-set/get.txt +108 -0
  55. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/attribute-set/list-associated-resources.txt +145 -0
  56. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/attribute-set/list.txt +211 -0
  57. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/attribute-set/update.txt +192 -0
  58. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/attribute-set.txt +28 -0
  59. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-archive-retrieval/list.txt +5 -0
  60. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-event-summary/list-audit-event-analytics.txt +11 -10
  61. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-event-summary/list-audit-events.txt +9 -8
  62. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-policy-analytics/list.txt +5 -0
  63. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-policy-collection/list-audit-policies.txt +5 -0
  64. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-profile/calculate-audit-volume-available.txt +5 -1
  65. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-profile/calculate-audit-volume-collected.txt +5 -1
  66. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-profile/change-compartment.txt +5 -2
  67. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-profile/change-retention.txt +14 -10
  68. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-profile/create.txt +205 -0
  69. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-profile/delete.txt +135 -0
  70. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-profile/discover-audit-trails.txt +5 -1
  71. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-profile/get.txt +5 -1
  72. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-profile/list-available-audit-volumes.txt +5 -1
  73. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-profile/list-collected-audit-volumes.txt +5 -1
  74. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-profile/list-target-overrides.txt +143 -0
  75. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-profile/list.txt +14 -0
  76. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-profile/update.txt +14 -1
  77. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-profile-analytic-collection/list-audit-profile-analytics.txt +10 -1
  78. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-profile.txt +6 -0
  79. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-trail/list.txt +5 -0
  80. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-trail/start.txt +6 -0
  81. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-trail/update.txt +6 -0
  82. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/audit-trail-analytic-collection/list-audit-trail-analytics.txt +187 -0
  83. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/database-security-config/list.txt +5 -0
  84. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/database-table-access-entry-collection/list-database-table-access-entries.txt +1 -1
  85. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/database-view-access-entry-collection/list-database-view-access-entries.txt +1 -1
  86. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/masking-column/list.txt +1 -1
  87. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/masking-policy/list-masking-analytics.txt +28 -1
  88. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/masking-policy-referential-relation-summary/list-masking-policy-referential-relations.txt +1 -1
  89. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/on-prem-connector/list.txt +9 -9
  90. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/peer-target-database/create-peer-target-database-database-cloud-service-details.txt +10 -6
  91. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/peer-target-database/update-peer-target-database-database-cloud-service-details.txt +10 -6
  92. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/report-definition/generate-report.txt +13 -2
  93. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/report-summary/list-reports.txt +9 -0
  94. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/apply-security-assessment-template.txt +134 -0
  95. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/compare-to-template-baseline.txt +135 -0
  96. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/create.txt +33 -2
  97. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/download-security-assessment-report.txt +2 -2
  98. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/generate-security-assessment-report.txt +2 -2
  99. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/get-template-baseline-comparison.txt +112 -0
  100. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/list-checks.txt +186 -0
  101. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/list-finding-analytics.txt +49 -1
  102. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/list-findings.txt +41 -2
  103. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/list-security-feature-analytics.txt +5 -0
  104. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/list-security-features.txt +5 -0
  105. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/list-template-analytics.txt +188 -0
  106. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/list-template-association-analytics.txt +174 -0
  107. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/list.txt +21 -3
  108. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/patch-checks.txt +145 -0
  109. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/patch-findings.txt +145 -0
  110. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/remove.txt +129 -0
  111. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment.txt +18 -0
  112. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy/change-compartment.txt +3 -2
  113. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy/create.txt +159 -0
  114. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy/delete.txt +131 -0
  115. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy/get.txt +3 -1
  116. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy/list.txt +8 -0
  117. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy/update.txt +3 -1
  118. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-config/change-compartment.txt +135 -0
  119. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-config/create.txt +189 -0
  120. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-config/delete.txt +133 -0
  121. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-config/get.txt +95 -0
  122. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-config/update.txt +197 -0
  123. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-config-collection/list-security-policy-configs.txt +375 -0
  124. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-config-collection.txt +14 -0
  125. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-config.txt +23 -0
  126. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-deployment/change-compartment.txt +7 -2
  127. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-deployment/create.txt +179 -0
  128. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-deployment/delete.txt +135 -0
  129. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-deployment/deploy.txt +131 -0
  130. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-deployment/get.txt +7 -1
  131. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-deployment/list.txt +10 -1
  132. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-deployment/refresh.txt +132 -0
  133. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-deployment/update.txt +7 -1
  134. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-deployment.txt +8 -0
  135. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-entry-state/get.txt +7 -1
  136. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy-entry-state/list.txt +21 -2
  137. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-policy.txt +4 -0
  138. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/sensitive-data-model/list-discovery-analytics.txt +27 -0
  139. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/sensitive-data-model/list-sensitive-column-analytics.txt +5 -0
  140. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/sql-collection/list.txt +5 -0
  141. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/sql-collection-analytics/list.txt +5 -0
  142. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/sql-firewall-allowed-sql/list.txt +1 -1
  143. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/sql-firewall-allowed-sql-analytics/list.txt +1 -1
  144. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/sql-firewall-violation-summary/list-sql-firewall-violation-analytics.txt +2 -2
  145. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/sql-firewall-violation-summary/list-sql-firewall-violations.txt +2 -2
  146. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/target-database-group/change-compartment.txt +138 -0
  147. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/target-database-group/create.txt +175 -0
  148. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/target-database-group/delete.txt +137 -0
  149. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/target-database-group/get-group-members.txt +118 -0
  150. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/target-database-group/get.txt +99 -0
  151. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/target-database-group/update.txt +189 -0
  152. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/target-database-group-summary/list-target-database-groups.txt +365 -0
  153. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/target-database-group-summary.txt +15 -0
  154. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/target-database-group.txt +25 -0
  155. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/unified-audit-policy/bulk-create.txt +164 -0
  156. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/unified-audit-policy/change-compartment.txt +142 -0
  157. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/unified-audit-policy/create.txt +195 -0
  158. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/unified-audit-policy/delete.txt +140 -0
  159. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/unified-audit-policy/get.txt +102 -0
  160. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/unified-audit-policy/update.txt +202 -0
  161. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/unified-audit-policy-collection/list-unified-audit-policies.txt +385 -0
  162. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/unified-audit-policy-collection.txt +14 -0
  163. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/unified-audit-policy-definition/change-compartment.txt +132 -0
  164. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/unified-audit-policy-definition/delete.txt +129 -0
  165. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/unified-audit-policy-definition/get.txt +92 -0
  166. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/unified-audit-policy-definition/update.txt +171 -0
  167. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/unified-audit-policy-definition-collection/list-unified-audit-policy-definitions.txt +205 -0
  168. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/unified-audit-policy-definition-collection.txt +14 -0
  169. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/unified-audit-policy-definition.txt +20 -0
  170. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/unified-audit-policy.txt +25 -0
  171. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/user-assessment/create.txt +13 -2
  172. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/user-assessment/list.txt +14 -0
  173. oci_cli/help_text_producer/data_files/text/cmdref/data-safe.txt +118 -0
  174. oci_cli/help_text_producer/data_files/text/cmdref/data-science/job/change-compartment.txt +1 -7
  175. oci_cli/help_text_producer/data_files/text/cmdref/data-science/job/create-job-artifact.txt +1 -7
  176. oci_cli/help_text_producer/data_files/text/cmdref/data-science/job/create.txt +29 -24
  177. oci_cli/help_text_producer/data_files/text/cmdref/data-science/job/delete.txt +1 -7
  178. oci_cli/help_text_producer/data_files/text/cmdref/data-science/job/get-artifact-content.txt +2 -7
  179. oci_cli/help_text_producer/data_files/text/cmdref/data-science/job/get.txt +1 -7
  180. oci_cli/help_text_producer/data_files/text/cmdref/data-science/job/head-job-artifact.txt +1 -7
  181. oci_cli/help_text_producer/data_files/text/cmdref/data-science/job/update.txt +1 -7
  182. oci_cli/help_text_producer/data_files/text/cmdref/data-science/job-run/cancel.txt +1 -7
  183. oci_cli/help_text_producer/data_files/text/cmdref/data-science/job-run/change-compartment.txt +1 -7
  184. oci_cli/help_text_producer/data_files/text/cmdref/data-science/job-run/create.txt +23 -7
  185. oci_cli/help_text_producer/data_files/text/cmdref/data-science/job-run/delete.txt +1 -7
  186. oci_cli/help_text_producer/data_files/text/cmdref/data-science/job-run/get.txt +1 -7
  187. oci_cli/help_text_producer/data_files/text/cmdref/data-science/job-run/update.txt +1 -7
  188. oci_cli/help_text_producer/data_files/text/cmdref/data-science/pipeline-run/create.txt +11 -0
  189. oci_cli/help_text_producer/data_files/text/cmdref/db/pluggable-database/create-local-clone.txt +4 -0
  190. oci_cli/help_text_producer/data_files/text/cmdref/db/pluggable-database/create-remote-clone.txt +4 -0
  191. oci_cli/help_text_producer/data_files/text/cmdref/db/pluggable-database/create-snapshot.txt +157 -0
  192. oci_cli/help_text_producer/data_files/text/cmdref/db/pluggable-database/delete-snapshot.txt +129 -0
  193. oci_cli/help_text_producer/data_files/text/cmdref/db/pluggable-database/get-snapshot.txt +92 -0
  194. oci_cli/help_text_producer/data_files/text/cmdref/db/pluggable-database/list-snapshots.txt +145 -0
  195. oci_cli/help_text_producer/data_files/text/cmdref/db/pluggable-database.txt +8 -0
  196. oci_cli/help_text_producer/data_files/text/cmdref/db.txt +8 -0
  197. oci_cli/help_text_producer/data_files/text/cmdref/devops/protected-branch/create-or-update.txt +1 -1
  198. oci_cli/help_text_producer/data_files/text/cmdref/devops/protected-branch/delete.txt +1 -1
  199. oci_cli/help_text_producer/data_files/text/cmdref/devops/pull-request/reopen-pull-request-comment.txt +119 -0
  200. oci_cli/help_text_producer/data_files/text/cmdref/devops/pull-request/resolve-pull-request-comment.txt +119 -0
  201. oci_cli/help_text_producer/data_files/text/cmdref/devops/pull-request.txt +4 -0
  202. oci_cli/help_text_producer/data_files/text/cmdref/devops.txt +4 -0
  203. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-inference/chat-result/chat-cohere-chat-request.txt +3 -1
  204. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-inference/chat-result/chat-generic-chat-request.txt +83 -3
  205. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-amazon-kinesis-connection.txt +9 -0
  206. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-amazon-s3-connection.txt +4 -3
  207. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-azure-data-lake-storage-connection.txt +9 -0
  208. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-db2-connection.txt +20 -8
  209. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-google-pub-sub-connection.txt +8 -9
  210. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-jms-connection.txt +1 -1
  211. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-object-storage-connection.txt +2 -2
  212. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/create-oracle-nosql-connection.txt +2 -2
  213. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-amazon-kinesis-connection.txt +9 -0
  214. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-amazon-s3-connection.txt +4 -3
  215. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-azure-data-lake-storage-connection.txt +9 -0
  216. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-db2-connection.txt +20 -8
  217. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-jms-connection.txt +1 -1
  218. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-object-storage-connection.txt +2 -2
  219. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/connection/update-oracle-nosql-connection.txt +2 -2
  220. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request/{work-request-log/list.txt → work-request-log-entry/list-logs.txt} +5 -5
  221. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request/{work-request-log.txt → work-request-log-entry.txt} +3 -3
  222. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request.txt +2 -2
  223. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane.txt +2 -2
  224. oci_cli/help_text_producer/data_files/text/cmdref/network/drg-route-distribution/create.txt +2 -2
  225. oci_cli/help_text_producer/data_files/text/cmdref/network/drg-route-distribution.txt +12 -10
  226. oci_cli/help_text_producer/data_files/text/cmdref/network/ip-sec-connection/create.txt +11 -16
  227. oci_cli/help_text_producer/data_files/text/cmdref/network/ipv6/create.txt +4 -0
  228. oci_cli/help_text_producer/data_files/text/cmdref/network/vnic/assign-ipv6.txt +4 -0
  229. oci_cli/help_text_producer/data_files/text/cmdref/redis/oci-cache-config-set/associated-oci-cache-cluster-summary/list-associated-oci-cache-clusters.txt +139 -0
  230. oci_cli/help_text_producer/data_files/text/cmdref/redis/oci-cache-config-set/associated-oci-cache-cluster-summary.txt +14 -0
  231. oci_cli/help_text_producer/data_files/text/cmdref/redis/oci-cache-config-set/oci-cache-config-set/change-compartment.txt +139 -0
  232. oci_cli/help_text_producer/data_files/text/cmdref/redis/oci-cache-config-set/oci-cache-config-set/create.txt +175 -0
  233. oci_cli/help_text_producer/data_files/text/cmdref/redis/oci-cache-config-set/oci-cache-config-set/delete.txt +138 -0
  234. oci_cli/help_text_producer/data_files/text/cmdref/redis/oci-cache-config-set/oci-cache-config-set/get.txt +100 -0
  235. oci_cli/help_text_producer/data_files/text/cmdref/redis/oci-cache-config-set/oci-cache-config-set/update.txt +173 -0
  236. oci_cli/help_text_producer/data_files/text/cmdref/redis/oci-cache-config-set/oci-cache-config-set-summary/list-oci-cache-config-sets.txt +148 -0
  237. oci_cli/help_text_producer/data_files/text/cmdref/redis/oci-cache-config-set/oci-cache-config-set-summary.txt +14 -0
  238. oci_cli/help_text_producer/data_files/text/cmdref/redis/oci-cache-config-set/oci-cache-config-set.txt +23 -0
  239. oci_cli/help_text_producer/data_files/text/cmdref/redis/oci-cache-config-set.txt +33 -0
  240. oci_cli/help_text_producer/data_files/text/cmdref/redis/oci-cache-default-config-set/oci-cache-default-config-set/get.txt +96 -0
  241. oci_cli/help_text_producer/data_files/text/cmdref/redis/oci-cache-default-config-set/oci-cache-default-config-set-summary/list-oci-cache-default-config-sets.txt +156 -0
  242. oci_cli/help_text_producer/data_files/text/cmdref/redis/oci-cache-default-config-set/oci-cache-default-config-set-summary.txt +14 -0
  243. oci_cli/help_text_producer/data_files/text/cmdref/redis/oci-cache-default-config-set/oci-cache-default-config-set.txt +15 -0
  244. oci_cli/help_text_producer/data_files/text/cmdref/redis/oci-cache-default-config-set.txt +21 -0
  245. oci_cli/help_text_producer/data_files/text/cmdref/redis/redis-cluster/redis-cluster/create.txt +4 -0
  246. oci_cli/help_text_producer/data_files/text/cmdref/redis/redis-cluster/redis-cluster/update.txt +4 -0
  247. oci_cli/help_text_producer/data_files/text/cmdref/redis.txt +32 -0
  248. oci_cli/help_text_producer/data_files/text/cmdref/session/authenticate.txt +2 -1
  249. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/create.txt +15 -12
  250. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/get.txt +2 -2
  251. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/list.txt +2 -2
  252. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/put-attachment.txt +153 -0
  253. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/update.txt +20 -14
  254. oci_cli/help_text_producer/data_files/text/cmdref/support/incident-resource-type/list.txt +2 -2
  255. oci_cli/help_text_producer/data_files/text/cmdref/support/incident.txt +3 -1
  256. oci_cli/help_text_producer/data_files/text/cmdref/support.txt +2 -0
  257. oci_cli/version.py +1 -1
  258. {oci_cli-3.63.3.dist-info → oci_cli-3.64.1.dist-info}/METADATA +2 -2
  259. {oci_cli-3.63.3.dist-info → oci_cli-3.64.1.dist-info}/RECORD +288 -161
  260. services/ai_vision/src/oci_cli_ai_service_vision/generated/aiservicevision_cli.py +2349 -448
  261. services/cims/src/oci_cli_incident/cims_cli_extended.py +70 -14
  262. services/cims/src/oci_cli_incident/generated/incident_cli.py +76 -15
  263. services/core/src/oci_cli_compute/generated/compute_cli.py +19 -79
  264. services/core/src/oci_cli_virtual_network/generated/virtualnetwork_cli.py +21 -15
  265. services/core/src/oci_cli_virtual_network/virtualnetwork_cli_extended.py +5 -1
  266. services/data_safe/src/oci_cli_data_safe/generated/datasafe_cli.py +3832 -391
  267. services/data_science/src/oci_cli_data_science/datascience_cli_extended.py +47 -6
  268. services/data_science/src/oci_cli_data_science/generated/datascience_cli.py +1351 -139
  269. services/database/src/oci_cli_database/database_cli_extended.py +53 -2
  270. services/database/src/oci_cli_database/generated/database_cli.py +222 -2
  271. services/devops/src/oci_cli_devops/generated/devops_cli.py +62 -2
  272. services/generative_ai_inference/src/oci_cli_generative_ai_inference/generated/generativeaiinference_cli.py +39 -5
  273. services/golden_gate/src/oci_cli_golden_gate/generated/goldengate_cli.py +67 -25
  274. services/golden_gate/src/oci_cli_golden_gate/golden_gate_cli_extended.py +38 -4
  275. services/redis/src/oci_cli_oci_cache_config_set/__init__.py +4 -0
  276. services/redis/src/oci_cli_oci_cache_config_set/generated/__init__.py +4 -0
  277. services/redis/src/oci_cli_oci_cache_config_set/generated/client_mappings.py +14 -0
  278. services/redis/src/oci_cli_oci_cache_config_set/generated/ocicacheconfigset_cli.py +458 -0
  279. services/redis/src/oci_cli_oci_cache_default_config_set/__init__.py +4 -0
  280. services/redis/src/oci_cli_oci_cache_default_config_set/generated/__init__.py +4 -0
  281. services/redis/src/oci_cli_oci_cache_default_config_set/generated/client_mappings.py +14 -0
  282. services/redis/src/oci_cli_oci_cache_default_config_set/generated/ocicachedefaultconfigset_cli.py +129 -0
  283. services/redis/src/oci_cli_redis_cluster/generated/rediscluster_cli.py +10 -2
  284. oci_cli/help_text_producer/data_files/text/cmdref/compute/compute-gpu-memory-cluster-collection.txt +0 -14
  285. {oci_cli-3.63.3.dist-info → oci_cli-3.64.1.dist-info}/LICENSE.txt +0 -0
  286. {oci_cli-3.63.3.dist-info → oci_cli-3.64.1.dist-info}/THIRD_PARTY_LICENSES.txt +0 -0
  287. {oci_cli-3.63.3.dist-info → oci_cli-3.64.1.dist-info}/WHEEL +0 -0
  288. {oci_cli-3.63.3.dist-info → oci_cli-3.64.1.dist-info}/entry_points.txt +0 -0
  289. {oci_cli-3.63.3.dist-info → oci_cli-3.64.1.dist-info}/top_level.txt +0 -0
@@ -22,39 +22,39 @@ def ai_vision_root_group():
22
22
  pass
23
23
 
24
24
 
25
- @click.command(cli_util.override('ai_vision.video_job_group.command_name', 'video-job'), cls=CommandGroupWithAlias, help="""Job details for a video analysis.""")
25
+ @click.command(cli_util.override('ai_vision.stream_source_group.command_name', 'stream-source'), cls=CommandGroupWithAlias, help="""Stream source information""")
26
26
  @cli_util.help_option_group
27
- def video_job_group():
27
+ def stream_source_group():
28
28
  pass
29
29
 
30
30
 
31
- @click.command(cli_util.override('ai_vision.image_job_group.command_name', 'image-job'), cls=CommandGroupWithAlias, help="""The job details for a batch image analysis.""")
31
+ @click.command(cli_util.override('ai_vision.stream_source_collection_group.command_name', 'stream-source-collection'), cls=CommandGroupWithAlias, help="""The results of a streamSource search.""")
32
32
  @cli_util.help_option_group
33
- def image_job_group():
33
+ def stream_source_collection_group():
34
34
  pass
35
35
 
36
36
 
37
- @click.command(cli_util.override('ai_vision.work_request_error_group.command_name', 'work-request-error'), cls=CommandGroupWithAlias, help="""An error encountered while executing a work request.""")
37
+ @click.command(cli_util.override('ai_vision.video_job_group.command_name', 'video-job'), cls=CommandGroupWithAlias, help="""Job details for a video analysis.""")
38
38
  @cli_util.help_option_group
39
- def work_request_error_group():
39
+ def video_job_group():
40
40
  pass
41
41
 
42
42
 
43
- @click.command(cli_util.override('ai_vision.project_group.command_name', 'project'), cls=CommandGroupWithAlias, help="""A Vision Project containing models.""")
43
+ @click.command(cli_util.override('ai_vision.stream_job_collection_group.command_name', 'stream-job-collection'), cls=CommandGroupWithAlias, help="""The results of a stream job search.""")
44
44
  @cli_util.help_option_group
45
- def project_group():
45
+ def stream_job_collection_group():
46
46
  pass
47
47
 
48
48
 
49
- @click.command(cli_util.override('ai_vision.analyze_document_result_group.command_name', 'analyze-document-result'), cls=CommandGroupWithAlias, help="""The document analysis results.""")
49
+ @click.command(cli_util.override('ai_vision.vision_private_endpoint_group.command_name', 'vision-private-endpoint'), cls=CommandGroupWithAlias, help="""Vision private endpoint.""")
50
50
  @cli_util.help_option_group
51
- def analyze_document_result_group():
51
+ def vision_private_endpoint_group():
52
52
  pass
53
53
 
54
54
 
55
- @click.command(cli_util.override('ai_vision.model_group.command_name', 'model'), cls=CommandGroupWithAlias, help="""Machine-learned Model.""")
55
+ @click.command(cli_util.override('ai_vision.project_group.command_name', 'project'), cls=CommandGroupWithAlias, help="""A Vision Project containing models.""")
56
56
  @cli_util.help_option_group
57
- def model_group():
57
+ def project_group():
58
58
  pass
59
59
 
60
60
 
@@ -76,12 +76,6 @@ def work_request_group():
76
76
  pass
77
77
 
78
78
 
79
- @click.command(cli_util.override('ai_vision.analyze_image_result_group.command_name', 'analyze-image-result'), cls=CommandGroupWithAlias, help="""The image analysis results.""")
80
- @cli_util.help_option_group
81
- def analyze_image_result_group():
82
- pass
83
-
84
-
85
79
  @click.command(cli_util.override('ai_vision.document_job_group.command_name', 'document-job'), cls=CommandGroupWithAlias, help="""The job details for a batch document analysis.""")
86
80
  @cli_util.help_option_group
87
81
  def document_job_group():
@@ -94,18 +88,80 @@ def model_collection_group():
94
88
  pass
95
89
 
96
90
 
91
+ @click.command(cli_util.override('ai_vision.stream_job_group.command_name', 'stream-job'), cls=CommandGroupWithAlias, help="""Job details for a stream analysis.""")
92
+ @cli_util.help_option_group
93
+ def stream_job_group():
94
+ pass
95
+
96
+
97
+ @click.command(cli_util.override('ai_vision.image_job_group.command_name', 'image-job'), cls=CommandGroupWithAlias, help="""The job details for a batch image analysis.""")
98
+ @cli_util.help_option_group
99
+ def image_job_group():
100
+ pass
101
+
102
+
103
+ @click.command(cli_util.override('ai_vision.stream_group_collection_group.command_name', 'stream-group-collection'), cls=CommandGroupWithAlias, help="""The results of a streamGroup search.""")
104
+ @cli_util.help_option_group
105
+ def stream_group_collection_group():
106
+ pass
107
+
108
+
109
+ @click.command(cli_util.override('ai_vision.work_request_error_group.command_name', 'work-request-error'), cls=CommandGroupWithAlias, help="""An error encountered while executing a work request.""")
110
+ @cli_util.help_option_group
111
+ def work_request_error_group():
112
+ pass
113
+
114
+
115
+ @click.command(cli_util.override('ai_vision.stream_group_group.command_name', 'stream-group'), cls=CommandGroupWithAlias, help="""Details for a Stream Group""")
116
+ @cli_util.help_option_group
117
+ def stream_group_group():
118
+ pass
119
+
120
+
121
+ @click.command(cli_util.override('ai_vision.analyze_document_result_group.command_name', 'analyze-document-result'), cls=CommandGroupWithAlias, help="""The document analysis results.""")
122
+ @cli_util.help_option_group
123
+ def analyze_document_result_group():
124
+ pass
125
+
126
+
127
+ @click.command(cli_util.override('ai_vision.model_group.command_name', 'model'), cls=CommandGroupWithAlias, help="""Machine-learned Model.""")
128
+ @cli_util.help_option_group
129
+ def model_group():
130
+ pass
131
+
132
+
133
+ @click.command(cli_util.override('ai_vision.analyze_image_result_group.command_name', 'analyze-image-result'), cls=CommandGroupWithAlias, help="""The image analysis results.""")
134
+ @cli_util.help_option_group
135
+ def analyze_image_result_group():
136
+ pass
137
+
138
+
139
+ @click.command(cli_util.override('ai_vision.vision_private_endpoint_collection_group.command_name', 'vision-private-endpoint-collection'), cls=CommandGroupWithAlias, help="""The results of a visionPrivateEndpoint search.""")
140
+ @cli_util.help_option_group
141
+ def vision_private_endpoint_collection_group():
142
+ pass
143
+
144
+
145
+ ai_vision_root_group.add_command(stream_source_group)
146
+ ai_vision_root_group.add_command(stream_source_collection_group)
97
147
  ai_vision_root_group.add_command(video_job_group)
98
- ai_vision_root_group.add_command(image_job_group)
99
- ai_vision_root_group.add_command(work_request_error_group)
148
+ ai_vision_root_group.add_command(stream_job_collection_group)
149
+ ai_vision_root_group.add_command(vision_private_endpoint_group)
100
150
  ai_vision_root_group.add_command(project_group)
101
- ai_vision_root_group.add_command(analyze_document_result_group)
102
- ai_vision_root_group.add_command(model_group)
103
151
  ai_vision_root_group.add_command(work_request_log_entry_group)
104
152
  ai_vision_root_group.add_command(project_collection_group)
105
153
  ai_vision_root_group.add_command(work_request_group)
106
- ai_vision_root_group.add_command(analyze_image_result_group)
107
154
  ai_vision_root_group.add_command(document_job_group)
108
155
  ai_vision_root_group.add_command(model_collection_group)
156
+ ai_vision_root_group.add_command(stream_job_group)
157
+ ai_vision_root_group.add_command(image_job_group)
158
+ ai_vision_root_group.add_command(stream_group_collection_group)
159
+ ai_vision_root_group.add_command(work_request_error_group)
160
+ ai_vision_root_group.add_command(stream_group_group)
161
+ ai_vision_root_group.add_command(analyze_document_result_group)
162
+ ai_vision_root_group.add_command(model_group)
163
+ ai_vision_root_group.add_command(analyze_image_result_group)
164
+ ai_vision_root_group.add_command(vision_private_endpoint_collection_group)
109
165
 
110
166
 
111
167
  @analyze_document_result_group.command(name=cli_util.override('ai_vision.analyze_document.command_name', 'analyze-document'), help=u"""Perform different types of image analysis. \n[Command Reference](analyzeDocument)""")
@@ -501,6 +557,220 @@ def change_project_compartment(ctx, from_json, project_id, compartment_id, if_ma
501
557
  cli_util.render_response(result, ctx)
502
558
 
503
559
 
560
+ @stream_group_group.command(name=cli_util.override('ai_vision.change_stream_group_compartment.command_name', 'change-compartment'), help=u"""Move a streamGroup from one compartment to another. When provided, If-Match is checked against the ETag values of the resource. \n[Command Reference](changeStreamGroupCompartment)""")
561
+ @cli_util.option('--stream-group-id', required=True, help=u"""StreamGroup Id.""")
562
+ @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment into which the streamGroup should be moved.""")
563
+ @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.""")
564
+ @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.""")
565
+ @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.""")
566
+ @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.""")
567
+ @json_skeleton_utils.get_cli_json_input_option({})
568
+ @cli_util.help_option
569
+ @click.pass_context
570
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
571
+ @cli_util.wrap_exceptions
572
+ def change_stream_group_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, stream_group_id, compartment_id, if_match):
573
+
574
+ if isinstance(stream_group_id, six.string_types) and len(stream_group_id.strip()) == 0:
575
+ raise click.UsageError('Parameter --stream-group-id cannot be whitespace or empty string')
576
+
577
+ kwargs = {}
578
+ if if_match is not None:
579
+ kwargs['if_match'] = if_match
580
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
581
+
582
+ _details = {}
583
+ _details['compartmentId'] = compartment_id
584
+
585
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
586
+ result = client.change_stream_group_compartment(
587
+ stream_group_id=stream_group_id,
588
+ change_stream_group_compartment_details=_details,
589
+ **kwargs
590
+ )
591
+ if wait_for_state:
592
+
593
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
594
+ try:
595
+ wait_period_kwargs = {}
596
+ if max_wait_seconds is not None:
597
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
598
+ if wait_interval_seconds is not None:
599
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
600
+ if 'opc-work-request-id' not in result.headers:
601
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
602
+ cli_util.render_response(result, ctx)
603
+ return
604
+
605
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
606
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
607
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
608
+ # If we fail, we should show an error, but we should still provide the information to the customer
609
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
610
+ cli_util.render_response(result, ctx)
611
+ sys.exit(2)
612
+ except Exception:
613
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
614
+ cli_util.render_response(result, ctx)
615
+ raise
616
+ else:
617
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
618
+ cli_util.render_response(result, ctx)
619
+
620
+
621
+ @stream_job_group.command(name=cli_util.override('ai_vision.change_stream_job_compartment.command_name', 'change-compartment'), help=u"""Move a streamJob from one compartment to another. When provided, If-Match is checked against the ETag values of the resource. \n[Command Reference](changeStreamJobCompartment)""")
622
+ @cli_util.option('--stream-job-id', required=True, help=u"""Stream job id.""")
623
+ @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment into which the streamJob should be moved.""")
624
+ @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.""")
625
+ @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.""")
626
+ @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
627
+ @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.""")
628
+ @json_skeleton_utils.get_cli_json_input_option({})
629
+ @cli_util.help_option
630
+ @click.pass_context
631
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
632
+ @cli_util.wrap_exceptions
633
+ def change_stream_job_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, stream_job_id, compartment_id, if_match):
634
+
635
+ if isinstance(stream_job_id, six.string_types) and len(stream_job_id.strip()) == 0:
636
+ raise click.UsageError('Parameter --stream-job-id cannot be whitespace or empty string')
637
+
638
+ kwargs = {}
639
+ if if_match is not None:
640
+ kwargs['if_match'] = if_match
641
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
642
+
643
+ _details = {}
644
+ _details['compartmentId'] = compartment_id
645
+
646
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
647
+ result = client.change_stream_job_compartment(
648
+ stream_job_id=stream_job_id,
649
+ change_stream_job_compartment_details=_details,
650
+ **kwargs
651
+ )
652
+ if wait_for_state:
653
+
654
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
655
+ try:
656
+ wait_period_kwargs = {}
657
+ if max_wait_seconds is not None:
658
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
659
+ if wait_interval_seconds is not None:
660
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
661
+ if 'opc-work-request-id' not in result.headers:
662
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
663
+ cli_util.render_response(result, ctx)
664
+ return
665
+
666
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
667
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
668
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
669
+ # If we fail, we should show an error, but we should still provide the information to the customer
670
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
671
+ cli_util.render_response(result, ctx)
672
+ sys.exit(2)
673
+ except Exception:
674
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
675
+ cli_util.render_response(result, ctx)
676
+ raise
677
+ else:
678
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
679
+ cli_util.render_response(result, ctx)
680
+
681
+
682
+ @stream_source_group.command(name=cli_util.override('ai_vision.change_stream_source_compartment.command_name', 'change-compartment'), help=u"""Move a streamSource from one compartment to another. When provided, If-Match is checked against the ETag values of the resource. \n[Command Reference](changeStreamSourceCompartment)""")
683
+ @cli_util.option('--stream-source-id', required=True, help=u"""StreamSource Id.""")
684
+ @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment into which the streamSource should be moved.""")
685
+ @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.""")
686
+ @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.""")
687
+ @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
688
+ @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.""")
689
+ @json_skeleton_utils.get_cli_json_input_option({})
690
+ @cli_util.help_option
691
+ @click.pass_context
692
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
693
+ @cli_util.wrap_exceptions
694
+ def change_stream_source_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, stream_source_id, compartment_id, if_match):
695
+
696
+ if isinstance(stream_source_id, six.string_types) and len(stream_source_id.strip()) == 0:
697
+ raise click.UsageError('Parameter --stream-source-id cannot be whitespace or empty string')
698
+
699
+ kwargs = {}
700
+ if if_match is not None:
701
+ kwargs['if_match'] = if_match
702
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
703
+
704
+ _details = {}
705
+ _details['compartmentId'] = compartment_id
706
+
707
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
708
+ result = client.change_stream_source_compartment(
709
+ stream_source_id=stream_source_id,
710
+ change_stream_source_compartment_details=_details,
711
+ **kwargs
712
+ )
713
+ if wait_for_state:
714
+
715
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
716
+ try:
717
+ wait_period_kwargs = {}
718
+ if max_wait_seconds is not None:
719
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
720
+ if wait_interval_seconds is not None:
721
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
722
+ if 'opc-work-request-id' not in result.headers:
723
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
724
+ cli_util.render_response(result, ctx)
725
+ return
726
+
727
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
728
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
729
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
730
+ # If we fail, we should show an error, but we should still provide the information to the customer
731
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
732
+ cli_util.render_response(result, ctx)
733
+ sys.exit(2)
734
+ except Exception:
735
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
736
+ cli_util.render_response(result, ctx)
737
+ raise
738
+ else:
739
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
740
+ cli_util.render_response(result, ctx)
741
+
742
+
743
+ @vision_private_endpoint_group.command(name=cli_util.override('ai_vision.change_vision_private_endpoint_compartment.command_name', 'change-compartment'), help=u"""Move a visionPrivateEndpoint from one compartment to another. When provided, If-Match is checked against the ETag values of the resource. \n[Command Reference](changeVisionPrivateEndpointCompartment)""")
744
+ @cli_util.option('--vision-private-endpoint-id', required=True, help=u"""Vision private endpoint Id.""")
745
+ @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment into which the visionPrivateEndpoint should be moved.""")
746
+ @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.""")
747
+ @json_skeleton_utils.get_cli_json_input_option({})
748
+ @cli_util.help_option
749
+ @click.pass_context
750
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
751
+ @cli_util.wrap_exceptions
752
+ def change_vision_private_endpoint_compartment(ctx, from_json, vision_private_endpoint_id, compartment_id, if_match):
753
+
754
+ if isinstance(vision_private_endpoint_id, six.string_types) and len(vision_private_endpoint_id.strip()) == 0:
755
+ raise click.UsageError('Parameter --vision-private-endpoint-id cannot be whitespace or empty string')
756
+
757
+ kwargs = {}
758
+ if if_match is not None:
759
+ kwargs['if_match'] = if_match
760
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
761
+
762
+ _details = {}
763
+ _details['compartmentId'] = compartment_id
764
+
765
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
766
+ result = client.change_vision_private_endpoint_compartment(
767
+ vision_private_endpoint_id=vision_private_endpoint_id,
768
+ change_vision_private_endpoint_compartment_details=_details,
769
+ **kwargs
770
+ )
771
+ cli_util.render_response(result, ctx)
772
+
773
+
504
774
  @document_job_group.command(name=cli_util.override('ai_vision.create_document_job.command_name', 'create'), help=u"""Create a document analysis batch job. \n[Command Reference](createDocumentJob)""")
505
775
  @cli_util.option('--input-location', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
506
776
  @cli_util.option('--features', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of requested document analysis types.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@@ -947,38 +1217,44 @@ def create_project(ctx, from_json, wait_for_state, max_wait_seconds, wait_interv
947
1217
  cli_util.render_response(result, ctx)
948
1218
 
949
1219
 
950
- @video_job_group.command(name=cli_util.override('ai_vision.create_video_job.command_name', 'create'), help=u"""Create a video analysis job with given inputs and features. \n[Command Reference](createVideoJob)""")
951
- @cli_util.option('--input-location', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
952
- @cli_util.option('--features', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""a list of video analysis features.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
953
- @cli_util.option('--output-location', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
954
- @cli_util.option('--compartment-id', help=u"""Compartment identifier from the requester.""")
955
- @cli_util.option('--display-name', help=u"""Video job display name.""")
1220
+ @stream_group_group.command(name=cli_util.override('ai_vision.create_stream_group.command_name', 'create'), help=u"""Registration of new streamGroup \n[Command Reference](createStreamGroup)""")
1221
+ @cli_util.option('--compartment-id', required=True, help=u"""[OCID] of compartment""")
1222
+ @cli_util.option('--display-name', help=u"""A human-friendly name for the streamGroup.""")
1223
+ @cli_util.option('--is-enabled', type=click.BOOL, help=u"""Stream""")
1224
+ @cli_util.option('--stream-source-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of streamSource OCIDs associated with the stream group""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1225
+ @cli_util.option('--stream-overlaps', type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of streamSource OCIDs where the streamSource overlaps in field of view.
1226
+
1227
+ This option is a JSON list with items of type StreamGroupOverlap. For documentation on StreamGroupOverlap please see our API reference: https://docs.cloud.oracle.com/api/#/en/aiservicevision/20220125/datatypes/StreamGroupOverlap.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
956
1228
  @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
957
1229
  @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 example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
958
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["SUCCEEDED", "FAILED", "ACCEPTED", "CANCELED", "IN_PROGRESS", "CANCELING"]), 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.""")
959
- @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.""")
960
- @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.""")
961
- @json_skeleton_utils.get_cli_json_input_option({'input-location': {'module': 'ai_vision', 'class': 'InputLocation'}, 'features': {'module': 'ai_vision', 'class': 'list[VideoFeature]'}, 'output-location': {'module': 'ai_vision', 'class': 'OutputLocation'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
1230
+ @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.""")
1231
+ @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.""")
1232
+ @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.""")
1233
+ @json_skeleton_utils.get_cli_json_input_option({'stream-source-ids': {'module': 'ai_vision', 'class': 'list[string]'}, 'stream-overlaps': {'module': 'ai_vision', 'class': 'list[StreamGroupOverlap]'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
962
1234
  @cli_util.help_option
963
1235
  @click.pass_context
964
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'input-location': {'module': 'ai_vision', 'class': 'InputLocation'}, 'features': {'module': 'ai_vision', 'class': 'list[VideoFeature]'}, 'output-location': {'module': 'ai_vision', 'class': 'OutputLocation'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'ai_vision', 'class': 'VideoJob'})
1236
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'stream-source-ids': {'module': 'ai_vision', 'class': 'list[string]'}, 'stream-overlaps': {'module': 'ai_vision', 'class': 'list[StreamGroupOverlap]'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'ai_vision', 'class': 'StreamGroup'})
965
1237
  @cli_util.wrap_exceptions
966
- def create_video_job(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, input_location, features, output_location, compartment_id, display_name, freeform_tags, defined_tags):
1238
+ def create_stream_group(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, display_name, is_enabled, stream_source_ids, stream_overlaps, freeform_tags, defined_tags):
967
1239
 
968
1240
  kwargs = {}
969
1241
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
970
1242
 
971
1243
  _details = {}
972
- _details['inputLocation'] = cli_util.parse_json_parameter("input_location", input_location)
973
- _details['features'] = cli_util.parse_json_parameter("features", features)
974
- _details['outputLocation'] = cli_util.parse_json_parameter("output_location", output_location)
975
-
976
- if compartment_id is not None:
977
- _details['compartmentId'] = compartment_id
1244
+ _details['compartmentId'] = compartment_id
978
1245
 
979
1246
  if display_name is not None:
980
1247
  _details['displayName'] = display_name
981
1248
 
1249
+ if is_enabled is not None:
1250
+ _details['isEnabled'] = is_enabled
1251
+
1252
+ if stream_source_ids is not None:
1253
+ _details['streamSourceIds'] = cli_util.parse_json_parameter("stream_source_ids", stream_source_ids)
1254
+
1255
+ if stream_overlaps is not None:
1256
+ _details['streamOverlaps'] = cli_util.parse_json_parameter("stream_overlaps", stream_overlaps)
1257
+
982
1258
  if freeform_tags is not None:
983
1259
  _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
984
1260
 
@@ -986,65 +1262,66 @@ def create_video_job(ctx, from_json, wait_for_state, max_wait_seconds, wait_inte
986
1262
  _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
987
1263
 
988
1264
  client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
989
- result = client.create_video_job(
990
- create_video_job_details=_details,
1265
+ result = client.create_stream_group(
1266
+ create_stream_group_details=_details,
991
1267
  **kwargs
992
1268
  )
993
1269
  if wait_for_state:
994
1270
 
995
- if hasattr(client, 'get_video_job') and callable(getattr(client, 'get_video_job')):
1271
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
996
1272
  try:
997
1273
  wait_period_kwargs = {}
998
1274
  if max_wait_seconds is not None:
999
1275
  wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1000
1276
  if wait_interval_seconds is not None:
1001
1277
  wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1278
+ if 'opc-work-request-id' not in result.headers:
1279
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
1280
+ cli_util.render_response(result, ctx)
1281
+ return
1002
1282
 
1003
- click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
1004
- result = oci.wait_until(client, client.get_video_job(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
1283
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
1284
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1005
1285
  except oci.exceptions.MaximumWaitTimeExceeded as e:
1006
1286
  # If we fail, we should show an error, but we should still provide the information to the customer
1007
- click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
1287
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
1008
1288
  cli_util.render_response(result, ctx)
1009
1289
  sys.exit(2)
1010
1290
  except Exception:
1011
- click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
1291
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
1012
1292
  cli_util.render_response(result, ctx)
1013
1293
  raise
1014
1294
  else:
1015
- click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1295
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1016
1296
  cli_util.render_response(result, ctx)
1017
1297
 
1018
1298
 
1019
- @video_job_group.command(name=cli_util.override('ai_vision.create_video_job_object_list_inline_input_location.command_name', 'create-video-job-object-list-inline-input-location'), help=u"""Create a video analysis job with given inputs and features. \n[Command Reference](createVideoJob)""")
1020
- @cli_util.option('--features', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""a list of video analysis features.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1021
- @cli_util.option('--output-location', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1022
- @cli_util.option('--input-location-object-locations', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of ObjectLocations.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1023
- @cli_util.option('--compartment-id', help=u"""Compartment identifier from the requester.""")
1024
- @cli_util.option('--display-name', help=u"""Video job display name.""")
1299
+ @stream_job_group.command(name=cli_util.override('ai_vision.create_stream_job.command_name', 'create'), help=u"""Create a stream analysis job with given inputs and features. \n[Command Reference](createStreamJob)""")
1300
+ @cli_util.option('--stream-source-id', required=True, help=u"""[OCID] of streamSource.""")
1301
+ @cli_util.option('--features', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""a list of stream analysis features.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1302
+ @cli_util.option('--stream-output-location', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1303
+ @cli_util.option('--compartment-id', required=True, help=u"""[OCID] of the compartment""")
1304
+ @cli_util.option('--display-name', help=u"""Stream job display name.""")
1025
1305
  @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1026
1306
  @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 example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1027
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["SUCCEEDED", "FAILED", "ACCEPTED", "CANCELED", "IN_PROGRESS", "CANCELING"]), 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.""")
1028
- @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.""")
1029
- @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.""")
1030
- @json_skeleton_utils.get_cli_json_input_option({'features': {'module': 'ai_vision', 'class': 'list[VideoFeature]'}, 'output-location': {'module': 'ai_vision', 'class': 'OutputLocation'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}, 'input-location-object-locations': {'module': 'ai_vision', 'class': 'list[ObjectLocation]'}})
1307
+ @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.""")
1308
+ @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.""")
1309
+ @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.""")
1310
+ @json_skeleton_utils.get_cli_json_input_option({'features': {'module': 'ai_vision', 'class': 'list[VideoStreamFeature]'}, 'stream-output-location': {'module': 'ai_vision', 'class': 'StreamOutputLocation'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
1031
1311
  @cli_util.help_option
1032
1312
  @click.pass_context
1033
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'features': {'module': 'ai_vision', 'class': 'list[VideoFeature]'}, 'output-location': {'module': 'ai_vision', 'class': 'OutputLocation'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}, 'input-location-object-locations': {'module': 'ai_vision', 'class': 'list[ObjectLocation]'}}, output_type={'module': 'ai_vision', 'class': 'VideoJob'})
1313
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'features': {'module': 'ai_vision', 'class': 'list[VideoStreamFeature]'}, 'stream-output-location': {'module': 'ai_vision', 'class': 'StreamOutputLocation'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'ai_vision', 'class': 'StreamJob'})
1034
1314
  @cli_util.wrap_exceptions
1035
- def create_video_job_object_list_inline_input_location(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, features, output_location, input_location_object_locations, compartment_id, display_name, freeform_tags, defined_tags):
1315
+ def create_stream_job(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, stream_source_id, features, stream_output_location, compartment_id, display_name, freeform_tags, defined_tags):
1036
1316
 
1037
1317
  kwargs = {}
1038
1318
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1039
1319
 
1040
1320
  _details = {}
1041
- _details['inputLocation'] = {}
1321
+ _details['streamSourceId'] = stream_source_id
1042
1322
  _details['features'] = cli_util.parse_json_parameter("features", features)
1043
- _details['outputLocation'] = cli_util.parse_json_parameter("output_location", output_location)
1044
- _details['inputLocation']['objectLocations'] = cli_util.parse_json_parameter("input_location_object_locations", input_location_object_locations)
1045
-
1046
- if compartment_id is not None:
1047
- _details['compartmentId'] = compartment_id
1323
+ _details['streamOutputLocation'] = cli_util.parse_json_parameter("stream_output_location", stream_output_location)
1324
+ _details['compartmentId'] = compartment_id
1048
1325
 
1049
1326
  if display_name is not None:
1050
1327
  _details['displayName'] = display_name
@@ -1055,63 +1332,87 @@ def create_video_job_object_list_inline_input_location(ctx, from_json, wait_for_
1055
1332
  if defined_tags is not None:
1056
1333
  _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1057
1334
 
1058
- _details['inputLocation']['sourceType'] = 'OBJECT_LIST_INLINE_INPUT_LOCATION'
1059
-
1060
1335
  client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1061
- result = client.create_video_job(
1062
- create_video_job_details=_details,
1336
+ result = client.create_stream_job(
1337
+ create_stream_job_details=_details,
1063
1338
  **kwargs
1064
1339
  )
1065
1340
  if wait_for_state:
1066
1341
 
1067
- if hasattr(client, 'get_video_job') and callable(getattr(client, 'get_video_job')):
1342
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
1068
1343
  try:
1069
1344
  wait_period_kwargs = {}
1070
1345
  if max_wait_seconds is not None:
1071
1346
  wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1072
1347
  if wait_interval_seconds is not None:
1073
1348
  wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1349
+ if 'opc-work-request-id' not in result.headers:
1350
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
1351
+ cli_util.render_response(result, ctx)
1352
+ return
1074
1353
 
1075
- click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
1076
- result = oci.wait_until(client, client.get_video_job(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
1354
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
1355
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1077
1356
  except oci.exceptions.MaximumWaitTimeExceeded as e:
1078
1357
  # If we fail, we should show an error, but we should still provide the information to the customer
1079
- click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
1358
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
1080
1359
  cli_util.render_response(result, ctx)
1081
1360
  sys.exit(2)
1082
1361
  except Exception:
1083
- click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
1362
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
1084
1363
  cli_util.render_response(result, ctx)
1085
1364
  raise
1086
1365
  else:
1087
- click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1366
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1088
1367
  cli_util.render_response(result, ctx)
1089
1368
 
1090
1369
 
1091
- @model_group.command(name=cli_util.override('ai_vision.delete_model.command_name', 'delete'), help=u"""Delete a model by identifier. \n[Command Reference](deleteModel)""")
1092
- @cli_util.option('--model-id', required=True, help=u"""A unique model identifier.""")
1093
- @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.""")
1094
- @cli_util.confirm_delete_option
1370
+ @stream_job_group.command(name=cli_util.override('ai_vision.create_stream_job_object_storage_output_location.command_name', 'create-stream-job-object-storage-output-location'), help=u"""Create a stream analysis job with given inputs and features. \n[Command Reference](createStreamJob)""")
1371
+ @cli_util.option('--stream-source-id', required=True, help=u"""[OCID] of streamSource.""")
1372
+ @cli_util.option('--features', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""a list of stream analysis features.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1373
+ @cli_util.option('--compartment-id', required=True, help=u"""[OCID] of the compartment""")
1374
+ @cli_util.option('--stream-output-location-namespace-name', required=True, help=u"""The Object Storage namespace.""")
1375
+ @cli_util.option('--stream-output-location-bucket-name', required=True, help=u"""The Object Storage bucket name.""")
1376
+ @cli_util.option('--stream-output-location-prefix', required=True, help=u"""The Object Storage folder name.""")
1377
+ @cli_util.option('--display-name', help=u"""Stream job display name.""")
1378
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1379
+ @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 example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1095
1380
  @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.""")
1096
1381
  @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.""")
1097
1382
  @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.""")
1098
- @json_skeleton_utils.get_cli_json_input_option({})
1383
+ @json_skeleton_utils.get_cli_json_input_option({'features': {'module': 'ai_vision', 'class': 'list[VideoStreamFeature]'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
1099
1384
  @cli_util.help_option
1100
1385
  @click.pass_context
1101
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
1386
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'features': {'module': 'ai_vision', 'class': 'list[VideoStreamFeature]'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'ai_vision', 'class': 'StreamJob'})
1102
1387
  @cli_util.wrap_exceptions
1103
- def delete_model(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, model_id, if_match):
1104
-
1105
- if isinstance(model_id, six.string_types) and len(model_id.strip()) == 0:
1106
- raise click.UsageError('Parameter --model-id cannot be whitespace or empty string')
1388
+ def create_stream_job_object_storage_output_location(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, stream_source_id, features, compartment_id, stream_output_location_namespace_name, stream_output_location_bucket_name, stream_output_location_prefix, display_name, freeform_tags, defined_tags):
1107
1389
 
1108
1390
  kwargs = {}
1109
- if if_match is not None:
1110
- kwargs['if_match'] = if_match
1111
1391
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1392
+
1393
+ _details = {}
1394
+ _details['streamOutputLocation'] = {}
1395
+ _details['streamSourceId'] = stream_source_id
1396
+ _details['features'] = cli_util.parse_json_parameter("features", features)
1397
+ _details['compartmentId'] = compartment_id
1398
+ _details['streamOutputLocation']['namespaceName'] = stream_output_location_namespace_name
1399
+ _details['streamOutputLocation']['bucketName'] = stream_output_location_bucket_name
1400
+ _details['streamOutputLocation']['prefix'] = stream_output_location_prefix
1401
+
1402
+ if display_name is not None:
1403
+ _details['displayName'] = display_name
1404
+
1405
+ if freeform_tags is not None:
1406
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
1407
+
1408
+ if defined_tags is not None:
1409
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1410
+
1411
+ _details['streamOutputLocation']['outputLocationType'] = 'OBJECT_STORAGE'
1412
+
1112
1413
  client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1113
- result = client.delete_model(
1114
- model_id=model_id,
1414
+ result = client.create_stream_job(
1415
+ create_stream_job_details=_details,
1115
1416
  **kwargs
1116
1417
  )
1117
1418
  if wait_for_state:
@@ -1132,7 +1433,7 @@ def delete_model(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval
1132
1433
  result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1133
1434
  except oci.exceptions.MaximumWaitTimeExceeded as e:
1134
1435
  # If we fail, we should show an error, but we should still provide the information to the customer
1135
- 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)
1436
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
1136
1437
  cli_util.render_response(result, ctx)
1137
1438
  sys.exit(2)
1138
1439
  except Exception:
@@ -1144,30 +1445,41 @@ def delete_model(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval
1144
1445
  cli_util.render_response(result, ctx)
1145
1446
 
1146
1447
 
1147
- @project_group.command(name=cli_util.override('ai_vision.delete_project.command_name', 'delete'), help=u"""Delete a project by identifier. \n[Command Reference](deleteProject)""")
1148
- @cli_util.option('--project-id', required=True, help=u"""A unique project identifier.""")
1149
- @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.""")
1150
- @cli_util.confirm_delete_option
1448
+ @stream_source_group.command(name=cli_util.override('ai_vision.create_stream_source.command_name', 'create'), help=u"""Registration of new streamSource \n[Command Reference](createStreamSource)""")
1449
+ @cli_util.option('--stream-source-details', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1450
+ @cli_util.option('--compartment-id', required=True, help=u"""[OCID] of compartment""")
1451
+ @cli_util.option('--display-name', help=u"""A human-friendly name for the streamSource.""")
1452
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1453
+ @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 example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1151
1454
  @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.""")
1152
1455
  @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.""")
1153
1456
  @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.""")
1154
- @json_skeleton_utils.get_cli_json_input_option({})
1457
+ @json_skeleton_utils.get_cli_json_input_option({'stream-source-details': {'module': 'ai_vision', 'class': 'StreamSourceDetails'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
1155
1458
  @cli_util.help_option
1156
1459
  @click.pass_context
1157
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
1460
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'stream-source-details': {'module': 'ai_vision', 'class': 'StreamSourceDetails'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'ai_vision', 'class': 'StreamSource'})
1158
1461
  @cli_util.wrap_exceptions
1159
- def delete_project(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, project_id, if_match):
1160
-
1161
- if isinstance(project_id, six.string_types) and len(project_id.strip()) == 0:
1162
- raise click.UsageError('Parameter --project-id cannot be whitespace or empty string')
1462
+ def create_stream_source(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, stream_source_details, compartment_id, display_name, freeform_tags, defined_tags):
1163
1463
 
1164
1464
  kwargs = {}
1165
- if if_match is not None:
1166
- kwargs['if_match'] = if_match
1167
1465
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1466
+
1467
+ _details = {}
1468
+ _details['streamSourceDetails'] = cli_util.parse_json_parameter("stream_source_details", stream_source_details)
1469
+ _details['compartmentId'] = compartment_id
1470
+
1471
+ if display_name is not None:
1472
+ _details['displayName'] = display_name
1473
+
1474
+ if freeform_tags is not None:
1475
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
1476
+
1477
+ if defined_tags is not None:
1478
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1479
+
1168
1480
  client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1169
- result = client.delete_project(
1170
- project_id=project_id,
1481
+ result = client.create_stream_source(
1482
+ create_stream_source_details=_details,
1171
1483
  **kwargs
1172
1484
  )
1173
1485
  if wait_for_state:
@@ -1188,7 +1500,7 @@ def delete_project(ctx, from_json, wait_for_state, max_wait_seconds, wait_interv
1188
1500
  result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1189
1501
  except oci.exceptions.MaximumWaitTimeExceeded as e:
1190
1502
  # If we fail, we should show an error, but we should still provide the information to the customer
1191
- 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)
1503
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
1192
1504
  cli_util.render_response(result, ctx)
1193
1505
  sys.exit(2)
1194
1506
  except Exception:
@@ -1200,461 +1512,2045 @@ def delete_project(ctx, from_json, wait_for_state, max_wait_seconds, wait_interv
1200
1512
  cli_util.render_response(result, ctx)
1201
1513
 
1202
1514
 
1203
- @document_job_group.command(name=cli_util.override('ai_vision.get_document_job.command_name', 'get'), help=u"""Get details of a document batch job. \n[Command Reference](getDocumentJob)""")
1204
- @cli_util.option('--document-job-id', required=True, help=u"""The document job ID.""")
1205
- @json_skeleton_utils.get_cli_json_input_option({})
1515
+ @stream_source_group.command(name=cli_util.override('ai_vision.create_stream_source_rtsp_source_details.command_name', 'create-stream-source-rtsp-source-details'), help=u"""Registration of new streamSource \n[Command Reference](createStreamSource)""")
1516
+ @cli_util.option('--compartment-id', required=True, help=u"""[OCID] of compartment""")
1517
+ @cli_util.option('--stream-source-details-stream-network-access-details', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1518
+ @cli_util.option('--stream-source-details-camera-url', required=True, help=u"""url of camera""")
1519
+ @cli_util.option('--display-name', help=u"""A human-friendly name for the streamSource.""")
1520
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1521
+ @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 example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1522
+ @cli_util.option('--stream-source-details-secret-id', help=u"""[OCID] of secret where credentials are stored in username:password format.""")
1523
+ @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.""")
1524
+ @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.""")
1525
+ @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.""")
1526
+ @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}, 'stream-source-details-stream-network-access-details': {'module': 'ai_vision', 'class': 'StreamNetworkAccessDetails'}})
1206
1527
  @cli_util.help_option
1207
1528
  @click.pass_context
1208
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'DocumentJob'})
1529
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}, 'stream-source-details-stream-network-access-details': {'module': 'ai_vision', 'class': 'StreamNetworkAccessDetails'}}, output_type={'module': 'ai_vision', 'class': 'StreamSource'})
1209
1530
  @cli_util.wrap_exceptions
1210
- def get_document_job(ctx, from_json, document_job_id):
1211
-
1212
- if isinstance(document_job_id, six.string_types) and len(document_job_id.strip()) == 0:
1213
- raise click.UsageError('Parameter --document-job-id cannot be whitespace or empty string')
1531
+ def create_stream_source_rtsp_source_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, stream_source_details_stream_network_access_details, stream_source_details_camera_url, display_name, freeform_tags, defined_tags, stream_source_details_secret_id):
1214
1532
 
1215
1533
  kwargs = {}
1216
1534
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1217
- client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1218
- result = client.get_document_job(
1219
- document_job_id=document_job_id,
1220
- **kwargs
1221
- )
1222
- cli_util.render_response(result, ctx)
1223
1535
 
1536
+ _details = {}
1537
+ _details['streamSourceDetails'] = {}
1538
+ _details['compartmentId'] = compartment_id
1539
+ _details['streamSourceDetails']['streamNetworkAccessDetails'] = cli_util.parse_json_parameter("stream_source_details_stream_network_access_details", stream_source_details_stream_network_access_details)
1540
+ _details['streamSourceDetails']['cameraUrl'] = stream_source_details_camera_url
1224
1541
 
1225
- @image_job_group.command(name=cli_util.override('ai_vision.get_image_job.command_name', 'get'), help=u"""Get details of an image batch job. \n[Command Reference](getImageJob)""")
1226
- @cli_util.option('--image-job-id', required=True, help=u"""The image job ID.""")
1227
- @json_skeleton_utils.get_cli_json_input_option({})
1228
- @cli_util.help_option
1229
- @click.pass_context
1230
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'ImageJob'})
1231
- @cli_util.wrap_exceptions
1232
- def get_image_job(ctx, from_json, image_job_id):
1542
+ if display_name is not None:
1543
+ _details['displayName'] = display_name
1233
1544
 
1234
- if isinstance(image_job_id, six.string_types) and len(image_job_id.strip()) == 0:
1235
- raise click.UsageError('Parameter --image-job-id cannot be whitespace or empty string')
1545
+ if freeform_tags is not None:
1546
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
1547
+
1548
+ if defined_tags is not None:
1549
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1550
+
1551
+ if stream_source_details_secret_id is not None:
1552
+ _details['streamSourceDetails']['secretId'] = stream_source_details_secret_id
1553
+
1554
+ _details['streamSourceDetails']['sourceType'] = 'RTSP'
1236
1555
 
1237
- kwargs = {}
1238
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1239
1556
  client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1240
- result = client.get_image_job(
1241
- image_job_id=image_job_id,
1557
+ result = client.create_stream_source(
1558
+ create_stream_source_details=_details,
1242
1559
  **kwargs
1243
1560
  )
1561
+ if wait_for_state:
1562
+
1563
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
1564
+ try:
1565
+ wait_period_kwargs = {}
1566
+ if max_wait_seconds is not None:
1567
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1568
+ if wait_interval_seconds is not None:
1569
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1570
+ if 'opc-work-request-id' not in result.headers:
1571
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
1572
+ cli_util.render_response(result, ctx)
1573
+ return
1574
+
1575
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
1576
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1577
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1578
+ # If we fail, we should show an error, but we should still provide the information to the customer
1579
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
1580
+ cli_util.render_response(result, ctx)
1581
+ sys.exit(2)
1582
+ except Exception:
1583
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
1584
+ cli_util.render_response(result, ctx)
1585
+ raise
1586
+ else:
1587
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1244
1588
  cli_util.render_response(result, ctx)
1245
1589
 
1246
1590
 
1247
- @model_group.command(name=cli_util.override('ai_vision.get_model.command_name', 'get'), help=u"""Get a model by identifier. \n[Command Reference](getModel)""")
1248
- @cli_util.option('--model-id', required=True, help=u"""A unique model identifier.""")
1249
- @json_skeleton_utils.get_cli_json_input_option({})
1591
+ @video_job_group.command(name=cli_util.override('ai_vision.create_video_job.command_name', 'create'), help=u"""Create a video analysis job with given inputs and features. \n[Command Reference](createVideoJob)""")
1592
+ @cli_util.option('--input-location', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1593
+ @cli_util.option('--features', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""a list of video analysis features.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1594
+ @cli_util.option('--output-location', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1595
+ @cli_util.option('--compartment-id', help=u"""Compartment identifier from the requester.""")
1596
+ @cli_util.option('--display-name', help=u"""Video job display name.""")
1597
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1598
+ @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 example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1599
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["SUCCEEDED", "FAILED", "ACCEPTED", "CANCELED", "IN_PROGRESS", "CANCELING"]), 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.""")
1600
+ @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.""")
1601
+ @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.""")
1602
+ @json_skeleton_utils.get_cli_json_input_option({'input-location': {'module': 'ai_vision', 'class': 'InputLocation'}, 'features': {'module': 'ai_vision', 'class': 'list[VideoFeature]'}, 'output-location': {'module': 'ai_vision', 'class': 'OutputLocation'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
1250
1603
  @cli_util.help_option
1251
1604
  @click.pass_context
1252
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'Model'})
1605
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'input-location': {'module': 'ai_vision', 'class': 'InputLocation'}, 'features': {'module': 'ai_vision', 'class': 'list[VideoFeature]'}, 'output-location': {'module': 'ai_vision', 'class': 'OutputLocation'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'ai_vision', 'class': 'VideoJob'})
1253
1606
  @cli_util.wrap_exceptions
1254
- def get_model(ctx, from_json, model_id):
1255
-
1256
- if isinstance(model_id, six.string_types) and len(model_id.strip()) == 0:
1257
- raise click.UsageError('Parameter --model-id cannot be whitespace or empty string')
1607
+ def create_video_job(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, input_location, features, output_location, compartment_id, display_name, freeform_tags, defined_tags):
1258
1608
 
1259
1609
  kwargs = {}
1260
1610
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1261
- client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1262
- result = client.get_model(
1263
- model_id=model_id,
1264
- **kwargs
1265
- )
1266
- cli_util.render_response(result, ctx)
1267
1611
 
1612
+ _details = {}
1613
+ _details['inputLocation'] = cli_util.parse_json_parameter("input_location", input_location)
1614
+ _details['features'] = cli_util.parse_json_parameter("features", features)
1615
+ _details['outputLocation'] = cli_util.parse_json_parameter("output_location", output_location)
1268
1616
 
1269
- @project_group.command(name=cli_util.override('ai_vision.get_project.command_name', 'get'), help=u"""Get a project by identifier. \n[Command Reference](getProject)""")
1270
- @cli_util.option('--project-id', required=True, help=u"""A unique project identifier.""")
1271
- @json_skeleton_utils.get_cli_json_input_option({})
1617
+ if compartment_id is not None:
1618
+ _details['compartmentId'] = compartment_id
1619
+
1620
+ if display_name is not None:
1621
+ _details['displayName'] = display_name
1622
+
1623
+ if freeform_tags is not None:
1624
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
1625
+
1626
+ if defined_tags is not None:
1627
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1628
+
1629
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1630
+ result = client.create_video_job(
1631
+ create_video_job_details=_details,
1632
+ **kwargs
1633
+ )
1634
+ if wait_for_state:
1635
+
1636
+ if hasattr(client, 'get_video_job') and callable(getattr(client, 'get_video_job')):
1637
+ try:
1638
+ wait_period_kwargs = {}
1639
+ if max_wait_seconds is not None:
1640
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1641
+ if wait_interval_seconds is not None:
1642
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1643
+
1644
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
1645
+ result = oci.wait_until(client, client.get_video_job(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
1646
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1647
+ # If we fail, we should show an error, but we should still provide the information to the customer
1648
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
1649
+ cli_util.render_response(result, ctx)
1650
+ sys.exit(2)
1651
+ except Exception:
1652
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
1653
+ cli_util.render_response(result, ctx)
1654
+ raise
1655
+ else:
1656
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1657
+ cli_util.render_response(result, ctx)
1658
+
1659
+
1660
+ @video_job_group.command(name=cli_util.override('ai_vision.create_video_job_object_list_inline_input_location.command_name', 'create-video-job-object-list-inline-input-location'), help=u"""Create a video analysis job with given inputs and features. \n[Command Reference](createVideoJob)""")
1661
+ @cli_util.option('--features', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""a list of video analysis features.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1662
+ @cli_util.option('--output-location', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1663
+ @cli_util.option('--input-location-object-locations', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of ObjectLocations.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1664
+ @cli_util.option('--compartment-id', help=u"""Compartment identifier from the requester.""")
1665
+ @cli_util.option('--display-name', help=u"""Video job display name.""")
1666
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1667
+ @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 example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1668
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["SUCCEEDED", "FAILED", "ACCEPTED", "CANCELED", "IN_PROGRESS", "CANCELING"]), 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.""")
1669
+ @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.""")
1670
+ @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.""")
1671
+ @json_skeleton_utils.get_cli_json_input_option({'features': {'module': 'ai_vision', 'class': 'list[VideoFeature]'}, 'output-location': {'module': 'ai_vision', 'class': 'OutputLocation'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}, 'input-location-object-locations': {'module': 'ai_vision', 'class': 'list[ObjectLocation]'}})
1272
1672
  @cli_util.help_option
1273
1673
  @click.pass_context
1274
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'Project'})
1674
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'features': {'module': 'ai_vision', 'class': 'list[VideoFeature]'}, 'output-location': {'module': 'ai_vision', 'class': 'OutputLocation'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}, 'input-location-object-locations': {'module': 'ai_vision', 'class': 'list[ObjectLocation]'}}, output_type={'module': 'ai_vision', 'class': 'VideoJob'})
1275
1675
  @cli_util.wrap_exceptions
1276
- def get_project(ctx, from_json, project_id):
1277
-
1278
- if isinstance(project_id, six.string_types) and len(project_id.strip()) == 0:
1279
- raise click.UsageError('Parameter --project-id cannot be whitespace or empty string')
1676
+ def create_video_job_object_list_inline_input_location(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, features, output_location, input_location_object_locations, compartment_id, display_name, freeform_tags, defined_tags):
1280
1677
 
1281
1678
  kwargs = {}
1282
1679
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1680
+
1681
+ _details = {}
1682
+ _details['inputLocation'] = {}
1683
+ _details['features'] = cli_util.parse_json_parameter("features", features)
1684
+ _details['outputLocation'] = cli_util.parse_json_parameter("output_location", output_location)
1685
+ _details['inputLocation']['objectLocations'] = cli_util.parse_json_parameter("input_location_object_locations", input_location_object_locations)
1686
+
1687
+ if compartment_id is not None:
1688
+ _details['compartmentId'] = compartment_id
1689
+
1690
+ if display_name is not None:
1691
+ _details['displayName'] = display_name
1692
+
1693
+ if freeform_tags is not None:
1694
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
1695
+
1696
+ if defined_tags is not None:
1697
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1698
+
1699
+ _details['inputLocation']['sourceType'] = 'OBJECT_LIST_INLINE_INPUT_LOCATION'
1700
+
1283
1701
  client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1284
- result = client.get_project(
1285
- project_id=project_id,
1702
+ result = client.create_video_job(
1703
+ create_video_job_details=_details,
1286
1704
  **kwargs
1287
1705
  )
1706
+ if wait_for_state:
1707
+
1708
+ if hasattr(client, 'get_video_job') and callable(getattr(client, 'get_video_job')):
1709
+ try:
1710
+ wait_period_kwargs = {}
1711
+ if max_wait_seconds is not None:
1712
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1713
+ if wait_interval_seconds is not None:
1714
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1715
+
1716
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
1717
+ result = oci.wait_until(client, client.get_video_job(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
1718
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1719
+ # If we fail, we should show an error, but we should still provide the information to the customer
1720
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
1721
+ cli_util.render_response(result, ctx)
1722
+ sys.exit(2)
1723
+ except Exception:
1724
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
1725
+ cli_util.render_response(result, ctx)
1726
+ raise
1727
+ else:
1728
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1288
1729
  cli_util.render_response(result, ctx)
1289
1730
 
1290
1731
 
1291
- @video_job_group.command(name=cli_util.override('ai_vision.get_video_job.command_name', 'get'), help=u"""Get details of a video analysis job. \n[Command Reference](getVideoJob)""")
1292
- @cli_util.option('--video-job-id', required=True, help=u"""Video job id.""")
1293
- @json_skeleton_utils.get_cli_json_input_option({})
1732
+ @vision_private_endpoint_group.command(name=cli_util.override('ai_vision.create_vision_private_endpoint.command_name', 'create'), help=u"""Create a new visionPrivateEndpoint. \n[Command Reference](createVisionPrivateEndpoint)""")
1733
+ @cli_util.option('--subnet-id', required=True, help=u"""[OCID] of subnet""")
1734
+ @cli_util.option('--compartment-id', required=True, help=u"""The compartment identifier.""")
1735
+ @cli_util.option('--display-name', help=u"""A human-friendly name for the visionPrivateEndpoint, that can be changed.""")
1736
+ @cli_util.option('--description', help=u"""An optional description of the visionPrivateEndpoint.""")
1737
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1738
+ @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 example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1739
+ @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.""")
1740
+ @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.""")
1741
+ @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.""")
1742
+ @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
1294
1743
  @cli_util.help_option
1295
1744
  @click.pass_context
1296
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'VideoJob'})
1745
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'ai_vision', 'class': 'VisionPrivateEndpoint'})
1297
1746
  @cli_util.wrap_exceptions
1298
- def get_video_job(ctx, from_json, video_job_id):
1299
-
1300
- if isinstance(video_job_id, six.string_types) and len(video_job_id.strip()) == 0:
1301
- raise click.UsageError('Parameter --video-job-id cannot be whitespace or empty string')
1747
+ def create_vision_private_endpoint(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, subnet_id, compartment_id, display_name, description, freeform_tags, defined_tags):
1302
1748
 
1303
1749
  kwargs = {}
1304
1750
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1751
+
1752
+ _details = {}
1753
+ _details['subnetId'] = subnet_id
1754
+ _details['compartmentId'] = compartment_id
1755
+
1756
+ if display_name is not None:
1757
+ _details['displayName'] = display_name
1758
+
1759
+ if description is not None:
1760
+ _details['description'] = description
1761
+
1762
+ if freeform_tags is not None:
1763
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
1764
+
1765
+ if defined_tags is not None:
1766
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1767
+
1305
1768
  client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1306
- result = client.get_video_job(
1307
- video_job_id=video_job_id,
1769
+ result = client.create_vision_private_endpoint(
1770
+ create_vision_private_endpoint_details=_details,
1308
1771
  **kwargs
1309
1772
  )
1773
+ if wait_for_state:
1774
+
1775
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
1776
+ try:
1777
+ wait_period_kwargs = {}
1778
+ if max_wait_seconds is not None:
1779
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1780
+ if wait_interval_seconds is not None:
1781
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1782
+ if 'opc-work-request-id' not in result.headers:
1783
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
1784
+ cli_util.render_response(result, ctx)
1785
+ return
1786
+
1787
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
1788
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1789
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1790
+ # If we fail, we should show an error, but we should still provide the information to the customer
1791
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
1792
+ cli_util.render_response(result, ctx)
1793
+ sys.exit(2)
1794
+ except Exception:
1795
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
1796
+ cli_util.render_response(result, ctx)
1797
+ raise
1798
+ else:
1799
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1310
1800
  cli_util.render_response(result, ctx)
1311
1801
 
1312
1802
 
1313
- @work_request_group.command(name=cli_util.override('ai_vision.get_work_request.command_name', 'get'), help=u"""Gets the status of the work request with the given ID. \n[Command Reference](getWorkRequest)""")
1314
- @cli_util.option('--work-request-id', required=True, help=u"""The ID of the asynchronous request.""")
1803
+ @model_group.command(name=cli_util.override('ai_vision.delete_model.command_name', 'delete'), help=u"""Delete a model by identifier. \n[Command Reference](deleteModel)""")
1804
+ @cli_util.option('--model-id', required=True, help=u"""A unique model identifier.""")
1805
+ @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.""")
1806
+ @cli_util.confirm_delete_option
1807
+ @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.""")
1808
+ @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.""")
1809
+ @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.""")
1315
1810
  @json_skeleton_utils.get_cli_json_input_option({})
1316
1811
  @cli_util.help_option
1317
1812
  @click.pass_context
1318
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'WorkRequest'})
1813
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
1319
1814
  @cli_util.wrap_exceptions
1320
- def get_work_request(ctx, from_json, work_request_id):
1815
+ def delete_model(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, model_id, if_match):
1321
1816
 
1322
- if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
1323
- raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
1817
+ if isinstance(model_id, six.string_types) and len(model_id.strip()) == 0:
1818
+ raise click.UsageError('Parameter --model-id cannot be whitespace or empty string')
1324
1819
 
1325
1820
  kwargs = {}
1821
+ if if_match is not None:
1822
+ kwargs['if_match'] = if_match
1326
1823
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1327
1824
  client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1328
- result = client.get_work_request(
1329
- work_request_id=work_request_id,
1825
+ result = client.delete_model(
1826
+ model_id=model_id,
1330
1827
  **kwargs
1331
1828
  )
1829
+ if wait_for_state:
1830
+
1831
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
1832
+ try:
1833
+ wait_period_kwargs = {}
1834
+ if max_wait_seconds is not None:
1835
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1836
+ if wait_interval_seconds is not None:
1837
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1838
+ if 'opc-work-request-id' not in result.headers:
1839
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
1840
+ cli_util.render_response(result, ctx)
1841
+ return
1842
+
1843
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
1844
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1845
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1846
+ # If we fail, we should show an error, but we should still provide the information to the customer
1847
+ 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)
1848
+ cli_util.render_response(result, ctx)
1849
+ sys.exit(2)
1850
+ except Exception:
1851
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
1852
+ cli_util.render_response(result, ctx)
1853
+ raise
1854
+ else:
1855
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1332
1856
  cli_util.render_response(result, ctx)
1333
1857
 
1334
1858
 
1335
- @model_collection_group.command(name=cli_util.override('ai_vision.list_models.command_name', 'list-models'), help=u"""Returns a list of models in a compartment. \n[Command Reference](listModels)""")
1336
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources.""")
1337
- @cli_util.option('--project-id', help=u"""The ID of the project for which to list the objects.""")
1338
- @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""The filter to match models with the given lifecycleState.""")
1339
- @cli_util.option('--display-name', help=u"""A filter to return only resources that match the entire display name given.""")
1340
- @cli_util.option('--id', help=u"""The filter to find the model with the given identifier.""")
1341
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
1342
- @cli_util.option('--page', help=u"""The position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""")
1343
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""")
1344
- @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. The default order for timeCreated is descending. The default order for displayName is ascending.""")
1345
- @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.""")
1346
- @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.""")
1859
+ @project_group.command(name=cli_util.override('ai_vision.delete_project.command_name', 'delete'), help=u"""Delete a project by identifier. \n[Command Reference](deleteProject)""")
1860
+ @cli_util.option('--project-id', required=True, help=u"""A unique project identifier.""")
1861
+ @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.""")
1862
+ @cli_util.confirm_delete_option
1863
+ @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.""")
1864
+ @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.""")
1865
+ @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.""")
1347
1866
  @json_skeleton_utils.get_cli_json_input_option({})
1348
1867
  @cli_util.help_option
1349
1868
  @click.pass_context
1350
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'ModelCollection'})
1869
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
1351
1870
  @cli_util.wrap_exceptions
1352
- def list_models(ctx, from_json, all_pages, page_size, compartment_id, project_id, lifecycle_state, display_name, id, limit, page, sort_order, sort_by):
1871
+ def delete_project(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, project_id, if_match):
1353
1872
 
1354
- if all_pages and limit:
1355
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
1873
+ if isinstance(project_id, six.string_types) and len(project_id.strip()) == 0:
1874
+ raise click.UsageError('Parameter --project-id cannot be whitespace or empty string')
1356
1875
 
1357
1876
  kwargs = {}
1358
- if compartment_id is not None:
1359
- kwargs['compartment_id'] = compartment_id
1360
- if project_id is not None:
1361
- kwargs['project_id'] = project_id
1362
- if lifecycle_state is not None:
1363
- kwargs['lifecycle_state'] = lifecycle_state
1364
- if display_name is not None:
1365
- kwargs['display_name'] = display_name
1366
- if id is not None:
1367
- kwargs['id'] = id
1368
- if limit is not None:
1369
- kwargs['limit'] = limit
1370
- if page is not None:
1371
- kwargs['page'] = page
1372
- if sort_order is not None:
1373
- kwargs['sort_order'] = sort_order
1374
- if sort_by is not None:
1375
- kwargs['sort_by'] = sort_by
1877
+ if if_match is not None:
1878
+ kwargs['if_match'] = if_match
1376
1879
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1377
1880
  client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1378
- if all_pages:
1379
- if page_size:
1380
- kwargs['limit'] = page_size
1881
+ result = client.delete_project(
1882
+ project_id=project_id,
1883
+ **kwargs
1884
+ )
1885
+ if wait_for_state:
1381
1886
 
1382
- result = cli_util.list_call_get_all_results(
1383
- client.list_models,
1384
- **kwargs
1385
- )
1386
- elif limit is not None:
1387
- result = cli_util.list_call_get_up_to_limit(
1388
- client.list_models,
1389
- limit,
1390
- page_size,
1391
- **kwargs
1392
- )
1393
- else:
1394
- result = client.list_models(
1395
- **kwargs
1396
- )
1887
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
1888
+ try:
1889
+ wait_period_kwargs = {}
1890
+ if max_wait_seconds is not None:
1891
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1892
+ if wait_interval_seconds is not None:
1893
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1894
+ if 'opc-work-request-id' not in result.headers:
1895
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
1896
+ cli_util.render_response(result, ctx)
1897
+ return
1898
+
1899
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
1900
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1901
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1902
+ # If we fail, we should show an error, but we should still provide the information to the customer
1903
+ 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)
1904
+ cli_util.render_response(result, ctx)
1905
+ sys.exit(2)
1906
+ except Exception:
1907
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
1908
+ cli_util.render_response(result, ctx)
1909
+ raise
1910
+ else:
1911
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1397
1912
  cli_util.render_response(result, ctx)
1398
1913
 
1399
1914
 
1400
- @project_collection_group.command(name=cli_util.override('ai_vision.list_projects.command_name', 'list-projects'), help=u"""Returns a list of projects. \n[Command Reference](listProjects)""")
1401
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources.""")
1402
- @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""The filter to match projects with the given lifecycleState.""")
1403
- @cli_util.option('--display-name', help=u"""A filter to return only resources that match the entire display name given.""")
1404
- @cli_util.option('--id', help=u"""The filter to find the project with the given identifier.""")
1405
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
1406
- @cli_util.option('--page', help=u"""The position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""")
1407
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""")
1408
- @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. The default order for timeCreated is descending. The default order for displayName is ascending.""")
1409
- @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.""")
1410
- @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.""")
1915
+ @stream_group_group.command(name=cli_util.override('ai_vision.delete_stream_group.command_name', 'delete'), help=u"""Delete a streamGroup \n[Command Reference](deleteStreamGroup)""")
1916
+ @cli_util.option('--stream-group-id', required=True, help=u"""StreamGroup Id.""")
1917
+ @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.""")
1918
+ @cli_util.confirm_delete_option
1919
+ @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.""")
1920
+ @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.""")
1921
+ @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.""")
1411
1922
  @json_skeleton_utils.get_cli_json_input_option({})
1412
1923
  @cli_util.help_option
1413
1924
  @click.pass_context
1414
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'ProjectCollection'})
1925
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
1415
1926
  @cli_util.wrap_exceptions
1416
- def list_projects(ctx, from_json, all_pages, page_size, compartment_id, lifecycle_state, display_name, id, limit, page, sort_order, sort_by):
1927
+ def delete_stream_group(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, stream_group_id, if_match):
1417
1928
 
1418
- if all_pages and limit:
1419
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
1929
+ if isinstance(stream_group_id, six.string_types) and len(stream_group_id.strip()) == 0:
1930
+ raise click.UsageError('Parameter --stream-group-id cannot be whitespace or empty string')
1420
1931
 
1421
1932
  kwargs = {}
1422
- if compartment_id is not None:
1423
- kwargs['compartment_id'] = compartment_id
1424
- if lifecycle_state is not None:
1425
- kwargs['lifecycle_state'] = lifecycle_state
1426
- if display_name is not None:
1427
- kwargs['display_name'] = display_name
1428
- if id is not None:
1429
- kwargs['id'] = id
1430
- if limit is not None:
1431
- kwargs['limit'] = limit
1432
- if page is not None:
1433
- kwargs['page'] = page
1434
- if sort_order is not None:
1435
- kwargs['sort_order'] = sort_order
1436
- if sort_by is not None:
1437
- kwargs['sort_by'] = sort_by
1933
+ if if_match is not None:
1934
+ kwargs['if_match'] = if_match
1438
1935
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1439
1936
  client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1440
- if all_pages:
1441
- if page_size:
1442
- kwargs['limit'] = page_size
1937
+ result = client.delete_stream_group(
1938
+ stream_group_id=stream_group_id,
1939
+ **kwargs
1940
+ )
1941
+ if wait_for_state:
1443
1942
 
1444
- result = cli_util.list_call_get_all_results(
1445
- client.list_projects,
1446
- **kwargs
1447
- )
1448
- elif limit is not None:
1449
- result = cli_util.list_call_get_up_to_limit(
1450
- client.list_projects,
1451
- limit,
1452
- page_size,
1453
- **kwargs
1454
- )
1455
- else:
1456
- result = client.list_projects(
1457
- **kwargs
1458
- )
1943
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
1944
+ try:
1945
+ wait_period_kwargs = {}
1946
+ if max_wait_seconds is not None:
1947
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1948
+ if wait_interval_seconds is not None:
1949
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1950
+ if 'opc-work-request-id' not in result.headers:
1951
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
1952
+ cli_util.render_response(result, ctx)
1953
+ return
1954
+
1955
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
1956
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1957
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1958
+ # If we fail, we should show an error, but we should still provide the information to the customer
1959
+ 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)
1960
+ cli_util.render_response(result, ctx)
1961
+ sys.exit(2)
1962
+ except Exception:
1963
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
1964
+ cli_util.render_response(result, ctx)
1965
+ raise
1966
+ else:
1967
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1459
1968
  cli_util.render_response(result, ctx)
1460
1969
 
1461
1970
 
1462
- @work_request_error_group.command(name=cli_util.override('ai_vision.list_work_request_errors.command_name', 'list'), help=u"""Returns a (paginated) list of errors for a given work request. \n[Command Reference](listWorkRequestErrors)""")
1463
- @cli_util.option('--work-request-id', required=True, help=u"""The ID of the asynchronous request.""")
1464
- @cli_util.option('--page', help=u"""The position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""")
1465
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
1466
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeAccepted"]), help=u"""The field to sort by. Only one sort order may be provided. The default order for timeAccepted is descending.""")
1467
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""")
1468
- @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.""")
1469
- @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.""")
1971
+ @stream_job_group.command(name=cli_util.override('ai_vision.delete_stream_job.command_name', 'delete'), help=u"""Get details of a stream analysis job. \n[Command Reference](deleteStreamJob)""")
1972
+ @cli_util.option('--stream-job-id', required=True, help=u"""Stream job id.""")
1973
+ @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.""")
1974
+ @cli_util.confirm_delete_option
1975
+ @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
+ @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
+ @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.""")
1470
1978
  @json_skeleton_utils.get_cli_json_input_option({})
1471
1979
  @cli_util.help_option
1472
1980
  @click.pass_context
1473
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'WorkRequestErrorCollection'})
1981
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
1982
+ @cli_util.wrap_exceptions
1983
+ def delete_stream_job(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, stream_job_id, if_match):
1984
+
1985
+ if isinstance(stream_job_id, six.string_types) and len(stream_job_id.strip()) == 0:
1986
+ raise click.UsageError('Parameter --stream-job-id cannot be whitespace or empty string')
1987
+
1988
+ kwargs = {}
1989
+ if if_match is not None:
1990
+ kwargs['if_match'] = if_match
1991
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1992
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1993
+ result = client.delete_stream_job(
1994
+ stream_job_id=stream_job_id,
1995
+ **kwargs
1996
+ )
1997
+ if wait_for_state:
1998
+
1999
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
2000
+ try:
2001
+ wait_period_kwargs = {}
2002
+ if max_wait_seconds is not None:
2003
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2004
+ if wait_interval_seconds is not None:
2005
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2006
+ if 'opc-work-request-id' not in result.headers:
2007
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
2008
+ cli_util.render_response(result, ctx)
2009
+ return
2010
+
2011
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
2012
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
2013
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
2014
+ # If we fail, we should show an error, but we should still provide the information to the customer
2015
+ 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)
2016
+ cli_util.render_response(result, ctx)
2017
+ sys.exit(2)
2018
+ except Exception:
2019
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
2020
+ cli_util.render_response(result, ctx)
2021
+ raise
2022
+ else:
2023
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
2024
+ cli_util.render_response(result, ctx)
2025
+
2026
+
2027
+ @stream_source_group.command(name=cli_util.override('ai_vision.delete_stream_source.command_name', 'delete'), help=u"""Delete a streamSource \n[Command Reference](deleteStreamSource)""")
2028
+ @cli_util.option('--stream-source-id', required=True, help=u"""StreamSource Id.""")
2029
+ @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.""")
2030
+ @cli_util.confirm_delete_option
2031
+ @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.""")
2032
+ @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.""")
2033
+ @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.""")
2034
+ @json_skeleton_utils.get_cli_json_input_option({})
2035
+ @cli_util.help_option
2036
+ @click.pass_context
2037
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
2038
+ @cli_util.wrap_exceptions
2039
+ def delete_stream_source(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, stream_source_id, if_match):
2040
+
2041
+ if isinstance(stream_source_id, six.string_types) and len(stream_source_id.strip()) == 0:
2042
+ raise click.UsageError('Parameter --stream-source-id cannot be whitespace or empty string')
2043
+
2044
+ kwargs = {}
2045
+ if if_match is not None:
2046
+ kwargs['if_match'] = if_match
2047
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2048
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2049
+ result = client.delete_stream_source(
2050
+ stream_source_id=stream_source_id,
2051
+ **kwargs
2052
+ )
2053
+ if wait_for_state:
2054
+
2055
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
2056
+ try:
2057
+ wait_period_kwargs = {}
2058
+ if max_wait_seconds is not None:
2059
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2060
+ if wait_interval_seconds is not None:
2061
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2062
+ if 'opc-work-request-id' not in result.headers:
2063
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
2064
+ cli_util.render_response(result, ctx)
2065
+ return
2066
+
2067
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
2068
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
2069
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
2070
+ # If we fail, we should show an error, but we should still provide the information to the customer
2071
+ 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)
2072
+ cli_util.render_response(result, ctx)
2073
+ sys.exit(2)
2074
+ except Exception:
2075
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
2076
+ cli_util.render_response(result, ctx)
2077
+ raise
2078
+ else:
2079
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
2080
+ cli_util.render_response(result, ctx)
2081
+
2082
+
2083
+ @vision_private_endpoint_group.command(name=cli_util.override('ai_vision.delete_vision_private_endpoint.command_name', 'delete'), help=u"""Delete a visionPrivateEndpoint by identifier. \n[Command Reference](deleteVisionPrivateEndpoint)""")
2084
+ @cli_util.option('--vision-private-endpoint-id', required=True, help=u"""Vision private endpoint Id.""")
2085
+ @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.""")
2086
+ @cli_util.confirm_delete_option
2087
+ @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.""")
2088
+ @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.""")
2089
+ @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.""")
2090
+ @json_skeleton_utils.get_cli_json_input_option({})
2091
+ @cli_util.help_option
2092
+ @click.pass_context
2093
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
2094
+ @cli_util.wrap_exceptions
2095
+ def delete_vision_private_endpoint(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, vision_private_endpoint_id, if_match):
2096
+
2097
+ if isinstance(vision_private_endpoint_id, six.string_types) and len(vision_private_endpoint_id.strip()) == 0:
2098
+ raise click.UsageError('Parameter --vision-private-endpoint-id cannot be whitespace or empty string')
2099
+
2100
+ kwargs = {}
2101
+ if if_match is not None:
2102
+ kwargs['if_match'] = if_match
2103
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2104
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2105
+ result = client.delete_vision_private_endpoint(
2106
+ vision_private_endpoint_id=vision_private_endpoint_id,
2107
+ **kwargs
2108
+ )
2109
+ if wait_for_state:
2110
+
2111
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
2112
+ try:
2113
+ wait_period_kwargs = {}
2114
+ if max_wait_seconds is not None:
2115
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2116
+ if wait_interval_seconds is not None:
2117
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2118
+ if 'opc-work-request-id' not in result.headers:
2119
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
2120
+ cli_util.render_response(result, ctx)
2121
+ return
2122
+
2123
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
2124
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
2125
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
2126
+ # If we fail, we should show an error, but we should still provide the information to the customer
2127
+ 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)
2128
+ cli_util.render_response(result, ctx)
2129
+ sys.exit(2)
2130
+ except Exception:
2131
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
2132
+ cli_util.render_response(result, ctx)
2133
+ raise
2134
+ else:
2135
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
2136
+ cli_util.render_response(result, ctx)
2137
+
2138
+
2139
+ @document_job_group.command(name=cli_util.override('ai_vision.get_document_job.command_name', 'get'), help=u"""Get details of a document batch job. \n[Command Reference](getDocumentJob)""")
2140
+ @cli_util.option('--document-job-id', required=True, help=u"""The document job ID.""")
2141
+ @json_skeleton_utils.get_cli_json_input_option({})
2142
+ @cli_util.help_option
2143
+ @click.pass_context
2144
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'DocumentJob'})
2145
+ @cli_util.wrap_exceptions
2146
+ def get_document_job(ctx, from_json, document_job_id):
2147
+
2148
+ if isinstance(document_job_id, six.string_types) and len(document_job_id.strip()) == 0:
2149
+ raise click.UsageError('Parameter --document-job-id cannot be whitespace or empty string')
2150
+
2151
+ kwargs = {}
2152
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2153
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2154
+ result = client.get_document_job(
2155
+ document_job_id=document_job_id,
2156
+ **kwargs
2157
+ )
2158
+ cli_util.render_response(result, ctx)
2159
+
2160
+
2161
+ @image_job_group.command(name=cli_util.override('ai_vision.get_image_job.command_name', 'get'), help=u"""Get details of an image batch job. \n[Command Reference](getImageJob)""")
2162
+ @cli_util.option('--image-job-id', required=True, help=u"""The image job ID.""")
2163
+ @json_skeleton_utils.get_cli_json_input_option({})
2164
+ @cli_util.help_option
2165
+ @click.pass_context
2166
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'ImageJob'})
2167
+ @cli_util.wrap_exceptions
2168
+ def get_image_job(ctx, from_json, image_job_id):
2169
+
2170
+ if isinstance(image_job_id, six.string_types) and len(image_job_id.strip()) == 0:
2171
+ raise click.UsageError('Parameter --image-job-id cannot be whitespace or empty string')
2172
+
2173
+ kwargs = {}
2174
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2175
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2176
+ result = client.get_image_job(
2177
+ image_job_id=image_job_id,
2178
+ **kwargs
2179
+ )
2180
+ cli_util.render_response(result, ctx)
2181
+
2182
+
2183
+ @model_group.command(name=cli_util.override('ai_vision.get_model.command_name', 'get'), help=u"""Get a model by identifier. \n[Command Reference](getModel)""")
2184
+ @cli_util.option('--model-id', required=True, help=u"""A unique model identifier.""")
2185
+ @json_skeleton_utils.get_cli_json_input_option({})
2186
+ @cli_util.help_option
2187
+ @click.pass_context
2188
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'Model'})
2189
+ @cli_util.wrap_exceptions
2190
+ def get_model(ctx, from_json, model_id):
2191
+
2192
+ if isinstance(model_id, six.string_types) and len(model_id.strip()) == 0:
2193
+ raise click.UsageError('Parameter --model-id cannot be whitespace or empty string')
2194
+
2195
+ kwargs = {}
2196
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2197
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2198
+ result = client.get_model(
2199
+ model_id=model_id,
2200
+ **kwargs
2201
+ )
2202
+ cli_util.render_response(result, ctx)
2203
+
2204
+
2205
+ @project_group.command(name=cli_util.override('ai_vision.get_project.command_name', 'get'), help=u"""Get a project by identifier. \n[Command Reference](getProject)""")
2206
+ @cli_util.option('--project-id', required=True, help=u"""A unique project identifier.""")
2207
+ @json_skeleton_utils.get_cli_json_input_option({})
2208
+ @cli_util.help_option
2209
+ @click.pass_context
2210
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'Project'})
2211
+ @cli_util.wrap_exceptions
2212
+ def get_project(ctx, from_json, project_id):
2213
+
2214
+ if isinstance(project_id, six.string_types) and len(project_id.strip()) == 0:
2215
+ raise click.UsageError('Parameter --project-id cannot be whitespace or empty string')
2216
+
2217
+ kwargs = {}
2218
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2219
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2220
+ result = client.get_project(
2221
+ project_id=project_id,
2222
+ **kwargs
2223
+ )
2224
+ cli_util.render_response(result, ctx)
2225
+
2226
+
2227
+ @stream_group_group.command(name=cli_util.override('ai_vision.get_stream_group.command_name', 'get'), help=u"""Get a streamGroup \n[Command Reference](getStreamGroup)""")
2228
+ @cli_util.option('--stream-group-id', required=True, help=u"""StreamGroup Id.""")
2229
+ @json_skeleton_utils.get_cli_json_input_option({})
2230
+ @cli_util.help_option
2231
+ @click.pass_context
2232
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'StreamGroup'})
2233
+ @cli_util.wrap_exceptions
2234
+ def get_stream_group(ctx, from_json, stream_group_id):
2235
+
2236
+ if isinstance(stream_group_id, six.string_types) and len(stream_group_id.strip()) == 0:
2237
+ raise click.UsageError('Parameter --stream-group-id cannot be whitespace or empty string')
2238
+
2239
+ kwargs = {}
2240
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2241
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2242
+ result = client.get_stream_group(
2243
+ stream_group_id=stream_group_id,
2244
+ **kwargs
2245
+ )
2246
+ cli_util.render_response(result, ctx)
2247
+
2248
+
2249
+ @stream_job_group.command(name=cli_util.override('ai_vision.get_stream_job.command_name', 'get'), help=u"""Get details of a stream analysis job. \n[Command Reference](getStreamJob)""")
2250
+ @cli_util.option('--stream-job-id', required=True, help=u"""Stream job id.""")
2251
+ @json_skeleton_utils.get_cli_json_input_option({})
2252
+ @cli_util.help_option
2253
+ @click.pass_context
2254
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'StreamJob'})
2255
+ @cli_util.wrap_exceptions
2256
+ def get_stream_job(ctx, from_json, stream_job_id):
2257
+
2258
+ if isinstance(stream_job_id, six.string_types) and len(stream_job_id.strip()) == 0:
2259
+ raise click.UsageError('Parameter --stream-job-id cannot be whitespace or empty string')
2260
+
2261
+ kwargs = {}
2262
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2263
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2264
+ result = client.get_stream_job(
2265
+ stream_job_id=stream_job_id,
2266
+ **kwargs
2267
+ )
2268
+ cli_util.render_response(result, ctx)
2269
+
2270
+
2271
+ @stream_source_group.command(name=cli_util.override('ai_vision.get_stream_source.command_name', 'get'), help=u"""Get a streamSource \n[Command Reference](getStreamSource)""")
2272
+ @cli_util.option('--stream-source-id', required=True, help=u"""StreamSource Id.""")
2273
+ @json_skeleton_utils.get_cli_json_input_option({})
2274
+ @cli_util.help_option
2275
+ @click.pass_context
2276
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'StreamSource'})
2277
+ @cli_util.wrap_exceptions
2278
+ def get_stream_source(ctx, from_json, stream_source_id):
2279
+
2280
+ if isinstance(stream_source_id, six.string_types) and len(stream_source_id.strip()) == 0:
2281
+ raise click.UsageError('Parameter --stream-source-id cannot be whitespace or empty string')
2282
+
2283
+ kwargs = {}
2284
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2285
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2286
+ result = client.get_stream_source(
2287
+ stream_source_id=stream_source_id,
2288
+ **kwargs
2289
+ )
2290
+ cli_util.render_response(result, ctx)
2291
+
2292
+
2293
+ @video_job_group.command(name=cli_util.override('ai_vision.get_video_job.command_name', 'get'), help=u"""Get details of a video analysis job. \n[Command Reference](getVideoJob)""")
2294
+ @cli_util.option('--video-job-id', required=True, help=u"""Video job id.""")
2295
+ @json_skeleton_utils.get_cli_json_input_option({})
2296
+ @cli_util.help_option
2297
+ @click.pass_context
2298
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'VideoJob'})
2299
+ @cli_util.wrap_exceptions
2300
+ def get_video_job(ctx, from_json, video_job_id):
2301
+
2302
+ if isinstance(video_job_id, six.string_types) and len(video_job_id.strip()) == 0:
2303
+ raise click.UsageError('Parameter --video-job-id cannot be whitespace or empty string')
2304
+
2305
+ kwargs = {}
2306
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2307
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2308
+ result = client.get_video_job(
2309
+ video_job_id=video_job_id,
2310
+ **kwargs
2311
+ )
2312
+ cli_util.render_response(result, ctx)
2313
+
2314
+
2315
+ @vision_private_endpoint_group.command(name=cli_util.override('ai_vision.get_vision_private_endpoint.command_name', 'get'), help=u"""Get a visionPrivateEndpoint by identifier. \n[Command Reference](getVisionPrivateEndpoint)""")
2316
+ @cli_util.option('--vision-private-endpoint-id', required=True, help=u"""Vision private endpoint Id.""")
2317
+ @json_skeleton_utils.get_cli_json_input_option({})
2318
+ @cli_util.help_option
2319
+ @click.pass_context
2320
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'VisionPrivateEndpoint'})
2321
+ @cli_util.wrap_exceptions
2322
+ def get_vision_private_endpoint(ctx, from_json, vision_private_endpoint_id):
2323
+
2324
+ if isinstance(vision_private_endpoint_id, six.string_types) and len(vision_private_endpoint_id.strip()) == 0:
2325
+ raise click.UsageError('Parameter --vision-private-endpoint-id cannot be whitespace or empty string')
2326
+
2327
+ kwargs = {}
2328
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2329
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2330
+ result = client.get_vision_private_endpoint(
2331
+ vision_private_endpoint_id=vision_private_endpoint_id,
2332
+ **kwargs
2333
+ )
2334
+ cli_util.render_response(result, ctx)
2335
+
2336
+
2337
+ @work_request_group.command(name=cli_util.override('ai_vision.get_work_request.command_name', 'get'), help=u"""Gets the status of the work request with the given ID. \n[Command Reference](getWorkRequest)""")
2338
+ @cli_util.option('--work-request-id', required=True, help=u"""The ID of the asynchronous request.""")
2339
+ @json_skeleton_utils.get_cli_json_input_option({})
2340
+ @cli_util.help_option
2341
+ @click.pass_context
2342
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'WorkRequest'})
2343
+ @cli_util.wrap_exceptions
2344
+ def get_work_request(ctx, from_json, work_request_id):
2345
+
2346
+ if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
2347
+ raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
2348
+
2349
+ kwargs = {}
2350
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2351
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2352
+ result = client.get_work_request(
2353
+ work_request_id=work_request_id,
2354
+ **kwargs
2355
+ )
2356
+ cli_util.render_response(result, ctx)
2357
+
2358
+
2359
+ @model_collection_group.command(name=cli_util.override('ai_vision.list_models.command_name', 'list-models'), help=u"""Returns a list of models in a compartment. \n[Command Reference](listModels)""")
2360
+ @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources.""")
2361
+ @cli_util.option('--project-id', help=u"""The ID of the project for which to list the objects.""")
2362
+ @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""The filter to match models with the given lifecycleState.""")
2363
+ @cli_util.option('--display-name', help=u"""A filter to return only resources that match the entire display name given.""")
2364
+ @cli_util.option('--id', help=u"""The filter to find the model with the given identifier.""")
2365
+ @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2366
+ @cli_util.option('--page', help=u"""The position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""")
2367
+ @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""")
2368
+ @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. The default order for timeCreated is descending. The default order for displayName is ascending.""")
2369
+ @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.""")
2370
+ @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.""")
2371
+ @json_skeleton_utils.get_cli_json_input_option({})
2372
+ @cli_util.help_option
2373
+ @click.pass_context
2374
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'ModelCollection'})
2375
+ @cli_util.wrap_exceptions
2376
+ def list_models(ctx, from_json, all_pages, page_size, compartment_id, project_id, lifecycle_state, display_name, id, limit, page, sort_order, sort_by):
2377
+
2378
+ if all_pages and limit:
2379
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2380
+
2381
+ kwargs = {}
2382
+ if compartment_id is not None:
2383
+ kwargs['compartment_id'] = compartment_id
2384
+ if project_id is not None:
2385
+ kwargs['project_id'] = project_id
2386
+ if lifecycle_state is not None:
2387
+ kwargs['lifecycle_state'] = lifecycle_state
2388
+ if display_name is not None:
2389
+ kwargs['display_name'] = display_name
2390
+ if id is not None:
2391
+ kwargs['id'] = id
2392
+ if limit is not None:
2393
+ kwargs['limit'] = limit
2394
+ if page is not None:
2395
+ kwargs['page'] = page
2396
+ if sort_order is not None:
2397
+ kwargs['sort_order'] = sort_order
2398
+ if sort_by is not None:
2399
+ kwargs['sort_by'] = sort_by
2400
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2401
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2402
+ if all_pages:
2403
+ if page_size:
2404
+ kwargs['limit'] = page_size
2405
+
2406
+ result = cli_util.list_call_get_all_results(
2407
+ client.list_models,
2408
+ **kwargs
2409
+ )
2410
+ elif limit is not None:
2411
+ result = cli_util.list_call_get_up_to_limit(
2412
+ client.list_models,
2413
+ limit,
2414
+ page_size,
2415
+ **kwargs
2416
+ )
2417
+ else:
2418
+ result = client.list_models(
2419
+ **kwargs
2420
+ )
2421
+ cli_util.render_response(result, ctx)
2422
+
2423
+
2424
+ @project_collection_group.command(name=cli_util.override('ai_vision.list_projects.command_name', 'list-projects'), help=u"""Returns a list of projects. \n[Command Reference](listProjects)""")
2425
+ @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources.""")
2426
+ @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""The filter to match projects with the given lifecycleState.""")
2427
+ @cli_util.option('--display-name', help=u"""A filter to return only resources that match the entire display name given.""")
2428
+ @cli_util.option('--id', help=u"""The filter to find the project with the given identifier.""")
2429
+ @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2430
+ @cli_util.option('--page', help=u"""The position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""")
2431
+ @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""")
2432
+ @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. The default order for timeCreated is descending. The default order for displayName is ascending.""")
2433
+ @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.""")
2434
+ @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.""")
2435
+ @json_skeleton_utils.get_cli_json_input_option({})
2436
+ @cli_util.help_option
2437
+ @click.pass_context
2438
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'ProjectCollection'})
2439
+ @cli_util.wrap_exceptions
2440
+ def list_projects(ctx, from_json, all_pages, page_size, compartment_id, lifecycle_state, display_name, id, limit, page, sort_order, sort_by):
2441
+
2442
+ if all_pages and limit:
2443
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2444
+
2445
+ kwargs = {}
2446
+ if compartment_id is not None:
2447
+ kwargs['compartment_id'] = compartment_id
2448
+ if lifecycle_state is not None:
2449
+ kwargs['lifecycle_state'] = lifecycle_state
2450
+ if display_name is not None:
2451
+ kwargs['display_name'] = display_name
2452
+ if id is not None:
2453
+ kwargs['id'] = id
2454
+ if limit is not None:
2455
+ kwargs['limit'] = limit
2456
+ if page is not None:
2457
+ kwargs['page'] = page
2458
+ if sort_order is not None:
2459
+ kwargs['sort_order'] = sort_order
2460
+ if sort_by is not None:
2461
+ kwargs['sort_by'] = sort_by
2462
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2463
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2464
+ if all_pages:
2465
+ if page_size:
2466
+ kwargs['limit'] = page_size
2467
+
2468
+ result = cli_util.list_call_get_all_results(
2469
+ client.list_projects,
2470
+ **kwargs
2471
+ )
2472
+ elif limit is not None:
2473
+ result = cli_util.list_call_get_up_to_limit(
2474
+ client.list_projects,
2475
+ limit,
2476
+ page_size,
2477
+ **kwargs
2478
+ )
2479
+ else:
2480
+ result = client.list_projects(
2481
+ **kwargs
2482
+ )
2483
+ cli_util.render_response(result, ctx)
2484
+
2485
+
2486
+ @stream_group_collection_group.command(name=cli_util.override('ai_vision.list_stream_groups.command_name', 'list-stream-groups'), help=u"""Gets a list of the streamGroups in the specified compartment. \n[Command Reference](listStreamGroups)""")
2487
+ @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources.""")
2488
+ @cli_util.option('--id', help=u"""The filter to find the device with the given identifier.""")
2489
+ @cli_util.option('--display-name', help=u"""A filter to return only resources that match the entire display name given.""")
2490
+ @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2491
+ @cli_util.option('--page', help=u"""The position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""")
2492
+ @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""")
2493
+ @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. The default order for timeCreated is descending. The default order for displayName is ascending.""")
2494
+ @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.""")
2495
+ @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.""")
2496
+ @json_skeleton_utils.get_cli_json_input_option({})
2497
+ @cli_util.help_option
2498
+ @click.pass_context
2499
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'StreamGroupCollection'})
2500
+ @cli_util.wrap_exceptions
2501
+ def list_stream_groups(ctx, from_json, all_pages, page_size, compartment_id, id, display_name, limit, page, sort_order, sort_by):
2502
+
2503
+ if all_pages and limit:
2504
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2505
+
2506
+ kwargs = {}
2507
+ if compartment_id is not None:
2508
+ kwargs['compartment_id'] = compartment_id
2509
+ if id is not None:
2510
+ kwargs['id'] = id
2511
+ if display_name is not None:
2512
+ kwargs['display_name'] = display_name
2513
+ if limit is not None:
2514
+ kwargs['limit'] = limit
2515
+ if page is not None:
2516
+ kwargs['page'] = page
2517
+ if sort_order is not None:
2518
+ kwargs['sort_order'] = sort_order
2519
+ if sort_by is not None:
2520
+ kwargs['sort_by'] = sort_by
2521
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2522
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2523
+ if all_pages:
2524
+ if page_size:
2525
+ kwargs['limit'] = page_size
2526
+
2527
+ result = cli_util.list_call_get_all_results(
2528
+ client.list_stream_groups,
2529
+ **kwargs
2530
+ )
2531
+ elif limit is not None:
2532
+ result = cli_util.list_call_get_up_to_limit(
2533
+ client.list_stream_groups,
2534
+ limit,
2535
+ page_size,
2536
+ **kwargs
2537
+ )
2538
+ else:
2539
+ result = client.list_stream_groups(
2540
+ **kwargs
2541
+ )
2542
+ cli_util.render_response(result, ctx)
2543
+
2544
+
2545
+ @stream_job_collection_group.command(name=cli_util.override('ai_vision.list_stream_jobs.command_name', 'list-stream-jobs'), help=u"""Get list of stream jobs \n[Command Reference](listStreamJobs)""")
2546
+ @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources.""")
2547
+ @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "INACTIVE", "NEEDS_ATTENTION"]), help=u"""The filter to match projects with the given lifecycleState.""")
2548
+ @cli_util.option('--id', help=u"""The filter to find the streamjob with the given identifier.""")
2549
+ @cli_util.option('--display-name', help=u"""A filter to return only resources that match the entire display name given.""")
2550
+ @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2551
+ @cli_util.option('--page', help=u"""The position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""")
2552
+ @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""")
2553
+ @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. The default order for timeCreated is descending. The default order for displayName is ascending.""")
2554
+ @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.""")
2555
+ @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.""")
2556
+ @json_skeleton_utils.get_cli_json_input_option({})
2557
+ @cli_util.help_option
2558
+ @click.pass_context
2559
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'StreamJobCollection'})
2560
+ @cli_util.wrap_exceptions
2561
+ def list_stream_jobs(ctx, from_json, all_pages, page_size, compartment_id, lifecycle_state, id, display_name, limit, page, sort_order, sort_by):
2562
+
2563
+ if all_pages and limit:
2564
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2565
+
2566
+ kwargs = {}
2567
+ if compartment_id is not None:
2568
+ kwargs['compartment_id'] = compartment_id
2569
+ if lifecycle_state is not None:
2570
+ kwargs['lifecycle_state'] = lifecycle_state
2571
+ if id is not None:
2572
+ kwargs['id'] = id
2573
+ if display_name is not None:
2574
+ kwargs['display_name'] = display_name
2575
+ if limit is not None:
2576
+ kwargs['limit'] = limit
2577
+ if page is not None:
2578
+ kwargs['page'] = page
2579
+ if sort_order is not None:
2580
+ kwargs['sort_order'] = sort_order
2581
+ if sort_by is not None:
2582
+ kwargs['sort_by'] = sort_by
2583
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2584
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2585
+ if all_pages:
2586
+ if page_size:
2587
+ kwargs['limit'] = page_size
2588
+
2589
+ result = cli_util.list_call_get_all_results(
2590
+ client.list_stream_jobs,
2591
+ **kwargs
2592
+ )
2593
+ elif limit is not None:
2594
+ result = cli_util.list_call_get_up_to_limit(
2595
+ client.list_stream_jobs,
2596
+ limit,
2597
+ page_size,
2598
+ **kwargs
2599
+ )
2600
+ else:
2601
+ result = client.list_stream_jobs(
2602
+ **kwargs
2603
+ )
2604
+ cli_util.render_response(result, ctx)
2605
+
2606
+
2607
+ @stream_source_collection_group.command(name=cli_util.override('ai_vision.list_stream_sources.command_name', 'list-stream-sources'), help=u"""Gets a list of the streamSources in the specified compartment. \n[Command Reference](listStreamSources)""")
2608
+ @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources.""")
2609
+ @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""The filter to match projects with the given lifecycleState.""")
2610
+ @cli_util.option('--id', help=u"""The filter to find the device with the given identifier.""")
2611
+ @cli_util.option('--display-name', help=u"""A filter to return only resources that match the entire display name given.""")
2612
+ @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2613
+ @cli_util.option('--page', help=u"""The position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""")
2614
+ @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""")
2615
+ @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. The default order for timeCreated is descending. The default order for displayName is ascending.""")
2616
+ @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.""")
2617
+ @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.""")
2618
+ @json_skeleton_utils.get_cli_json_input_option({})
2619
+ @cli_util.help_option
2620
+ @click.pass_context
2621
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'StreamSourceCollection'})
2622
+ @cli_util.wrap_exceptions
2623
+ def list_stream_sources(ctx, from_json, all_pages, page_size, compartment_id, lifecycle_state, id, display_name, limit, page, sort_order, sort_by):
2624
+
2625
+ if all_pages and limit:
2626
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2627
+
2628
+ kwargs = {}
2629
+ if compartment_id is not None:
2630
+ kwargs['compartment_id'] = compartment_id
2631
+ if lifecycle_state is not None:
2632
+ kwargs['lifecycle_state'] = lifecycle_state
2633
+ if id is not None:
2634
+ kwargs['id'] = id
2635
+ if display_name is not None:
2636
+ kwargs['display_name'] = display_name
2637
+ if limit is not None:
2638
+ kwargs['limit'] = limit
2639
+ if page is not None:
2640
+ kwargs['page'] = page
2641
+ if sort_order is not None:
2642
+ kwargs['sort_order'] = sort_order
2643
+ if sort_by is not None:
2644
+ kwargs['sort_by'] = sort_by
2645
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2646
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2647
+ if all_pages:
2648
+ if page_size:
2649
+ kwargs['limit'] = page_size
2650
+
2651
+ result = cli_util.list_call_get_all_results(
2652
+ client.list_stream_sources,
2653
+ **kwargs
2654
+ )
2655
+ elif limit is not None:
2656
+ result = cli_util.list_call_get_up_to_limit(
2657
+ client.list_stream_sources,
2658
+ limit,
2659
+ page_size,
2660
+ **kwargs
2661
+ )
2662
+ else:
2663
+ result = client.list_stream_sources(
2664
+ **kwargs
2665
+ )
2666
+ cli_util.render_response(result, ctx)
2667
+
2668
+
2669
+ @vision_private_endpoint_collection_group.command(name=cli_util.override('ai_vision.list_vision_private_endpoints.command_name', 'list-vision-private-endpoints'), help=u"""Returns a list of visionPrivateEndpoints. \n[Command Reference](listVisionPrivateEndpoints)""")
2670
+ @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources.""")
2671
+ @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""The filter to match projects with the given lifecycleState.""")
2672
+ @cli_util.option('--display-name', help=u"""A filter to return only resources that match the entire display name given.""")
2673
+ @cli_util.option('--id', help=u"""The filter to find the device with the given identifier.""")
2674
+ @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2675
+ @cli_util.option('--page', help=u"""The position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""")
2676
+ @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""")
2677
+ @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. The default order for timeCreated is descending. The default order for displayName is ascending.""")
2678
+ @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.""")
2679
+ @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.""")
2680
+ @json_skeleton_utils.get_cli_json_input_option({})
2681
+ @cli_util.help_option
2682
+ @click.pass_context
2683
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'VisionPrivateEndpointCollection'})
2684
+ @cli_util.wrap_exceptions
2685
+ def list_vision_private_endpoints(ctx, from_json, all_pages, page_size, compartment_id, lifecycle_state, display_name, id, limit, page, sort_order, sort_by):
2686
+
2687
+ if all_pages and limit:
2688
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2689
+
2690
+ kwargs = {}
2691
+ if compartment_id is not None:
2692
+ kwargs['compartment_id'] = compartment_id
2693
+ if lifecycle_state is not None:
2694
+ kwargs['lifecycle_state'] = lifecycle_state
2695
+ if display_name is not None:
2696
+ kwargs['display_name'] = display_name
2697
+ if id is not None:
2698
+ kwargs['id'] = id
2699
+ if limit is not None:
2700
+ kwargs['limit'] = limit
2701
+ if page is not None:
2702
+ kwargs['page'] = page
2703
+ if sort_order is not None:
2704
+ kwargs['sort_order'] = sort_order
2705
+ if sort_by is not None:
2706
+ kwargs['sort_by'] = sort_by
2707
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2708
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2709
+ if all_pages:
2710
+ if page_size:
2711
+ kwargs['limit'] = page_size
2712
+
2713
+ result = cli_util.list_call_get_all_results(
2714
+ client.list_vision_private_endpoints,
2715
+ **kwargs
2716
+ )
2717
+ elif limit is not None:
2718
+ result = cli_util.list_call_get_up_to_limit(
2719
+ client.list_vision_private_endpoints,
2720
+ limit,
2721
+ page_size,
2722
+ **kwargs
2723
+ )
2724
+ else:
2725
+ result = client.list_vision_private_endpoints(
2726
+ **kwargs
2727
+ )
2728
+ cli_util.render_response(result, ctx)
2729
+
2730
+
2731
+ @work_request_error_group.command(name=cli_util.override('ai_vision.list_work_request_errors.command_name', 'list'), help=u"""Returns a (paginated) list of errors for a given work request. \n[Command Reference](listWorkRequestErrors)""")
2732
+ @cli_util.option('--work-request-id', required=True, help=u"""The ID of the asynchronous request.""")
2733
+ @cli_util.option('--page', help=u"""The position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""")
2734
+ @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2735
+ @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeAccepted"]), help=u"""The field to sort by. Only one sort order may be provided. The default order for timeAccepted is descending.""")
2736
+ @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""")
2737
+ @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.""")
2738
+ @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.""")
2739
+ @json_skeleton_utils.get_cli_json_input_option({})
2740
+ @cli_util.help_option
2741
+ @click.pass_context
2742
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'WorkRequestErrorCollection'})
2743
+ @cli_util.wrap_exceptions
2744
+ def list_work_request_errors(ctx, from_json, all_pages, page_size, work_request_id, page, limit, sort_by, sort_order):
2745
+
2746
+ if all_pages and limit:
2747
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2748
+
2749
+ if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
2750
+ raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
2751
+
2752
+ kwargs = {}
2753
+ if page is not None:
2754
+ kwargs['page'] = page
2755
+ if limit is not None:
2756
+ kwargs['limit'] = limit
2757
+ if sort_by is not None:
2758
+ kwargs['sort_by'] = sort_by
2759
+ if sort_order is not None:
2760
+ kwargs['sort_order'] = sort_order
2761
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2762
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2763
+ if all_pages:
2764
+ if page_size:
2765
+ kwargs['limit'] = page_size
2766
+
2767
+ result = cli_util.list_call_get_all_results(
2768
+ client.list_work_request_errors,
2769
+ work_request_id=work_request_id,
2770
+ **kwargs
2771
+ )
2772
+ elif limit is not None:
2773
+ result = cli_util.list_call_get_up_to_limit(
2774
+ client.list_work_request_errors,
2775
+ limit,
2776
+ page_size,
2777
+ work_request_id=work_request_id,
2778
+ **kwargs
2779
+ )
2780
+ else:
2781
+ result = client.list_work_request_errors(
2782
+ work_request_id=work_request_id,
2783
+ **kwargs
2784
+ )
2785
+ cli_util.render_response(result, ctx)
2786
+
2787
+
2788
+ @work_request_log_entry_group.command(name=cli_util.override('ai_vision.list_work_request_logs.command_name', 'list-work-request-logs'), help=u"""Return a (paginated) list of logs for a given work request. \n[Command Reference](listWorkRequestLogs)""")
2789
+ @cli_util.option('--work-request-id', required=True, help=u"""The ID of the asynchronous request.""")
2790
+ @cli_util.option('--page', help=u"""The position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""")
2791
+ @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2792
+ @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeAccepted"]), help=u"""The field to sort by. Only one sort order may be provided. The default order for timeAccepted is descending.""")
2793
+ @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""")
2794
+ @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.""")
2795
+ @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.""")
2796
+ @json_skeleton_utils.get_cli_json_input_option({})
2797
+ @cli_util.help_option
2798
+ @click.pass_context
2799
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'WorkRequestLogEntryCollection'})
2800
+ @cli_util.wrap_exceptions
2801
+ def list_work_request_logs(ctx, from_json, all_pages, page_size, work_request_id, page, limit, sort_by, sort_order):
2802
+
2803
+ if all_pages and limit:
2804
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2805
+
2806
+ if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
2807
+ raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
2808
+
2809
+ kwargs = {}
2810
+ if page is not None:
2811
+ kwargs['page'] = page
2812
+ if limit is not None:
2813
+ kwargs['limit'] = limit
2814
+ if sort_by is not None:
2815
+ kwargs['sort_by'] = sort_by
2816
+ if sort_order is not None:
2817
+ kwargs['sort_order'] = sort_order
2818
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2819
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2820
+ if all_pages:
2821
+ if page_size:
2822
+ kwargs['limit'] = page_size
2823
+
2824
+ result = cli_util.list_call_get_all_results(
2825
+ client.list_work_request_logs,
2826
+ work_request_id=work_request_id,
2827
+ **kwargs
2828
+ )
2829
+ elif limit is not None:
2830
+ result = cli_util.list_call_get_up_to_limit(
2831
+ client.list_work_request_logs,
2832
+ limit,
2833
+ page_size,
2834
+ work_request_id=work_request_id,
2835
+ **kwargs
2836
+ )
2837
+ else:
2838
+ result = client.list_work_request_logs(
2839
+ work_request_id=work_request_id,
2840
+ **kwargs
2841
+ )
2842
+ cli_util.render_response(result, ctx)
2843
+
2844
+
2845
+ @work_request_group.command(name=cli_util.override('ai_vision.list_work_requests.command_name', 'list'), help=u"""Lists the work requests in a compartment. \n[Command Reference](listWorkRequests)""")
2846
+ @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources.""")
2847
+ @cli_util.option('--work-request-id', help=u"""The ID of the asynchronous work request.""")
2848
+ @cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"]), help=u"""A filter to return only resources whose lifecycleState matches the given OperationStatus.""")
2849
+ @cli_util.option('--resource-id', help=u"""The ID of the resource affected by the work request.""")
2850
+ @cli_util.option('--page', help=u"""The position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""")
2851
+ @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2852
+ @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""")
2853
+ @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeAccepted"]), help=u"""The field to sort by. Only one sort order may be provided. The default order for timeAccepted is descending.""")
2854
+ @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.""")
2855
+ @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.""")
2856
+ @json_skeleton_utils.get_cli_json_input_option({})
2857
+ @cli_util.help_option
2858
+ @click.pass_context
2859
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'WorkRequestSummaryCollection'})
2860
+ @cli_util.wrap_exceptions
2861
+ def list_work_requests(ctx, from_json, all_pages, page_size, compartment_id, work_request_id, status, resource_id, page, limit, sort_order, sort_by):
2862
+
2863
+ if all_pages and limit:
2864
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2865
+
2866
+ kwargs = {}
2867
+ if compartment_id is not None:
2868
+ kwargs['compartment_id'] = compartment_id
2869
+ if work_request_id is not None:
2870
+ kwargs['work_request_id'] = work_request_id
2871
+ if status is not None:
2872
+ kwargs['status'] = status
2873
+ if resource_id is not None:
2874
+ kwargs['resource_id'] = resource_id
2875
+ if page is not None:
2876
+ kwargs['page'] = page
2877
+ if limit is not None:
2878
+ kwargs['limit'] = limit
2879
+ if sort_order is not None:
2880
+ kwargs['sort_order'] = sort_order
2881
+ if sort_by is not None:
2882
+ kwargs['sort_by'] = sort_by
2883
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2884
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2885
+ if all_pages:
2886
+ if page_size:
2887
+ kwargs['limit'] = page_size
2888
+
2889
+ result = cli_util.list_call_get_all_results(
2890
+ client.list_work_requests,
2891
+ **kwargs
2892
+ )
2893
+ elif limit is not None:
2894
+ result = cli_util.list_call_get_up_to_limit(
2895
+ client.list_work_requests,
2896
+ limit,
2897
+ page_size,
2898
+ **kwargs
2899
+ )
2900
+ else:
2901
+ result = client.list_work_requests(
2902
+ **kwargs
2903
+ )
2904
+ cli_util.render_response(result, ctx)
2905
+
2906
+
2907
+ @stream_job_group.command(name=cli_util.override('ai_vision.start_stream_job.command_name', 'start'), help=u"""End a stream analysis Run. \n[Command Reference](startStreamJob)""")
2908
+ @cli_util.option('--stream-job-id', required=True, help=u"""Stream job id.""")
2909
+ @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.""")
2910
+ @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.""")
2911
+ @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.""")
2912
+ @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.""")
2913
+ @json_skeleton_utils.get_cli_json_input_option({})
2914
+ @cli_util.help_option
2915
+ @click.pass_context
2916
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
2917
+ @cli_util.wrap_exceptions
2918
+ def start_stream_job(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, stream_job_id, if_match):
2919
+
2920
+ if isinstance(stream_job_id, six.string_types) and len(stream_job_id.strip()) == 0:
2921
+ raise click.UsageError('Parameter --stream-job-id cannot be whitespace or empty string')
2922
+
2923
+ kwargs = {}
2924
+ if if_match is not None:
2925
+ kwargs['if_match'] = if_match
2926
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2927
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2928
+ result = client.start_stream_job(
2929
+ stream_job_id=stream_job_id,
2930
+ **kwargs
2931
+ )
2932
+ if wait_for_state:
2933
+
2934
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
2935
+ try:
2936
+ wait_period_kwargs = {}
2937
+ if max_wait_seconds is not None:
2938
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2939
+ if wait_interval_seconds is not None:
2940
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2941
+ if 'opc-work-request-id' not in result.headers:
2942
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
2943
+ cli_util.render_response(result, ctx)
2944
+ return
2945
+
2946
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
2947
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
2948
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
2949
+ # If we fail, we should show an error, but we should still provide the information to the customer
2950
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
2951
+ cli_util.render_response(result, ctx)
2952
+ sys.exit(2)
2953
+ except Exception:
2954
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
2955
+ cli_util.render_response(result, ctx)
2956
+ raise
2957
+ else:
2958
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
2959
+ cli_util.render_response(result, ctx)
2960
+
2961
+
2962
+ @stream_job_group.command(name=cli_util.override('ai_vision.stop_stream_job.command_name', 'stop'), help=u"""End a stream analysis Run. \n[Command Reference](stopStreamJob)""")
2963
+ @cli_util.option('--stream-job-id', required=True, help=u"""Stream job id.""")
2964
+ @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.""")
2965
+ @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.""")
2966
+ @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.""")
2967
+ @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.""")
2968
+ @json_skeleton_utils.get_cli_json_input_option({})
2969
+ @cli_util.help_option
2970
+ @click.pass_context
2971
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
2972
+ @cli_util.wrap_exceptions
2973
+ def stop_stream_job(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, stream_job_id, if_match):
2974
+
2975
+ if isinstance(stream_job_id, six.string_types) and len(stream_job_id.strip()) == 0:
2976
+ raise click.UsageError('Parameter --stream-job-id cannot be whitespace or empty string')
2977
+
2978
+ kwargs = {}
2979
+ if if_match is not None:
2980
+ kwargs['if_match'] = if_match
2981
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2982
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
2983
+ result = client.stop_stream_job(
2984
+ stream_job_id=stream_job_id,
2985
+ **kwargs
2986
+ )
2987
+ if wait_for_state:
2988
+
2989
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
2990
+ try:
2991
+ wait_period_kwargs = {}
2992
+ if max_wait_seconds is not None:
2993
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2994
+ if wait_interval_seconds is not None:
2995
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2996
+ if 'opc-work-request-id' not in result.headers:
2997
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
2998
+ cli_util.render_response(result, ctx)
2999
+ return
3000
+
3001
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
3002
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
3003
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
3004
+ # If we fail, we should show an error, but we should still provide the information to the customer
3005
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
3006
+ cli_util.render_response(result, ctx)
3007
+ sys.exit(2)
3008
+ except Exception:
3009
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
3010
+ cli_util.render_response(result, ctx)
3011
+ raise
3012
+ else:
3013
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
3014
+ cli_util.render_response(result, ctx)
3015
+
3016
+
3017
+ @model_group.command(name=cli_util.override('ai_vision.update_model.command_name', 'update'), help=u"""Updates the model metadata. \n[Command Reference](updateModel)""")
3018
+ @cli_util.option('--model-id', required=True, help=u"""A unique model identifier.""")
3019
+ @cli_util.option('--display-name', help=u"""A human-friendly name of the model, which can be changed.""")
3020
+ @cli_util.option('--description', help=u"""An optional description of the model.""")
3021
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3022
+ @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 example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3023
+ @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.""")
3024
+ @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
3025
+ @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.""")
3026
+ @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.""")
3027
+ @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.""")
3028
+ @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
3029
+ @cli_util.help_option
3030
+ @click.pass_context
3031
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
3032
+ @cli_util.wrap_exceptions
3033
+ def update_model(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, model_id, display_name, description, freeform_tags, defined_tags, if_match):
3034
+
3035
+ if isinstance(model_id, six.string_types) and len(model_id.strip()) == 0:
3036
+ raise click.UsageError('Parameter --model-id cannot be whitespace or empty string')
3037
+ if not force:
3038
+ if freeform_tags or defined_tags:
3039
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
3040
+ ctx.abort()
3041
+
3042
+ kwargs = {}
3043
+ if if_match is not None:
3044
+ kwargs['if_match'] = if_match
3045
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3046
+
3047
+ _details = {}
3048
+
3049
+ if display_name is not None:
3050
+ _details['displayName'] = display_name
3051
+
3052
+ if description is not None:
3053
+ _details['description'] = description
3054
+
3055
+ if freeform_tags is not None:
3056
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
3057
+
3058
+ if defined_tags is not None:
3059
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
3060
+
3061
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
3062
+ result = client.update_model(
3063
+ model_id=model_id,
3064
+ update_model_details=_details,
3065
+ **kwargs
3066
+ )
3067
+ if wait_for_state:
3068
+
3069
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
3070
+ try:
3071
+ wait_period_kwargs = {}
3072
+ if max_wait_seconds is not None:
3073
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
3074
+ if wait_interval_seconds is not None:
3075
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
3076
+ if 'opc-work-request-id' not in result.headers:
3077
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
3078
+ cli_util.render_response(result, ctx)
3079
+ return
3080
+
3081
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
3082
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
3083
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
3084
+ # If we fail, we should show an error, but we should still provide the information to the customer
3085
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
3086
+ cli_util.render_response(result, ctx)
3087
+ sys.exit(2)
3088
+ except Exception:
3089
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
3090
+ cli_util.render_response(result, ctx)
3091
+ raise
3092
+ else:
3093
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
3094
+ cli_util.render_response(result, ctx)
3095
+
3096
+
3097
+ @project_group.command(name=cli_util.override('ai_vision.update_project.command_name', 'update'), help=u"""Update the project metadata. \n[Command Reference](updateProject)""")
3098
+ @cli_util.option('--project-id', required=True, help=u"""A unique project identifier.""")
3099
+ @cli_util.option('--display-name', help=u"""A human-friendly name for the project, that can be changed.""")
3100
+ @cli_util.option('--description', help=u"""An optional description of the project.""")
3101
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3102
+ @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 example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3103
+ @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.""")
3104
+ @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
3105
+ @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.""")
3106
+ @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.""")
3107
+ @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.""")
3108
+ @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
3109
+ @cli_util.help_option
3110
+ @click.pass_context
3111
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
3112
+ @cli_util.wrap_exceptions
3113
+ def update_project(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, project_id, display_name, description, freeform_tags, defined_tags, if_match):
3114
+
3115
+ if isinstance(project_id, six.string_types) and len(project_id.strip()) == 0:
3116
+ raise click.UsageError('Parameter --project-id cannot be whitespace or empty string')
3117
+ if not force:
3118
+ if freeform_tags or defined_tags:
3119
+ if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
3120
+ ctx.abort()
3121
+
3122
+ kwargs = {}
3123
+ if if_match is not None:
3124
+ kwargs['if_match'] = if_match
3125
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3126
+
3127
+ _details = {}
3128
+
3129
+ if display_name is not None:
3130
+ _details['displayName'] = display_name
3131
+
3132
+ if description is not None:
3133
+ _details['description'] = description
3134
+
3135
+ if freeform_tags is not None:
3136
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
3137
+
3138
+ if defined_tags is not None:
3139
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
3140
+
3141
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
3142
+ result = client.update_project(
3143
+ project_id=project_id,
3144
+ update_project_details=_details,
3145
+ **kwargs
3146
+ )
3147
+ if wait_for_state:
3148
+
3149
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
3150
+ try:
3151
+ wait_period_kwargs = {}
3152
+ if max_wait_seconds is not None:
3153
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
3154
+ if wait_interval_seconds is not None:
3155
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
3156
+ if 'opc-work-request-id' not in result.headers:
3157
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
3158
+ cli_util.render_response(result, ctx)
3159
+ return
3160
+
3161
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
3162
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
3163
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
3164
+ # If we fail, we should show an error, but we should still provide the information to the customer
3165
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
3166
+ cli_util.render_response(result, ctx)
3167
+ sys.exit(2)
3168
+ except Exception:
3169
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
3170
+ cli_util.render_response(result, ctx)
3171
+ raise
3172
+ else:
3173
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
3174
+ cli_util.render_response(result, ctx)
3175
+
3176
+
3177
+ @stream_group_group.command(name=cli_util.override('ai_vision.update_stream_group.command_name', 'update'), help=u"""Update a streamGroup \n[Command Reference](updateStreamGroup)""")
3178
+ @cli_util.option('--stream-group-id', required=True, help=u"""StreamGroup Id.""")
3179
+ @cli_util.option('--display-name', help=u"""A human-friendly name for the streamGroup.""")
3180
+ @cli_util.option('--is-enabled', type=click.BOOL, help=u"""Stream""")
3181
+ @cli_util.option('--stream-source-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of streamSource OCIDs associated with the stream group""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3182
+ @cli_util.option('--stream-overlaps', type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of streamSource OCIDs where the streamSource overlaps in field of view.
3183
+
3184
+ This option is a JSON list with items of type StreamGroupOverlap. For documentation on StreamGroupOverlap please see our API reference: https://docs.cloud.oracle.com/api/#/en/aiservicevision/20220125/datatypes/StreamGroupOverlap.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3185
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3186
+ @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 example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3187
+ @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.""")
3188
+ @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
3189
+ @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.""")
3190
+ @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.""")
3191
+ @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.""")
3192
+ @json_skeleton_utils.get_cli_json_input_option({'stream-source-ids': {'module': 'ai_vision', 'class': 'list[string]'}, 'stream-overlaps': {'module': 'ai_vision', 'class': 'list[StreamGroupOverlap]'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
3193
+ @cli_util.help_option
3194
+ @click.pass_context
3195
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'stream-source-ids': {'module': 'ai_vision', 'class': 'list[string]'}, 'stream-overlaps': {'module': 'ai_vision', 'class': 'list[StreamGroupOverlap]'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
3196
+ @cli_util.wrap_exceptions
3197
+ def update_stream_group(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, stream_group_id, display_name, is_enabled, stream_source_ids, stream_overlaps, freeform_tags, defined_tags, if_match):
3198
+
3199
+ if isinstance(stream_group_id, six.string_types) and len(stream_group_id.strip()) == 0:
3200
+ raise click.UsageError('Parameter --stream-group-id cannot be whitespace or empty string')
3201
+ if not force:
3202
+ if stream_source_ids or stream_overlaps or freeform_tags or defined_tags:
3203
+ if not click.confirm("WARNING: Updates to stream-source-ids and stream-overlaps and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
3204
+ ctx.abort()
3205
+
3206
+ kwargs = {}
3207
+ if if_match is not None:
3208
+ kwargs['if_match'] = if_match
3209
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3210
+
3211
+ _details = {}
3212
+
3213
+ if display_name is not None:
3214
+ _details['displayName'] = display_name
3215
+
3216
+ if is_enabled is not None:
3217
+ _details['isEnabled'] = is_enabled
3218
+
3219
+ if stream_source_ids is not None:
3220
+ _details['streamSourceIds'] = cli_util.parse_json_parameter("stream_source_ids", stream_source_ids)
3221
+
3222
+ if stream_overlaps is not None:
3223
+ _details['streamOverlaps'] = cli_util.parse_json_parameter("stream_overlaps", stream_overlaps)
3224
+
3225
+ if freeform_tags is not None:
3226
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
3227
+
3228
+ if defined_tags is not None:
3229
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
3230
+
3231
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
3232
+ result = client.update_stream_group(
3233
+ stream_group_id=stream_group_id,
3234
+ update_stream_group_details=_details,
3235
+ **kwargs
3236
+ )
3237
+ if wait_for_state:
3238
+
3239
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
3240
+ try:
3241
+ wait_period_kwargs = {}
3242
+ if max_wait_seconds is not None:
3243
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
3244
+ if wait_interval_seconds is not None:
3245
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
3246
+ if 'opc-work-request-id' not in result.headers:
3247
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
3248
+ cli_util.render_response(result, ctx)
3249
+ return
3250
+
3251
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
3252
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
3253
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
3254
+ # If we fail, we should show an error, but we should still provide the information to the customer
3255
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
3256
+ cli_util.render_response(result, ctx)
3257
+ sys.exit(2)
3258
+ except Exception:
3259
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
3260
+ cli_util.render_response(result, ctx)
3261
+ raise
3262
+ else:
3263
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
3264
+ cli_util.render_response(result, ctx)
3265
+
3266
+
3267
+ @stream_job_group.command(name=cli_util.override('ai_vision.update_stream_job.command_name', 'update'), help=u"""Create a stream analysis job with given inputs and features. \n[Command Reference](updateStreamJob)""")
3268
+ @cli_util.option('--stream-job-id', required=True, help=u"""Stream job id.""")
3269
+ @cli_util.option('--stream-source-id', help=u"""[OCID] of streamSource""")
3270
+ @cli_util.option('--features', type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of stream analysis features.
3271
+
3272
+ This option is a JSON list with items of type VideoStreamFeature. For documentation on VideoStreamFeature please see our API reference: https://docs.cloud.oracle.com/api/#/en/aiservicevision/20220125/datatypes/VideoStreamFeature.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3273
+ @cli_util.option('--stream-output-location', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3274
+ @cli_util.option('--display-name', help=u"""Stream job display name.""")
3275
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3276
+ @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 example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3277
+ @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.""")
3278
+ @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
3279
+ @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.""")
3280
+ @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.""")
3281
+ @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.""")
3282
+ @json_skeleton_utils.get_cli_json_input_option({'features': {'module': 'ai_vision', 'class': 'list[VideoStreamFeature]'}, 'stream-output-location': {'module': 'ai_vision', 'class': 'StreamOutputLocation'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
3283
+ @cli_util.help_option
3284
+ @click.pass_context
3285
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'features': {'module': 'ai_vision', 'class': 'list[VideoStreamFeature]'}, 'stream-output-location': {'module': 'ai_vision', 'class': 'StreamOutputLocation'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
3286
+ @cli_util.wrap_exceptions
3287
+ def update_stream_job(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, stream_job_id, stream_source_id, features, stream_output_location, display_name, freeform_tags, defined_tags, if_match):
3288
+
3289
+ if isinstance(stream_job_id, six.string_types) and len(stream_job_id.strip()) == 0:
3290
+ raise click.UsageError('Parameter --stream-job-id cannot be whitespace or empty string')
3291
+ if not force:
3292
+ if features or stream_output_location or freeform_tags or defined_tags:
3293
+ if not click.confirm("WARNING: Updates to features and stream-output-location and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
3294
+ ctx.abort()
3295
+
3296
+ kwargs = {}
3297
+ if if_match is not None:
3298
+ kwargs['if_match'] = if_match
3299
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3300
+
3301
+ _details = {}
3302
+
3303
+ if stream_source_id is not None:
3304
+ _details['streamSourceId'] = stream_source_id
3305
+
3306
+ if features is not None:
3307
+ _details['features'] = cli_util.parse_json_parameter("features", features)
3308
+
3309
+ if stream_output_location is not None:
3310
+ _details['streamOutputLocation'] = cli_util.parse_json_parameter("stream_output_location", stream_output_location)
3311
+
3312
+ if display_name is not None:
3313
+ _details['displayName'] = display_name
3314
+
3315
+ if freeform_tags is not None:
3316
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
3317
+
3318
+ if defined_tags is not None:
3319
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
3320
+
3321
+ client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
3322
+ result = client.update_stream_job(
3323
+ stream_job_id=stream_job_id,
3324
+ update_stream_job_details=_details,
3325
+ **kwargs
3326
+ )
3327
+ if wait_for_state:
3328
+
3329
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
3330
+ try:
3331
+ wait_period_kwargs = {}
3332
+ if max_wait_seconds is not None:
3333
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
3334
+ if wait_interval_seconds is not None:
3335
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
3336
+ if 'opc-work-request-id' not in result.headers:
3337
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
3338
+ cli_util.render_response(result, ctx)
3339
+ return
3340
+
3341
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
3342
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
3343
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
3344
+ # If we fail, we should show an error, but we should still provide the information to the customer
3345
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
3346
+ cli_util.render_response(result, ctx)
3347
+ sys.exit(2)
3348
+ except Exception:
3349
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
3350
+ cli_util.render_response(result, ctx)
3351
+ raise
3352
+ else:
3353
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
3354
+ cli_util.render_response(result, ctx)
3355
+
3356
+
3357
+ @stream_job_group.command(name=cli_util.override('ai_vision.update_stream_job_object_storage_output_location.command_name', 'update-stream-job-object-storage-output-location'), help=u"""Create a stream analysis job with given inputs and features. \n[Command Reference](updateStreamJob)""")
3358
+ @cli_util.option('--stream-job-id', required=True, help=u"""Stream job id.""")
3359
+ @cli_util.option('--stream-output-location-namespace-name', required=True, help=u"""The Object Storage namespace.""")
3360
+ @cli_util.option('--stream-output-location-bucket-name', required=True, help=u"""The Object Storage bucket name.""")
3361
+ @cli_util.option('--stream-output-location-prefix', required=True, help=u"""The Object Storage folder name.""")
3362
+ @cli_util.option('--stream-source-id', help=u"""[OCID] of streamSource""")
3363
+ @cli_util.option('--features', type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of stream analysis features.
3364
+
3365
+ This option is a JSON list with items of type VideoStreamFeature. For documentation on VideoStreamFeature please see our API reference: https://docs.cloud.oracle.com/api/#/en/aiservicevision/20220125/datatypes/VideoStreamFeature.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3366
+ @cli_util.option('--display-name', help=u"""Stream job display name.""")
3367
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3368
+ @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 example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3369
+ @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.""")
3370
+ @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
3371
+ @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.""")
3372
+ @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.""")
3373
+ @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.""")
3374
+ @json_skeleton_utils.get_cli_json_input_option({'features': {'module': 'ai_vision', 'class': 'list[VideoStreamFeature]'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
3375
+ @cli_util.help_option
3376
+ @click.pass_context
3377
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'features': {'module': 'ai_vision', 'class': 'list[VideoStreamFeature]'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
1474
3378
  @cli_util.wrap_exceptions
1475
- def list_work_request_errors(ctx, from_json, all_pages, page_size, work_request_id, page, limit, sort_by, sort_order):
1476
-
1477
- if all_pages and limit:
1478
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
3379
+ def update_stream_job_object_storage_output_location(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, stream_job_id, stream_output_location_namespace_name, stream_output_location_bucket_name, stream_output_location_prefix, stream_source_id, features, display_name, freeform_tags, defined_tags, if_match):
1479
3380
 
1480
- if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
1481
- raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
3381
+ if isinstance(stream_job_id, six.string_types) and len(stream_job_id.strip()) == 0:
3382
+ raise click.UsageError('Parameter --stream-job-id cannot be whitespace or empty string')
3383
+ if not force:
3384
+ if features or freeform_tags or defined_tags:
3385
+ if not click.confirm("WARNING: Updates to features and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
3386
+ ctx.abort()
1482
3387
 
1483
3388
  kwargs = {}
1484
- if page is not None:
1485
- kwargs['page'] = page
1486
- if limit is not None:
1487
- kwargs['limit'] = limit
1488
- if sort_by is not None:
1489
- kwargs['sort_by'] = sort_by
1490
- if sort_order is not None:
1491
- kwargs['sort_order'] = sort_order
3389
+ if if_match is not None:
3390
+ kwargs['if_match'] = if_match
1492
3391
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1493
- client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1494
- if all_pages:
1495
- if page_size:
1496
- kwargs['limit'] = page_size
1497
3392
 
1498
- result = cli_util.list_call_get_all_results(
1499
- client.list_work_request_errors,
1500
- work_request_id=work_request_id,
1501
- **kwargs
1502
- )
1503
- elif limit is not None:
1504
- result = cli_util.list_call_get_up_to_limit(
1505
- client.list_work_request_errors,
1506
- limit,
1507
- page_size,
1508
- work_request_id=work_request_id,
1509
- **kwargs
1510
- )
1511
- else:
1512
- result = client.list_work_request_errors(
1513
- work_request_id=work_request_id,
1514
- **kwargs
1515
- )
1516
- cli_util.render_response(result, ctx)
3393
+ _details = {}
3394
+ _details['streamOutputLocation'] = {}
3395
+ _details['streamOutputLocation']['namespaceName'] = stream_output_location_namespace_name
3396
+ _details['streamOutputLocation']['bucketName'] = stream_output_location_bucket_name
3397
+ _details['streamOutputLocation']['prefix'] = stream_output_location_prefix
1517
3398
 
3399
+ if stream_source_id is not None:
3400
+ _details['streamSourceId'] = stream_source_id
1518
3401
 
1519
- @work_request_log_entry_group.command(name=cli_util.override('ai_vision.list_work_request_logs.command_name', 'list-work-request-logs'), help=u"""Return a (paginated) list of logs for a given work request. \n[Command Reference](listWorkRequestLogs)""")
1520
- @cli_util.option('--work-request-id', required=True, help=u"""The ID of the asynchronous request.""")
1521
- @cli_util.option('--page', help=u"""The position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""")
1522
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
1523
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeAccepted"]), help=u"""The field to sort by. Only one sort order may be provided. The default order for timeAccepted is descending.""")
1524
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""")
1525
- @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.""")
1526
- @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.""")
1527
- @json_skeleton_utils.get_cli_json_input_option({})
1528
- @cli_util.help_option
1529
- @click.pass_context
1530
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'WorkRequestLogEntryCollection'})
1531
- @cli_util.wrap_exceptions
1532
- def list_work_request_logs(ctx, from_json, all_pages, page_size, work_request_id, page, limit, sort_by, sort_order):
3402
+ if features is not None:
3403
+ _details['features'] = cli_util.parse_json_parameter("features", features)
1533
3404
 
1534
- if all_pages and limit:
1535
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
3405
+ if display_name is not None:
3406
+ _details['displayName'] = display_name
1536
3407
 
1537
- if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
1538
- raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
3408
+ if freeform_tags is not None:
3409
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
3410
+
3411
+ if defined_tags is not None:
3412
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
3413
+
3414
+ _details['streamOutputLocation']['outputLocationType'] = 'OBJECT_STORAGE'
1539
3415
 
1540
- kwargs = {}
1541
- if page is not None:
1542
- kwargs['page'] = page
1543
- if limit is not None:
1544
- kwargs['limit'] = limit
1545
- if sort_by is not None:
1546
- kwargs['sort_by'] = sort_by
1547
- if sort_order is not None:
1548
- kwargs['sort_order'] = sort_order
1549
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1550
3416
  client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1551
- if all_pages:
1552
- if page_size:
1553
- kwargs['limit'] = page_size
3417
+ result = client.update_stream_job(
3418
+ stream_job_id=stream_job_id,
3419
+ update_stream_job_details=_details,
3420
+ **kwargs
3421
+ )
3422
+ if wait_for_state:
1554
3423
 
1555
- result = cli_util.list_call_get_all_results(
1556
- client.list_work_request_logs,
1557
- work_request_id=work_request_id,
1558
- **kwargs
1559
- )
1560
- elif limit is not None:
1561
- result = cli_util.list_call_get_up_to_limit(
1562
- client.list_work_request_logs,
1563
- limit,
1564
- page_size,
1565
- work_request_id=work_request_id,
1566
- **kwargs
1567
- )
1568
- else:
1569
- result = client.list_work_request_logs(
1570
- work_request_id=work_request_id,
1571
- **kwargs
1572
- )
3424
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
3425
+ try:
3426
+ wait_period_kwargs = {}
3427
+ if max_wait_seconds is not None:
3428
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
3429
+ if wait_interval_seconds is not None:
3430
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
3431
+ if 'opc-work-request-id' not in result.headers:
3432
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
3433
+ cli_util.render_response(result, ctx)
3434
+ return
3435
+
3436
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
3437
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
3438
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
3439
+ # If we fail, we should show an error, but we should still provide the information to the customer
3440
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
3441
+ cli_util.render_response(result, ctx)
3442
+ sys.exit(2)
3443
+ except Exception:
3444
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
3445
+ cli_util.render_response(result, ctx)
3446
+ raise
3447
+ else:
3448
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1573
3449
  cli_util.render_response(result, ctx)
1574
3450
 
1575
3451
 
1576
- @work_request_group.command(name=cli_util.override('ai_vision.list_work_requests.command_name', 'list'), help=u"""Lists the work requests in a compartment. \n[Command Reference](listWorkRequests)""")
1577
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources.""")
1578
- @cli_util.option('--work-request-id', help=u"""The ID of the asynchronous work request.""")
1579
- @cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"]), help=u"""A filter to return only resources whose lifecycleState matches the given OperationStatus.""")
1580
- @cli_util.option('--resource-id', help=u"""The ID of the resource affected by the work request.""")
1581
- @cli_util.option('--page', help=u"""The position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""")
1582
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
1583
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""")
1584
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeAccepted"]), help=u"""The field to sort by. Only one sort order may be provided. The default order for timeAccepted is descending.""")
1585
- @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.""")
1586
- @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.""")
1587
- @json_skeleton_utils.get_cli_json_input_option({})
3452
+ @stream_source_group.command(name=cli_util.override('ai_vision.update_stream_source.command_name', 'update'), help=u"""Update a streamSource \n[Command Reference](updateStreamSource)""")
3453
+ @cli_util.option('--stream-source-id', required=True, help=u"""StreamSource Id.""")
3454
+ @cli_util.option('--stream-source-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3455
+ @cli_util.option('--display-name', help=u"""A human-friendly name for the streamSource, that can be changed.""")
3456
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3457
+ @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 example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3458
+ @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.""")
3459
+ @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
3460
+ @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.""")
3461
+ @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.""")
3462
+ @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.""")
3463
+ @json_skeleton_utils.get_cli_json_input_option({'stream-source-details': {'module': 'ai_vision', 'class': 'StreamSourceDetails'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
1588
3464
  @cli_util.help_option
1589
3465
  @click.pass_context
1590
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ai_vision', 'class': 'WorkRequestSummaryCollection'})
3466
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'stream-source-details': {'module': 'ai_vision', 'class': 'StreamSourceDetails'}, 'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
1591
3467
  @cli_util.wrap_exceptions
1592
- def list_work_requests(ctx, from_json, all_pages, page_size, compartment_id, work_request_id, status, resource_id, page, limit, sort_order, sort_by):
3468
+ def update_stream_source(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, stream_source_id, stream_source_details, display_name, freeform_tags, defined_tags, if_match):
1593
3469
 
1594
- if all_pages and limit:
1595
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
3470
+ if isinstance(stream_source_id, six.string_types) and len(stream_source_id.strip()) == 0:
3471
+ raise click.UsageError('Parameter --stream-source-id cannot be whitespace or empty string')
3472
+ if not force:
3473
+ if stream_source_details or freeform_tags or defined_tags:
3474
+ if not click.confirm("WARNING: Updates to stream-source-details and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
3475
+ ctx.abort()
1596
3476
 
1597
3477
  kwargs = {}
1598
- if compartment_id is not None:
1599
- kwargs['compartment_id'] = compartment_id
1600
- if work_request_id is not None:
1601
- kwargs['work_request_id'] = work_request_id
1602
- if status is not None:
1603
- kwargs['status'] = status
1604
- if resource_id is not None:
1605
- kwargs['resource_id'] = resource_id
1606
- if page is not None:
1607
- kwargs['page'] = page
1608
- if limit is not None:
1609
- kwargs['limit'] = limit
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
3478
+ if if_match is not None:
3479
+ kwargs['if_match'] = if_match
1614
3480
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3481
+
3482
+ _details = {}
3483
+
3484
+ if stream_source_details is not None:
3485
+ _details['streamSourceDetails'] = cli_util.parse_json_parameter("stream_source_details", stream_source_details)
3486
+
3487
+ if display_name is not None:
3488
+ _details['displayName'] = display_name
3489
+
3490
+ if freeform_tags is not None:
3491
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
3492
+
3493
+ if defined_tags is not None:
3494
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
3495
+
1615
3496
  client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1616
- if all_pages:
1617
- if page_size:
1618
- kwargs['limit'] = page_size
3497
+ result = client.update_stream_source(
3498
+ stream_source_id=stream_source_id,
3499
+ update_stream_source_details=_details,
3500
+ **kwargs
3501
+ )
3502
+ if wait_for_state:
1619
3503
 
1620
- result = cli_util.list_call_get_all_results(
1621
- client.list_work_requests,
1622
- **kwargs
1623
- )
1624
- elif limit is not None:
1625
- result = cli_util.list_call_get_up_to_limit(
1626
- client.list_work_requests,
1627
- limit,
1628
- page_size,
1629
- **kwargs
1630
- )
1631
- else:
1632
- result = client.list_work_requests(
1633
- **kwargs
1634
- )
3504
+ if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
3505
+ try:
3506
+ wait_period_kwargs = {}
3507
+ if max_wait_seconds is not None:
3508
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
3509
+ if wait_interval_seconds is not None:
3510
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
3511
+ if 'opc-work-request-id' not in result.headers:
3512
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
3513
+ cli_util.render_response(result, ctx)
3514
+ return
3515
+
3516
+ click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
3517
+ result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
3518
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
3519
+ # If we fail, we should show an error, but we should still provide the information to the customer
3520
+ click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
3521
+ cli_util.render_response(result, ctx)
3522
+ sys.exit(2)
3523
+ except Exception:
3524
+ click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
3525
+ cli_util.render_response(result, ctx)
3526
+ raise
3527
+ else:
3528
+ click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1635
3529
  cli_util.render_response(result, ctx)
1636
3530
 
1637
3531
 
1638
- @model_group.command(name=cli_util.override('ai_vision.update_model.command_name', 'update'), help=u"""Updates the model metadata. \n[Command Reference](updateModel)""")
1639
- @cli_util.option('--model-id', required=True, help=u"""A unique model identifier.""")
1640
- @cli_util.option('--display-name', help=u"""A human-friendly name of the model, which can be changed.""")
1641
- @cli_util.option('--description', help=u"""An optional description of the model.""")
3532
+ @stream_source_group.command(name=cli_util.override('ai_vision.update_stream_source_rtsp_source_details.command_name', 'update-stream-source-rtsp-source-details'), help=u"""Update a streamSource \n[Command Reference](updateStreamSource)""")
3533
+ @cli_util.option('--stream-source-id', required=True, help=u"""StreamSource Id.""")
3534
+ @cli_util.option('--stream-source-details-stream-network-access-details', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3535
+ @cli_util.option('--stream-source-details-camera-url', required=True, help=u"""url of camera""")
3536
+ @cli_util.option('--display-name', help=u"""A human-friendly name for the streamSource, that can be changed.""")
1642
3537
  @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1643
3538
  @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 example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1644
3539
  @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.""")
3540
+ @cli_util.option('--stream-source-details-secret-id', help=u"""[OCID] of secret where credentials are stored in username:password format.""")
1645
3541
  @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
1646
3542
  @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.""")
1647
3543
  @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.""")
1648
3544
  @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.""")
1649
- @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
3545
+ @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}, 'stream-source-details-stream-network-access-details': {'module': 'ai_vision', 'class': 'StreamNetworkAccessDetails'}})
1650
3546
  @cli_util.help_option
1651
3547
  @click.pass_context
1652
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
3548
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}, 'stream-source-details-stream-network-access-details': {'module': 'ai_vision', 'class': 'StreamNetworkAccessDetails'}})
1653
3549
  @cli_util.wrap_exceptions
1654
- def update_model(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, model_id, display_name, description, freeform_tags, defined_tags, if_match):
3550
+ def update_stream_source_rtsp_source_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, stream_source_id, stream_source_details_stream_network_access_details, stream_source_details_camera_url, display_name, freeform_tags, defined_tags, if_match, stream_source_details_secret_id):
1655
3551
 
1656
- if isinstance(model_id, six.string_types) and len(model_id.strip()) == 0:
1657
- raise click.UsageError('Parameter --model-id cannot be whitespace or empty string')
3552
+ if isinstance(stream_source_id, six.string_types) and len(stream_source_id.strip()) == 0:
3553
+ raise click.UsageError('Parameter --stream-source-id cannot be whitespace or empty string')
1658
3554
  if not force:
1659
3555
  if freeform_tags or defined_tags:
1660
3556
  if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
@@ -1666,23 +3562,28 @@ def update_model(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_i
1666
3562
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1667
3563
 
1668
3564
  _details = {}
3565
+ _details['streamSourceDetails'] = {}
3566
+ _details['streamSourceDetails']['streamNetworkAccessDetails'] = cli_util.parse_json_parameter("stream_source_details_stream_network_access_details", stream_source_details_stream_network_access_details)
3567
+ _details['streamSourceDetails']['cameraUrl'] = stream_source_details_camera_url
1669
3568
 
1670
3569
  if display_name is not None:
1671
3570
  _details['displayName'] = display_name
1672
3571
 
1673
- if description is not None:
1674
- _details['description'] = description
1675
-
1676
3572
  if freeform_tags is not None:
1677
3573
  _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
1678
3574
 
1679
3575
  if defined_tags is not None:
1680
3576
  _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1681
3577
 
3578
+ if stream_source_details_secret_id is not None:
3579
+ _details['streamSourceDetails']['secretId'] = stream_source_details_secret_id
3580
+
3581
+ _details['streamSourceDetails']['sourceType'] = 'RTSP'
3582
+
1682
3583
  client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1683
- result = client.update_model(
1684
- model_id=model_id,
1685
- update_model_details=_details,
3584
+ result = client.update_stream_source(
3585
+ stream_source_id=stream_source_id,
3586
+ update_stream_source_details=_details,
1686
3587
  **kwargs
1687
3588
  )
1688
3589
  if wait_for_state:
@@ -1715,10 +3616,10 @@ def update_model(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_i
1715
3616
  cli_util.render_response(result, ctx)
1716
3617
 
1717
3618
 
1718
- @project_group.command(name=cli_util.override('ai_vision.update_project.command_name', 'update'), help=u"""Update the project metadata. \n[Command Reference](updateProject)""")
1719
- @cli_util.option('--project-id', required=True, help=u"""A unique project identifier.""")
1720
- @cli_util.option('--display-name', help=u"""A human-friendly name for the project, that can be changed.""")
1721
- @cli_util.option('--description', help=u"""An optional description of the project.""")
3619
+ @vision_private_endpoint_group.command(name=cli_util.override('ai_vision.update_vision_private_endpoint.command_name', 'update'), help=u"""Update the visionPrivateEndpoint metadata. \n[Command Reference](updateVisionPrivateEndpoint)""")
3620
+ @cli_util.option('--vision-private-endpoint-id', required=True, help=u"""Vision private endpoint Id.""")
3621
+ @cli_util.option('--display-name', help=u"""A human-friendly name for the visionPrivateEndpoint, that can be changed.""")
3622
+ @cli_util.option('--description', help=u"""An optional description of the visionPrivateEndpoint.""")
1722
3623
  @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1723
3624
  @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 example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1724
3625
  @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.""")
@@ -1731,10 +3632,10 @@ def update_model(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_i
1731
3632
  @click.pass_context
1732
3633
  @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'ai_vision', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ai_vision', 'class': 'dict(str, dict(str, object))'}})
1733
3634
  @cli_util.wrap_exceptions
1734
- def update_project(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, project_id, display_name, description, freeform_tags, defined_tags, if_match):
3635
+ def update_vision_private_endpoint(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, vision_private_endpoint_id, display_name, description, freeform_tags, defined_tags, if_match):
1735
3636
 
1736
- if isinstance(project_id, six.string_types) and len(project_id.strip()) == 0:
1737
- raise click.UsageError('Parameter --project-id cannot be whitespace or empty string')
3637
+ if isinstance(vision_private_endpoint_id, six.string_types) and len(vision_private_endpoint_id.strip()) == 0:
3638
+ raise click.UsageError('Parameter --vision-private-endpoint-id cannot be whitespace or empty string')
1738
3639
  if not force:
1739
3640
  if freeform_tags or defined_tags:
1740
3641
  if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
@@ -1760,9 +3661,9 @@ def update_project(ctx, from_json, force, wait_for_state, max_wait_seconds, wait
1760
3661
  _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1761
3662
 
1762
3663
  client = cli_util.build_client('ai_vision', 'ai_service_vision', ctx)
1763
- result = client.update_project(
1764
- project_id=project_id,
1765
- update_project_details=_details,
3664
+ result = client.update_vision_private_endpoint(
3665
+ vision_private_endpoint_id=vision_private_endpoint_id,
3666
+ update_vision_private_endpoint_details=_details,
1766
3667
  **kwargs
1767
3668
  )
1768
3669
  if wait_for_state: