oci-cli 3.66.1__py3-none-any.whl → 3.67.0__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 (290) hide show
  1. common_util/ignored_commands.py +3 -1
  2. oci_cli/bin/jms.psm1 +74 -6
  3. oci_cli/bin/marketplace.psm1 +7 -1
  4. oci_cli/help_text_producer/data_files/text/cmdref/compute/compute-gpu-memory-fabric/update.txt +2 -2
  5. oci_cli/help_text_producer/data_files/text/cmdref/compute/image-capability-schema/create.txt +26 -0
  6. oci_cli/help_text_producer/data_files/text/cmdref/compute/image-capability-schema/delete.txt +26 -0
  7. oci_cli/help_text_producer/data_files/text/cmdref/compute/image-capability-schema/update.txt +26 -0
  8. oci_cli/help_text_producer/data_files/text/cmdref/compute/instance/launch-instance-compute-bare-metal-host-placement-constraint-details.txt +4 -0
  9. oci_cli/help_text_producer/data_files/text/cmdref/compute/instance/launch-instance-host-group-placement-constraint-details.txt +4 -0
  10. oci_cli/help_text_producer/data_files/text/cmdref/compute/instance/launch.txt +4 -0
  11. oci_cli/help_text_producer/data_files/text/cmdref/compute/instance/update-instance-amd-vm-update-instance-platform-config.txt +4 -0
  12. oci_cli/help_text_producer/data_files/text/cmdref/compute/instance/update-instance-intel-vm-update-instance-platform-config.txt +4 -0
  13. oci_cli/help_text_producer/data_files/text/cmdref/compute/instance/update-instance-update-instance-source-via-boot-volume-details.txt +4 -0
  14. oci_cli/help_text_producer/data_files/text/cmdref/compute/instance/update-instance-update-instance-source-via-image-details.txt +4 -0
  15. oci_cli/help_text_producer/data_files/text/cmdref/compute/instance/update.txt +4 -0
  16. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/discovery-job/list-discovery-job-results.txt +13 -1
  17. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/masking-error-summary/list-masking-errors.txt +1 -1
  18. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/masking-policy/list-masking-reports.txt +5 -0
  19. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/masking-policy/mask-data.txt +6 -0
  20. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/list-findings.txt +5 -0
  21. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/sensitive-column/list.txt +22 -1
  22. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/service/get.txt +2 -2
  23. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/create-autonomous-database-gcp-key-details.txt +779 -0
  24. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database/update-autonomous-database-gcp-key-details.txt +1079 -0
  25. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-database.txt +4 -0
  26. oci_cli/help_text_producer/data_files/text/cmdref/db/cloud-exa-infra/configure-exascale.txt +136 -0
  27. oci_cli/help_text_producer/data_files/text/cmdref/db/cloud-exa-infra.txt +2 -0
  28. oci_cli/help_text_producer/data_files/text/cmdref/db/cloud-vm-cluster/create.txt +35 -9
  29. oci_cli/help_text_producer/data_files/text/cmdref/db/cloud-vm-cluster/update.txt +38 -1
  30. oci_cli/help_text_producer/data_files/text/cmdref/db/exascale-db-storage-vault/create.txt +1 -1
  31. oci_cli/help_text_producer/data_files/text/cmdref/db/exascale-db-storage-vault/list.txt +23 -1
  32. oci_cli/help_text_producer/data_files/text/cmdref/db/system-shape.txt +5 -0
  33. oci_cli/help_text_producer/data_files/text/cmdref/db.txt +6 -0
  34. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-collection/create-db.txt +2 -2
  35. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-collection/create-exadb-stack.txt +173 -0
  36. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-collection/create-gi.txt +2 -2
  37. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-collection/create-guest-os.txt +180 -0
  38. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-collection/create.txt +7 -4
  39. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-collection/update.txt +1 -1
  40. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-collection-summary/list.txt +1 -1
  41. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-collection.txt +4 -0
  42. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-cycle/clone.txt +6 -5
  43. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-cycle/create-fsu-cycle-create-upgrade-fsu-cycle.txt +4 -4
  44. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-cycle/create-patch.txt +14 -12
  45. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-cycle/create.txt +4 -4
  46. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-cycle/update-fsu-cycle-exadb-stack-fsu-goal-version-details.txt +230 -0
  47. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-cycle/update-patch.txt +10 -10
  48. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-cycle-summary/list.txt +1 -1
  49. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-cycle.txt +2 -0
  50. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-discovery/create-exadb-stack.txt +173 -0
  51. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-discovery/create-guest-os.txt +185 -0
  52. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update/fsu-discovery.txt +4 -0
  53. oci_cli/help_text_producer/data_files/text/cmdref/fleet-software-update.txt +10 -0
  54. oci_cli/help_text_producer/data_files/text/cmdref/fn/function/create.txt +26 -0
  55. oci_cli/help_text_producer/data_files/text/cmdref/fn/function/update.txt +26 -0
  56. oci_cli/help_text_producer/data_files/text/cmdref/fusion-apps/fusion-environment/create.txt +6 -0
  57. oci_cli/help_text_producer/data_files/text/cmdref/fusion-apps/fusion-environment/update.txt +6 -0
  58. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/endpoint/create.txt +5 -0
  59. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/endpoint/update.txt +5 -0
  60. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/generative-ai-private-endpoint/change-compartment.txt +136 -0
  61. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/generative-ai-private-endpoint/create.txt +186 -0
  62. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/generative-ai-private-endpoint/delete.txt +133 -0
  63. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/generative-ai-private-endpoint/get.txt +96 -0
  64. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/generative-ai-private-endpoint/update.txt +195 -0
  65. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/generative-ai-private-endpoint-collection/list-generative-ai-private-endpoints.txt +147 -0
  66. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/generative-ai-private-endpoint-collection.txt +14 -0
  67. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai/generative-ai-private-endpoint.txt +22 -0
  68. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai.txt +16 -0
  69. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request/work-request-error/{list.txt → list-errors.txt} +5 -5
  70. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request/work-request-error.txt +1 -1
  71. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request/{work-request-log-entry/list-work-request-logs.txt → work-request-log/list.txt} +5 -5
  72. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request/work-request-log.txt +14 -0
  73. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request.txt +3 -3
  74. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane.txt +3 -3
  75. oci_cli/help_text_producer/data_files/text/cmdref/jms/agent-installer-summary/generate-agent-installer-configuration.txt +8 -0
  76. oci_cli/help_text_producer/data_files/text/cmdref/jms/blocklist/create.txt +1 -1
  77. oci_cli/help_text_producer/data_files/text/cmdref/jms/blocklist/list.txt +1 -1
  78. oci_cli/help_text_producer/data_files/text/cmdref/jms/container-summary/list-containers.txt +338 -0
  79. oci_cli/help_text_producer/data_files/text/cmdref/jms/container-summary.txt +14 -0
  80. oci_cli/help_text_producer/data_files/text/cmdref/jms/export-setting/update.txt +15 -0
  81. oci_cli/help_text_producer/data_files/text/cmdref/jms/fleet-agent-configuration/update.txt +8 -0
  82. oci_cli/help_text_producer/data_files/text/cmdref/jms/installation-usage/summarize.txt +1 -1
  83. oci_cli/help_text_producer/data_files/text/cmdref/jms/jms-plugin/create.txt +12 -3
  84. oci_cli/help_text_producer/data_files/text/cmdref/jms/jms-plugin/list.txt +3 -3
  85. oci_cli/help_text_producer/data_files/text/cmdref/jms/library-application-usage-summary/list-library-application-usage.txt +332 -0
  86. oci_cli/help_text_producer/data_files/text/cmdref/jms/library-application-usage-summary.txt +16 -0
  87. oci_cli/help_text_producer/data_files/text/cmdref/jms/library-inventory/summarize.txt +284 -0
  88. oci_cli/help_text_producer/data_files/text/cmdref/jms/library-inventory.txt +14 -0
  89. oci_cli/help_text_producer/data_files/text/cmdref/jms/library-managed-instance-usage-summary/list-library-managed-instance-usage.txt +332 -0
  90. oci_cli/help_text_producer/data_files/text/cmdref/jms/library-managed-instance-usage-summary.txt +16 -0
  91. oci_cli/help_text_producer/data_files/text/cmdref/jms/library-usage/scan.txt +8 -0
  92. oci_cli/help_text_producer/data_files/text/cmdref/jms/library-usage/summarize.txt +3 -3
  93. oci_cli/help_text_producer/data_files/text/cmdref/jms/managed-instance-usage/summarize.txt +1 -1
  94. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/create-task-schedule-add-installation-site-task-details.txt +148 -0
  95. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/create-task-schedule-crypto-task-details.txt +148 -0
  96. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/create-task-schedule-deployed-application-migration-task-details.txt +148 -0
  97. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/create-task-schedule-java-migration-task-details.txt +148 -0
  98. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/create-task-schedule-jfr-task-details.txt +148 -0
  99. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/create-task-schedule-performance-tuning-task-details.txt +148 -0
  100. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/create-task-schedule-remove-installation-site-task-details.txt +148 -0
  101. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/create-task-schedule-scan-java-server-task-details.txt +148 -0
  102. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/create-task-schedule-scan-library-task-details.txt +148 -0
  103. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/create.txt +150 -0
  104. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/delete.txt +146 -0
  105. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/get.txt +108 -0
  106. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/list.txt +136 -0
  107. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/update-task-schedule-add-installation-site-task-details.txt +165 -0
  108. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/update-task-schedule-crypto-task-details.txt +165 -0
  109. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/update-task-schedule-deployed-application-migration-task-details.txt +165 -0
  110. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/update-task-schedule-java-migration-task-details.txt +165 -0
  111. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/update-task-schedule-jfr-task-details.txt +165 -0
  112. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/update-task-schedule-performance-tuning-task-details.txt +165 -0
  113. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/update-task-schedule-remove-installation-site-task-details.txt +165 -0
  114. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/update-task-schedule-scan-java-server-task-details.txt +165 -0
  115. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/update-task-schedule-scan-library-task-details.txt +165 -0
  116. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule/update.txt +171 -0
  117. oci_cli/help_text_producer/data_files/text/cmdref/jms/task-schedule.txt +58 -0
  118. oci_cli/help_text_producer/data_files/text/cmdref/jms/uncorrelated-package-application-usage-summary/list-uncorrelated-package-application-usage.txt +324 -0
  119. oci_cli/help_text_producer/data_files/text/cmdref/jms/uncorrelated-package-application-usage-summary.txt +16 -0
  120. oci_cli/help_text_producer/data_files/text/cmdref/jms/uncorrelated-package-managed-instance-usage-summary/list-uncorrelated-package-managed-instance-usage.txt +324 -0
  121. oci_cli/help_text_producer/data_files/text/cmdref/jms/uncorrelated-package-managed-instance-usage-summary.txt +16 -0
  122. oci_cli/help_text_producer/data_files/text/cmdref/jms/uncorrelated-package-usage-summary/list-uncorrelated-package-usage.txt +323 -0
  123. oci_cli/help_text_producer/data_files/text/cmdref/jms/uncorrelated-package-usage-summary.txt +14 -0
  124. oci_cli/help_text_producer/data_files/text/cmdref/jms/work-request/list.txt +1 -1
  125. oci_cli/help_text_producer/data_files/text/cmdref/jms-java-downloads/java-license/get.txt +1 -1
  126. oci_cli/help_text_producer/data_files/text/cmdref/jms-java-downloads/java-license/list.txt +1 -1
  127. oci_cli/help_text_producer/data_files/text/cmdref/jms-java-downloads/java-license-acceptance-record/create.txt +1 -1
  128. oci_cli/help_text_producer/data_files/text/cmdref/jms-java-downloads/java-license-acceptance-record/list.txt +1 -1
  129. oci_cli/help_text_producer/data_files/text/cmdref/jms-java-downloads.txt +1 -3
  130. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/analyze-applications-configuration/get.txt +83 -0
  131. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/analyze-applications-configuration/update.txt +99 -0
  132. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/analyze-applications-configuration.txt +16 -0
  133. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/java-migration-analysis/delete.txt +103 -0
  134. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/java-migration-analysis/get.txt +91 -0
  135. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/java-migration-analysis/list.txt +128 -0
  136. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/java-migration-analysis/request.txt +172 -0
  137. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/java-migration-analysis.txt +23 -0
  138. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/performance-tuning-analysis/delete.txt +103 -0
  139. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/performance-tuning-analysis/get.txt +91 -0
  140. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/performance-tuning-analysis/list.txt +136 -0
  141. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/performance-tuning-analysis/request.txt +172 -0
  142. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/performance-tuning-analysis.txt +23 -0
  143. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/subscription-acknowledgment-configuration/get.txt +83 -0
  144. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/subscription-acknowledgment-configuration/update.txt +95 -0
  145. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/subscription-acknowledgment-configuration.txt +16 -0
  146. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/work-item-summary/list-work-items.txt +110 -0
  147. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/work-item-summary.txt +14 -0
  148. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/work-request/cancel.txt +103 -0
  149. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/work-request/get.txt +91 -0
  150. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/work-request/list.txt +137 -0
  151. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/work-request-error/list.txt +128 -0
  152. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/work-request-error.txt +15 -0
  153. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/work-request-log-entry/list-work-request-logs.txt +128 -0
  154. oci_cli/help_text_producer/data_files/text/cmdref/{governance-rules-control-plane/work-request → jms-utils}/work-request-log-entry.txt +2 -1
  155. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils/work-request.txt +23 -0
  156. oci_cli/help_text_producer/data_files/text/cmdref/jms-utils.txt +65 -0
  157. oci_cli/help_text_producer/data_files/text/cmdref/jms.txt +76 -0
  158. oci_cli/help_text_producer/data_files/text/cmdref/marketplace/create-marketplace-external-attested-metadata-details/create-marketplace-external-attested-metadata.txt +96 -0
  159. oci_cli/help_text_producer/data_files/text/cmdref/marketplace/create-marketplace-external-attested-metadata-details.txt +15 -0
  160. oci_cli/help_text_producer/data_files/text/cmdref/marketplace/marketplace-metadata-public-key-summary/list-marketplace-metadata-public-keys.txt +121 -0
  161. oci_cli/help_text_producer/data_files/text/cmdref/marketplace/marketplace-metadata-public-key-summary.txt +15 -0
  162. oci_cli/help_text_producer/data_files/text/cmdref/marketplace.txt +8 -0
  163. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/cluster/cluster/create.txt +12 -1
  164. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/cluster/cluster/update.txt +1 -1
  165. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore/add-block-volume.txt +142 -0
  166. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore/change-compartment.txt +114 -0
  167. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore/create.txt +190 -0
  168. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore/delete.txt +140 -0
  169. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore/get.txt +100 -0
  170. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore/list.txt +163 -0
  171. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore/update.txt +185 -0
  172. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore-cluster/add-datastore.txt +147 -0
  173. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore-cluster/attach-to-cluster.txt +153 -0
  174. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore-cluster/attach-to-esxi-host.txt +155 -0
  175. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore-cluster/change-compartment.txt +110 -0
  176. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore-cluster/create.txt +188 -0
  177. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore-cluster/delete.txt +134 -0
  178. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore-cluster/detach-from-cluster.txt +134 -0
  179. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore-cluster/detach-from-esxi-host.txt +155 -0
  180. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore-cluster/get.txt +96 -0
  181. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore-cluster/list.txt +163 -0
  182. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore-cluster/remove-datastore.txt +147 -0
  183. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore-cluster/update.txt +182 -0
  184. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore-cluster.txt +37 -0
  185. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/datastore.txt +27 -0
  186. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/esxi-host/create.txt +1 -1
  187. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/esxi-host/update.txt +6 -2
  188. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/work-request-error/{list.txt → list-errors.txt} +5 -5
  189. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/work-request-error.txt +1 -1
  190. oci_cli/help_text_producer/data_files/text/cmdref/ocvs.txt +43 -1
  191. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/monitored-region/create.txt +127 -0
  192. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/monitored-region/delete.txt +136 -0
  193. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/monitored-region/get.txt +98 -0
  194. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/monitored-region/list.txt +137 -0
  195. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/monitored-region.txt +26 -0
  196. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/resource-analytics-instance/change-compartment.txt +135 -0
  197. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/resource-analytics-instance/create.txt +204 -0
  198. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/resource-analytics-instance/delete.txt +133 -0
  199. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/resource-analytics-instance/disable-oac.txt +129 -0
  200. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/resource-analytics-instance/enable-oac.txt +154 -0
  201. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/resource-analytics-instance/get.txt +95 -0
  202. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/resource-analytics-instance/list.txt +142 -0
  203. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/resource-analytics-instance/update.txt +179 -0
  204. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/resource-analytics-instance.txt +34 -0
  205. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/tenancy-attachment/create.txt +131 -0
  206. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/tenancy-attachment/delete.txt +136 -0
  207. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/tenancy-attachment/get.txt +98 -0
  208. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/tenancy-attachment/list.txt +137 -0
  209. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/tenancy-attachment/update.txt +137 -0
  210. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/tenancy-attachment.txt +29 -0
  211. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/work-request/cancel.txt +103 -0
  212. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/work-request/get.txt +91 -0
  213. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/work-request/list.txt +140 -0
  214. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/work-request-error/list.txt +131 -0
  215. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/work-request-error.txt +15 -0
  216. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/work-request-log-entry/list.txt +131 -0
  217. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/work-request-log-entry.txt +15 -0
  218. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics/work-request.txt +23 -0
  219. oci_cli/help_text_producer/data_files/text/cmdref/resource-analytics.txt +68 -0
  220. oci_cli/help_text_producer/data_files/text/cmdref/session/authenticate.txt +7 -7
  221. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/create.txt +6 -6
  222. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/get.txt +2 -2
  223. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/list.txt +1 -1
  224. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/update.txt +4 -4
  225. oci_cli/help_text_producer/data_files/text/cmdref/support/incident-resource-type/list.txt +3 -3
  226. oci_cli/help_text_producer/data_files/text/cmdref/support/validation-response/validate-user.txt +1 -1
  227. oci_cli/help_text_producer/data_files/text/index.txt +6 -2
  228. oci_cli/service_mapping.py +11 -1
  229. oci_cli/version.py +1 -1
  230. {oci_cli-3.66.1.dist-info → oci_cli-3.67.0.dist-info}/METADATA +2 -2
  231. {oci_cli-3.66.1.dist-info → oci_cli-3.67.0.dist-info}/RECORD +290 -116
  232. services/core/src/oci_cli_compute/generated/compute_cli.py +194 -28
  233. services/data_safe/src/oci_cli_data_safe/generated/datasafe_cli.py +28 -9
  234. services/database/src/oci_cli_database/database_cli_extended.py +43 -2
  235. services/database/src/oci_cli_database/generated/database_cli.py +830 -4
  236. services/fleet_software_update/src/oci_cli_fleet_software_update/fleetsoftwareupdate_cli_extended.py +16 -0
  237. services/fleet_software_update/src/oci_cli_fleet_software_update/generated/fleetsoftwareupdate_cli.py +421 -32
  238. services/functions/src/oci_cli_functions_management/functionsmanagement_cli_extended.py +87 -5
  239. services/functions/src/oci_cli_functions_management/generated/functionsmanagement_cli.py +2361 -469
  240. services/fusion_apps/src/oci_cli_fusion_applications/fusionapplications_cli_extended.py +40 -0
  241. services/fusion_apps/src/oci_cli_fusion_applications/generated/fusionapplications_cli.py +10 -2
  242. services/generative_ai/src/oci_cli_generative_ai/generated/generativeai_cli.py +399 -2
  243. services/jms/src/oci_cli_java_management_service/generated/javamanagementservice_cli.py +4359 -2378
  244. services/jms_java_downloads/src/oci_cli_java_download/generated/javadownload_cli.py +5 -5
  245. services/jms_utils/__init__.py +4 -0
  246. services/jms_utils/src/__init__.py +4 -0
  247. services/jms_utils/src/oci_cli_jms_utils/__init__.py +4 -0
  248. services/jms_utils/src/oci_cli_jms_utils/generated/__init__.py +4 -0
  249. services/jms_utils/src/oci_cli_jms_utils/generated/client_mappings.py +14 -0
  250. services/jms_utils/src/oci_cli_jms_utils/generated/jmsutils_cli.py +812 -0
  251. services/jms_utils/tests/__init__.py +4 -0
  252. services/marketplace/src/oci_cli_marketplace/generated/marketplace_cli.py +94 -0
  253. services/ocvp/src/oci_cli_cluster/generated/cluster_cli.py +9 -5
  254. services/ocvp/src/oci_cli_datastore/__init__.py +4 -0
  255. services/ocvp/src/oci_cli_datastore/datastore_cli_extended.py +25 -0
  256. services/ocvp/src/oci_cli_datastore/generated/__init__.py +4 -0
  257. services/ocvp/src/oci_cli_datastore/generated/client_mappings.py +14 -0
  258. services/ocvp/src/oci_cli_datastore/generated/datastore_cli.py +434 -0
  259. services/ocvp/src/oci_cli_datastore_cluster/__init__.py +4 -0
  260. services/ocvp/src/oci_cli_datastore_cluster/datastorecluster_cli_extended.py +50 -0
  261. services/ocvp/src/oci_cli_datastore_cluster/generated/__init__.py +4 -0
  262. services/ocvp/src/oci_cli_datastore_cluster/generated/client_mappings.py +14 -0
  263. services/ocvp/src/oci_cli_datastore_cluster/generated/datastorecluster_cli.py +737 -0
  264. services/ocvp/src/oci_cli_esxi_host/generated/esxihost_cli.py +5 -3
  265. services/resource_analytics/__init__.py +4 -0
  266. services/resource_analytics/src/__init__.py +4 -0
  267. services/resource_analytics/src/oci_cli_monitored_region/__init__.py +4 -0
  268. services/resource_analytics/src/oci_cli_monitored_region/generated/__init__.py +4 -0
  269. services/resource_analytics/src/oci_cli_monitored_region/generated/client_mappings.py +14 -0
  270. services/resource_analytics/src/oci_cli_monitored_region/generated/monitoredregion_cli.py +233 -0
  271. services/resource_analytics/src/oci_cli_monitored_region/monitored_region_cli_extended.py +39 -0
  272. services/resource_analytics/src/oci_cli_resource_analytics/__init__.py +4 -0
  273. services/resource_analytics/src/oci_cli_resource_analytics/generated/__init__.py +4 -0
  274. services/resource_analytics/src/oci_cli_resource_analytics/generated/resource_analytics_service_cli.py +14 -0
  275. services/resource_analytics/src/oci_cli_resource_analytics_instance/__init__.py +4 -0
  276. services/resource_analytics/src/oci_cli_resource_analytics_instance/generated/__init__.py +4 -0
  277. services/resource_analytics/src/oci_cli_resource_analytics_instance/generated/client_mappings.py +14 -0
  278. services/resource_analytics/src/oci_cli_resource_analytics_instance/generated/resourceanalyticsinstance_cli.py +968 -0
  279. services/resource_analytics/src/oci_cli_resource_analytics_instance/resource_analytics_instance_cli_extended.py +40 -0
  280. services/resource_analytics/src/oci_cli_tenancy_attachment/__init__.py +4 -0
  281. services/resource_analytics/src/oci_cli_tenancy_attachment/generated/__init__.py +4 -0
  282. services/resource_analytics/src/oci_cli_tenancy_attachment/generated/client_mappings.py +14 -0
  283. services/resource_analytics/src/oci_cli_tenancy_attachment/generated/tenancyattachment_cli.py +298 -0
  284. services/resource_analytics/src/oci_cli_tenancy_attachment/tenancy_attachment_cli_extended.py +39 -0
  285. services/resource_analytics/tests/__init__.py +4 -0
  286. {oci_cli-3.66.1.dist-info → oci_cli-3.67.0.dist-info}/LICENSE.txt +0 -0
  287. {oci_cli-3.66.1.dist-info → oci_cli-3.67.0.dist-info}/THIRD_PARTY_LICENSES.txt +0 -0
  288. {oci_cli-3.66.1.dist-info → oci_cli-3.67.0.dist-info}/WHEEL +0 -0
  289. {oci_cli-3.66.1.dist-info → oci_cli-3.67.0.dist-info}/entry_points.txt +0 -0
  290. {oci_cli-3.66.1.dist-info → oci_cli-3.67.0.dist-info}/top_level.txt +0 -0
@@ -200,6 +200,9 @@ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
200
200
  The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
201
201
  @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
202
202
  @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
203
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
204
+ @cli_util.option('--failure-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
205
+ @cli_util.option('--success-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
203
206
  @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
204
207
  @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
205
208
 
@@ -210,12 +213,12 @@ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_comp
210
213
  @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
211
214
  @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.""")
212
215
  @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.""")
213
- @json_skeleton_utils.get_cli_json_input_option({'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
216
+ @json_skeleton_utils.get_cli_json_input_option({'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
214
217
  @cli_util.help_option
215
218
  @click.pass_context
216
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
219
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
217
220
  @cli_util.wrap_exceptions
218
- def create_function(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, application_id, memory_in_mbs, image, image_digest, source_details, config, timeout_in_seconds, provisioned_concurrency_config, trace_config, freeform_tags, defined_tags):
221
+ def create_function(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, application_id, memory_in_mbs, image, image_digest, source_details, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, failure_destination, success_destination, trace_config, freeform_tags, defined_tags):
219
222
 
220
223
  kwargs = {}
221
224
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
@@ -243,6 +246,15 @@ def create_function(ctx, from_json, wait_for_state, max_wait_seconds, wait_inter
243
246
  if provisioned_concurrency_config is not None:
244
247
  _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
245
248
 
249
+ if detached_mode_timeout_in_seconds is not None:
250
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
251
+
252
+ if failure_destination is not None:
253
+ _details['failureDestination'] = cli_util.parse_json_parameter("failure_destination", failure_destination)
254
+
255
+ if success_destination is not None:
256
+ _details['successDestination'] = cli_util.parse_json_parameter("success_destination", success_destination)
257
+
246
258
  if trace_config is not None:
247
259
  _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
248
260
 
@@ -297,6 +309,9 @@ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
297
309
  The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
298
310
  @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
299
311
  @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
312
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
313
+ @cli_util.option('--failure-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
314
+ @cli_util.option('--success-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
300
315
  @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
301
316
  @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
302
317
 
@@ -307,12 +322,12 @@ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_comp
307
322
  @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
308
323
  @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.""")
309
324
  @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.""")
310
- @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
325
+ @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
311
326
  @cli_util.help_option
312
327
  @click.pass_context
313
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
328
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
314
329
  @cli_util.wrap_exceptions
315
- def create_function_pre_built_function_source_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, application_id, memory_in_mbs, source_details_pbf_listing_id, image, image_digest, config, timeout_in_seconds, provisioned_concurrency_config, trace_config, freeform_tags, defined_tags):
330
+ def create_function_pre_built_function_source_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, application_id, memory_in_mbs, source_details_pbf_listing_id, image, image_digest, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, failure_destination, success_destination, trace_config, freeform_tags, defined_tags):
316
331
 
317
332
  kwargs = {}
318
333
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
@@ -339,6 +354,15 @@ def create_function_pre_built_function_source_details(ctx, from_json, wait_for_s
339
354
  if provisioned_concurrency_config is not None:
340
355
  _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
341
356
 
357
+ if detached_mode_timeout_in_seconds is not None:
358
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
359
+
360
+ if failure_destination is not None:
361
+ _details['failureDestination'] = cli_util.parse_json_parameter("failure_destination", failure_destination)
362
+
363
+ if success_destination is not None:
364
+ _details['successDestination'] = cli_util.parse_json_parameter("success_destination", success_destination)
365
+
342
366
  if trace_config is not None:
343
367
  _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
344
368
 
@@ -394,6 +418,9 @@ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
394
418
 
395
419
  The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
396
420
  @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
421
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
422
+ @cli_util.option('--failure-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
423
+ @cli_util.option('--success-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
397
424
  @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
398
425
  @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
399
426
 
@@ -404,12 +431,12 @@ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_comp
404
431
  @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
405
432
  @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.""")
406
433
  @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.""")
407
- @json_skeleton_utils.get_cli_json_input_option({'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
434
+ @json_skeleton_utils.get_cli_json_input_option({'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
408
435
  @cli_util.help_option
409
436
  @click.pass_context
410
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
437
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
411
438
  @cli_util.wrap_exceptions
412
- def create_function_none_provisioned_concurrency_config(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, application_id, memory_in_mbs, image, image_digest, source_details, config, timeout_in_seconds, trace_config, freeform_tags, defined_tags):
439
+ def create_function_none_provisioned_concurrency_config(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, application_id, memory_in_mbs, image, image_digest, source_details, config, timeout_in_seconds, detached_mode_timeout_in_seconds, failure_destination, success_destination, trace_config, freeform_tags, defined_tags):
413
440
 
414
441
  kwargs = {}
415
442
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
@@ -435,6 +462,15 @@ def create_function_none_provisioned_concurrency_config(ctx, from_json, wait_for
435
462
  if timeout_in_seconds is not None:
436
463
  _details['timeoutInSeconds'] = timeout_in_seconds
437
464
 
465
+ if detached_mode_timeout_in_seconds is not None:
466
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
467
+
468
+ if failure_destination is not None:
469
+ _details['failureDestination'] = cli_util.parse_json_parameter("failure_destination", failure_destination)
470
+
471
+ if success_destination is not None:
472
+ _details['successDestination'] = cli_util.parse_json_parameter("success_destination", success_destination)
473
+
438
474
  if trace_config is not None:
439
475
  _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
440
476
 
@@ -491,6 +527,9 @@ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
491
527
 
492
528
  The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
493
529
  @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
530
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
531
+ @cli_util.option('--failure-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
532
+ @cli_util.option('--success-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
494
533
  @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
495
534
  @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
496
535
 
@@ -501,12 +540,12 @@ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_comp
501
540
  @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
502
541
  @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.""")
503
542
  @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.""")
504
- @json_skeleton_utils.get_cli_json_input_option({'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
543
+ @json_skeleton_utils.get_cli_json_input_option({'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
505
544
  @cli_util.help_option
506
545
  @click.pass_context
507
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
546
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
508
547
  @cli_util.wrap_exceptions
509
- def create_function_constant_provisioned_concurrency_config(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, application_id, memory_in_mbs, provisioned_concurrency_config_count, image, image_digest, source_details, config, timeout_in_seconds, trace_config, freeform_tags, defined_tags):
548
+ def create_function_constant_provisioned_concurrency_config(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, application_id, memory_in_mbs, provisioned_concurrency_config_count, image, image_digest, source_details, config, timeout_in_seconds, detached_mode_timeout_in_seconds, failure_destination, success_destination, trace_config, freeform_tags, defined_tags):
510
549
 
511
550
  kwargs = {}
512
551
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
@@ -533,6 +572,15 @@ def create_function_constant_provisioned_concurrency_config(ctx, from_json, wait
533
572
  if timeout_in_seconds is not None:
534
573
  _details['timeoutInSeconds'] = timeout_in_seconds
535
574
 
575
+ if detached_mode_timeout_in_seconds is not None:
576
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
577
+
578
+ if failure_destination is not None:
579
+ _details['failureDestination'] = cli_util.parse_json_parameter("failure_destination", failure_destination)
580
+
581
+ if success_destination is not None:
582
+ _details['successDestination'] = cli_util.parse_json_parameter("success_destination", success_destination)
583
+
536
584
  if trace_config is not None:
537
585
  _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
538
586
 
@@ -575,35 +623,93 @@ def create_function_constant_provisioned_concurrency_config(ctx, from_json, wait
575
623
  cli_util.render_response(result, ctx)
576
624
 
577
625
 
578
- @application_group.command(name=cli_util.override('functions_management.delete_application.command_name', 'delete'), help=u"""Deletes an application. \n[Command Reference](deleteApplication)""")
579
- @cli_util.option('--application-id', required=True, help=u"""The [OCID] of this application.""")
580
- @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.""")
581
- @cli_util.confirm_delete_option
626
+ @function_group.command(name=cli_util.override('functions_management.create_function_stream_failure_destination_details.command_name', 'create-function-stream-failure-destination-details'), help=u"""Creates a new function. \n[Command Reference](createFunction)""")
627
+ @cli_util.option('--display-name', required=True, help=u"""The display name of the function. The display name must be unique within the application containing the function. Avoid entering confidential information.""")
628
+ @cli_util.option('--application-id', required=True, help=u"""The OCID of the application this function belongs to.""")
629
+ @cli_util.option('--memory-in-mbs', required=True, type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
630
+ @cli_util.option('--failure-destination-stream-id', required=True, help=u"""The [OCID] of the stream.""")
631
+ @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
632
+ @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. If no value is specified, the digest currently associated with the image in the OCI Registry will be used. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
633
+ @cli_util.option('--source-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
634
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
635
+
636
+ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
637
+
638
+ The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
639
+ @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
640
+ @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
641
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
642
+ @cli_util.option('--success-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
643
+ @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
644
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
645
+
646
+ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
647
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
648
+
649
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
582
650
  @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
583
651
  @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.""")
584
652
  @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.""")
585
- @json_skeleton_utils.get_cli_json_input_option({})
653
+ @json_skeleton_utils.get_cli_json_input_option({'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
586
654
  @cli_util.help_option
587
655
  @click.pass_context
588
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
656
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
589
657
  @cli_util.wrap_exceptions
590
- def delete_application(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, application_id, if_match):
591
-
592
- if isinstance(application_id, six.string_types) and len(application_id.strip()) == 0:
593
- raise click.UsageError('Parameter --application-id cannot be whitespace or empty string')
658
+ def create_function_stream_failure_destination_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, application_id, memory_in_mbs, failure_destination_stream_id, image, image_digest, source_details, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, success_destination, trace_config, freeform_tags, defined_tags):
594
659
 
595
660
  kwargs = {}
596
- if if_match is not None:
597
- kwargs['if_match'] = if_match
598
661
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
662
+
663
+ _details = {}
664
+ _details['failureDestination'] = {}
665
+ _details['displayName'] = display_name
666
+ _details['applicationId'] = application_id
667
+ _details['memoryInMBs'] = memory_in_mbs
668
+ _details['failureDestination']['streamId'] = failure_destination_stream_id
669
+
670
+ if image is not None:
671
+ _details['image'] = image
672
+
673
+ if image_digest is not None:
674
+ _details['imageDigest'] = image_digest
675
+
676
+ if source_details is not None:
677
+ _details['sourceDetails'] = cli_util.parse_json_parameter("source_details", source_details)
678
+
679
+ if config is not None:
680
+ _details['config'] = cli_util.parse_json_parameter("config", config)
681
+
682
+ if timeout_in_seconds is not None:
683
+ _details['timeoutInSeconds'] = timeout_in_seconds
684
+
685
+ if provisioned_concurrency_config is not None:
686
+ _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
687
+
688
+ if detached_mode_timeout_in_seconds is not None:
689
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
690
+
691
+ if success_destination is not None:
692
+ _details['successDestination'] = cli_util.parse_json_parameter("success_destination", success_destination)
693
+
694
+ if trace_config is not None:
695
+ _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
696
+
697
+ if freeform_tags is not None:
698
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
699
+
700
+ if defined_tags is not None:
701
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
702
+
703
+ _details['failureDestination']['kind'] = 'STREAM'
704
+
599
705
  client = cli_util.build_client('functions', 'functions_management', ctx)
600
- result = client.delete_application(
601
- application_id=application_id,
706
+ result = client.create_function(
707
+ create_function_details=_details,
602
708
  **kwargs
603
709
  )
604
710
  if wait_for_state:
605
711
 
606
- if hasattr(client, 'get_application') and callable(getattr(client, 'get_application')):
712
+ if hasattr(client, 'get_function') and callable(getattr(client, 'get_function')):
607
713
  try:
608
714
  wait_period_kwargs = {}
609
715
  if max_wait_seconds is not None:
@@ -612,22 +718,10 @@ def delete_application(ctx, from_json, wait_for_state, max_wait_seconds, wait_in
612
718
  wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
613
719
 
614
720
  click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
615
- oci.wait_until(client, client.get_application(application_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
616
- except oci.exceptions.ServiceError as e:
617
- # We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
618
- # outcome of a delete operation it is possible that the resource is already gone and so the initial service call
619
- # will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
620
- # the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
621
- # succeed_on_not_found=True to the waiter).
622
- #
623
- # Any non-404 should still result in the exception being thrown.
624
- if e.status == 404:
625
- pass
626
- else:
627
- raise
721
+ result = oci.wait_until(client, client.get_function(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
628
722
  except oci.exceptions.MaximumWaitTimeExceeded as e:
629
723
  # If we fail, we should show an error, but we should still provide the information to the customer
630
- click.echo('Failed to wait until the resource entered the specified state. Please retrieve the resource to find its current state', file=sys.stderr)
724
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
631
725
  cli_util.render_response(result, ctx)
632
726
  sys.exit(2)
633
727
  except Exception:
@@ -639,30 +733,92 @@ def delete_application(ctx, from_json, wait_for_state, max_wait_seconds, wait_in
639
733
  cli_util.render_response(result, ctx)
640
734
 
641
735
 
642
- @function_group.command(name=cli_util.override('functions_management.delete_function.command_name', 'delete'), help=u"""Deletes a function. \n[Command Reference](deleteFunction)""")
643
- @cli_util.option('--function-id', required=True, help=u"""The [OCID] of this function.""")
644
- @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.""")
645
- @cli_util.confirm_delete_option
736
+ @function_group.command(name=cli_util.override('functions_management.create_function_queue_failure_destination_details.command_name', 'create-function-queue-failure-destination-details'), help=u"""Creates a new function. \n[Command Reference](createFunction)""")
737
+ @cli_util.option('--display-name', required=True, help=u"""The display name of the function. The display name must be unique within the application containing the function. Avoid entering confidential information.""")
738
+ @cli_util.option('--application-id', required=True, help=u"""The OCID of the application this function belongs to.""")
739
+ @cli_util.option('--memory-in-mbs', required=True, type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
740
+ @cli_util.option('--failure-destination-queue-id', required=True, help=u"""The [OCID] of the queue.""")
741
+ @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
742
+ @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. If no value is specified, the digest currently associated with the image in the OCI Registry will be used. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
743
+ @cli_util.option('--source-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
744
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
745
+
746
+ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
747
+
748
+ The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
749
+ @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
750
+ @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
751
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
752
+ @cli_util.option('--success-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
753
+ @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
754
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
755
+
756
+ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
757
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
758
+
759
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
760
+ @cli_util.option('--failure-destination-channel-id', help=u"""The ID of the channel in the queue.""")
646
761
  @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
647
762
  @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.""")
648
763
  @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.""")
649
- @json_skeleton_utils.get_cli_json_input_option({})
764
+ @json_skeleton_utils.get_cli_json_input_option({'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
650
765
  @cli_util.help_option
651
766
  @click.pass_context
652
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
767
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
653
768
  @cli_util.wrap_exceptions
654
- def delete_function(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, function_id, if_match):
655
-
656
- if isinstance(function_id, six.string_types) and len(function_id.strip()) == 0:
657
- raise click.UsageError('Parameter --function-id cannot be whitespace or empty string')
769
+ def create_function_queue_failure_destination_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, application_id, memory_in_mbs, failure_destination_queue_id, image, image_digest, source_details, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, success_destination, trace_config, freeform_tags, defined_tags, failure_destination_channel_id):
658
770
 
659
771
  kwargs = {}
660
- if if_match is not None:
661
- kwargs['if_match'] = if_match
662
772
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
773
+
774
+ _details = {}
775
+ _details['failureDestination'] = {}
776
+ _details['displayName'] = display_name
777
+ _details['applicationId'] = application_id
778
+ _details['memoryInMBs'] = memory_in_mbs
779
+ _details['failureDestination']['queueId'] = failure_destination_queue_id
780
+
781
+ if image is not None:
782
+ _details['image'] = image
783
+
784
+ if image_digest is not None:
785
+ _details['imageDigest'] = image_digest
786
+
787
+ if source_details is not None:
788
+ _details['sourceDetails'] = cli_util.parse_json_parameter("source_details", source_details)
789
+
790
+ if config is not None:
791
+ _details['config'] = cli_util.parse_json_parameter("config", config)
792
+
793
+ if timeout_in_seconds is not None:
794
+ _details['timeoutInSeconds'] = timeout_in_seconds
795
+
796
+ if provisioned_concurrency_config is not None:
797
+ _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
798
+
799
+ if detached_mode_timeout_in_seconds is not None:
800
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
801
+
802
+ if success_destination is not None:
803
+ _details['successDestination'] = cli_util.parse_json_parameter("success_destination", success_destination)
804
+
805
+ if trace_config is not None:
806
+ _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
807
+
808
+ if freeform_tags is not None:
809
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
810
+
811
+ if defined_tags is not None:
812
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
813
+
814
+ if failure_destination_channel_id is not None:
815
+ _details['failureDestination']['channelId'] = failure_destination_channel_id
816
+
817
+ _details['failureDestination']['kind'] = 'QUEUE'
818
+
663
819
  client = cli_util.build_client('functions', 'functions_management', ctx)
664
- result = client.delete_function(
665
- function_id=function_id,
820
+ result = client.create_function(
821
+ create_function_details=_details,
666
822
  **kwargs
667
823
  )
668
824
  if wait_for_state:
@@ -676,22 +832,10 @@ def delete_function(ctx, from_json, wait_for_state, max_wait_seconds, wait_inter
676
832
  wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
677
833
 
678
834
  click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
679
- oci.wait_until(client, client.get_function(function_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
680
- except oci.exceptions.ServiceError as e:
681
- # We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
682
- # outcome of a delete operation it is possible that the resource is already gone and so the initial service call
683
- # will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
684
- # the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
685
- # succeed_on_not_found=True to the waiter).
686
- #
687
- # Any non-404 should still result in the exception being thrown.
688
- if e.status == 404:
689
- pass
690
- else:
691
- raise
835
+ result = oci.wait_until(client, client.get_function(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
692
836
  except oci.exceptions.MaximumWaitTimeExceeded as e:
693
837
  # If we fail, we should show an error, but we should still provide the information to the customer
694
- click.echo('Failed to wait until the resource entered the specified state. Please retrieve the resource to find its current state', file=sys.stderr)
838
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
695
839
  cli_util.render_response(result, ctx)
696
840
  sys.exit(2)
697
841
  except Exception:
@@ -703,470 +847,2161 @@ def delete_function(ctx, from_json, wait_for_state, max_wait_seconds, wait_inter
703
847
  cli_util.render_response(result, ctx)
704
848
 
705
849
 
706
- @application_group.command(name=cli_util.override('functions_management.get_application.command_name', 'get'), help=u"""Retrieves an application. \n[Command Reference](getApplication)""")
707
- @cli_util.option('--application-id', required=True, help=u"""The [OCID] of this application.""")
708
- @json_skeleton_utils.get_cli_json_input_option({})
709
- @cli_util.help_option
710
- @click.pass_context
711
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'functions', 'class': 'Application'})
712
- @cli_util.wrap_exceptions
713
- def get_application(ctx, from_json, application_id):
850
+ @function_group.command(name=cli_util.override('functions_management.create_function_notification_failure_destination_details.command_name', 'create-function-notification-failure-destination-details'), help=u"""Creates a new function. \n[Command Reference](createFunction)""")
851
+ @cli_util.option('--display-name', required=True, help=u"""The display name of the function. The display name must be unique within the application containing the function. Avoid entering confidential information.""")
852
+ @cli_util.option('--application-id', required=True, help=u"""The OCID of the application this function belongs to.""")
853
+ @cli_util.option('--memory-in-mbs', required=True, type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
854
+ @cli_util.option('--failure-destination-topic-id', required=True, help=u"""The [OCID] of the topic.""")
855
+ @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
856
+ @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. If no value is specified, the digest currently associated with the image in the OCI Registry will be used. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
857
+ @cli_util.option('--source-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
858
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
714
859
 
715
- if isinstance(application_id, six.string_types) and len(application_id.strip()) == 0:
716
- raise click.UsageError('Parameter --application-id cannot be whitespace or empty string')
860
+ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
717
861
 
718
- kwargs = {}
719
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
720
- client = cli_util.build_client('functions', 'functions_management', ctx)
721
- result = client.get_application(
722
- application_id=application_id,
723
- **kwargs
724
- )
725
- cli_util.render_response(result, ctx)
862
+ The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
863
+ @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
864
+ @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
865
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
866
+ @cli_util.option('--success-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
867
+ @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
868
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
726
869
 
870
+ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
871
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
727
872
 
728
- @function_group.command(name=cli_util.override('functions_management.get_function.command_name', 'get'), help=u"""Retrieves a function. \n[Command Reference](getFunction)""")
729
- @cli_util.option('--function-id', required=True, help=u"""The [OCID] of this function.""")
730
- @json_skeleton_utils.get_cli_json_input_option({})
873
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
874
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
875
+ @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.""")
876
+ @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.""")
877
+ @json_skeleton_utils.get_cli_json_input_option({'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
731
878
  @cli_util.help_option
732
879
  @click.pass_context
733
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'functions', 'class': 'Function'})
880
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
734
881
  @cli_util.wrap_exceptions
735
- def get_function(ctx, from_json, function_id):
736
-
737
- if isinstance(function_id, six.string_types) and len(function_id.strip()) == 0:
738
- raise click.UsageError('Parameter --function-id cannot be whitespace or empty string')
882
+ def create_function_notification_failure_destination_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, application_id, memory_in_mbs, failure_destination_topic_id, image, image_digest, source_details, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, success_destination, trace_config, freeform_tags, defined_tags):
739
883
 
740
884
  kwargs = {}
741
885
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
742
- client = cli_util.build_client('functions', 'functions_management', ctx)
743
- result = client.get_function(
744
- function_id=function_id,
745
- **kwargs
746
- )
747
- cli_util.render_response(result, ctx)
748
886
 
887
+ _details = {}
888
+ _details['failureDestination'] = {}
889
+ _details['displayName'] = display_name
890
+ _details['applicationId'] = application_id
891
+ _details['memoryInMBs'] = memory_in_mbs
892
+ _details['failureDestination']['topicId'] = failure_destination_topic_id
749
893
 
750
- @pbf_listing_group.command(name=cli_util.override('functions_management.get_pbf_listing.command_name', 'get'), help=u"""Fetches a Pre-built Function(PBF) Listing. Returns a PbfListing response model. \n[Command Reference](getPbfListing)""")
751
- @cli_util.option('--pbf-listing-id', required=True, help=u"""unique PbfListing identifier""")
752
- @json_skeleton_utils.get_cli_json_input_option({})
753
- @cli_util.help_option
754
- @click.pass_context
755
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'functions', 'class': 'PbfListing'})
756
- @cli_util.wrap_exceptions
757
- def get_pbf_listing(ctx, from_json, pbf_listing_id):
894
+ if image is not None:
895
+ _details['image'] = image
758
896
 
759
- if isinstance(pbf_listing_id, six.string_types) and len(pbf_listing_id.strip()) == 0:
760
- raise click.UsageError('Parameter --pbf-listing-id cannot be whitespace or empty string')
897
+ if image_digest is not None:
898
+ _details['imageDigest'] = image_digest
761
899
 
762
- kwargs = {}
763
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
764
- client = cli_util.build_client('functions', 'functions_management', ctx)
765
- result = client.get_pbf_listing(
766
- pbf_listing_id=pbf_listing_id,
767
- **kwargs
768
- )
769
- cli_util.render_response(result, ctx)
900
+ if source_details is not None:
901
+ _details['sourceDetails'] = cli_util.parse_json_parameter("source_details", source_details)
770
902
 
903
+ if config is not None:
904
+ _details['config'] = cli_util.parse_json_parameter("config", config)
771
905
 
772
- @pbf_listing_version_group.command(name=cli_util.override('functions_management.get_pbf_listing_version.command_name', 'get'), help=u"""Gets a PbfListingVersion by identifier for a PbfListing. \n[Command Reference](getPbfListingVersion)""")
773
- @cli_util.option('--pbf-listing-version-id', required=True, help=u"""unique PbfListingVersion identifier""")
774
- @json_skeleton_utils.get_cli_json_input_option({})
775
- @cli_util.help_option
776
- @click.pass_context
777
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'functions', 'class': 'PbfListingVersion'})
778
- @cli_util.wrap_exceptions
779
- def get_pbf_listing_version(ctx, from_json, pbf_listing_version_id):
906
+ if timeout_in_seconds is not None:
907
+ _details['timeoutInSeconds'] = timeout_in_seconds
780
908
 
781
- if isinstance(pbf_listing_version_id, six.string_types) and len(pbf_listing_version_id.strip()) == 0:
782
- raise click.UsageError('Parameter --pbf-listing-version-id cannot be whitespace or empty string')
909
+ if provisioned_concurrency_config is not None:
910
+ _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
911
+
912
+ if detached_mode_timeout_in_seconds is not None:
913
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
914
+
915
+ if success_destination is not None:
916
+ _details['successDestination'] = cli_util.parse_json_parameter("success_destination", success_destination)
917
+
918
+ if trace_config is not None:
919
+ _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
920
+
921
+ if freeform_tags is not None:
922
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
923
+
924
+ if defined_tags is not None:
925
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
926
+
927
+ _details['failureDestination']['kind'] = 'NOTIFICATION'
783
928
 
784
- kwargs = {}
785
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
786
929
  client = cli_util.build_client('functions', 'functions_management', ctx)
787
- result = client.get_pbf_listing_version(
788
- pbf_listing_version_id=pbf_listing_version_id,
930
+ result = client.create_function(
931
+ create_function_details=_details,
789
932
  **kwargs
790
933
  )
934
+ if wait_for_state:
935
+
936
+ if hasattr(client, 'get_function') and callable(getattr(client, 'get_function')):
937
+ try:
938
+ wait_period_kwargs = {}
939
+ if max_wait_seconds is not None:
940
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
941
+ if wait_interval_seconds is not None:
942
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
943
+
944
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
945
+ result = oci.wait_until(client, client.get_function(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
946
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
947
+ # If we fail, we should show an error, but we should still provide the information to the customer
948
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
949
+ cli_util.render_response(result, ctx)
950
+ sys.exit(2)
951
+ except Exception:
952
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
953
+ cli_util.render_response(result, ctx)
954
+ raise
955
+ else:
956
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
791
957
  cli_util.render_response(result, ctx)
792
958
 
793
959
 
794
- @application_group.command(name=cli_util.override('functions_management.list_applications.command_name', 'list'), help=u"""Lists applications for a compartment. \n[Command Reference](listApplications)""")
795
- @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment to which this resource belongs.""")
796
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return. 1 is the minimum, 50 is the maximum.
960
+ @function_group.command(name=cli_util.override('functions_management.create_function_none_failure_destination_details.command_name', 'create-function-none-failure-destination-details'), help=u"""Creates a new function. \n[Command Reference](createFunction)""")
961
+ @cli_util.option('--display-name', required=True, help=u"""The display name of the function. The display name must be unique within the application containing the function. Avoid entering confidential information.""")
962
+ @cli_util.option('--application-id', required=True, help=u"""The OCID of the application this function belongs to.""")
963
+ @cli_util.option('--memory-in-mbs', required=True, type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
964
+ @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
965
+ @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. If no value is specified, the digest currently associated with the image in the OCI Registry will be used. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
966
+ @cli_util.option('--source-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
967
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
797
968
 
798
- Default: 10""")
799
- @cli_util.option('--page', help=u"""The pagination token for a list query returned by a previous operation""")
800
- @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only applications that match the lifecycle state in this parameter. Example: `Creating`""")
801
- @cli_util.option('--display-name', help=u"""A filter to return only applications with display names that match the display name string. Matching is exact.""")
802
- @cli_util.option('--id', help=u"""A filter to return only applications with the specified OCID.""")
803
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order.
969
+ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
804
970
 
805
- * **ASC:** Ascending sort order. * **DESC:** Descending sort order.""")
806
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "id", "displayName"]), help=u"""Specifies the attribute with which to sort the rules.
971
+ The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
972
+ @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
973
+ @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
974
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
975
+ @cli_util.option('--success-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
976
+ @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
977
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
807
978
 
808
- Default: `displayName`
979
+ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
980
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
809
981
 
810
- * **timeCreated:** Sorts by timeCreated. * **displayName:** Sorts by displayName. * **id:** Sorts by id.""")
811
- @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.""")
812
- @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.""")
813
- @json_skeleton_utils.get_cli_json_input_option({})
982
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
983
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
984
+ @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.""")
985
+ @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.""")
986
+ @json_skeleton_utils.get_cli_json_input_option({'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
814
987
  @cli_util.help_option
815
988
  @click.pass_context
816
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'functions', 'class': 'list[ApplicationSummary]'})
989
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
817
990
  @cli_util.wrap_exceptions
818
- def list_applications(ctx, from_json, all_pages, page_size, compartment_id, limit, page, lifecycle_state, display_name, id, sort_order, sort_by):
819
-
820
- if all_pages and limit:
821
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
991
+ def create_function_none_failure_destination_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, application_id, memory_in_mbs, image, image_digest, source_details, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, success_destination, trace_config, freeform_tags, defined_tags):
822
992
 
823
993
  kwargs = {}
824
- if limit is not None:
825
- kwargs['limit'] = limit
826
- if page is not None:
827
- kwargs['page'] = page
828
- if lifecycle_state is not None:
829
- kwargs['lifecycle_state'] = lifecycle_state
830
- if display_name is not None:
831
- kwargs['display_name'] = display_name
832
- if id is not None:
833
- kwargs['id'] = id
834
- if sort_order is not None:
835
- kwargs['sort_order'] = sort_order
836
- if sort_by is not None:
837
- kwargs['sort_by'] = sort_by
838
994
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
839
- client = cli_util.build_client('functions', 'functions_management', ctx)
840
- if all_pages:
841
- if page_size:
842
- kwargs['limit'] = page_size
843
995
 
844
- result = cli_util.list_call_get_all_results(
845
- client.list_applications,
846
- compartment_id=compartment_id,
847
- **kwargs
848
- )
849
- elif limit is not None:
850
- result = cli_util.list_call_get_up_to_limit(
851
- client.list_applications,
852
- limit,
853
- page_size,
854
- compartment_id=compartment_id,
855
- **kwargs
856
- )
857
- else:
858
- result = client.list_applications(
859
- compartment_id=compartment_id,
860
- **kwargs
861
- )
862
- cli_util.render_response(result, ctx)
996
+ _details = {}
997
+ _details['failureDestination'] = {}
998
+ _details['displayName'] = display_name
999
+ _details['applicationId'] = application_id
1000
+ _details['memoryInMBs'] = memory_in_mbs
863
1001
 
1002
+ if image is not None:
1003
+ _details['image'] = image
864
1004
 
865
- @function_group.command(name=cli_util.override('functions_management.list_functions.command_name', 'list'), help=u"""Lists functions for an application. \n[Command Reference](listFunctions)""")
866
- @cli_util.option('--application-id', required=True, help=u"""The [OCID] of the application to which this function belongs.""")
867
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return. 1 is the minimum, 50 is the maximum.
1005
+ if image_digest is not None:
1006
+ _details['imageDigest'] = image_digest
868
1007
 
869
- Default: 10""")
870
- @cli_util.option('--page', help=u"""The pagination token for a list query returned by a previous operation""")
871
- @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only functions that match the lifecycle state in this parameter. Example: `Creating`""")
872
- @cli_util.option('--display-name', help=u"""A filter to return only functions with display names that match the display name string. Matching is exact.""")
873
- @cli_util.option('--id', help=u"""A filter to return only functions with the specified OCID.""")
874
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order.
1008
+ if source_details is not None:
1009
+ _details['sourceDetails'] = cli_util.parse_json_parameter("source_details", source_details)
875
1010
 
876
- * **ASC:** Ascending sort order. * **DESC:** Descending sort order.""")
877
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "id", "displayName"]), help=u"""Specifies the attribute with which to sort the rules.
1011
+ if config is not None:
1012
+ _details['config'] = cli_util.parse_json_parameter("config", config)
878
1013
 
879
- Default: `displayName`
1014
+ if timeout_in_seconds is not None:
1015
+ _details['timeoutInSeconds'] = timeout_in_seconds
880
1016
 
881
- * **timeCreated:** Sorts by timeCreated. * **displayName:** Sorts by displayName. * **id:** Sorts by id.""")
882
- @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.""")
883
- @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.""")
884
- @json_skeleton_utils.get_cli_json_input_option({})
885
- @cli_util.help_option
886
- @click.pass_context
887
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'functions', 'class': 'list[FunctionSummary]'})
888
- @cli_util.wrap_exceptions
889
- def list_functions(ctx, from_json, all_pages, page_size, application_id, limit, page, lifecycle_state, display_name, id, sort_order, sort_by):
1017
+ if provisioned_concurrency_config is not None:
1018
+ _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
890
1019
 
891
- if all_pages and limit:
892
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
1020
+ if detached_mode_timeout_in_seconds is not None:
1021
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
893
1022
 
894
- kwargs = {}
895
- if limit is not None:
896
- kwargs['limit'] = limit
897
- if page is not None:
898
- kwargs['page'] = page
899
- if lifecycle_state is not None:
900
- kwargs['lifecycle_state'] = lifecycle_state
901
- if display_name is not None:
902
- kwargs['display_name'] = display_name
903
- if id is not None:
904
- kwargs['id'] = id
905
- if sort_order is not None:
906
- kwargs['sort_order'] = sort_order
907
- if sort_by is not None:
908
- kwargs['sort_by'] = sort_by
909
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
910
- client = cli_util.build_client('functions', 'functions_management', ctx)
911
- if all_pages:
912
- if page_size:
913
- kwargs['limit'] = page_size
1023
+ if success_destination is not None:
1024
+ _details['successDestination'] = cli_util.parse_json_parameter("success_destination", success_destination)
914
1025
 
915
- result = cli_util.list_call_get_all_results(
916
- client.list_functions,
917
- application_id=application_id,
918
- **kwargs
919
- )
920
- elif limit is not None:
921
- result = cli_util.list_call_get_up_to_limit(
922
- client.list_functions,
923
- limit,
924
- page_size,
925
- application_id=application_id,
926
- **kwargs
927
- )
928
- else:
929
- result = client.list_functions(
930
- application_id=application_id,
931
- **kwargs
932
- )
933
- cli_util.render_response(result, ctx)
1026
+ if trace_config is not None:
1027
+ _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
934
1028
 
1029
+ if freeform_tags is not None:
1030
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
935
1031
 
936
- @pbf_listing_version_group.command(name=cli_util.override('functions_management.list_pbf_listing_versions.command_name', 'list'), help=u"""Fetches a wrapped list of all Pre-built Function(PBF) Listing versions. Returns a PbfListingVersionCollection containing an array of PbfListingVersionSummary response models.
1032
+ if defined_tags is not None:
1033
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
937
1034
 
938
- Note that the PbfListingIdentifier must be provided as a query parameter, otherwise an exception shall be thrown. \n[Command Reference](listPbfListingVersions)""")
939
- @cli_util.option('--pbf-listing-id', required=True, help=u"""unique PbfListing identifier""")
940
- @cli_util.option('--pbf-listing-version-id', help=u"""unique PbfListingVersion identifier""")
941
- @cli_util.option('--name', help=u"""Matches a PbfListingVersion based on a provided semantic version name for a PbfListingVersion. Each PbfListingVersion name is unique with respect to its associated PbfListing.""")
942
- @cli_util.option('--is-current-version', type=click.BOOL, help=u"""Matches the current version (the most recently added version with an Active lifecycleState) associated with a PbfListing.""")
943
- @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "INACTIVE", "DELETED"]), help=u"""A filter to return only resources their lifecycleState matches the given lifecycleState.""")
944
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return. 1 is the minimum, 50 is the maximum.
1035
+ _details['failureDestination']['kind'] = 'NONE'
945
1036
 
946
- Default: 10""")
947
- @cli_util.option('--page', help=u"""The pagination token for a list query returned by a previous operation""")
948
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order.
1037
+ client = cli_util.build_client('functions', 'functions_management', ctx)
1038
+ result = client.create_function(
1039
+ create_function_details=_details,
1040
+ **kwargs
1041
+ )
1042
+ if wait_for_state:
949
1043
 
950
- * **ASC:** Ascending sort order. * **DESC:** Descending sort order.""")
951
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "name"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for name is ascending.""")
952
- @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.""")
953
- @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.""")
954
- @json_skeleton_utils.get_cli_json_input_option({})
955
- @cli_util.help_option
956
- @click.pass_context
1044
+ if hasattr(client, 'get_function') and callable(getattr(client, 'get_function')):
1045
+ try:
1046
+ wait_period_kwargs = {}
1047
+ if max_wait_seconds is not None:
1048
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1049
+ if wait_interval_seconds is not None:
1050
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1051
+
1052
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
1053
+ result = oci.wait_until(client, client.get_function(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
1054
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1055
+ # If we fail, we should show an error, but we should still provide the information to the customer
1056
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
1057
+ cli_util.render_response(result, ctx)
1058
+ sys.exit(2)
1059
+ except Exception:
1060
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
1061
+ cli_util.render_response(result, ctx)
1062
+ raise
1063
+ else:
1064
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1065
+ cli_util.render_response(result, ctx)
1066
+
1067
+
1068
+ @function_group.command(name=cli_util.override('functions_management.create_function_stream_success_destination_details.command_name', 'create-function-stream-success-destination-details'), help=u"""Creates a new function. \n[Command Reference](createFunction)""")
1069
+ @cli_util.option('--display-name', required=True, help=u"""The display name of the function. The display name must be unique within the application containing the function. Avoid entering confidential information.""")
1070
+ @cli_util.option('--application-id', required=True, help=u"""The OCID of the application this function belongs to.""")
1071
+ @cli_util.option('--memory-in-mbs', required=True, type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
1072
+ @cli_util.option('--success-destination-stream-id', required=True, help=u"""The [OCID] of the stream.""")
1073
+ @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
1074
+ @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. If no value is specified, the digest currently associated with the image in the OCI Registry will be used. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
1075
+ @cli_util.option('--source-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1076
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
1077
+
1078
+ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
1079
+
1080
+ The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1081
+ @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
1082
+ @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1083
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
1084
+ @cli_util.option('--failure-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1085
+ @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1086
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
1087
+
1088
+ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1089
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
1090
+
1091
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1092
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1093
+ @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.""")
1094
+ @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.""")
1095
+ @json_skeleton_utils.get_cli_json_input_option({'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
1096
+ @cli_util.help_option
1097
+ @click.pass_context
1098
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
1099
+ @cli_util.wrap_exceptions
1100
+ def create_function_stream_success_destination_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, application_id, memory_in_mbs, success_destination_stream_id, image, image_digest, source_details, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, failure_destination, trace_config, freeform_tags, defined_tags):
1101
+
1102
+ kwargs = {}
1103
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1104
+
1105
+ _details = {}
1106
+ _details['successDestination'] = {}
1107
+ _details['displayName'] = display_name
1108
+ _details['applicationId'] = application_id
1109
+ _details['memoryInMBs'] = memory_in_mbs
1110
+ _details['successDestination']['streamId'] = success_destination_stream_id
1111
+
1112
+ if image is not None:
1113
+ _details['image'] = image
1114
+
1115
+ if image_digest is not None:
1116
+ _details['imageDigest'] = image_digest
1117
+
1118
+ if source_details is not None:
1119
+ _details['sourceDetails'] = cli_util.parse_json_parameter("source_details", source_details)
1120
+
1121
+ if config is not None:
1122
+ _details['config'] = cli_util.parse_json_parameter("config", config)
1123
+
1124
+ if timeout_in_seconds is not None:
1125
+ _details['timeoutInSeconds'] = timeout_in_seconds
1126
+
1127
+ if provisioned_concurrency_config is not None:
1128
+ _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
1129
+
1130
+ if detached_mode_timeout_in_seconds is not None:
1131
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
1132
+
1133
+ if failure_destination is not None:
1134
+ _details['failureDestination'] = cli_util.parse_json_parameter("failure_destination", failure_destination)
1135
+
1136
+ if trace_config is not None:
1137
+ _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
1138
+
1139
+ if freeform_tags is not None:
1140
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
1141
+
1142
+ if defined_tags is not None:
1143
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1144
+
1145
+ _details['successDestination']['kind'] = 'STREAM'
1146
+
1147
+ client = cli_util.build_client('functions', 'functions_management', ctx)
1148
+ result = client.create_function(
1149
+ create_function_details=_details,
1150
+ **kwargs
1151
+ )
1152
+ if wait_for_state:
1153
+
1154
+ if hasattr(client, 'get_function') and callable(getattr(client, 'get_function')):
1155
+ try:
1156
+ wait_period_kwargs = {}
1157
+ if max_wait_seconds is not None:
1158
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1159
+ if wait_interval_seconds is not None:
1160
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1161
+
1162
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
1163
+ result = oci.wait_until(client, client.get_function(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
1164
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1165
+ # If we fail, we should show an error, but we should still provide the information to the customer
1166
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
1167
+ cli_util.render_response(result, ctx)
1168
+ sys.exit(2)
1169
+ except Exception:
1170
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
1171
+ cli_util.render_response(result, ctx)
1172
+ raise
1173
+ else:
1174
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1175
+ cli_util.render_response(result, ctx)
1176
+
1177
+
1178
+ @function_group.command(name=cli_util.override('functions_management.create_function_notification_success_destination_details.command_name', 'create-function-notification-success-destination-details'), help=u"""Creates a new function. \n[Command Reference](createFunction)""")
1179
+ @cli_util.option('--display-name', required=True, help=u"""The display name of the function. The display name must be unique within the application containing the function. Avoid entering confidential information.""")
1180
+ @cli_util.option('--application-id', required=True, help=u"""The OCID of the application this function belongs to.""")
1181
+ @cli_util.option('--memory-in-mbs', required=True, type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
1182
+ @cli_util.option('--success-destination-topic-id', required=True, help=u"""The [OCID] of the topic.""")
1183
+ @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
1184
+ @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. If no value is specified, the digest currently associated with the image in the OCI Registry will be used. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
1185
+ @cli_util.option('--source-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1186
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
1187
+
1188
+ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
1189
+
1190
+ The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1191
+ @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
1192
+ @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1193
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
1194
+ @cli_util.option('--failure-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1195
+ @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1196
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
1197
+
1198
+ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1199
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
1200
+
1201
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1202
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1203
+ @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.""")
1204
+ @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.""")
1205
+ @json_skeleton_utils.get_cli_json_input_option({'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
1206
+ @cli_util.help_option
1207
+ @click.pass_context
1208
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
1209
+ @cli_util.wrap_exceptions
1210
+ def create_function_notification_success_destination_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, application_id, memory_in_mbs, success_destination_topic_id, image, image_digest, source_details, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, failure_destination, trace_config, freeform_tags, defined_tags):
1211
+
1212
+ kwargs = {}
1213
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1214
+
1215
+ _details = {}
1216
+ _details['successDestination'] = {}
1217
+ _details['displayName'] = display_name
1218
+ _details['applicationId'] = application_id
1219
+ _details['memoryInMBs'] = memory_in_mbs
1220
+ _details['successDestination']['topicId'] = success_destination_topic_id
1221
+
1222
+ if image is not None:
1223
+ _details['image'] = image
1224
+
1225
+ if image_digest is not None:
1226
+ _details['imageDigest'] = image_digest
1227
+
1228
+ if source_details is not None:
1229
+ _details['sourceDetails'] = cli_util.parse_json_parameter("source_details", source_details)
1230
+
1231
+ if config is not None:
1232
+ _details['config'] = cli_util.parse_json_parameter("config", config)
1233
+
1234
+ if timeout_in_seconds is not None:
1235
+ _details['timeoutInSeconds'] = timeout_in_seconds
1236
+
1237
+ if provisioned_concurrency_config is not None:
1238
+ _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
1239
+
1240
+ if detached_mode_timeout_in_seconds is not None:
1241
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
1242
+
1243
+ if failure_destination is not None:
1244
+ _details['failureDestination'] = cli_util.parse_json_parameter("failure_destination", failure_destination)
1245
+
1246
+ if trace_config is not None:
1247
+ _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
1248
+
1249
+ if freeform_tags is not None:
1250
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
1251
+
1252
+ if defined_tags is not None:
1253
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1254
+
1255
+ _details['successDestination']['kind'] = 'NOTIFICATION'
1256
+
1257
+ client = cli_util.build_client('functions', 'functions_management', ctx)
1258
+ result = client.create_function(
1259
+ create_function_details=_details,
1260
+ **kwargs
1261
+ )
1262
+ if wait_for_state:
1263
+
1264
+ if hasattr(client, 'get_function') and callable(getattr(client, 'get_function')):
1265
+ try:
1266
+ wait_period_kwargs = {}
1267
+ if max_wait_seconds is not None:
1268
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1269
+ if wait_interval_seconds is not None:
1270
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1271
+
1272
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
1273
+ result = oci.wait_until(client, client.get_function(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
1274
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1275
+ # If we fail, we should show an error, but we should still provide the information to the customer
1276
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
1277
+ cli_util.render_response(result, ctx)
1278
+ sys.exit(2)
1279
+ except Exception:
1280
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
1281
+ cli_util.render_response(result, ctx)
1282
+ raise
1283
+ else:
1284
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1285
+ cli_util.render_response(result, ctx)
1286
+
1287
+
1288
+ @function_group.command(name=cli_util.override('functions_management.create_function_queue_success_destination_details.command_name', 'create-function-queue-success-destination-details'), help=u"""Creates a new function. \n[Command Reference](createFunction)""")
1289
+ @cli_util.option('--display-name', required=True, help=u"""The display name of the function. The display name must be unique within the application containing the function. Avoid entering confidential information.""")
1290
+ @cli_util.option('--application-id', required=True, help=u"""The OCID of the application this function belongs to.""")
1291
+ @cli_util.option('--memory-in-mbs', required=True, type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
1292
+ @cli_util.option('--success-destination-queue-id', required=True, help=u"""The [OCID] of the queue.""")
1293
+ @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
1294
+ @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. If no value is specified, the digest currently associated with the image in the OCI Registry will be used. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
1295
+ @cli_util.option('--source-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1296
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
1297
+
1298
+ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
1299
+
1300
+ The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1301
+ @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
1302
+ @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1303
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
1304
+ @cli_util.option('--failure-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1305
+ @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1306
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
1307
+
1308
+ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1309
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
1310
+
1311
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1312
+ @cli_util.option('--success-destination-channel-id', help=u"""The ID of the channel in the queue.""")
1313
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1314
+ @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.""")
1315
+ @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.""")
1316
+ @json_skeleton_utils.get_cli_json_input_option({'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
1317
+ @cli_util.help_option
1318
+ @click.pass_context
1319
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
1320
+ @cli_util.wrap_exceptions
1321
+ def create_function_queue_success_destination_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, application_id, memory_in_mbs, success_destination_queue_id, image, image_digest, source_details, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, failure_destination, trace_config, freeform_tags, defined_tags, success_destination_channel_id):
1322
+
1323
+ kwargs = {}
1324
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1325
+
1326
+ _details = {}
1327
+ _details['successDestination'] = {}
1328
+ _details['displayName'] = display_name
1329
+ _details['applicationId'] = application_id
1330
+ _details['memoryInMBs'] = memory_in_mbs
1331
+ _details['successDestination']['queueId'] = success_destination_queue_id
1332
+
1333
+ if image is not None:
1334
+ _details['image'] = image
1335
+
1336
+ if image_digest is not None:
1337
+ _details['imageDigest'] = image_digest
1338
+
1339
+ if source_details is not None:
1340
+ _details['sourceDetails'] = cli_util.parse_json_parameter("source_details", source_details)
1341
+
1342
+ if config is not None:
1343
+ _details['config'] = cli_util.parse_json_parameter("config", config)
1344
+
1345
+ if timeout_in_seconds is not None:
1346
+ _details['timeoutInSeconds'] = timeout_in_seconds
1347
+
1348
+ if provisioned_concurrency_config is not None:
1349
+ _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
1350
+
1351
+ if detached_mode_timeout_in_seconds is not None:
1352
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
1353
+
1354
+ if failure_destination is not None:
1355
+ _details['failureDestination'] = cli_util.parse_json_parameter("failure_destination", failure_destination)
1356
+
1357
+ if trace_config is not None:
1358
+ _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
1359
+
1360
+ if freeform_tags is not None:
1361
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
1362
+
1363
+ if defined_tags is not None:
1364
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1365
+
1366
+ if success_destination_channel_id is not None:
1367
+ _details['successDestination']['channelId'] = success_destination_channel_id
1368
+
1369
+ _details['successDestination']['kind'] = 'QUEUE'
1370
+
1371
+ client = cli_util.build_client('functions', 'functions_management', ctx)
1372
+ result = client.create_function(
1373
+ create_function_details=_details,
1374
+ **kwargs
1375
+ )
1376
+ if wait_for_state:
1377
+
1378
+ if hasattr(client, 'get_function') and callable(getattr(client, 'get_function')):
1379
+ try:
1380
+ wait_period_kwargs = {}
1381
+ if max_wait_seconds is not None:
1382
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1383
+ if wait_interval_seconds is not None:
1384
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1385
+
1386
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
1387
+ result = oci.wait_until(client, client.get_function(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
1388
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1389
+ # If we fail, we should show an error, but we should still provide the information to the customer
1390
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
1391
+ cli_util.render_response(result, ctx)
1392
+ sys.exit(2)
1393
+ except Exception:
1394
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
1395
+ cli_util.render_response(result, ctx)
1396
+ raise
1397
+ else:
1398
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1399
+ cli_util.render_response(result, ctx)
1400
+
1401
+
1402
+ @function_group.command(name=cli_util.override('functions_management.create_function_none_success_destination_details.command_name', 'create-function-none-success-destination-details'), help=u"""Creates a new function. \n[Command Reference](createFunction)""")
1403
+ @cli_util.option('--display-name', required=True, help=u"""The display name of the function. The display name must be unique within the application containing the function. Avoid entering confidential information.""")
1404
+ @cli_util.option('--application-id', required=True, help=u"""The OCID of the application this function belongs to.""")
1405
+ @cli_util.option('--memory-in-mbs', required=True, type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
1406
+ @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
1407
+ @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. If no value is specified, the digest currently associated with the image in the OCI Registry will be used. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
1408
+ @cli_util.option('--source-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1409
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
1410
+
1411
+ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
1412
+
1413
+ The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1414
+ @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
1415
+ @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1416
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
1417
+ @cli_util.option('--failure-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1418
+ @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1419
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
1420
+
1421
+ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1422
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
1423
+
1424
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1425
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1426
+ @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.""")
1427
+ @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.""")
1428
+ @json_skeleton_utils.get_cli_json_input_option({'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
1429
+ @cli_util.help_option
1430
+ @click.pass_context
1431
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'source-details': {'module': 'functions', 'class': 'FunctionSourceDetails'}, 'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
1432
+ @cli_util.wrap_exceptions
1433
+ def create_function_none_success_destination_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, application_id, memory_in_mbs, image, image_digest, source_details, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, failure_destination, trace_config, freeform_tags, defined_tags):
1434
+
1435
+ kwargs = {}
1436
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1437
+
1438
+ _details = {}
1439
+ _details['successDestination'] = {}
1440
+ _details['displayName'] = display_name
1441
+ _details['applicationId'] = application_id
1442
+ _details['memoryInMBs'] = memory_in_mbs
1443
+
1444
+ if image is not None:
1445
+ _details['image'] = image
1446
+
1447
+ if image_digest is not None:
1448
+ _details['imageDigest'] = image_digest
1449
+
1450
+ if source_details is not None:
1451
+ _details['sourceDetails'] = cli_util.parse_json_parameter("source_details", source_details)
1452
+
1453
+ if config is not None:
1454
+ _details['config'] = cli_util.parse_json_parameter("config", config)
1455
+
1456
+ if timeout_in_seconds is not None:
1457
+ _details['timeoutInSeconds'] = timeout_in_seconds
1458
+
1459
+ if provisioned_concurrency_config is not None:
1460
+ _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
1461
+
1462
+ if detached_mode_timeout_in_seconds is not None:
1463
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
1464
+
1465
+ if failure_destination is not None:
1466
+ _details['failureDestination'] = cli_util.parse_json_parameter("failure_destination", failure_destination)
1467
+
1468
+ if trace_config is not None:
1469
+ _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
1470
+
1471
+ if freeform_tags is not None:
1472
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
1473
+
1474
+ if defined_tags is not None:
1475
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1476
+
1477
+ _details['successDestination']['kind'] = 'NONE'
1478
+
1479
+ client = cli_util.build_client('functions', 'functions_management', ctx)
1480
+ result = client.create_function(
1481
+ create_function_details=_details,
1482
+ **kwargs
1483
+ )
1484
+ if wait_for_state:
1485
+
1486
+ if hasattr(client, 'get_function') and callable(getattr(client, 'get_function')):
1487
+ try:
1488
+ wait_period_kwargs = {}
1489
+ if max_wait_seconds is not None:
1490
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1491
+ if wait_interval_seconds is not None:
1492
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1493
+
1494
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
1495
+ result = oci.wait_until(client, client.get_function(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
1496
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1497
+ # If we fail, we should show an error, but we should still provide the information to the customer
1498
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
1499
+ cli_util.render_response(result, ctx)
1500
+ sys.exit(2)
1501
+ except Exception:
1502
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
1503
+ cli_util.render_response(result, ctx)
1504
+ raise
1505
+ else:
1506
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1507
+ cli_util.render_response(result, ctx)
1508
+
1509
+
1510
+ @application_group.command(name=cli_util.override('functions_management.delete_application.command_name', 'delete'), help=u"""Deletes an application. \n[Command Reference](deleteApplication)""")
1511
+ @cli_util.option('--application-id', required=True, help=u"""The [OCID] of this application.""")
1512
+ @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.""")
1513
+ @cli_util.confirm_delete_option
1514
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1515
+ @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.""")
1516
+ @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.""")
1517
+ @json_skeleton_utils.get_cli_json_input_option({})
1518
+ @cli_util.help_option
1519
+ @click.pass_context
1520
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
1521
+ @cli_util.wrap_exceptions
1522
+ def delete_application(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, application_id, if_match):
1523
+
1524
+ if isinstance(application_id, six.string_types) and len(application_id.strip()) == 0:
1525
+ raise click.UsageError('Parameter --application-id cannot be whitespace or empty string')
1526
+
1527
+ kwargs = {}
1528
+ if if_match is not None:
1529
+ kwargs['if_match'] = if_match
1530
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1531
+ client = cli_util.build_client('functions', 'functions_management', ctx)
1532
+ result = client.delete_application(
1533
+ application_id=application_id,
1534
+ **kwargs
1535
+ )
1536
+ if wait_for_state:
1537
+
1538
+ if hasattr(client, 'get_application') and callable(getattr(client, 'get_application')):
1539
+ try:
1540
+ wait_period_kwargs = {}
1541
+ if max_wait_seconds is not None:
1542
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1543
+ if wait_interval_seconds is not None:
1544
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1545
+
1546
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
1547
+ oci.wait_until(client, client.get_application(application_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
1548
+ except oci.exceptions.ServiceError as e:
1549
+ # We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
1550
+ # outcome of a delete operation it is possible that the resource is already gone and so the initial service call
1551
+ # will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
1552
+ # the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
1553
+ # succeed_on_not_found=True to the waiter).
1554
+ #
1555
+ # Any non-404 should still result in the exception being thrown.
1556
+ if e.status == 404:
1557
+ pass
1558
+ else:
1559
+ raise
1560
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1561
+ # If we fail, we should show an error, but we should still provide the information to the customer
1562
+ click.echo('Failed to wait until the resource entered the specified state. Please retrieve the resource to find its current state', file=sys.stderr)
1563
+ cli_util.render_response(result, ctx)
1564
+ sys.exit(2)
1565
+ except Exception:
1566
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
1567
+ cli_util.render_response(result, ctx)
1568
+ raise
1569
+ else:
1570
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1571
+ cli_util.render_response(result, ctx)
1572
+
1573
+
1574
+ @function_group.command(name=cli_util.override('functions_management.delete_function.command_name', 'delete'), help=u"""Deletes a function. \n[Command Reference](deleteFunction)""")
1575
+ @cli_util.option('--function-id', required=True, help=u"""The [OCID] of this function.""")
1576
+ @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.""")
1577
+ @cli_util.confirm_delete_option
1578
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1579
+ @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.""")
1580
+ @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.""")
1581
+ @json_skeleton_utils.get_cli_json_input_option({})
1582
+ @cli_util.help_option
1583
+ @click.pass_context
1584
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
1585
+ @cli_util.wrap_exceptions
1586
+ def delete_function(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, function_id, if_match):
1587
+
1588
+ if isinstance(function_id, six.string_types) and len(function_id.strip()) == 0:
1589
+ raise click.UsageError('Parameter --function-id cannot be whitespace or empty string')
1590
+
1591
+ kwargs = {}
1592
+ if if_match is not None:
1593
+ kwargs['if_match'] = if_match
1594
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1595
+ client = cli_util.build_client('functions', 'functions_management', ctx)
1596
+ result = client.delete_function(
1597
+ function_id=function_id,
1598
+ **kwargs
1599
+ )
1600
+ if wait_for_state:
1601
+
1602
+ if hasattr(client, 'get_function') and callable(getattr(client, 'get_function')):
1603
+ try:
1604
+ wait_period_kwargs = {}
1605
+ if max_wait_seconds is not None:
1606
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1607
+ if wait_interval_seconds is not None:
1608
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1609
+
1610
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
1611
+ oci.wait_until(client, client.get_function(function_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
1612
+ except oci.exceptions.ServiceError as e:
1613
+ # We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
1614
+ # outcome of a delete operation it is possible that the resource is already gone and so the initial service call
1615
+ # will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
1616
+ # the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
1617
+ # succeed_on_not_found=True to the waiter).
1618
+ #
1619
+ # Any non-404 should still result in the exception being thrown.
1620
+ if e.status == 404:
1621
+ pass
1622
+ else:
1623
+ raise
1624
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
1625
+ # If we fail, we should show an error, but we should still provide the information to the customer
1626
+ click.echo('Failed to wait until the resource entered the specified state. Please retrieve the resource to find its current state', file=sys.stderr)
1627
+ cli_util.render_response(result, ctx)
1628
+ sys.exit(2)
1629
+ except Exception:
1630
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
1631
+ cli_util.render_response(result, ctx)
1632
+ raise
1633
+ else:
1634
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1635
+ cli_util.render_response(result, ctx)
1636
+
1637
+
1638
+ @application_group.command(name=cli_util.override('functions_management.get_application.command_name', 'get'), help=u"""Retrieves an application. \n[Command Reference](getApplication)""")
1639
+ @cli_util.option('--application-id', required=True, help=u"""The [OCID] of this application.""")
1640
+ @json_skeleton_utils.get_cli_json_input_option({})
1641
+ @cli_util.help_option
1642
+ @click.pass_context
1643
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'functions', 'class': 'Application'})
1644
+ @cli_util.wrap_exceptions
1645
+ def get_application(ctx, from_json, application_id):
1646
+
1647
+ if isinstance(application_id, six.string_types) and len(application_id.strip()) == 0:
1648
+ raise click.UsageError('Parameter --application-id cannot be whitespace or empty string')
1649
+
1650
+ kwargs = {}
1651
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1652
+ client = cli_util.build_client('functions', 'functions_management', ctx)
1653
+ result = client.get_application(
1654
+ application_id=application_id,
1655
+ **kwargs
1656
+ )
1657
+ cli_util.render_response(result, ctx)
1658
+
1659
+
1660
+ @function_group.command(name=cli_util.override('functions_management.get_function.command_name', 'get'), help=u"""Retrieves a function. \n[Command Reference](getFunction)""")
1661
+ @cli_util.option('--function-id', required=True, help=u"""The [OCID] of this function.""")
1662
+ @json_skeleton_utils.get_cli_json_input_option({})
1663
+ @cli_util.help_option
1664
+ @click.pass_context
1665
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'functions', 'class': 'Function'})
1666
+ @cli_util.wrap_exceptions
1667
+ def get_function(ctx, from_json, function_id):
1668
+
1669
+ if isinstance(function_id, six.string_types) and len(function_id.strip()) == 0:
1670
+ raise click.UsageError('Parameter --function-id cannot be whitespace or empty string')
1671
+
1672
+ kwargs = {}
1673
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1674
+ client = cli_util.build_client('functions', 'functions_management', ctx)
1675
+ result = client.get_function(
1676
+ function_id=function_id,
1677
+ **kwargs
1678
+ )
1679
+ cli_util.render_response(result, ctx)
1680
+
1681
+
1682
+ @pbf_listing_group.command(name=cli_util.override('functions_management.get_pbf_listing.command_name', 'get'), help=u"""Fetches a Pre-built Function(PBF) Listing. Returns a PbfListing response model. \n[Command Reference](getPbfListing)""")
1683
+ @cli_util.option('--pbf-listing-id', required=True, help=u"""unique PbfListing identifier""")
1684
+ @json_skeleton_utils.get_cli_json_input_option({})
1685
+ @cli_util.help_option
1686
+ @click.pass_context
1687
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'functions', 'class': 'PbfListing'})
1688
+ @cli_util.wrap_exceptions
1689
+ def get_pbf_listing(ctx, from_json, pbf_listing_id):
1690
+
1691
+ if isinstance(pbf_listing_id, six.string_types) and len(pbf_listing_id.strip()) == 0:
1692
+ raise click.UsageError('Parameter --pbf-listing-id cannot be whitespace or empty string')
1693
+
1694
+ kwargs = {}
1695
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1696
+ client = cli_util.build_client('functions', 'functions_management', ctx)
1697
+ result = client.get_pbf_listing(
1698
+ pbf_listing_id=pbf_listing_id,
1699
+ **kwargs
1700
+ )
1701
+ cli_util.render_response(result, ctx)
1702
+
1703
+
1704
+ @pbf_listing_version_group.command(name=cli_util.override('functions_management.get_pbf_listing_version.command_name', 'get'), help=u"""Gets a PbfListingVersion by identifier for a PbfListing. \n[Command Reference](getPbfListingVersion)""")
1705
+ @cli_util.option('--pbf-listing-version-id', required=True, help=u"""unique PbfListingVersion identifier""")
1706
+ @json_skeleton_utils.get_cli_json_input_option({})
1707
+ @cli_util.help_option
1708
+ @click.pass_context
1709
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'functions', 'class': 'PbfListingVersion'})
1710
+ @cli_util.wrap_exceptions
1711
+ def get_pbf_listing_version(ctx, from_json, pbf_listing_version_id):
1712
+
1713
+ if isinstance(pbf_listing_version_id, six.string_types) and len(pbf_listing_version_id.strip()) == 0:
1714
+ raise click.UsageError('Parameter --pbf-listing-version-id cannot be whitespace or empty string')
1715
+
1716
+ kwargs = {}
1717
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1718
+ client = cli_util.build_client('functions', 'functions_management', ctx)
1719
+ result = client.get_pbf_listing_version(
1720
+ pbf_listing_version_id=pbf_listing_version_id,
1721
+ **kwargs
1722
+ )
1723
+ cli_util.render_response(result, ctx)
1724
+
1725
+
1726
+ @application_group.command(name=cli_util.override('functions_management.list_applications.command_name', 'list'), help=u"""Lists applications for a compartment. \n[Command Reference](listApplications)""")
1727
+ @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment to which this resource belongs.""")
1728
+ @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return. 1 is the minimum, 50 is the maximum.
1729
+
1730
+ Default: 10""")
1731
+ @cli_util.option('--page', help=u"""The pagination token for a list query returned by a previous operation""")
1732
+ @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only applications that match the lifecycle state in this parameter. Example: `Creating`""")
1733
+ @cli_util.option('--display-name', help=u"""A filter to return only applications with display names that match the display name string. Matching is exact.""")
1734
+ @cli_util.option('--id', help=u"""A filter to return only applications with the specified OCID.""")
1735
+ @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order.
1736
+
1737
+ * **ASC:** Ascending sort order. * **DESC:** Descending sort order.""")
1738
+ @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "id", "displayName"]), help=u"""Specifies the attribute with which to sort the rules.
1739
+
1740
+ Default: `displayName`
1741
+
1742
+ * **timeCreated:** Sorts by timeCreated. * **displayName:** Sorts by displayName. * **id:** Sorts by id.""")
1743
+ @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.""")
1744
+ @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.""")
1745
+ @json_skeleton_utils.get_cli_json_input_option({})
1746
+ @cli_util.help_option
1747
+ @click.pass_context
1748
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'functions', 'class': 'list[ApplicationSummary]'})
1749
+ @cli_util.wrap_exceptions
1750
+ def list_applications(ctx, from_json, all_pages, page_size, compartment_id, limit, page, lifecycle_state, display_name, id, sort_order, sort_by):
1751
+
1752
+ if all_pages and limit:
1753
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
1754
+
1755
+ kwargs = {}
1756
+ if limit is not None:
1757
+ kwargs['limit'] = limit
1758
+ if page is not None:
1759
+ kwargs['page'] = page
1760
+ if lifecycle_state is not None:
1761
+ kwargs['lifecycle_state'] = lifecycle_state
1762
+ if display_name is not None:
1763
+ kwargs['display_name'] = display_name
1764
+ if id is not None:
1765
+ kwargs['id'] = id
1766
+ if sort_order is not None:
1767
+ kwargs['sort_order'] = sort_order
1768
+ if sort_by is not None:
1769
+ kwargs['sort_by'] = sort_by
1770
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1771
+ client = cli_util.build_client('functions', 'functions_management', ctx)
1772
+ if all_pages:
1773
+ if page_size:
1774
+ kwargs['limit'] = page_size
1775
+
1776
+ result = cli_util.list_call_get_all_results(
1777
+ client.list_applications,
1778
+ compartment_id=compartment_id,
1779
+ **kwargs
1780
+ )
1781
+ elif limit is not None:
1782
+ result = cli_util.list_call_get_up_to_limit(
1783
+ client.list_applications,
1784
+ limit,
1785
+ page_size,
1786
+ compartment_id=compartment_id,
1787
+ **kwargs
1788
+ )
1789
+ else:
1790
+ result = client.list_applications(
1791
+ compartment_id=compartment_id,
1792
+ **kwargs
1793
+ )
1794
+ cli_util.render_response(result, ctx)
1795
+
1796
+
1797
+ @function_group.command(name=cli_util.override('functions_management.list_functions.command_name', 'list'), help=u"""Lists functions for an application. \n[Command Reference](listFunctions)""")
1798
+ @cli_util.option('--application-id', required=True, help=u"""The [OCID] of the application to which this function belongs.""")
1799
+ @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return. 1 is the minimum, 50 is the maximum.
1800
+
1801
+ Default: 10""")
1802
+ @cli_util.option('--page', help=u"""The pagination token for a list query returned by a previous operation""")
1803
+ @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only functions that match the lifecycle state in this parameter. Example: `Creating`""")
1804
+ @cli_util.option('--display-name', help=u"""A filter to return only functions with display names that match the display name string. Matching is exact.""")
1805
+ @cli_util.option('--id', help=u"""A filter to return only functions with the specified OCID.""")
1806
+ @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order.
1807
+
1808
+ * **ASC:** Ascending sort order. * **DESC:** Descending sort order.""")
1809
+ @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "id", "displayName"]), help=u"""Specifies the attribute with which to sort the rules.
1810
+
1811
+ Default: `displayName`
1812
+
1813
+ * **timeCreated:** Sorts by timeCreated. * **displayName:** Sorts by displayName. * **id:** Sorts by id.""")
1814
+ @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.""")
1815
+ @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.""")
1816
+ @json_skeleton_utils.get_cli_json_input_option({})
1817
+ @cli_util.help_option
1818
+ @click.pass_context
1819
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'functions', 'class': 'list[FunctionSummary]'})
1820
+ @cli_util.wrap_exceptions
1821
+ def list_functions(ctx, from_json, all_pages, page_size, application_id, limit, page, lifecycle_state, display_name, id, sort_order, sort_by):
1822
+
1823
+ if all_pages and limit:
1824
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
1825
+
1826
+ kwargs = {}
1827
+ if limit is not None:
1828
+ kwargs['limit'] = limit
1829
+ if page is not None:
1830
+ kwargs['page'] = page
1831
+ if lifecycle_state is not None:
1832
+ kwargs['lifecycle_state'] = lifecycle_state
1833
+ if display_name is not None:
1834
+ kwargs['display_name'] = display_name
1835
+ if id is not None:
1836
+ kwargs['id'] = id
1837
+ if sort_order is not None:
1838
+ kwargs['sort_order'] = sort_order
1839
+ if sort_by is not None:
1840
+ kwargs['sort_by'] = sort_by
1841
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1842
+ client = cli_util.build_client('functions', 'functions_management', ctx)
1843
+ if all_pages:
1844
+ if page_size:
1845
+ kwargs['limit'] = page_size
1846
+
1847
+ result = cli_util.list_call_get_all_results(
1848
+ client.list_functions,
1849
+ application_id=application_id,
1850
+ **kwargs
1851
+ )
1852
+ elif limit is not None:
1853
+ result = cli_util.list_call_get_up_to_limit(
1854
+ client.list_functions,
1855
+ limit,
1856
+ page_size,
1857
+ application_id=application_id,
1858
+ **kwargs
1859
+ )
1860
+ else:
1861
+ result = client.list_functions(
1862
+ application_id=application_id,
1863
+ **kwargs
1864
+ )
1865
+ cli_util.render_response(result, ctx)
1866
+
1867
+
1868
+ @pbf_listing_version_group.command(name=cli_util.override('functions_management.list_pbf_listing_versions.command_name', 'list'), help=u"""Fetches a wrapped list of all Pre-built Function(PBF) Listing versions. Returns a PbfListingVersionCollection containing an array of PbfListingVersionSummary response models.
1869
+
1870
+ Note that the PbfListingIdentifier must be provided as a query parameter, otherwise an exception shall be thrown. \n[Command Reference](listPbfListingVersions)""")
1871
+ @cli_util.option('--pbf-listing-id', required=True, help=u"""unique PbfListing identifier""")
1872
+ @cli_util.option('--pbf-listing-version-id', help=u"""unique PbfListingVersion identifier""")
1873
+ @cli_util.option('--name', help=u"""Matches a PbfListingVersion based on a provided semantic version name for a PbfListingVersion. Each PbfListingVersion name is unique with respect to its associated PbfListing.""")
1874
+ @cli_util.option('--is-current-version', type=click.BOOL, help=u"""Matches the current version (the most recently added version with an Active lifecycleState) associated with a PbfListing.""")
1875
+ @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "INACTIVE", "DELETED"]), help=u"""A filter to return only resources their lifecycleState matches the given lifecycleState.""")
1876
+ @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return. 1 is the minimum, 50 is the maximum.
1877
+
1878
+ Default: 10""")
1879
+ @cli_util.option('--page', help=u"""The pagination token for a list query returned by a previous operation""")
1880
+ @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order.
1881
+
1882
+ * **ASC:** Ascending sort order. * **DESC:** Descending sort order.""")
1883
+ @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "name"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for name is ascending.""")
1884
+ @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.""")
1885
+ @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.""")
1886
+ @json_skeleton_utils.get_cli_json_input_option({})
1887
+ @cli_util.help_option
1888
+ @click.pass_context
957
1889
  @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'functions', 'class': 'PbfListingVersionsCollection'})
958
1890
  @cli_util.wrap_exceptions
959
- def list_pbf_listing_versions(ctx, from_json, all_pages, page_size, pbf_listing_id, pbf_listing_version_id, name, is_current_version, lifecycle_state, limit, page, sort_order, sort_by):
1891
+ def list_pbf_listing_versions(ctx, from_json, all_pages, page_size, pbf_listing_id, pbf_listing_version_id, name, is_current_version, lifecycle_state, limit, page, sort_order, sort_by):
1892
+
1893
+ if all_pages and limit:
1894
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
1895
+
1896
+ kwargs = {}
1897
+ if pbf_listing_version_id is not None:
1898
+ kwargs['pbf_listing_version_id'] = pbf_listing_version_id
1899
+ if name is not None:
1900
+ kwargs['name'] = name
1901
+ if is_current_version is not None:
1902
+ kwargs['is_current_version'] = is_current_version
1903
+ if lifecycle_state is not None:
1904
+ kwargs['lifecycle_state'] = lifecycle_state
1905
+ if limit is not None:
1906
+ kwargs['limit'] = limit
1907
+ if page is not None:
1908
+ kwargs['page'] = page
1909
+ if sort_order is not None:
1910
+ kwargs['sort_order'] = sort_order
1911
+ if sort_by is not None:
1912
+ kwargs['sort_by'] = sort_by
1913
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1914
+ client = cli_util.build_client('functions', 'functions_management', ctx)
1915
+ if all_pages:
1916
+ if page_size:
1917
+ kwargs['limit'] = page_size
1918
+
1919
+ result = cli_util.list_call_get_all_results(
1920
+ client.list_pbf_listing_versions,
1921
+ pbf_listing_id=pbf_listing_id,
1922
+ **kwargs
1923
+ )
1924
+ elif limit is not None:
1925
+ result = cli_util.list_call_get_up_to_limit(
1926
+ client.list_pbf_listing_versions,
1927
+ limit,
1928
+ page_size,
1929
+ pbf_listing_id=pbf_listing_id,
1930
+ **kwargs
1931
+ )
1932
+ else:
1933
+ result = client.list_pbf_listing_versions(
1934
+ pbf_listing_id=pbf_listing_id,
1935
+ **kwargs
1936
+ )
1937
+ cli_util.render_response(result, ctx)
1938
+
1939
+
1940
+ @pbf_listing_group.command(name=cli_util.override('functions_management.list_pbf_listings.command_name', 'list'), help=u"""Fetches a wrapped list of all Pre-built Function(PBF) Listings. Returns a PbfListingCollection containing an array of PbfListingSummary response models. \n[Command Reference](listPbfListings)""")
1941
+ @cli_util.option('--pbf-listing-id', help=u"""unique PbfListing identifier""")
1942
+ @cli_util.option('--name', help=u"""A filter to return only resources that match the entire PBF name given.""")
1943
+ @cli_util.option('--name-contains', help=u"""A filter to return only resources that contain the supplied filter text in the PBF name given.""")
1944
+ @cli_util.option('--name-starts-with', help=u"""A filter to return only resources that start with the supplied filter text in the PBF name given.""")
1945
+ @cli_util.option('--trigger', multiple=True, help=u"""A filter to return only resources that match the service trigger sources of a PBF.""")
1946
+ @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "INACTIVE", "DELETED"]), help=u"""A filter to return only resources their lifecycleState matches the given lifecycleState.""")
1947
+ @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return. 1 is the minimum, 50 is the maximum.
1948
+
1949
+ Default: 10""")
1950
+ @cli_util.option('--page', help=u"""The pagination token for a list query returned by a previous operation""")
1951
+ @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order.
1952
+
1953
+ * **ASC:** Ascending sort order. * **DESC:** Descending sort order.""")
1954
+ @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "name"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for name is ascending.""")
1955
+ @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.""")
1956
+ @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.""")
1957
+ @json_skeleton_utils.get_cli_json_input_option({'trigger': {'module': 'functions', 'class': 'list[string]'}})
1958
+ @cli_util.help_option
1959
+ @click.pass_context
1960
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'trigger': {'module': 'functions', 'class': 'list[string]'}}, output_type={'module': 'functions', 'class': 'PbfListingsCollection'})
1961
+ @cli_util.wrap_exceptions
1962
+ def list_pbf_listings(ctx, from_json, all_pages, page_size, pbf_listing_id, name, name_contains, name_starts_with, trigger, lifecycle_state, limit, page, sort_order, sort_by):
1963
+
1964
+ if all_pages and limit:
1965
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
1966
+
1967
+ kwargs = {}
1968
+ if pbf_listing_id is not None:
1969
+ kwargs['pbf_listing_id'] = pbf_listing_id
1970
+ if name is not None:
1971
+ kwargs['name'] = name
1972
+ if name_contains is not None:
1973
+ kwargs['name_contains'] = name_contains
1974
+ if name_starts_with is not None:
1975
+ kwargs['name_starts_with'] = name_starts_with
1976
+ if trigger is not None and len(trigger) > 0:
1977
+ kwargs['trigger'] = trigger
1978
+ if lifecycle_state is not None:
1979
+ kwargs['lifecycle_state'] = lifecycle_state
1980
+ if limit is not None:
1981
+ kwargs['limit'] = limit
1982
+ if page is not None:
1983
+ kwargs['page'] = page
1984
+ if sort_order is not None:
1985
+ kwargs['sort_order'] = sort_order
1986
+ if sort_by is not None:
1987
+ kwargs['sort_by'] = sort_by
1988
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1989
+ client = cli_util.build_client('functions', 'functions_management', ctx)
1990
+ if all_pages:
1991
+ if page_size:
1992
+ kwargs['limit'] = page_size
1993
+
1994
+ result = cli_util.list_call_get_all_results(
1995
+ client.list_pbf_listings,
1996
+ **kwargs
1997
+ )
1998
+ elif limit is not None:
1999
+ result = cli_util.list_call_get_up_to_limit(
2000
+ client.list_pbf_listings,
2001
+ limit,
2002
+ page_size,
2003
+ **kwargs
2004
+ )
2005
+ else:
2006
+ result = client.list_pbf_listings(
2007
+ **kwargs
2008
+ )
2009
+ cli_util.render_response(result, ctx)
2010
+
2011
+
2012
+ @triggers_collection_group.command(name=cli_util.override('functions_management.list_triggers.command_name', 'list-triggers'), help=u"""Returns a list of Triggers. \n[Command Reference](listTriggers)""")
2013
+ @cli_util.option('--name', help=u"""A filter to return only resources that match the service trigger source of a PBF.""")
2014
+ @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return. 1 is the minimum, 50 is the maximum.
2015
+
2016
+ Default: 10""")
2017
+ @cli_util.option('--page', help=u"""The pagination token for a list query returned by a previous operation""")
2018
+ @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order.
2019
+
2020
+ * **ASC:** Ascending sort order. * **DESC:** Descending sort order.""")
2021
+ @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.""")
2022
+ @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.""")
2023
+ @json_skeleton_utils.get_cli_json_input_option({})
2024
+ @cli_util.help_option
2025
+ @click.pass_context
2026
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'functions', 'class': 'TriggersCollection'})
2027
+ @cli_util.wrap_exceptions
2028
+ def list_triggers(ctx, from_json, all_pages, page_size, name, limit, page, sort_order):
2029
+
2030
+ if all_pages and limit:
2031
+ raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2032
+
2033
+ kwargs = {}
2034
+ if name is not None:
2035
+ kwargs['name'] = name
2036
+ if limit is not None:
2037
+ kwargs['limit'] = limit
2038
+ if page is not None:
2039
+ kwargs['page'] = page
2040
+ if sort_order is not None:
2041
+ kwargs['sort_order'] = sort_order
2042
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2043
+ client = cli_util.build_client('functions', 'functions_management', ctx)
2044
+ if all_pages:
2045
+ if page_size:
2046
+ kwargs['limit'] = page_size
2047
+
2048
+ result = cli_util.list_call_get_all_results(
2049
+ client.list_triggers,
2050
+ **kwargs
2051
+ )
2052
+ elif limit is not None:
2053
+ result = cli_util.list_call_get_up_to_limit(
2054
+ client.list_triggers,
2055
+ limit,
2056
+ page_size,
2057
+ **kwargs
2058
+ )
2059
+ else:
2060
+ result = client.list_triggers(
2061
+ **kwargs
2062
+ )
2063
+ cli_util.render_response(result, ctx)
2064
+
2065
+
2066
+ @application_group.command(name=cli_util.override('functions_management.update_application.command_name', 'update'), help=u"""Modifies an application \n[Command Reference](updateApplication)""")
2067
+ @cli_util.option('--application-id', required=True, help=u"""The [OCID] of this application.""")
2068
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Application configuration. These values are passed on to the function as environment variables, functions may override application configuration. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
2069
+
2070
+ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
2071
+
2072
+ The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2073
+ @cli_util.option('--network-security-group-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The [OCID]s of the Network Security Groups to add the application to.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2074
+ @cli_util.option('--syslog-url', help=u"""A syslog URL to which to send all function logs. Supports tcp, udp, and tcp+tls. The syslog URL must be reachable from all of the subnets configured for the application. Note: If you enable the OCI Logging service for this application, the syslogUrl value is ignored. Function logs are sent to the OCI Logging service, and not to the syslog URL.
2075
+
2076
+ Example: `tcp://logserver.myserver:1234`""")
2077
+ @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2078
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
2079
+
2080
+ Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2081
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
2082
+
2083
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2084
+ @cli_util.option('--image-policy-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
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.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
2087
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
2088
+ @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.""")
2089
+ @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.""")
2090
+ @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'network-security-group-ids': {'module': 'functions', 'class': 'list[string]'}, 'trace-config': {'module': 'functions', 'class': 'ApplicationTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}, 'image-policy-config': {'module': 'functions', 'class': 'ImagePolicyConfig'}})
2091
+ @cli_util.help_option
2092
+ @click.pass_context
2093
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'network-security-group-ids': {'module': 'functions', 'class': 'list[string]'}, 'trace-config': {'module': 'functions', 'class': 'ApplicationTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}, 'image-policy-config': {'module': 'functions', 'class': 'ImagePolicyConfig'}}, output_type={'module': 'functions', 'class': 'Application'})
2094
+ @cli_util.wrap_exceptions
2095
+ def update_application(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, application_id, config, network_security_group_ids, syslog_url, trace_config, freeform_tags, defined_tags, image_policy_config, if_match):
2096
+
2097
+ if isinstance(application_id, six.string_types) and len(application_id.strip()) == 0:
2098
+ raise click.UsageError('Parameter --application-id cannot be whitespace or empty string')
2099
+ if not force:
2100
+ if config or network_security_group_ids or trace_config or freeform_tags or defined_tags or image_policy_config:
2101
+ if not click.confirm("WARNING: Updates to config and network-security-group-ids and trace-config and freeform-tags and defined-tags and image-policy-config will replace any existing values. Are you sure you want to continue?"):
2102
+ ctx.abort()
2103
+
2104
+ kwargs = {}
2105
+ if if_match is not None:
2106
+ kwargs['if_match'] = if_match
2107
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2108
+
2109
+ _details = {}
2110
+
2111
+ if config is not None:
2112
+ _details['config'] = cli_util.parse_json_parameter("config", config)
2113
+
2114
+ if network_security_group_ids is not None:
2115
+ _details['networkSecurityGroupIds'] = cli_util.parse_json_parameter("network_security_group_ids", network_security_group_ids)
2116
+
2117
+ if syslog_url is not None:
2118
+ _details['syslogUrl'] = syslog_url
2119
+
2120
+ if trace_config is not None:
2121
+ _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
2122
+
2123
+ if freeform_tags is not None:
2124
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
2125
+
2126
+ if defined_tags is not None:
2127
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
2128
+
2129
+ if image_policy_config is not None:
2130
+ _details['imagePolicyConfig'] = cli_util.parse_json_parameter("image_policy_config", image_policy_config)
2131
+
2132
+ client = cli_util.build_client('functions', 'functions_management', ctx)
2133
+ result = client.update_application(
2134
+ application_id=application_id,
2135
+ update_application_details=_details,
2136
+ **kwargs
2137
+ )
2138
+ if wait_for_state:
2139
+
2140
+ if hasattr(client, 'get_application') and callable(getattr(client, 'get_application')):
2141
+ try:
2142
+ wait_period_kwargs = {}
2143
+ if max_wait_seconds is not None:
2144
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2145
+ if wait_interval_seconds is not None:
2146
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2147
+
2148
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
2149
+ result = oci.wait_until(client, client.get_application(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
2150
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
2151
+ # If we fail, we should show an error, but we should still provide the information to the customer
2152
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
2153
+ cli_util.render_response(result, ctx)
2154
+ sys.exit(2)
2155
+ except Exception:
2156
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
2157
+ cli_util.render_response(result, ctx)
2158
+ raise
2159
+ else:
2160
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
2161
+ cli_util.render_response(result, ctx)
2162
+
2163
+
2164
+ @function_group.command(name=cli_util.override('functions_management.update_function.command_name', 'update'), help=u"""Modifies a function \n[Command Reference](updateFunction)""")
2165
+ @cli_util.option('--function-id', required=True, help=u"""The [OCID] of this function.""")
2166
+ @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. If an image is specified but no value for imageDigest is provided, the digest currently associated with the image tag in the OCI Registry will be used. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
2167
+ @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
2168
+ @cli_util.option('--memory-in-mbs', type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
2169
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
2170
+
2171
+ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
2172
+
2173
+ The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2174
+ @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
2175
+ @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2176
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
2177
+ @cli_util.option('--failure-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2178
+ @cli_util.option('--success-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2179
+ @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2180
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2181
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
2182
+
2183
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2184
+ @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.""")
2185
+ @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
2186
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
2187
+ @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.""")
2188
+ @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.""")
2189
+ @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
2190
+ @cli_util.help_option
2191
+ @click.pass_context
2192
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
2193
+ @cli_util.wrap_exceptions
2194
+ def update_function(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, function_id, image, image_digest, memory_in_mbs, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, failure_destination, success_destination, trace_config, freeform_tags, defined_tags, if_match):
2195
+
2196
+ if isinstance(function_id, six.string_types) and len(function_id.strip()) == 0:
2197
+ raise click.UsageError('Parameter --function-id cannot be whitespace or empty string')
2198
+ if not force:
2199
+ if config or provisioned_concurrency_config or failure_destination or success_destination or trace_config or freeform_tags or defined_tags:
2200
+ if not click.confirm("WARNING: Updates to config and provisioned-concurrency-config and failure-destination and success-destination and trace-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
2201
+ ctx.abort()
2202
+
2203
+ kwargs = {}
2204
+ if if_match is not None:
2205
+ kwargs['if_match'] = if_match
2206
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2207
+
2208
+ _details = {}
2209
+
2210
+ if image is not None:
2211
+ _details['image'] = image
2212
+
2213
+ if image_digest is not None:
2214
+ _details['imageDigest'] = image_digest
2215
+
2216
+ if memory_in_mbs is not None:
2217
+ _details['memoryInMBs'] = memory_in_mbs
2218
+
2219
+ if config is not None:
2220
+ _details['config'] = cli_util.parse_json_parameter("config", config)
2221
+
2222
+ if timeout_in_seconds is not None:
2223
+ _details['timeoutInSeconds'] = timeout_in_seconds
2224
+
2225
+ if provisioned_concurrency_config is not None:
2226
+ _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
2227
+
2228
+ if detached_mode_timeout_in_seconds is not None:
2229
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
2230
+
2231
+ if failure_destination is not None:
2232
+ _details['failureDestination'] = cli_util.parse_json_parameter("failure_destination", failure_destination)
2233
+
2234
+ if success_destination is not None:
2235
+ _details['successDestination'] = cli_util.parse_json_parameter("success_destination", success_destination)
2236
+
2237
+ if trace_config is not None:
2238
+ _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
2239
+
2240
+ if freeform_tags is not None:
2241
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
2242
+
2243
+ if defined_tags is not None:
2244
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
2245
+
2246
+ client = cli_util.build_client('functions', 'functions_management', ctx)
2247
+ result = client.update_function(
2248
+ function_id=function_id,
2249
+ update_function_details=_details,
2250
+ **kwargs
2251
+ )
2252
+ if wait_for_state:
2253
+
2254
+ if hasattr(client, 'get_function') and callable(getattr(client, 'get_function')):
2255
+ try:
2256
+ wait_period_kwargs = {}
2257
+ if max_wait_seconds is not None:
2258
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2259
+ if wait_interval_seconds is not None:
2260
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2261
+
2262
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
2263
+ result = oci.wait_until(client, client.get_function(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
2264
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
2265
+ # If we fail, we should show an error, but we should still provide the information to the customer
2266
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
2267
+ cli_util.render_response(result, ctx)
2268
+ sys.exit(2)
2269
+ except Exception:
2270
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
2271
+ cli_util.render_response(result, ctx)
2272
+ raise
2273
+ else:
2274
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
2275
+ cli_util.render_response(result, ctx)
2276
+
2277
+
2278
+ @function_group.command(name=cli_util.override('functions_management.update_function_none_provisioned_concurrency_config.command_name', 'update-function-none-provisioned-concurrency-config'), help=u"""Modifies a function \n[Command Reference](updateFunction)""")
2279
+ @cli_util.option('--function-id', required=True, help=u"""The [OCID] of this function.""")
2280
+ @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. If an image is specified but no value for imageDigest is provided, the digest currently associated with the image tag in the OCI Registry will be used. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
2281
+ @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
2282
+ @cli_util.option('--memory-in-mbs', type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
2283
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
2284
+
2285
+ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
2286
+
2287
+ The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2288
+ @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
2289
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
2290
+ @cli_util.option('--failure-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2291
+ @cli_util.option('--success-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2292
+ @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2293
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2294
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
2295
+
2296
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2297
+ @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.""")
2298
+ @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
2299
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
2300
+ @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.""")
2301
+ @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.""")
2302
+ @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
2303
+ @cli_util.help_option
2304
+ @click.pass_context
2305
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
2306
+ @cli_util.wrap_exceptions
2307
+ def update_function_none_provisioned_concurrency_config(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, function_id, image, image_digest, memory_in_mbs, config, timeout_in_seconds, detached_mode_timeout_in_seconds, failure_destination, success_destination, trace_config, freeform_tags, defined_tags, if_match):
2308
+
2309
+ if isinstance(function_id, six.string_types) and len(function_id.strip()) == 0:
2310
+ raise click.UsageError('Parameter --function-id cannot be whitespace or empty string')
2311
+ if not force:
2312
+ if config or failure_destination or success_destination or trace_config or freeform_tags or defined_tags:
2313
+ if not click.confirm("WARNING: Updates to config and failure-destination and success-destination and trace-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
2314
+ ctx.abort()
2315
+
2316
+ kwargs = {}
2317
+ if if_match is not None:
2318
+ kwargs['if_match'] = if_match
2319
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2320
+
2321
+ _details = {}
2322
+ _details['provisionedConcurrencyConfig'] = {}
2323
+
2324
+ if image is not None:
2325
+ _details['image'] = image
2326
+
2327
+ if image_digest is not None:
2328
+ _details['imageDigest'] = image_digest
2329
+
2330
+ if memory_in_mbs is not None:
2331
+ _details['memoryInMBs'] = memory_in_mbs
2332
+
2333
+ if config is not None:
2334
+ _details['config'] = cli_util.parse_json_parameter("config", config)
2335
+
2336
+ if timeout_in_seconds is not None:
2337
+ _details['timeoutInSeconds'] = timeout_in_seconds
2338
+
2339
+ if detached_mode_timeout_in_seconds is not None:
2340
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
2341
+
2342
+ if failure_destination is not None:
2343
+ _details['failureDestination'] = cli_util.parse_json_parameter("failure_destination", failure_destination)
2344
+
2345
+ if success_destination is not None:
2346
+ _details['successDestination'] = cli_util.parse_json_parameter("success_destination", success_destination)
2347
+
2348
+ if trace_config is not None:
2349
+ _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
2350
+
2351
+ if freeform_tags is not None:
2352
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
2353
+
2354
+ if defined_tags is not None:
2355
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
2356
+
2357
+ _details['provisionedConcurrencyConfig']['strategy'] = 'NONE'
2358
+
2359
+ client = cli_util.build_client('functions', 'functions_management', ctx)
2360
+ result = client.update_function(
2361
+ function_id=function_id,
2362
+ update_function_details=_details,
2363
+ **kwargs
2364
+ )
2365
+ if wait_for_state:
2366
+
2367
+ if hasattr(client, 'get_function') and callable(getattr(client, 'get_function')):
2368
+ try:
2369
+ wait_period_kwargs = {}
2370
+ if max_wait_seconds is not None:
2371
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2372
+ if wait_interval_seconds is not None:
2373
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2374
+
2375
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
2376
+ result = oci.wait_until(client, client.get_function(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
2377
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
2378
+ # If we fail, we should show an error, but we should still provide the information to the customer
2379
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
2380
+ cli_util.render_response(result, ctx)
2381
+ sys.exit(2)
2382
+ except Exception:
2383
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
2384
+ cli_util.render_response(result, ctx)
2385
+ raise
2386
+ else:
2387
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
2388
+ cli_util.render_response(result, ctx)
2389
+
2390
+
2391
+ @function_group.command(name=cli_util.override('functions_management.update_function_constant_provisioned_concurrency_config.command_name', 'update-function-constant-provisioned-concurrency-config'), help=u"""Modifies a function \n[Command Reference](updateFunction)""")
2392
+ @cli_util.option('--function-id', required=True, help=u"""The [OCID] of this function.""")
2393
+ @cli_util.option('--provisioned-concurrency-config-count', required=True, type=click.INT, help=u"""Configuration specifying a constant amount of provisioned concurrency.""")
2394
+ @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. If an image is specified but no value for imageDigest is provided, the digest currently associated with the image tag in the OCI Registry will be used. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
2395
+ @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
2396
+ @cli_util.option('--memory-in-mbs', type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
2397
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
2398
+
2399
+ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
2400
+
2401
+ The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2402
+ @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
2403
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
2404
+ @cli_util.option('--failure-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2405
+ @cli_util.option('--success-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2406
+ @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2407
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2408
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
2409
+
2410
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2411
+ @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.""")
2412
+ @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
2413
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
2414
+ @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.""")
2415
+ @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.""")
2416
+ @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
2417
+ @cli_util.help_option
2418
+ @click.pass_context
2419
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
2420
+ @cli_util.wrap_exceptions
2421
+ def update_function_constant_provisioned_concurrency_config(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, function_id, provisioned_concurrency_config_count, image, image_digest, memory_in_mbs, config, timeout_in_seconds, detached_mode_timeout_in_seconds, failure_destination, success_destination, trace_config, freeform_tags, defined_tags, if_match):
2422
+
2423
+ if isinstance(function_id, six.string_types) and len(function_id.strip()) == 0:
2424
+ raise click.UsageError('Parameter --function-id cannot be whitespace or empty string')
2425
+ if not force:
2426
+ if config or failure_destination or success_destination or trace_config or freeform_tags or defined_tags:
2427
+ if not click.confirm("WARNING: Updates to config and failure-destination and success-destination and trace-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
2428
+ ctx.abort()
2429
+
2430
+ kwargs = {}
2431
+ if if_match is not None:
2432
+ kwargs['if_match'] = if_match
2433
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2434
+
2435
+ _details = {}
2436
+ _details['provisionedConcurrencyConfig'] = {}
2437
+ _details['provisionedConcurrencyConfig']['count'] = provisioned_concurrency_config_count
2438
+
2439
+ if image is not None:
2440
+ _details['image'] = image
2441
+
2442
+ if image_digest is not None:
2443
+ _details['imageDigest'] = image_digest
2444
+
2445
+ if memory_in_mbs is not None:
2446
+ _details['memoryInMBs'] = memory_in_mbs
2447
+
2448
+ if config is not None:
2449
+ _details['config'] = cli_util.parse_json_parameter("config", config)
2450
+
2451
+ if timeout_in_seconds is not None:
2452
+ _details['timeoutInSeconds'] = timeout_in_seconds
2453
+
2454
+ if detached_mode_timeout_in_seconds is not None:
2455
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
2456
+
2457
+ if failure_destination is not None:
2458
+ _details['failureDestination'] = cli_util.parse_json_parameter("failure_destination", failure_destination)
2459
+
2460
+ if success_destination is not None:
2461
+ _details['successDestination'] = cli_util.parse_json_parameter("success_destination", success_destination)
2462
+
2463
+ if trace_config is not None:
2464
+ _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
2465
+
2466
+ if freeform_tags is not None:
2467
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
2468
+
2469
+ if defined_tags is not None:
2470
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
2471
+
2472
+ _details['provisionedConcurrencyConfig']['strategy'] = 'CONSTANT'
2473
+
2474
+ client = cli_util.build_client('functions', 'functions_management', ctx)
2475
+ result = client.update_function(
2476
+ function_id=function_id,
2477
+ update_function_details=_details,
2478
+ **kwargs
2479
+ )
2480
+ if wait_for_state:
2481
+
2482
+ if hasattr(client, 'get_function') and callable(getattr(client, 'get_function')):
2483
+ try:
2484
+ wait_period_kwargs = {}
2485
+ if max_wait_seconds is not None:
2486
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2487
+ if wait_interval_seconds is not None:
2488
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2489
+
2490
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
2491
+ result = oci.wait_until(client, client.get_function(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
2492
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
2493
+ # If we fail, we should show an error, but we should still provide the information to the customer
2494
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
2495
+ cli_util.render_response(result, ctx)
2496
+ sys.exit(2)
2497
+ except Exception:
2498
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
2499
+ cli_util.render_response(result, ctx)
2500
+ raise
2501
+ else:
2502
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
2503
+ cli_util.render_response(result, ctx)
2504
+
2505
+
2506
+ @function_group.command(name=cli_util.override('functions_management.update_function_stream_failure_destination_details.command_name', 'update-function-stream-failure-destination-details'), help=u"""Modifies a function \n[Command Reference](updateFunction)""")
2507
+ @cli_util.option('--function-id', required=True, help=u"""The [OCID] of this function.""")
2508
+ @cli_util.option('--failure-destination-stream-id', required=True, help=u"""The [OCID] of the stream.""")
2509
+ @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. If an image is specified but no value for imageDigest is provided, the digest currently associated with the image tag in the OCI Registry will be used. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
2510
+ @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
2511
+ @cli_util.option('--memory-in-mbs', type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
2512
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
2513
+
2514
+ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
2515
+
2516
+ The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2517
+ @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
2518
+ @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2519
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
2520
+ @cli_util.option('--success-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2521
+ @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2522
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2523
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
2524
+
2525
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2526
+ @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.""")
2527
+ @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
2528
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
2529
+ @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.""")
2530
+ @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.""")
2531
+ @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
2532
+ @cli_util.help_option
2533
+ @click.pass_context
2534
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
2535
+ @cli_util.wrap_exceptions
2536
+ def update_function_stream_failure_destination_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, function_id, failure_destination_stream_id, image, image_digest, memory_in_mbs, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, success_destination, trace_config, freeform_tags, defined_tags, if_match):
2537
+
2538
+ if isinstance(function_id, six.string_types) and len(function_id.strip()) == 0:
2539
+ raise click.UsageError('Parameter --function-id cannot be whitespace or empty string')
2540
+ if not force:
2541
+ if config or provisioned_concurrency_config or success_destination or trace_config or freeform_tags or defined_tags:
2542
+ if not click.confirm("WARNING: Updates to config and provisioned-concurrency-config and success-destination and trace-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
2543
+ ctx.abort()
2544
+
2545
+ kwargs = {}
2546
+ if if_match is not None:
2547
+ kwargs['if_match'] = if_match
2548
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2549
+
2550
+ _details = {}
2551
+ _details['failureDestination'] = {}
2552
+ _details['failureDestination']['streamId'] = failure_destination_stream_id
2553
+
2554
+ if image is not None:
2555
+ _details['image'] = image
2556
+
2557
+ if image_digest is not None:
2558
+ _details['imageDigest'] = image_digest
2559
+
2560
+ if memory_in_mbs is not None:
2561
+ _details['memoryInMBs'] = memory_in_mbs
2562
+
2563
+ if config is not None:
2564
+ _details['config'] = cli_util.parse_json_parameter("config", config)
2565
+
2566
+ if timeout_in_seconds is not None:
2567
+ _details['timeoutInSeconds'] = timeout_in_seconds
2568
+
2569
+ if provisioned_concurrency_config is not None:
2570
+ _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
2571
+
2572
+ if detached_mode_timeout_in_seconds is not None:
2573
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
2574
+
2575
+ if success_destination is not None:
2576
+ _details['successDestination'] = cli_util.parse_json_parameter("success_destination", success_destination)
2577
+
2578
+ if trace_config is not None:
2579
+ _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
2580
+
2581
+ if freeform_tags is not None:
2582
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
2583
+
2584
+ if defined_tags is not None:
2585
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
2586
+
2587
+ _details['failureDestination']['kind'] = 'STREAM'
2588
+
2589
+ client = cli_util.build_client('functions', 'functions_management', ctx)
2590
+ result = client.update_function(
2591
+ function_id=function_id,
2592
+ update_function_details=_details,
2593
+ **kwargs
2594
+ )
2595
+ if wait_for_state:
2596
+
2597
+ if hasattr(client, 'get_function') and callable(getattr(client, 'get_function')):
2598
+ try:
2599
+ wait_period_kwargs = {}
2600
+ if max_wait_seconds is not None:
2601
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2602
+ if wait_interval_seconds is not None:
2603
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2604
+
2605
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
2606
+ result = oci.wait_until(client, client.get_function(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
2607
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
2608
+ # If we fail, we should show an error, but we should still provide the information to the customer
2609
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
2610
+ cli_util.render_response(result, ctx)
2611
+ sys.exit(2)
2612
+ except Exception:
2613
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
2614
+ cli_util.render_response(result, ctx)
2615
+ raise
2616
+ else:
2617
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
2618
+ cli_util.render_response(result, ctx)
2619
+
2620
+
2621
+ @function_group.command(name=cli_util.override('functions_management.update_function_queue_failure_destination_details.command_name', 'update-function-queue-failure-destination-details'), help=u"""Modifies a function \n[Command Reference](updateFunction)""")
2622
+ @cli_util.option('--function-id', required=True, help=u"""The [OCID] of this function.""")
2623
+ @cli_util.option('--failure-destination-queue-id', required=True, help=u"""The [OCID] of the queue.""")
2624
+ @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. If an image is specified but no value for imageDigest is provided, the digest currently associated with the image tag in the OCI Registry will be used. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
2625
+ @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
2626
+ @cli_util.option('--memory-in-mbs', type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
2627
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
2628
+
2629
+ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
2630
+
2631
+ The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2632
+ @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
2633
+ @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2634
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
2635
+ @cli_util.option('--success-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2636
+ @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2637
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2638
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
2639
+
2640
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2641
+ @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.""")
2642
+ @cli_util.option('--failure-destination-channel-id', help=u"""The ID of the channel in the queue.""")
2643
+ @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
2644
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
2645
+ @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.""")
2646
+ @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.""")
2647
+ @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
2648
+ @cli_util.help_option
2649
+ @click.pass_context
2650
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
2651
+ @cli_util.wrap_exceptions
2652
+ def update_function_queue_failure_destination_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, function_id, failure_destination_queue_id, image, image_digest, memory_in_mbs, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, success_destination, trace_config, freeform_tags, defined_tags, if_match, failure_destination_channel_id):
960
2653
 
961
- if all_pages and limit:
962
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2654
+ if isinstance(function_id, six.string_types) and len(function_id.strip()) == 0:
2655
+ raise click.UsageError('Parameter --function-id cannot be whitespace or empty string')
2656
+ if not force:
2657
+ if config or provisioned_concurrency_config or success_destination or trace_config or freeform_tags or defined_tags:
2658
+ if not click.confirm("WARNING: Updates to config and provisioned-concurrency-config and success-destination and trace-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
2659
+ ctx.abort()
963
2660
 
964
2661
  kwargs = {}
965
- if pbf_listing_version_id is not None:
966
- kwargs['pbf_listing_version_id'] = pbf_listing_version_id
967
- if name is not None:
968
- kwargs['name'] = name
969
- if is_current_version is not None:
970
- kwargs['is_current_version'] = is_current_version
971
- if lifecycle_state is not None:
972
- kwargs['lifecycle_state'] = lifecycle_state
973
- if limit is not None:
974
- kwargs['limit'] = limit
975
- if page is not None:
976
- kwargs['page'] = page
977
- if sort_order is not None:
978
- kwargs['sort_order'] = sort_order
979
- if sort_by is not None:
980
- kwargs['sort_by'] = sort_by
2662
+ if if_match is not None:
2663
+ kwargs['if_match'] = if_match
981
2664
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2665
+
2666
+ _details = {}
2667
+ _details['failureDestination'] = {}
2668
+ _details['failureDestination']['queueId'] = failure_destination_queue_id
2669
+
2670
+ if image is not None:
2671
+ _details['image'] = image
2672
+
2673
+ if image_digest is not None:
2674
+ _details['imageDigest'] = image_digest
2675
+
2676
+ if memory_in_mbs is not None:
2677
+ _details['memoryInMBs'] = memory_in_mbs
2678
+
2679
+ if config is not None:
2680
+ _details['config'] = cli_util.parse_json_parameter("config", config)
2681
+
2682
+ if timeout_in_seconds is not None:
2683
+ _details['timeoutInSeconds'] = timeout_in_seconds
2684
+
2685
+ if provisioned_concurrency_config is not None:
2686
+ _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
2687
+
2688
+ if detached_mode_timeout_in_seconds is not None:
2689
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
2690
+
2691
+ if success_destination is not None:
2692
+ _details['successDestination'] = cli_util.parse_json_parameter("success_destination", success_destination)
2693
+
2694
+ if trace_config is not None:
2695
+ _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
2696
+
2697
+ if freeform_tags is not None:
2698
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
2699
+
2700
+ if defined_tags is not None:
2701
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
2702
+
2703
+ if failure_destination_channel_id is not None:
2704
+ _details['failureDestination']['channelId'] = failure_destination_channel_id
2705
+
2706
+ _details['failureDestination']['kind'] = 'QUEUE'
2707
+
982
2708
  client = cli_util.build_client('functions', 'functions_management', ctx)
983
- if all_pages:
984
- if page_size:
985
- kwargs['limit'] = page_size
2709
+ result = client.update_function(
2710
+ function_id=function_id,
2711
+ update_function_details=_details,
2712
+ **kwargs
2713
+ )
2714
+ if wait_for_state:
986
2715
 
987
- result = cli_util.list_call_get_all_results(
988
- client.list_pbf_listing_versions,
989
- pbf_listing_id=pbf_listing_id,
990
- **kwargs
991
- )
992
- elif limit is not None:
993
- result = cli_util.list_call_get_up_to_limit(
994
- client.list_pbf_listing_versions,
995
- limit,
996
- page_size,
997
- pbf_listing_id=pbf_listing_id,
998
- **kwargs
999
- )
1000
- else:
1001
- result = client.list_pbf_listing_versions(
1002
- pbf_listing_id=pbf_listing_id,
1003
- **kwargs
1004
- )
2716
+ if hasattr(client, 'get_function') and callable(getattr(client, 'get_function')):
2717
+ try:
2718
+ wait_period_kwargs = {}
2719
+ if max_wait_seconds is not None:
2720
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2721
+ if wait_interval_seconds is not None:
2722
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2723
+
2724
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
2725
+ result = oci.wait_until(client, client.get_function(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
2726
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
2727
+ # If we fail, we should show an error, but we should still provide the information to the customer
2728
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
2729
+ cli_util.render_response(result, ctx)
2730
+ sys.exit(2)
2731
+ except Exception:
2732
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
2733
+ cli_util.render_response(result, ctx)
2734
+ raise
2735
+ else:
2736
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1005
2737
  cli_util.render_response(result, ctx)
1006
2738
 
1007
2739
 
1008
- @pbf_listing_group.command(name=cli_util.override('functions_management.list_pbf_listings.command_name', 'list'), help=u"""Fetches a wrapped list of all Pre-built Function(PBF) Listings. Returns a PbfListingCollection containing an array of PbfListingSummary response models. \n[Command Reference](listPbfListings)""")
1009
- @cli_util.option('--pbf-listing-id', help=u"""unique PbfListing identifier""")
1010
- @cli_util.option('--name', help=u"""A filter to return only resources that match the entire PBF name given.""")
1011
- @cli_util.option('--name-contains', help=u"""A filter to return only resources that contain the supplied filter text in the PBF name given.""")
1012
- @cli_util.option('--name-starts-with', help=u"""A filter to return only resources that start with the supplied filter text in the PBF name given.""")
1013
- @cli_util.option('--trigger', multiple=True, help=u"""A filter to return only resources that match the service trigger sources of a PBF.""")
1014
- @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "INACTIVE", "DELETED"]), help=u"""A filter to return only resources their lifecycleState matches the given lifecycleState.""")
1015
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return. 1 is the minimum, 50 is the maximum.
2740
+ @function_group.command(name=cli_util.override('functions_management.update_function_notification_failure_destination_details.command_name', 'update-function-notification-failure-destination-details'), help=u"""Modifies a function \n[Command Reference](updateFunction)""")
2741
+ @cli_util.option('--function-id', required=True, help=u"""The [OCID] of this function.""")
2742
+ @cli_util.option('--failure-destination-topic-id', required=True, help=u"""The [OCID] of the topic.""")
2743
+ @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. If an image is specified but no value for imageDigest is provided, the digest currently associated with the image tag in the OCI Registry will be used. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
2744
+ @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
2745
+ @cli_util.option('--memory-in-mbs', type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
2746
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
2747
+
2748
+ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
2749
+
2750
+ The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2751
+ @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
2752
+ @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2753
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
2754
+ @cli_util.option('--success-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2755
+ @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2756
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2757
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
2758
+
2759
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2760
+ @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.""")
2761
+ @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
2762
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
2763
+ @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.""")
2764
+ @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.""")
2765
+ @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
2766
+ @cli_util.help_option
2767
+ @click.pass_context
2768
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
2769
+ @cli_util.wrap_exceptions
2770
+ def update_function_notification_failure_destination_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, function_id, failure_destination_topic_id, image, image_digest, memory_in_mbs, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, success_destination, trace_config, freeform_tags, defined_tags, if_match):
2771
+
2772
+ if isinstance(function_id, six.string_types) and len(function_id.strip()) == 0:
2773
+ raise click.UsageError('Parameter --function-id cannot be whitespace or empty string')
2774
+ if not force:
2775
+ if config or provisioned_concurrency_config or success_destination or trace_config or freeform_tags or defined_tags:
2776
+ if not click.confirm("WARNING: Updates to config and provisioned-concurrency-config and success-destination and trace-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
2777
+ ctx.abort()
2778
+
2779
+ kwargs = {}
2780
+ if if_match is not None:
2781
+ kwargs['if_match'] = if_match
2782
+ kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2783
+
2784
+ _details = {}
2785
+ _details['failureDestination'] = {}
2786
+ _details['failureDestination']['topicId'] = failure_destination_topic_id
2787
+
2788
+ if image is not None:
2789
+ _details['image'] = image
2790
+
2791
+ if image_digest is not None:
2792
+ _details['imageDigest'] = image_digest
2793
+
2794
+ if memory_in_mbs is not None:
2795
+ _details['memoryInMBs'] = memory_in_mbs
2796
+
2797
+ if config is not None:
2798
+ _details['config'] = cli_util.parse_json_parameter("config", config)
2799
+
2800
+ if timeout_in_seconds is not None:
2801
+ _details['timeoutInSeconds'] = timeout_in_seconds
2802
+
2803
+ if provisioned_concurrency_config is not None:
2804
+ _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
2805
+
2806
+ if detached_mode_timeout_in_seconds is not None:
2807
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
2808
+
2809
+ if success_destination is not None:
2810
+ _details['successDestination'] = cli_util.parse_json_parameter("success_destination", success_destination)
2811
+
2812
+ if trace_config is not None:
2813
+ _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
2814
+
2815
+ if freeform_tags is not None:
2816
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
2817
+
2818
+ if defined_tags is not None:
2819
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
2820
+
2821
+ _details['failureDestination']['kind'] = 'NOTIFICATION'
2822
+
2823
+ client = cli_util.build_client('functions', 'functions_management', ctx)
2824
+ result = client.update_function(
2825
+ function_id=function_id,
2826
+ update_function_details=_details,
2827
+ **kwargs
2828
+ )
2829
+ if wait_for_state:
2830
+
2831
+ if hasattr(client, 'get_function') and callable(getattr(client, 'get_function')):
2832
+ try:
2833
+ wait_period_kwargs = {}
2834
+ if max_wait_seconds is not None:
2835
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2836
+ if wait_interval_seconds is not None:
2837
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2838
+
2839
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
2840
+ result = oci.wait_until(client, client.get_function(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
2841
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
2842
+ # If we fail, we should show an error, but we should still provide the information to the customer
2843
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
2844
+ cli_util.render_response(result, ctx)
2845
+ sys.exit(2)
2846
+ except Exception:
2847
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
2848
+ cli_util.render_response(result, ctx)
2849
+ raise
2850
+ else:
2851
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
2852
+ cli_util.render_response(result, ctx)
2853
+
2854
+
2855
+ @function_group.command(name=cli_util.override('functions_management.update_function_none_failure_destination_details.command_name', 'update-function-none-failure-destination-details'), help=u"""Modifies a function \n[Command Reference](updateFunction)""")
2856
+ @cli_util.option('--function-id', required=True, help=u"""The [OCID] of this function.""")
2857
+ @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. If an image is specified but no value for imageDigest is provided, the digest currently associated with the image tag in the OCI Registry will be used. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
2858
+ @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
2859
+ @cli_util.option('--memory-in-mbs', type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
2860
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
1016
2861
 
1017
- Default: 10""")
1018
- @cli_util.option('--page', help=u"""The pagination token for a list query returned by a previous operation""")
1019
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order.
2862
+ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
1020
2863
 
1021
- * **ASC:** Ascending sort order. * **DESC:** Descending sort order.""")
1022
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "name"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for name is ascending.""")
1023
- @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.""")
1024
- @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.""")
1025
- @json_skeleton_utils.get_cli_json_input_option({'trigger': {'module': 'functions', 'class': 'list[string]'}})
2864
+ The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2865
+ @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
2866
+ @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2867
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
2868
+ @cli_util.option('--success-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2869
+ @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2870
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2871
+ @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
2872
+
2873
+ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2874
+ @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.""")
2875
+ @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
2876
+ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
2877
+ @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.""")
2878
+ @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.""")
2879
+ @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
1026
2880
  @cli_util.help_option
1027
2881
  @click.pass_context
1028
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'trigger': {'module': 'functions', 'class': 'list[string]'}}, output_type={'module': 'functions', 'class': 'PbfListingsCollection'})
2882
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'success-destination': {'module': 'functions', 'class': 'SuccessDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
1029
2883
  @cli_util.wrap_exceptions
1030
- def list_pbf_listings(ctx, from_json, all_pages, page_size, pbf_listing_id, name, name_contains, name_starts_with, trigger, lifecycle_state, limit, page, sort_order, sort_by):
2884
+ def update_function_none_failure_destination_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, function_id, image, image_digest, memory_in_mbs, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, success_destination, trace_config, freeform_tags, defined_tags, if_match):
1031
2885
 
1032
- if all_pages and limit:
1033
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2886
+ if isinstance(function_id, six.string_types) and len(function_id.strip()) == 0:
2887
+ raise click.UsageError('Parameter --function-id cannot be whitespace or empty string')
2888
+ if not force:
2889
+ if config or provisioned_concurrency_config or success_destination or trace_config or freeform_tags or defined_tags:
2890
+ if not click.confirm("WARNING: Updates to config and provisioned-concurrency-config and success-destination and trace-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
2891
+ ctx.abort()
1034
2892
 
1035
2893
  kwargs = {}
1036
- if pbf_listing_id is not None:
1037
- kwargs['pbf_listing_id'] = pbf_listing_id
1038
- if name is not None:
1039
- kwargs['name'] = name
1040
- if name_contains is not None:
1041
- kwargs['name_contains'] = name_contains
1042
- if name_starts_with is not None:
1043
- kwargs['name_starts_with'] = name_starts_with
1044
- if trigger is not None and len(trigger) > 0:
1045
- kwargs['trigger'] = trigger
1046
- if lifecycle_state is not None:
1047
- kwargs['lifecycle_state'] = lifecycle_state
1048
- if limit is not None:
1049
- kwargs['limit'] = limit
1050
- if page is not None:
1051
- kwargs['page'] = page
1052
- if sort_order is not None:
1053
- kwargs['sort_order'] = sort_order
1054
- if sort_by is not None:
1055
- kwargs['sort_by'] = sort_by
2894
+ if if_match is not None:
2895
+ kwargs['if_match'] = if_match
1056
2896
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1057
- client = cli_util.build_client('functions', 'functions_management', ctx)
1058
- if all_pages:
1059
- if page_size:
1060
- kwargs['limit'] = page_size
1061
2897
 
1062
- result = cli_util.list_call_get_all_results(
1063
- client.list_pbf_listings,
1064
- **kwargs
1065
- )
1066
- elif limit is not None:
1067
- result = cli_util.list_call_get_up_to_limit(
1068
- client.list_pbf_listings,
1069
- limit,
1070
- page_size,
1071
- **kwargs
1072
- )
1073
- else:
1074
- result = client.list_pbf_listings(
1075
- **kwargs
1076
- )
1077
- cli_util.render_response(result, ctx)
2898
+ _details = {}
2899
+ _details['failureDestination'] = {}
1078
2900
 
2901
+ if image is not None:
2902
+ _details['image'] = image
1079
2903
 
1080
- @triggers_collection_group.command(name=cli_util.override('functions_management.list_triggers.command_name', 'list-triggers'), help=u"""Returns a list of Triggers. \n[Command Reference](listTriggers)""")
1081
- @cli_util.option('--name', help=u"""A filter to return only resources that match the service trigger source of a PBF.""")
1082
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return. 1 is the minimum, 50 is the maximum.
2904
+ if image_digest is not None:
2905
+ _details['imageDigest'] = image_digest
1083
2906
 
1084
- Default: 10""")
1085
- @cli_util.option('--page', help=u"""The pagination token for a list query returned by a previous operation""")
1086
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order.
2907
+ if memory_in_mbs is not None:
2908
+ _details['memoryInMBs'] = memory_in_mbs
1087
2909
 
1088
- * **ASC:** Ascending sort order. * **DESC:** Descending sort order.""")
1089
- @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.""")
1090
- @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.""")
1091
- @json_skeleton_utils.get_cli_json_input_option({})
1092
- @cli_util.help_option
1093
- @click.pass_context
1094
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'functions', 'class': 'TriggersCollection'})
1095
- @cli_util.wrap_exceptions
1096
- def list_triggers(ctx, from_json, all_pages, page_size, name, limit, page, sort_order):
2910
+ if config is not None:
2911
+ _details['config'] = cli_util.parse_json_parameter("config", config)
1097
2912
 
1098
- if all_pages and limit:
1099
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2913
+ if timeout_in_seconds is not None:
2914
+ _details['timeoutInSeconds'] = timeout_in_seconds
2915
+
2916
+ if provisioned_concurrency_config is not None:
2917
+ _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
2918
+
2919
+ if detached_mode_timeout_in_seconds is not None:
2920
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
2921
+
2922
+ if success_destination is not None:
2923
+ _details['successDestination'] = cli_util.parse_json_parameter("success_destination", success_destination)
2924
+
2925
+ if trace_config is not None:
2926
+ _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
2927
+
2928
+ if freeform_tags is not None:
2929
+ _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
2930
+
2931
+ if defined_tags is not None:
2932
+ _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
2933
+
2934
+ _details['failureDestination']['kind'] = 'NONE'
1100
2935
 
1101
- kwargs = {}
1102
- if name is not None:
1103
- kwargs['name'] = name
1104
- if limit is not None:
1105
- kwargs['limit'] = limit
1106
- if page is not None:
1107
- kwargs['page'] = page
1108
- if sort_order is not None:
1109
- kwargs['sort_order'] = sort_order
1110
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1111
2936
  client = cli_util.build_client('functions', 'functions_management', ctx)
1112
- if all_pages:
1113
- if page_size:
1114
- kwargs['limit'] = page_size
2937
+ result = client.update_function(
2938
+ function_id=function_id,
2939
+ update_function_details=_details,
2940
+ **kwargs
2941
+ )
2942
+ if wait_for_state:
1115
2943
 
1116
- result = cli_util.list_call_get_all_results(
1117
- client.list_triggers,
1118
- **kwargs
1119
- )
1120
- elif limit is not None:
1121
- result = cli_util.list_call_get_up_to_limit(
1122
- client.list_triggers,
1123
- limit,
1124
- page_size,
1125
- **kwargs
1126
- )
1127
- else:
1128
- result = client.list_triggers(
1129
- **kwargs
1130
- )
2944
+ if hasattr(client, 'get_function') and callable(getattr(client, 'get_function')):
2945
+ try:
2946
+ wait_period_kwargs = {}
2947
+ if max_wait_seconds is not None:
2948
+ wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2949
+ if wait_interval_seconds is not None:
2950
+ wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2951
+
2952
+ click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
2953
+ result = oci.wait_until(client, client.get_function(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
2954
+ except oci.exceptions.MaximumWaitTimeExceeded as e:
2955
+ # If we fail, we should show an error, but we should still provide the information to the customer
2956
+ click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
2957
+ cli_util.render_response(result, ctx)
2958
+ sys.exit(2)
2959
+ except Exception:
2960
+ click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
2961
+ cli_util.render_response(result, ctx)
2962
+ raise
2963
+ else:
2964
+ click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
1131
2965
  cli_util.render_response(result, ctx)
1132
2966
 
1133
2967
 
1134
- @application_group.command(name=cli_util.override('functions_management.update_application.command_name', 'update'), help=u"""Modifies an application \n[Command Reference](updateApplication)""")
1135
- @cli_util.option('--application-id', required=True, help=u"""The [OCID] of this application.""")
1136
- @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Application configuration. These values are passed on to the function as environment variables, functions may override application configuration. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
2968
+ @function_group.command(name=cli_util.override('functions_management.update_function_stream_success_destination_details.command_name', 'update-function-stream-success-destination-details'), help=u"""Modifies a function \n[Command Reference](updateFunction)""")
2969
+ @cli_util.option('--function-id', required=True, help=u"""The [OCID] of this function.""")
2970
+ @cli_util.option('--success-destination-stream-id', required=True, help=u"""The [OCID] of the stream.""")
2971
+ @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. If an image is specified but no value for imageDigest is provided, the digest currently associated with the image tag in the OCI Registry will be used. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
2972
+ @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
2973
+ @cli_util.option('--memory-in-mbs', type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
2974
+ @cli_util.option('--config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
1137
2975
 
1138
2976
  Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
1139
2977
 
1140
2978
  The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1141
- @cli_util.option('--network-security-group-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The [OCID]s of the Network Security Groups to add the application to.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1142
- @cli_util.option('--syslog-url', help=u"""A syslog URL to which to send all function logs. Supports tcp, udp, and tcp+tls. The syslog URL must be reachable from all of the subnets configured for the application. Note: If you enable the OCI Logging service for this application, the syslogUrl value is ignored. Function logs are sent to the OCI Logging service, and not to the syslog URL.
1143
-
1144
- Example: `tcp://logserver.myserver:1234`""")
2979
+ @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
2980
+ @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2981
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
2982
+ @cli_util.option('--failure-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1145
2983
  @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1146
- @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags].
1147
-
1148
- Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
2984
+ @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1149
2985
  @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
1150
2986
 
1151
2987
  Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1152
- @cli_util.option('--image-policy-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1153
2988
  @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.""")
1154
2989
  @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
1155
2990
  @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1156
2991
  @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.""")
1157
2992
  @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.""")
1158
- @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'network-security-group-ids': {'module': 'functions', 'class': 'list[string]'}, 'trace-config': {'module': 'functions', 'class': 'ApplicationTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}, 'image-policy-config': {'module': 'functions', 'class': 'ImagePolicyConfig'}})
2993
+ @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
1159
2994
  @cli_util.help_option
1160
2995
  @click.pass_context
1161
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'network-security-group-ids': {'module': 'functions', 'class': 'list[string]'}, 'trace-config': {'module': 'functions', 'class': 'ApplicationTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}, 'image-policy-config': {'module': 'functions', 'class': 'ImagePolicyConfig'}}, output_type={'module': 'functions', 'class': 'Application'})
2996
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
1162
2997
  @cli_util.wrap_exceptions
1163
- def update_application(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, application_id, config, network_security_group_ids, syslog_url, trace_config, freeform_tags, defined_tags, image_policy_config, if_match):
2998
+ def update_function_stream_success_destination_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, function_id, success_destination_stream_id, image, image_digest, memory_in_mbs, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, failure_destination, trace_config, freeform_tags, defined_tags, if_match):
1164
2999
 
1165
- if isinstance(application_id, six.string_types) and len(application_id.strip()) == 0:
1166
- raise click.UsageError('Parameter --application-id cannot be whitespace or empty string')
3000
+ if isinstance(function_id, six.string_types) and len(function_id.strip()) == 0:
3001
+ raise click.UsageError('Parameter --function-id cannot be whitespace or empty string')
1167
3002
  if not force:
1168
- if config or network_security_group_ids or trace_config or freeform_tags or defined_tags or image_policy_config:
1169
- if not click.confirm("WARNING: Updates to config and network-security-group-ids and trace-config and freeform-tags and defined-tags and image-policy-config will replace any existing values. Are you sure you want to continue?"):
3003
+ if config or provisioned_concurrency_config or failure_destination or trace_config or freeform_tags or defined_tags:
3004
+ if not click.confirm("WARNING: Updates to config and provisioned-concurrency-config and failure-destination and trace-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
1170
3005
  ctx.abort()
1171
3006
 
1172
3007
  kwargs = {}
@@ -1175,15 +3010,32 @@ def update_application(ctx, from_json, force, wait_for_state, max_wait_seconds,
1175
3010
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1176
3011
 
1177
3012
  _details = {}
3013
+ _details['successDestination'] = {}
3014
+ _details['successDestination']['streamId'] = success_destination_stream_id
3015
+
3016
+ if image is not None:
3017
+ _details['image'] = image
3018
+
3019
+ if image_digest is not None:
3020
+ _details['imageDigest'] = image_digest
3021
+
3022
+ if memory_in_mbs is not None:
3023
+ _details['memoryInMBs'] = memory_in_mbs
1178
3024
 
1179
3025
  if config is not None:
1180
3026
  _details['config'] = cli_util.parse_json_parameter("config", config)
1181
3027
 
1182
- if network_security_group_ids is not None:
1183
- _details['networkSecurityGroupIds'] = cli_util.parse_json_parameter("network_security_group_ids", network_security_group_ids)
3028
+ if timeout_in_seconds is not None:
3029
+ _details['timeoutInSeconds'] = timeout_in_seconds
1184
3030
 
1185
- if syslog_url is not None:
1186
- _details['syslogUrl'] = syslog_url
3031
+ if provisioned_concurrency_config is not None:
3032
+ _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
3033
+
3034
+ if detached_mode_timeout_in_seconds is not None:
3035
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
3036
+
3037
+ if failure_destination is not None:
3038
+ _details['failureDestination'] = cli_util.parse_json_parameter("failure_destination", failure_destination)
1187
3039
 
1188
3040
  if trace_config is not None:
1189
3041
  _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
@@ -1194,18 +3046,17 @@ def update_application(ctx, from_json, force, wait_for_state, max_wait_seconds,
1194
3046
  if defined_tags is not None:
1195
3047
  _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1196
3048
 
1197
- if image_policy_config is not None:
1198
- _details['imagePolicyConfig'] = cli_util.parse_json_parameter("image_policy_config", image_policy_config)
3049
+ _details['successDestination']['kind'] = 'STREAM'
1199
3050
 
1200
3051
  client = cli_util.build_client('functions', 'functions_management', ctx)
1201
- result = client.update_application(
1202
- application_id=application_id,
1203
- update_application_details=_details,
3052
+ result = client.update_function(
3053
+ function_id=function_id,
3054
+ update_function_details=_details,
1204
3055
  **kwargs
1205
3056
  )
1206
3057
  if wait_for_state:
1207
3058
 
1208
- if hasattr(client, 'get_application') and callable(getattr(client, 'get_application')):
3059
+ if hasattr(client, 'get_function') and callable(getattr(client, 'get_function')):
1209
3060
  try:
1210
3061
  wait_period_kwargs = {}
1211
3062
  if max_wait_seconds is not None:
@@ -1214,7 +3065,7 @@ def update_application(ctx, from_json, force, wait_for_state, max_wait_seconds,
1214
3065
  wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1215
3066
 
1216
3067
  click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
1217
- result = oci.wait_until(client, client.get_application(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
3068
+ result = oci.wait_until(client, client.get_function(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
1218
3069
  except oci.exceptions.MaximumWaitTimeExceeded as e:
1219
3070
  # If we fail, we should show an error, but we should still provide the information to the customer
1220
3071
  click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
@@ -1229,8 +3080,9 @@ def update_application(ctx, from_json, force, wait_for_state, max_wait_seconds,
1229
3080
  cli_util.render_response(result, ctx)
1230
3081
 
1231
3082
 
1232
- @function_group.command(name=cli_util.override('functions_management.update_function.command_name', 'update'), help=u"""Modifies a function \n[Command Reference](updateFunction)""")
3083
+ @function_group.command(name=cli_util.override('functions_management.update_function_notification_success_destination_details.command_name', 'update-function-notification-success-destination-details'), help=u"""Modifies a function \n[Command Reference](updateFunction)""")
1233
3084
  @cli_util.option('--function-id', required=True, help=u"""The [OCID] of this function.""")
3085
+ @cli_util.option('--success-destination-topic-id', required=True, help=u"""The [OCID] of the topic.""")
1234
3086
  @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. If an image is specified but no value for imageDigest is provided, the digest currently associated with the image tag in the OCI Registry will be used. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
1235
3087
  @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
1236
3088
  @cli_util.option('--memory-in-mbs', type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
@@ -1241,6 +3093,8 @@ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
1241
3093
  The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1242
3094
  @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
1243
3095
  @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3096
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
3097
+ @cli_util.option('--failure-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1244
3098
  @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1245
3099
  @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1246
3100
  @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
@@ -1251,18 +3105,18 @@ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_comp
1251
3105
  @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1252
3106
  @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.""")
1253
3107
  @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.""")
1254
- @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
3108
+ @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
1255
3109
  @cli_util.help_option
1256
3110
  @click.pass_context
1257
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
3111
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
1258
3112
  @cli_util.wrap_exceptions
1259
- def update_function(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, function_id, image, image_digest, memory_in_mbs, config, timeout_in_seconds, provisioned_concurrency_config, trace_config, freeform_tags, defined_tags, if_match):
3113
+ def update_function_notification_success_destination_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, function_id, success_destination_topic_id, image, image_digest, memory_in_mbs, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, failure_destination, trace_config, freeform_tags, defined_tags, if_match):
1260
3114
 
1261
3115
  if isinstance(function_id, six.string_types) and len(function_id.strip()) == 0:
1262
3116
  raise click.UsageError('Parameter --function-id cannot be whitespace or empty string')
1263
3117
  if not force:
1264
- if config or provisioned_concurrency_config or trace_config or freeform_tags or defined_tags:
1265
- if not click.confirm("WARNING: Updates to config and provisioned-concurrency-config and trace-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
3118
+ if config or provisioned_concurrency_config or failure_destination or trace_config or freeform_tags or defined_tags:
3119
+ if not click.confirm("WARNING: Updates to config and provisioned-concurrency-config and failure-destination and trace-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
1266
3120
  ctx.abort()
1267
3121
 
1268
3122
  kwargs = {}
@@ -1271,6 +3125,8 @@ def update_function(ctx, from_json, force, wait_for_state, max_wait_seconds, wai
1271
3125
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1272
3126
 
1273
3127
  _details = {}
3128
+ _details['successDestination'] = {}
3129
+ _details['successDestination']['topicId'] = success_destination_topic_id
1274
3130
 
1275
3131
  if image is not None:
1276
3132
  _details['image'] = image
@@ -1290,6 +3146,12 @@ def update_function(ctx, from_json, force, wait_for_state, max_wait_seconds, wai
1290
3146
  if provisioned_concurrency_config is not None:
1291
3147
  _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
1292
3148
 
3149
+ if detached_mode_timeout_in_seconds is not None:
3150
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
3151
+
3152
+ if failure_destination is not None:
3153
+ _details['failureDestination'] = cli_util.parse_json_parameter("failure_destination", failure_destination)
3154
+
1293
3155
  if trace_config is not None:
1294
3156
  _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
1295
3157
 
@@ -1299,6 +3161,8 @@ def update_function(ctx, from_json, force, wait_for_state, max_wait_seconds, wai
1299
3161
  if defined_tags is not None:
1300
3162
  _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1301
3163
 
3164
+ _details['successDestination']['kind'] = 'NOTIFICATION'
3165
+
1302
3166
  client = cli_util.build_client('functions', 'functions_management', ctx)
1303
3167
  result = client.update_function(
1304
3168
  function_id=function_id,
@@ -1331,8 +3195,9 @@ def update_function(ctx, from_json, force, wait_for_state, max_wait_seconds, wai
1331
3195
  cli_util.render_response(result, ctx)
1332
3196
 
1333
3197
 
1334
- @function_group.command(name=cli_util.override('functions_management.update_function_none_provisioned_concurrency_config.command_name', 'update-function-none-provisioned-concurrency-config'), help=u"""Modifies a function \n[Command Reference](updateFunction)""")
3198
+ @function_group.command(name=cli_util.override('functions_management.update_function_queue_success_destination_details.command_name', 'update-function-queue-success-destination-details'), help=u"""Modifies a function \n[Command Reference](updateFunction)""")
1335
3199
  @cli_util.option('--function-id', required=True, help=u"""The [OCID] of this function.""")
3200
+ @cli_util.option('--success-destination-queue-id', required=True, help=u"""The [OCID] of the queue.""")
1336
3201
  @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. If an image is specified but no value for imageDigest is provided, the digest currently associated with the image tag in the OCI Registry will be used. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
1337
3202
  @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
1338
3203
  @cli_util.option('--memory-in-mbs', type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
@@ -1342,28 +3207,32 @@ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
1342
3207
 
1343
3208
  The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1344
3209
  @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
3210
+ @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3211
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
3212
+ @cli_util.option('--failure-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1345
3213
  @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1346
3214
  @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1347
3215
  @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
1348
3216
 
1349
3217
  Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1350
3218
  @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.""")
3219
+ @cli_util.option('--success-destination-channel-id', help=u"""The ID of the channel in the queue.""")
1351
3220
  @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
1352
3221
  @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1353
3222
  @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.""")
1354
3223
  @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.""")
1355
- @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
3224
+ @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
1356
3225
  @cli_util.help_option
1357
3226
  @click.pass_context
1358
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
3227
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
1359
3228
  @cli_util.wrap_exceptions
1360
- def update_function_none_provisioned_concurrency_config(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, function_id, image, image_digest, memory_in_mbs, config, timeout_in_seconds, trace_config, freeform_tags, defined_tags, if_match):
3229
+ def update_function_queue_success_destination_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, function_id, success_destination_queue_id, image, image_digest, memory_in_mbs, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, failure_destination, trace_config, freeform_tags, defined_tags, if_match, success_destination_channel_id):
1361
3230
 
1362
3231
  if isinstance(function_id, six.string_types) and len(function_id.strip()) == 0:
1363
3232
  raise click.UsageError('Parameter --function-id cannot be whitespace or empty string')
1364
3233
  if not force:
1365
- if config or trace_config or freeform_tags or defined_tags:
1366
- if not click.confirm("WARNING: Updates to config and trace-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
3234
+ if config or provisioned_concurrency_config or failure_destination or trace_config or freeform_tags or defined_tags:
3235
+ if not click.confirm("WARNING: Updates to config and provisioned-concurrency-config and failure-destination and trace-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
1367
3236
  ctx.abort()
1368
3237
 
1369
3238
  kwargs = {}
@@ -1372,7 +3241,8 @@ def update_function_none_provisioned_concurrency_config(ctx, from_json, force, w
1372
3241
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1373
3242
 
1374
3243
  _details = {}
1375
- _details['provisionedConcurrencyConfig'] = {}
3244
+ _details['successDestination'] = {}
3245
+ _details['successDestination']['queueId'] = success_destination_queue_id
1376
3246
 
1377
3247
  if image is not None:
1378
3248
  _details['image'] = image
@@ -1389,6 +3259,15 @@ def update_function_none_provisioned_concurrency_config(ctx, from_json, force, w
1389
3259
  if timeout_in_seconds is not None:
1390
3260
  _details['timeoutInSeconds'] = timeout_in_seconds
1391
3261
 
3262
+ if provisioned_concurrency_config is not None:
3263
+ _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
3264
+
3265
+ if detached_mode_timeout_in_seconds is not None:
3266
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
3267
+
3268
+ if failure_destination is not None:
3269
+ _details['failureDestination'] = cli_util.parse_json_parameter("failure_destination", failure_destination)
3270
+
1392
3271
  if trace_config is not None:
1393
3272
  _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
1394
3273
 
@@ -1398,7 +3277,10 @@ def update_function_none_provisioned_concurrency_config(ctx, from_json, force, w
1398
3277
  if defined_tags is not None:
1399
3278
  _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1400
3279
 
1401
- _details['provisionedConcurrencyConfig']['strategy'] = 'NONE'
3280
+ if success_destination_channel_id is not None:
3281
+ _details['successDestination']['channelId'] = success_destination_channel_id
3282
+
3283
+ _details['successDestination']['kind'] = 'QUEUE'
1402
3284
 
1403
3285
  client = cli_util.build_client('functions', 'functions_management', ctx)
1404
3286
  result = client.update_function(
@@ -1432,9 +3314,8 @@ def update_function_none_provisioned_concurrency_config(ctx, from_json, force, w
1432
3314
  cli_util.render_response(result, ctx)
1433
3315
 
1434
3316
 
1435
- @function_group.command(name=cli_util.override('functions_management.update_function_constant_provisioned_concurrency_config.command_name', 'update-function-constant-provisioned-concurrency-config'), help=u"""Modifies a function \n[Command Reference](updateFunction)""")
3317
+ @function_group.command(name=cli_util.override('functions_management.update_function_none_success_destination_details.command_name', 'update-function-none-success-destination-details'), help=u"""Modifies a function \n[Command Reference](updateFunction)""")
1436
3318
  @cli_util.option('--function-id', required=True, help=u"""The [OCID] of this function.""")
1437
- @cli_util.option('--provisioned-concurrency-config-count', required=True, type=click.INT, help=u"""Configuration specifying a constant amount of provisioned concurrency.""")
1438
3319
  @cli_util.option('--image', help=u"""The qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. If an image is specified but no value for imageDigest is provided, the digest currently associated with the image tag in the OCI Registry will be used. Example: `phx.ocir.io/ten/functions/function:0.0.1`""")
1439
3320
  @cli_util.option('--image-digest', help=u"""The image digest for the version of the image that will be pulled when invoking this function. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`""")
1440
3321
  @cli_util.option('--memory-in-mbs', type=click.INT, help=u"""Maximum usable memory for the function (MiB).""")
@@ -1444,6 +3325,9 @@ Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
1444
3325
 
1445
3326
  The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1446
3327
  @cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Timeout for executions of the function. Value in seconds.""")
3328
+ @cli_util.option('--provisioned-concurrency-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3329
+ @cli_util.option('--detached-mode-timeout-in-seconds', type=click.INT, help=u"""Timeout for detached function invocations. Value in seconds.""")
3330
+ @cli_util.option('--failure-destination', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1447
3331
  @cli_util.option('--trace-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1448
3332
  @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
1449
3333
  @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags].
@@ -1454,18 +3338,18 @@ Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_comp
1454
3338
  @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1455
3339
  @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.""")
1456
3340
  @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.""")
1457
- @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
3341
+ @json_skeleton_utils.get_cli_json_input_option({'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}})
1458
3342
  @cli_util.help_option
1459
3343
  @click.pass_context
1460
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
3344
+ @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'config': {'module': 'functions', 'class': 'dict(str, string)'}, 'provisioned-concurrency-config': {'module': 'functions', 'class': 'FunctionProvisionedConcurrencyConfig'}, 'failure-destination': {'module': 'functions', 'class': 'FailureDestinationDetails'}, 'trace-config': {'module': 'functions', 'class': 'FunctionTraceConfig'}, 'freeform-tags': {'module': 'functions', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'functions', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'functions', 'class': 'Function'})
1461
3345
  @cli_util.wrap_exceptions
1462
- def update_function_constant_provisioned_concurrency_config(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, function_id, provisioned_concurrency_config_count, image, image_digest, memory_in_mbs, config, timeout_in_seconds, trace_config, freeform_tags, defined_tags, if_match):
3346
+ def update_function_none_success_destination_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, function_id, image, image_digest, memory_in_mbs, config, timeout_in_seconds, provisioned_concurrency_config, detached_mode_timeout_in_seconds, failure_destination, trace_config, freeform_tags, defined_tags, if_match):
1463
3347
 
1464
3348
  if isinstance(function_id, six.string_types) and len(function_id.strip()) == 0:
1465
3349
  raise click.UsageError('Parameter --function-id cannot be whitespace or empty string')
1466
3350
  if not force:
1467
- if config or trace_config or freeform_tags or defined_tags:
1468
- if not click.confirm("WARNING: Updates to config and trace-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
3351
+ if config or provisioned_concurrency_config or failure_destination or trace_config or freeform_tags or defined_tags:
3352
+ if not click.confirm("WARNING: Updates to config and provisioned-concurrency-config and failure-destination and trace-config and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
1469
3353
  ctx.abort()
1470
3354
 
1471
3355
  kwargs = {}
@@ -1474,8 +3358,7 @@ def update_function_constant_provisioned_concurrency_config(ctx, from_json, forc
1474
3358
  kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1475
3359
 
1476
3360
  _details = {}
1477
- _details['provisionedConcurrencyConfig'] = {}
1478
- _details['provisionedConcurrencyConfig']['count'] = provisioned_concurrency_config_count
3361
+ _details['successDestination'] = {}
1479
3362
 
1480
3363
  if image is not None:
1481
3364
  _details['image'] = image
@@ -1492,6 +3375,15 @@ def update_function_constant_provisioned_concurrency_config(ctx, from_json, forc
1492
3375
  if timeout_in_seconds is not None:
1493
3376
  _details['timeoutInSeconds'] = timeout_in_seconds
1494
3377
 
3378
+ if provisioned_concurrency_config is not None:
3379
+ _details['provisionedConcurrencyConfig'] = cli_util.parse_json_parameter("provisioned_concurrency_config", provisioned_concurrency_config)
3380
+
3381
+ if detached_mode_timeout_in_seconds is not None:
3382
+ _details['detachedModeTimeoutInSeconds'] = detached_mode_timeout_in_seconds
3383
+
3384
+ if failure_destination is not None:
3385
+ _details['failureDestination'] = cli_util.parse_json_parameter("failure_destination", failure_destination)
3386
+
1495
3387
  if trace_config is not None:
1496
3388
  _details['traceConfig'] = cli_util.parse_json_parameter("trace_config", trace_config)
1497
3389
 
@@ -1501,7 +3393,7 @@ def update_function_constant_provisioned_concurrency_config(ctx, from_json, forc
1501
3393
  if defined_tags is not None:
1502
3394
  _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
1503
3395
 
1504
- _details['provisionedConcurrencyConfig']['strategy'] = 'CONSTANT'
3396
+ _details['successDestination']['kind'] = 'NONE'
1505
3397
 
1506
3398
  client = cli_util.build_client('functions', 'functions_management', ctx)
1507
3399
  result = client.update_function(