oci-cli 3.64.0__py3-none-any.whl → 3.65.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 (508) hide show
  1. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/list-finding-analytics.txt +14 -0
  2. oci_cli/help_text_producer/data_files/text/cmdref/data-safe/security-assessment/list-findings.txt +8 -0
  3. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-container-database/create-autonomous-container-database-create-autonomous-container-database-from-backup-details.txt +2 -2
  4. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-container-database/create.txt +3 -3
  5. oci_cli/help_text_producer/data_files/text/cmdref/db/autonomous-container-database-backup/list.txt +2 -2
  6. oci_cli/help_text_producer/data_files/text/cmdref/db/data-guard-association/create/with-new-db-system.txt +15 -0
  7. oci_cli/help_text_producer/data_files/text/cmdref/db/database/create-from-backup.txt +10 -0
  8. oci_cli/help_text_producer/data_files/text/cmdref/db/database/create-standby-database.txt +14 -0
  9. oci_cli/help_text_producer/data_files/text/cmdref/db/database/create.txt +10 -0
  10. oci_cli/help_text_producer/data_files/text/cmdref/db/database/update.txt +11 -0
  11. oci_cli/help_text_producer/data_files/text/cmdref/db/exadb-vm-cluster/create.txt +9 -0
  12. oci_cli/help_text_producer/data_files/text/cmdref/db/exascale-db-storage-vault/list.txt +21 -0
  13. oci_cli/help_text_producer/data_files/text/cmdref/db/gi-version/list.txt +5 -0
  14. oci_cli/help_text_producer/data_files/text/cmdref/db/pluggable-database/create-local-clone.txt +4 -0
  15. oci_cli/help_text_producer/data_files/text/cmdref/db/pluggable-database/create-remote-clone.txt +4 -0
  16. oci_cli/help_text_producer/data_files/text/cmdref/{anomaly-detection/project/create.txt → db/pluggable-database/create-snapshot.txt} +30 -25
  17. oci_cli/help_text_producer/data_files/text/cmdref/{os-management/managed-instance/install-all-updates.txt → db/pluggable-database/delete-snapshot.txt} +21 -17
  18. oci_cli/help_text_producer/data_files/text/cmdref/{os-management/work-request/get.txt → db/pluggable-database/get-snapshot.txt} +9 -8
  19. oci_cli/help_text_producer/data_files/text/cmdref/{service-mesh/access-policy/list.txt → db/pluggable-database/list-snapshots.txt} +32 -37
  20. oci_cli/help_text_producer/data_files/text/cmdref/db/pluggable-database.txt +8 -0
  21. oci_cli/help_text_producer/data_files/text/cmdref/db/system/launch-from-backup.txt +42 -27
  22. oci_cli/help_text_producer/data_files/text/cmdref/db/system/launch-from-database.txt +42 -27
  23. oci_cli/help_text_producer/data_files/text/cmdref/db/system/launch-from-db-system.txt +42 -27
  24. oci_cli/help_text_producer/data_files/text/cmdref/db/system/launch.txt +42 -27
  25. oci_cli/help_text_producer/data_files/text/cmdref/db/system/list-db-system-storage-performances.txt +4 -0
  26. oci_cli/help_text_producer/data_files/text/cmdref/db/system/update.txt +15 -0
  27. oci_cli/help_text_producer/data_files/text/cmdref/db/system-shape/list.txt +5 -0
  28. oci_cli/help_text_producer/data_files/text/cmdref/db/version/list.txt +5 -0
  29. oci_cli/help_text_producer/data_files/text/cmdref/db.txt +8 -0
  30. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/work-request-error/{list.txt → list-errors.txt} +5 -5
  31. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/work-request-error.txt +1 -1
  32. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/{work-request-log/list.txt → work-request-log-entry/list-logs.txt} +5 -5
  33. oci_cli/help_text_producer/data_files/text/cmdref/{anomaly-detection → delegate-access-control/work-request}/work-request-log-entry.txt +1 -1
  34. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request.txt +3 -3
  35. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control.txt +3 -3
  36. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-inference/chat-result/chat-cohere-chat-request.txt +3 -1
  37. oci_cli/help_text_producer/data_files/text/cmdref/generative-ai-inference/chat-result/chat-generic-chat-request.txt +83 -3
  38. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/deployment/create.txt +12 -0
  39. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/deployment/list.txt +9 -0
  40. oci_cli/help_text_producer/data_files/text/cmdref/goldengate/deployment/update.txt +12 -0
  41. 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
  42. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request/work-request-error.txt +1 -1
  43. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request/work-request-log-entry/{list-work-request-logs.txt → list-logs.txt} +5 -5
  44. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request/work-request-log-entry.txt +1 -1
  45. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane/work-request.txt +2 -2
  46. oci_cli/help_text_producer/data_files/text/cmdref/governance-rules-control-plane.txt +2 -2
  47. oci_cli/help_text_producer/data_files/text/cmdref/{service-mesh/mesh/delete.txt → kafka/cluster/change-compartment.txt} +15 -20
  48. oci_cli/help_text_producer/data_files/text/cmdref/{service-mesh/virtual-service → kafka/cluster}/create.txt +78 -66
  49. oci_cli/help_text_producer/data_files/text/cmdref/{anomaly-detection/project → kafka/cluster}/delete.txt +7 -12
  50. oci_cli/help_text_producer/data_files/text/cmdref/{os-management/managed-instance/install-all-windows-updates.txt → kafka/cluster/disable-superuser.txt} +17 -17
  51. oci_cli/help_text_producer/data_files/text/cmdref/{service-mesh/mesh/change-compartment.txt → kafka/cluster/enable-superuser.txt} +17 -18
  52. oci_cli/help_text_producer/data_files/text/cmdref/{os-management/erratum → kafka/cluster}/get.txt +6 -6
  53. oci_cli/help_text_producer/data_files/text/cmdref/{dts/export → kafka/cluster}/list.txt +36 -23
  54. oci_cli/help_text_producer/data_files/text/cmdref/{service-mesh/mesh → kafka/cluster}/update.txt +68 -45
  55. oci_cli/help_text_producer/data_files/text/cmdref/{anomaly-detection/project → kafka/cluster-config}/change-compartment.txt +10 -10
  56. oci_cli/help_text_producer/data_files/text/cmdref/{anomaly-detection/data-asset → kafka/cluster-config}/create.txt +30 -33
  57. oci_cli/help_text_producer/data_files/text/cmdref/{os-management/managed-instance-group → kafka/cluster-config}/delete.txt +7 -10
  58. oci_cli/help_text_producer/data_files/text/cmdref/{os-management/windows-update → kafka/cluster-config}/get.txt +6 -6
  59. oci_cli/help_text_producer/data_files/text/cmdref/{service-mesh/mesh → kafka/cluster-config}/list.txt +25 -30
  60. oci_cli/help_text_producer/data_files/text/cmdref/{anomaly-detection/data-asset → kafka/cluster-config}/update.txt +40 -30
  61. oci_cli/help_text_producer/data_files/text/cmdref/{anomaly-detection/work-request/cancel.txt → kafka/cluster-config-version/delete.txt} +12 -7
  62. oci_cli/help_text_producer/data_files/text/cmdref/{anomaly-detection/project → kafka/cluster-config-version}/get.txt +11 -8
  63. oci_cli/help_text_producer/data_files/text/cmdref/{dts/job → kafka/cluster-config-version}/list.txt +25 -23
  64. oci_cli/help_text_producer/data_files/text/cmdref/kafka/cluster-config-version.txt +18 -0
  65. oci_cli/help_text_producer/data_files/text/cmdref/kafka/cluster-config.txt +29 -0
  66. oci_cli/help_text_producer/data_files/text/cmdref/kafka/cluster.txt +33 -0
  67. oci_cli/help_text_producer/data_files/text/cmdref/{service-mesh → kafka}/work-request/cancel.txt +5 -5
  68. oci_cli/help_text_producer/data_files/text/cmdref/{service-mesh → kafka}/work-request/get.txt +5 -5
  69. oci_cli/help_text_producer/data_files/text/cmdref/{service-mesh → kafka}/work-request/list.txt +26 -31
  70. oci_cli/help_text_producer/data_files/text/cmdref/kafka/work-request-error/list.txt +131 -0
  71. oci_cli/help_text_producer/data_files/text/cmdref/{anomaly-detection → kafka}/work-request-error.txt +2 -1
  72. oci_cli/help_text_producer/data_files/text/cmdref/{service-mesh/work-request → kafka/work-request-log-entry}/list-work-request-logs.txt +14 -11
  73. oci_cli/help_text_producer/data_files/text/cmdref/kafka/work-request-log-entry.txt +15 -0
  74. oci_cli/help_text_producer/data_files/text/cmdref/kafka/work-request.txt +23 -0
  75. oci_cli/help_text_producer/data_files/text/cmdref/kafka.txt +69 -0
  76. oci_cli/help_text_producer/data_files/text/cmdref/lfs/lustre-file-system.txt +1 -1
  77. oci_cli/help_text_producer/data_files/text/cmdref/lfs.txt +2 -1
  78. oci_cli/help_text_producer/data_files/text/cmdref/network/ipv6/create.txt +4 -0
  79. oci_cli/help_text_producer/data_files/text/cmdref/network/vnic/assign-ipv6.txt +4 -0
  80. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/work-request-error/{list.txt → list-errors.txt} +5 -5
  81. oci_cli/help_text_producer/data_files/text/cmdref/ocvs/work-request-error.txt +1 -1
  82. oci_cli/help_text_producer/data_files/text/cmdref/ocvs.txt +1 -1
  83. oci_cli/help_text_producer/data_files/text/cmdref/organizations/work-request-error/{list.txt → list-errors.txt} +5 -5
  84. oci_cli/help_text_producer/data_files/text/cmdref/organizations/work-request-error.txt +1 -1
  85. oci_cli/help_text_producer/data_files/text/cmdref/organizations.txt +1 -1
  86. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/create.txt +6 -6
  87. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/get.txt +2 -2
  88. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/list.txt +1 -1
  89. oci_cli/help_text_producer/data_files/text/cmdref/support/incident/update.txt +4 -4
  90. oci_cli/help_text_producer/data_files/text/cmdref/support/incident-resource-type/list.txt +3 -3
  91. oci_cli/help_text_producer/data_files/text/cmdref/support/validation-response/validate-user.txt +1 -1
  92. oci_cli/help_text_producer/data_files/text/index.txt +2 -8
  93. oci_cli/service_mapping.py +5 -20
  94. oci_cli/version.py +1 -1
  95. {oci_cli-3.64.0.dist-info → oci_cli-3.65.0.dist-info}/METADATA +2 -2
  96. {oci_cli-3.64.0.dist-info → oci_cli-3.65.0.dist-info}/RECORD +117 -498
  97. services/cims/src/oci_cli_incident/cims_cli_extended.py +1 -1
  98. services/core/src/oci_cli_virtual_network/generated/virtualnetwork_cli.py +5 -1
  99. services/core/src/oci_cli_virtual_network/virtualnetwork_cli_extended.py +5 -1
  100. services/data_safe/src/oci_cli_data_safe/generated/datasafe_cli.py +12 -2
  101. services/database/src/oci_cli_database/database_cli_extended.py +109 -3
  102. services/database/src/oci_cli_database/generated/database_cli.py +381 -63
  103. services/generative_ai_inference/src/oci_cli_generative_ai_inference/generated/generativeaiinference_cli.py +39 -5
  104. services/golden_gate/src/oci_cli_golden_gate/generated/goldengate_cli.py +22 -3
  105. services/{ai_anomaly_detection → managed_kafka}/__init__.py +1 -1
  106. services/{ai_anomaly_detection → managed_kafka}/src/__init__.py +1 -1
  107. services/{ai_anomaly_detection/src/oci_cli_anomaly_detection → managed_kafka/src/oci_cli_kafka_cluster}/__init__.py +1 -1
  108. services/{ai_anomaly_detection/src/oci_cli_anomaly_detection → managed_kafka/src/oci_cli_kafka_cluster}/generated/__init__.py +1 -1
  109. services/{os_management/src/oci_cli_os_management → managed_kafka/src/oci_cli_kafka_cluster}/generated/client_mappings.py +6 -6
  110. services/managed_kafka/src/oci_cli_kafka_cluster/generated/kafkacluster_cli.py +1254 -0
  111. services/managed_kafka/src/oci_cli_kafka_cluster/kafkacluster_cli_extended.py +46 -0
  112. services/managed_kafka/tests/__init__.py +4 -0
  113. oci_cli/bin/dts.psm1 +0 -147
  114. oci_cli/bin/os-management.psm1 +0 -140
  115. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/data-asset/change-compartment.txt +0 -138
  116. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/data-asset/create-data-source-atp.txt +0 -207
  117. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/data-asset/create-data-source-influx.txt +0 -198
  118. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/data-asset/create-data-source-os.txt +0 -174
  119. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/data-asset/delete.txt +0 -138
  120. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/data-asset/get.txt +0 -100
  121. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/data-asset/list.txt +0 -146
  122. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/data-asset.txt +0 -30
  123. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/detect-anomaly-job/change-compartment.txt +0 -119
  124. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/detect-anomaly-job/create-detect-anomaly-job-embedded-input-details.txt +0 -144
  125. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/detect-anomaly-job/create-detect-anomaly-job-inline-input-details.txt +0 -185
  126. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/detect-anomaly-job/create-detect-anomaly-job-object-list-input-details.txt +0 -173
  127. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/detect-anomaly-job/create-detect-anomaly-job-object-store-output-details.txt +0 -175
  128. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/detect-anomaly-job/create.txt +0 -173
  129. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/detect-anomaly-job/delete.txt +0 -143
  130. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/detect-anomaly-job/get.txt +0 -105
  131. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/detect-anomaly-job/update.txt +0 -147
  132. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/detect-anomaly-job-collection/list-detect-anomaly-jobs.txt +0 -155
  133. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/detect-anomaly-job-collection.txt +0 -15
  134. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/detect-anomaly-job.txt +0 -31
  135. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/model/change-compartment.txt +0 -113
  136. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/model/create.txt +0 -174
  137. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/model/delete.txt +0 -140
  138. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/model/detect-anomalies-embedded.txt +0 -124
  139. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/model/detect-anomalies-inline.txt +0 -139
  140. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/model/detect-anomalies.txt +0 -125
  141. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/model/get.txt +0 -100
  142. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/model/list.txt +0 -148
  143. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/model/update.txt +0 -173
  144. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/model.txt +0 -30
  145. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/pe/change-compartment.txt +0 -138
  146. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/pe/create.txt +0 -170
  147. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/pe/delete.txt +0 -137
  148. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/pe/get.txt +0 -99
  149. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/pe/list.txt +0 -147
  150. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/pe/update.txt +0 -180
  151. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/pe.txt +0 -25
  152. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/project/list.txt +0 -144
  153. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/project/update.txt +0 -166
  154. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/project.txt +0 -24
  155. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/work-request/get.txt +0 -91
  156. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/work-request/list.txt +0 -114
  157. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/work-request-error/list.txt +0 -110
  158. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/work-request-log-entry/list-work-request-logs.txt +0 -110
  159. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection/work-request.txt +0 -18
  160. oci_cli/help_text_producer/data_files/text/cmdref/anomaly-detection.txt +0 -125
  161. oci_cli/help_text_producer/data_files/text/cmdref/delegate-access-control/work-request/work-request-log.txt +0 -14
  162. oci_cli/help_text_producer/data_files/text/cmdref/dts/appliance/cancel.txt +0 -101
  163. oci_cli/help_text_producer/data_files/text/cmdref/dts/appliance/delete.txt +0 -105
  164. oci_cli/help_text_producer/data_files/text/cmdref/dts/appliance/get-passphrase.txt +0 -101
  165. oci_cli/help_text_producer/data_files/text/cmdref/dts/appliance/list.txt +0 -100
  166. oci_cli/help_text_producer/data_files/text/cmdref/dts/appliance/never-receive.txt +0 -101
  167. oci_cli/help_text_producer/data_files/text/cmdref/dts/appliance/request-entitlement.txt +0 -189
  168. oci_cli/help_text_producer/data_files/text/cmdref/dts/appliance/request-return-label.txt +0 -249
  169. oci_cli/help_text_producer/data_files/text/cmdref/dts/appliance/request.txt +0 -188
  170. oci_cli/help_text_producer/data_files/text/cmdref/dts/appliance/setup-notifications.txt +0 -63
  171. oci_cli/help_text_producer/data_files/text/cmdref/dts/appliance/show-entitlement.txt +0 -113
  172. oci_cli/help_text_producer/data_files/text/cmdref/dts/appliance/show.txt +0 -101
  173. oci_cli/help_text_producer/data_files/text/cmdref/dts/appliance/update-minimum-storage-capacity.txt +0 -107
  174. oci_cli/help_text_producer/data_files/text/cmdref/dts/appliance/update-shipping-address.txt +0 -154
  175. oci_cli/help_text_producer/data_files/text/cmdref/dts/appliance.txt +0 -38
  176. oci_cli/help_text_producer/data_files/text/cmdref/dts/export/change-compartment.txt +0 -106
  177. oci_cli/help_text_producer/data_files/text/cmdref/dts/export/configure-physical-appliance.txt +0 -114
  178. oci_cli/help_text_producer/data_files/text/cmdref/dts/export/create-policy.txt +0 -68
  179. oci_cli/help_text_producer/data_files/text/cmdref/dts/export/create.txt +0 -226
  180. oci_cli/help_text_producer/data_files/text/cmdref/dts/export/delete.txt +0 -132
  181. oci_cli/help_text_producer/data_files/text/cmdref/dts/export/generate-manifest.txt +0 -97
  182. oci_cli/help_text_producer/data_files/text/cmdref/dts/export/get-passphrase.txt +0 -68
  183. oci_cli/help_text_producer/data_files/text/cmdref/dts/export/request-appliance.txt +0 -68
  184. oci_cli/help_text_producer/data_files/text/cmdref/dts/export/request-return-label.txt +0 -245
  185. oci_cli/help_text_producer/data_files/text/cmdref/dts/export/setup-notifications.txt +0 -51
  186. oci_cli/help_text_producer/data_files/text/cmdref/dts/export/show.txt +0 -96
  187. oci_cli/help_text_producer/data_files/text/cmdref/dts/export/update.txt +0 -265
  188. oci_cli/help_text_producer/data_files/text/cmdref/dts/export.txt +0 -38
  189. oci_cli/help_text_producer/data_files/text/cmdref/dts/job/change-compartment.txt +0 -106
  190. oci_cli/help_text_producer/data_files/text/cmdref/dts/job/close.txt +0 -96
  191. oci_cli/help_text_producer/data_files/text/cmdref/dts/job/create.txt +0 -192
  192. oci_cli/help_text_producer/data_files/text/cmdref/dts/job/delete.txt +0 -100
  193. oci_cli/help_text_producer/data_files/text/cmdref/dts/job/detach-devices-details/change-compartment.txt +0 -102
  194. oci_cli/help_text_producer/data_files/text/cmdref/dts/job/detach-devices-details.txt +0 -12
  195. oci_cli/help_text_producer/data_files/text/cmdref/dts/job/setup-notifications.txt +0 -68
  196. oci_cli/help_text_producer/data_files/text/cmdref/dts/job/show.txt +0 -96
  197. oci_cli/help_text_producer/data_files/text/cmdref/dts/job/update.txt +0 -150
  198. oci_cli/help_text_producer/data_files/text/cmdref/dts/job/verify-upload-user-credentials.txt +0 -91
  199. oci_cli/help_text_producer/data_files/text/cmdref/dts/job.txt +0 -34
  200. oci_cli/help_text_producer/data_files/text/cmdref/dts/nfs-dataset/activate.txt +0 -93
  201. oci_cli/help_text_producer/data_files/text/cmdref/dts/nfs-dataset/create.txt +0 -93
  202. oci_cli/help_text_producer/data_files/text/cmdref/dts/nfs-dataset/deactivate.txt +0 -77
  203. oci_cli/help_text_producer/data_files/text/cmdref/dts/nfs-dataset/delete.txt +0 -77
  204. oci_cli/help_text_producer/data_files/text/cmdref/dts/nfs-dataset/get-seal-manifest.txt +0 -81
  205. oci_cli/help_text_producer/data_files/text/cmdref/dts/nfs-dataset/list.txt +0 -67
  206. oci_cli/help_text_producer/data_files/text/cmdref/dts/nfs-dataset/reopen.txt +0 -77
  207. oci_cli/help_text_producer/data_files/text/cmdref/dts/nfs-dataset/seal-status.txt +0 -77
  208. oci_cli/help_text_producer/data_files/text/cmdref/dts/nfs-dataset/seal.txt +0 -75
  209. oci_cli/help_text_producer/data_files/text/cmdref/dts/nfs-dataset/set-export.txt +0 -93
  210. oci_cli/help_text_producer/data_files/text/cmdref/dts/nfs-dataset/show.txt +0 -77
  211. oci_cli/help_text_producer/data_files/text/cmdref/dts/nfs-dataset.txt +0 -34
  212. oci_cli/help_text_producer/data_files/text/cmdref/dts/physical-appliance/configure-encryption.txt +0 -81
  213. oci_cli/help_text_producer/data_files/text/cmdref/dts/physical-appliance/finalize.txt +0 -89
  214. oci_cli/help_text_producer/data_files/text/cmdref/dts/physical-appliance/initialize-authentication.txt +0 -106
  215. oci_cli/help_text_producer/data_files/text/cmdref/dts/physical-appliance/list.txt +0 -63
  216. oci_cli/help_text_producer/data_files/text/cmdref/dts/physical-appliance/show.txt +0 -67
  217. oci_cli/help_text_producer/data_files/text/cmdref/dts/physical-appliance/unlock.txt +0 -75
  218. oci_cli/help_text_producer/data_files/text/cmdref/dts/physical-appliance/unregister.txt +0 -67
  219. oci_cli/help_text_producer/data_files/text/cmdref/dts/physical-appliance.txt +0 -26
  220. oci_cli/help_text_producer/data_files/text/cmdref/dts/verify/configured.txt +0 -111
  221. oci_cli/help_text_producer/data_files/text/cmdref/dts/verify/copied.txt +0 -105
  222. oci_cli/help_text_producer/data_files/text/cmdref/dts/verify/monitored.txt +0 -102
  223. oci_cli/help_text_producer/data_files/text/cmdref/dts/verify/prepared.txt +0 -104
  224. oci_cli/help_text_producer/data_files/text/cmdref/dts/verify/shipped.txt +0 -106
  225. oci_cli/help_text_producer/data_files/text/cmdref/dts/verify.txt +0 -22
  226. oci_cli/help_text_producer/data_files/text/cmdref/dts.txt +0 -144
  227. oci_cli/help_text_producer/data_files/text/cmdref/os-management/erratum-summary/list-errata.txt +0 -310
  228. oci_cli/help_text_producer/data_files/text/cmdref/os-management/erratum-summary.txt +0 -15
  229. oci_cli/help_text_producer/data_files/text/cmdref/os-management/erratum.txt +0 -14
  230. oci_cli/help_text_producer/data_files/text/cmdref/os-management/event/delete-content.txt +0 -113
  231. oci_cli/help_text_producer/data_files/text/cmdref/os-management/event/get-content.txt +0 -108
  232. oci_cli/help_text_producer/data_files/text/cmdref/os-management/event/get-report.txt +0 -270
  233. oci_cli/help_text_producer/data_files/text/cmdref/os-management/event/list-related-events.txt +0 -307
  234. oci_cli/help_text_producer/data_files/text/cmdref/os-management/event/list.txt +0 -319
  235. oci_cli/help_text_producer/data_files/text/cmdref/os-management/event/update.txt +0 -139
  236. oci_cli/help_text_producer/data_files/text/cmdref/os-management/event/upload-content.txt +0 -110
  237. oci_cli/help_text_producer/data_files/text/cmdref/os-management/event.txt +0 -27
  238. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/attach-child.txt +0 -102
  239. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/attach-parent.txt +0 -104
  240. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/detach-child.txt +0 -101
  241. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/detach-parent.txt +0 -102
  242. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/disable-module-stream.txt +0 -138
  243. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/enable-module-stream.txt +0 -139
  244. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/get.txt +0 -91
  245. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/install-module-profile.txt +0 -141
  246. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/install-package.txt +0 -123
  247. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/install-update.txt +0 -123
  248. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/install-windows-update.txt +0 -124
  249. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/list-available-packages.txt +0 -142
  250. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/list-available-software-sources.txt +0 -141
  251. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/list-available-updates.txt +0 -141
  252. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/list-available-windows-updates.txt +0 -150
  253. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/list-installed-packages.txt +0 -141
  254. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/list-installed-windows-updates.txt +0 -142
  255. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/list-managed-instance-errata.txt +0 -141
  256. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/list-module-profiles.txt +0 -210
  257. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/list-module-streams.txt +0 -210
  258. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/list.txt +0 -144
  259. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/remove-module-profile.txt +0 -142
  260. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/remove-package.txt +0 -123
  261. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance/switch-module-stream.txt +0 -138
  262. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance-group/attach.txt +0 -102
  263. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance-group/change-compartment.txt +0 -107
  264. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance-group/create.txt +0 -163
  265. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance-group/detach.txt +0 -99
  266. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance-group/get.txt +0 -94
  267. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance-group/install-all-updates.txt +0 -128
  268. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance-group/list.txt +0 -152
  269. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance-group/update.txt +0 -166
  270. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance-group.txt +0 -30
  271. oci_cli/help_text_producer/data_files/text/cmdref/os-management/managed-instance.txt +0 -64
  272. oci_cli/help_text_producer/data_files/text/cmdref/os-management/module-profile/get.txt +0 -137
  273. oci_cli/help_text_producer/data_files/text/cmdref/os-management/module-profile/list.txt +0 -189
  274. oci_cli/help_text_producer/data_files/text/cmdref/os-management/module-profile.txt +0 -16
  275. oci_cli/help_text_producer/data_files/text/cmdref/os-management/module-stream/get.txt +0 -132
  276. oci_cli/help_text_producer/data_files/text/cmdref/os-management/module-stream/list.txt +0 -188
  277. oci_cli/help_text_producer/data_files/text/cmdref/os-management/module-stream.txt +0 -16
  278. oci_cli/help_text_producer/data_files/text/cmdref/os-management/scheduled-job/change-compartment.txt +0 -110
  279. oci_cli/help_text_producer/data_files/text/cmdref/os-management/scheduled-job/create.txt +0 -357
  280. oci_cli/help_text_producer/data_files/text/cmdref/os-management/scheduled-job/delete.txt +0 -135
  281. oci_cli/help_text_producer/data_files/text/cmdref/os-management/scheduled-job/get.txt +0 -97
  282. oci_cli/help_text_producer/data_files/text/cmdref/os-management/scheduled-job/list-upcoming.txt +0 -251
  283. oci_cli/help_text_producer/data_files/text/cmdref/os-management/scheduled-job/list.txt +0 -174
  284. oci_cli/help_text_producer/data_files/text/cmdref/os-management/scheduled-job/run-now.txt +0 -106
  285. oci_cli/help_text_producer/data_files/text/cmdref/os-management/scheduled-job/skip-next-execution.txt +0 -106
  286. oci_cli/help_text_producer/data_files/text/cmdref/os-management/scheduled-job/update.txt +0 -323
  287. oci_cli/help_text_producer/data_files/text/cmdref/os-management/scheduled-job.txt +0 -30
  288. oci_cli/help_text_producer/data_files/text/cmdref/os-management/software-source/add-packages.txt +0 -111
  289. oci_cli/help_text_producer/data_files/text/cmdref/os-management/software-source/change-compartment.txt +0 -108
  290. oci_cli/help_text_producer/data_files/text/cmdref/os-management/software-source/create.txt +0 -187
  291. oci_cli/help_text_producer/data_files/text/cmdref/os-management/software-source/delete.txt +0 -133
  292. oci_cli/help_text_producer/data_files/text/cmdref/os-management/software-source/get-package.txt +0 -101
  293. oci_cli/help_text_producer/data_files/text/cmdref/os-management/software-source/get.txt +0 -95
  294. oci_cli/help_text_producer/data_files/text/cmdref/os-management/software-source/list-packages.txt +0 -145
  295. oci_cli/help_text_producer/data_files/text/cmdref/os-management/software-source/list.txt +0 -144
  296. oci_cli/help_text_producer/data_files/text/cmdref/os-management/software-source/remove-packages.txt +0 -112
  297. oci_cli/help_text_producer/data_files/text/cmdref/os-management/software-source/search-packages.txt +0 -124
  298. oci_cli/help_text_producer/data_files/text/cmdref/os-management/software-source/update.txt +0 -187
  299. oci_cli/help_text_producer/data_files/text/cmdref/os-management/software-source.txt +0 -34
  300. oci_cli/help_text_producer/data_files/text/cmdref/os-management/update-managed-instance-details/update-managed-instance.txt +0 -107
  301. oci_cli/help_text_producer/data_files/text/cmdref/os-management/update-managed-instance-details.txt +0 -14
  302. oci_cli/help_text_producer/data_files/text/cmdref/os-management/windows-update/list.txt +0 -129
  303. oci_cli/help_text_producer/data_files/text/cmdref/os-management/windows-update.txt +0 -16
  304. oci_cli/help_text_producer/data_files/text/cmdref/os-management/work-request/list-errors.txt +0 -128
  305. oci_cli/help_text_producer/data_files/text/cmdref/os-management/work-request/list-logs.txt +0 -128
  306. oci_cli/help_text_producer/data_files/text/cmdref/os-management/work-request/list.txt +0 -148
  307. oci_cli/help_text_producer/data_files/text/cmdref/os-management/work-request.txt +0 -20
  308. oci_cli/help_text_producer/data_files/text/cmdref/os-management.txt +0 -187
  309. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/access-policy/change-compartment.txt +0 -143
  310. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/access-policy/create.txt +0 -187
  311. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/access-policy/delete.txt +0 -141
  312. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/access-policy/get.txt +0 -103
  313. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/access-policy/update.txt +0 -193
  314. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/access-policy.txt +0 -25
  315. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/debug/report.txt +0 -60
  316. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/debug.txt +0 -14
  317. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/ingress-gateway/change-compartment.txt +0 -143
  318. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/ingress-gateway/create.txt +0 -210
  319. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/ingress-gateway/delete.txt +0 -141
  320. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/ingress-gateway/get.txt +0 -103
  321. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/ingress-gateway/list.txt +0 -150
  322. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/ingress-gateway/update.txt +0 -215
  323. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/ingress-gateway-route-table/change-compartment.txt +0 -147
  324. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/ingress-gateway-route-table/create.txt +0 -197
  325. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/ingress-gateway-route-table/delete.txt +0 -145
  326. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/ingress-gateway-route-table/get.txt +0 -107
  327. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/ingress-gateway-route-table/list.txt +0 -150
  328. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/ingress-gateway-route-table/update.txt +0 -203
  329. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/ingress-gateway-route-table.txt +0 -25
  330. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/ingress-gateway.txt +0 -26
  331. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/mesh/create.txt +0 -190
  332. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/mesh/get.txt +0 -99
  333. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/mesh.txt +0 -27
  334. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/proxy-details/get.txt +0 -79
  335. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/proxy-details.txt +0 -14
  336. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-deployment/change-compartment.txt +0 -143
  337. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-deployment/create-virtual-deployment-disabled-service-discovery-configuration.txt +0 -204
  338. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-deployment/create-virtual-deployment-dns-service-discovery-configuration.txt +0 -209
  339. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-deployment/create.txt +0 -215
  340. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-deployment/delete.txt +0 -141
  341. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-deployment/get.txt +0 -103
  342. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-deployment/list.txt +0 -150
  343. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-deployment/update-virtual-deployment-disabled-service-discovery-configuration.txt +0 -204
  344. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-deployment/update-virtual-deployment-dns-service-discovery-configuration.txt +0 -209
  345. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-deployment/update.txt +0 -215
  346. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-deployment.txt +0 -33
  347. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-service/change-compartment.txt +0 -141
  348. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-service/delete.txt +0 -139
  349. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-service/get.txt +0 -101
  350. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-service/list.txt +0 -150
  351. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-service/update.txt +0 -211
  352. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-service-route-table/change-compartment.txt +0 -145
  353. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-service-route-table/create.txt +0 -195
  354. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-service-route-table/delete.txt +0 -143
  355. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-service-route-table/get.txt +0 -105
  356. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-service-route-table/list.txt +0 -150
  357. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-service-route-table/update.txt +0 -201
  358. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-service-route-table.txt +0 -25
  359. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/virtual-service.txt +0 -27
  360. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/work-request/list-work-request-errors.txt +0 -128
  361. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh/work-request.txt +0 -22
  362. oci_cli/help_text_producer/data_files/text/cmdref/service-mesh.txt +0 -139
  363. services/ai_anomaly_detection/src/oci_cli_anomaly_detection/anomalydetection_cli_extended.py +0 -234
  364. services/ai_anomaly_detection/src/oci_cli_anomaly_detection/generated/anomalydetection_cli.py +0 -2665
  365. services/ai_anomaly_detection/src/oci_cli_anomaly_detection/generated/client_mappings.py +0 -14
  366. services/ai_anomaly_detection/tests/__init__.py +0 -4
  367. services/dts/__init__.py +0 -4
  368. services/dts/src/__init__.py +0 -4
  369. services/dts/src/oci_cli_appliance_export_job/__init__.py +0 -4
  370. services/dts/src/oci_cli_appliance_export_job/applianceexportjob_cli_extended.py +0 -582
  371. services/dts/src/oci_cli_appliance_export_job/applianceexportjob_constants.py +0 -11
  372. services/dts/src/oci_cli_appliance_export_job/generated/__init__.py +0 -4
  373. services/dts/src/oci_cli_appliance_export_job/generated/applianceexportjob_cli.py +0 -428
  374. services/dts/src/oci_cli_appliance_export_job/generated/client_mappings.py +0 -14
  375. services/dts/src/oci_cli_appliance_export_job/manifest/__init__.py +0 -3
  376. services/dts/src/oci_cli_appliance_export_job/manifest/manifest_constants.py +0 -12
  377. services/dts/src/oci_cli_appliance_export_job/manifest/manifest_iterator.py +0 -86
  378. services/dts/src/oci_cli_appliance_export_job/manifest/manifest_line_item.py +0 -22
  379. services/dts/src/oci_cli_appliance_export_job/manifest/manifest_stats.py +0 -93
  380. services/dts/src/oci_cli_appliance_export_job/manifest/manifest_stats_consumer.py +0 -15
  381. services/dts/src/oci_cli_appliance_export_job/manifest/manifest_writer.py +0 -117
  382. services/dts/src/oci_cli_appliance_export_job/manifest/object_uploader.py +0 -124
  383. services/dts/src/oci_cli_dts/__init__.py +0 -4
  384. services/dts/src/oci_cli_dts/appliance_auth_manager.py +0 -59
  385. services/dts/src/oci_cli_dts/appliance_cert_manager.py +0 -51
  386. services/dts/src/oci_cli_dts/appliance_client_proxy.py +0 -57
  387. services/dts/src/oci_cli_dts/appliance_config.py +0 -34
  388. services/dts/src/oci_cli_dts/appliance_config_manager.py +0 -145
  389. services/dts/src/oci_cli_dts/appliance_config_spec.py +0 -38
  390. services/dts/src/oci_cli_dts/appliance_constants.py +0 -35
  391. services/dts/src/oci_cli_dts/appliance_init_auth.py +0 -81
  392. services/dts/src/oci_cli_dts/appliance_init_auth_spec.py +0 -32
  393. services/dts/src/oci_cli_dts/base_client.py +0 -102
  394. services/dts/src/oci_cli_dts/cli_utils.py +0 -131
  395. services/dts/src/oci_cli_dts/dts_service_cli_extended.py +0 -95
  396. services/dts/src/oci_cli_dts/dts_transform.py +0 -31
  397. services/dts/src/oci_cli_dts/generated/__init__.py +0 -4
  398. services/dts/src/oci_cli_dts/generated/dts_service_cli.py +0 -14
  399. services/dts/src/oci_cli_dts/nfs_dataset_client_proxy.py +0 -85
  400. services/dts/src/oci_cli_dts/nfsdataset_cli_extended.py +0 -371
  401. services/dts/src/oci_cli_dts/physical_appliance_control_plane/__init__.py +0 -3
  402. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/__init__.py +0 -16
  403. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/diagnose_tools_client.py +0 -163
  404. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/diagnose_tools_client_composite_operations.py +0 -24
  405. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/models/__init__.py +0 -28
  406. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/models/dataset_seal_status.py +0 -282
  407. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/models/details.py +0 -66
  408. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/models/nfs_dataset_info.py +0 -191
  409. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/models/nfs_dataset_spec.py +0 -93
  410. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/models/nfs_export_config.py +0 -174
  411. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/models/nfs_export_details.py +0 -66
  412. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/models/object_storage_upload_config.py +0 -201
  413. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/models/passphrase_details.py +0 -66
  414. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/models/physical_transfer_appliance.py +0 -214
  415. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/nfs_dataset_client.py +0 -835
  416. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/nfs_dataset_client_composite_operations.py +0 -24
  417. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/physical_transfer_appliance_client.py +0 -374
  418. services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/physical_transfer_appliance_client_composite_operations.py +0 -24
  419. services/dts/src/oci_cli_dts/physical_appliance_control_plane/service_endpoints.py +0 -9
  420. services/dts/src/oci_cli_dts/physicalappliance_cli_extended.py +0 -590
  421. services/dts/src/oci_cli_dts/verify_cli_extended.py +0 -494
  422. services/dts/src/oci_cli_shipping_vendors/__init__.py +0 -4
  423. services/dts/src/oci_cli_shipping_vendors/generated/__init__.py +0 -4
  424. services/dts/src/oci_cli_shipping_vendors/generated/client_mappings.py +0 -14
  425. services/dts/src/oci_cli_shipping_vendors/generated/shippingvendors_cli.py +0 -49
  426. services/dts/src/oci_cli_transfer_appliance/__init__.py +0 -4
  427. services/dts/src/oci_cli_transfer_appliance/generated/__init__.py +0 -4
  428. services/dts/src/oci_cli_transfer_appliance/generated/client_mappings.py +0 -14
  429. services/dts/src/oci_cli_transfer_appliance/generated/transferappliance_cli.py +0 -364
  430. services/dts/src/oci_cli_transfer_appliance/transferappliance_cli_extended.py +0 -362
  431. services/dts/src/oci_cli_transfer_appliance_entitlement/__init__.py +0 -4
  432. services/dts/src/oci_cli_transfer_appliance_entitlement/generated/__init__.py +0 -4
  433. services/dts/src/oci_cli_transfer_appliance_entitlement/generated/client_mappings.py +0 -14
  434. services/dts/src/oci_cli_transfer_appliance_entitlement/generated/transferapplianceentitlement_cli.py +0 -155
  435. services/dts/src/oci_cli_transfer_appliance_entitlement/transferapplianceentitlement_cli_extended.py +0 -66
  436. services/dts/src/oci_cli_transfer_device/__init__.py +0 -4
  437. services/dts/src/oci_cli_transfer_device/generated/__init__.py +0 -4
  438. services/dts/src/oci_cli_transfer_device/generated/client_mappings.py +0 -14
  439. services/dts/src/oci_cli_transfer_device/generated/transferdevice_cli.py +0 -209
  440. services/dts/src/oci_cli_transfer_job/__init__.py +0 -4
  441. services/dts/src/oci_cli_transfer_job/generated/__init__.py +0 -4
  442. services/dts/src/oci_cli_transfer_job/generated/client_mappings.py +0 -14
  443. services/dts/src/oci_cli_transfer_job/generated/transferjob_cli.py +0 -368
  444. services/dts/src/oci_cli_transfer_job/transferjob_cli_extended.py +0 -281
  445. services/dts/src/oci_cli_transfer_package/__init__.py +0 -4
  446. services/dts/src/oci_cli_transfer_package/generated/__init__.py +0 -4
  447. services/dts/src/oci_cli_transfer_package/generated/client_mappings.py +0 -14
  448. services/dts/src/oci_cli_transfer_package/generated/transferpackage_cli.py +0 -326
  449. services/dts/tests/__init__.py +0 -4
  450. services/os_management/__init__.py +0 -4
  451. services/os_management/src/__init__.py +0 -4
  452. services/os_management/src/oci_cli_event/__init__.py +0 -4
  453. services/os_management/src/oci_cli_event/event_cli_extended.py +0 -34
  454. services/os_management/src/oci_cli_event/generated/__init__.py +0 -4
  455. services/os_management/src/oci_cli_event/generated/client_mappings.py +0 -14
  456. services/os_management/src/oci_cli_event/generated/event_cli.py +0 -430
  457. services/os_management/src/oci_cli_os_management/__init__.py +0 -4
  458. services/os_management/src/oci_cli_os_management/generated/__init__.py +0 -4
  459. services/os_management/src/oci_cli_os_management/generated/os_management_service_cli.py +0 -15
  460. services/os_management/src/oci_cli_os_management/generated/osmanagement_cli.py +0 -4009
  461. services/os_management/src/oci_cli_os_management/osmanagement_cli_extended.py +0 -244
  462. services/os_management/tests/__init__.py +0 -4
  463. services/service_mesh/__init__.py +0 -4
  464. services/service_mesh/src/__init__.py +0 -4
  465. services/service_mesh/src/oci_cli_service_mesh/__init__.py +0 -4
  466. services/service_mesh/src/oci_cli_service_mesh/generated/__init__.py +0 -4
  467. services/service_mesh/src/oci_cli_service_mesh/generated/client_mappings.py +0 -14
  468. services/service_mesh/src/oci_cli_service_mesh/generated/servicemesh_cli.py +0 -3306
  469. services/service_mesh/src/oci_cli_service_mesh/service_mesh_cli_extended.py +0 -57
  470. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/__init__.py +0 -76
  471. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/aggregators/__init__.py +0 -3
  472. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/aggregators/aggregation_orchestrator.py +0 -88
  473. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/bundle_analyser.py +0 -163
  474. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/event.py +0 -43
  475. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/handlers/__init__.py +0 -3
  476. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/handlers/debug_handler.py +0 -209
  477. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/report_orchestrator.py +0 -82
  478. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/task_orchestrator.py +0 -76
  479. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/task_request.py +0 -232
  480. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/tasks/__init__.py +0 -3
  481. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/tasks/common_worker.py +0 -116
  482. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/tasks/csv_worker.py +0 -39
  483. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/tasks/file_worker.py +0 -33
  484. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/tasks/igd_worker.py +0 -48
  485. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/tasks/mesh_report_worker.py +0 -60
  486. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/tasks/mesh_resources_worker.py +0 -49
  487. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/tasks/namespaces_worker.py +0 -33
  488. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/tasks/oci_cli_version_worker.py +0 -34
  489. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/tasks/pod_worker.py +0 -112
  490. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/tasks/resource_worker.py +0 -75
  491. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/tasks/services_worker.py +0 -34
  492. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/tasks/task_worker.py +0 -33
  493. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/tasks/validate_crds_worker.py +0 -34
  494. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/tasks/vdb_worker.py +0 -51
  495. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/tasks/webhooks_worker.py +0 -34
  496. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/utils/__init__.py +0 -3
  497. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/utils/bundle_helper.py +0 -154
  498. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/utils/constants.py +0 -137
  499. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/utils/helper.py +0 -12
  500. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/utils/kubectl_command_helper.py +0 -646
  501. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/utils/messages.py +0 -16
  502. services/service_mesh/src/oci_cli_service_mesh/service_mesh_troubleshoot/utils/summary.py +0 -222
  503. services/service_mesh/tests/__init__.py +0 -4
  504. {oci_cli-3.64.0.dist-info → oci_cli-3.65.0.dist-info}/LICENSE.txt +0 -0
  505. {oci_cli-3.64.0.dist-info → oci_cli-3.65.0.dist-info}/THIRD_PARTY_LICENSES.txt +0 -0
  506. {oci_cli-3.64.0.dist-info → oci_cli-3.65.0.dist-info}/WHEEL +0 -0
  507. {oci_cli-3.64.0.dist-info → oci_cli-3.65.0.dist-info}/entry_points.txt +0 -0
  508. {oci_cli-3.64.0.dist-info → oci_cli-3.65.0.dist-info}/top_level.txt +0 -0
@@ -1,4009 +0,0 @@
1
- # coding: utf-8
2
- # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
3
- # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
4
- # NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20190801
5
-
6
- from __future__ import print_function
7
- import click
8
- import oci # noqa: F401
9
- import six # noqa: F401
10
- import sys # noqa: F401
11
- from oci_cli import cli_constants # noqa: F401
12
- from oci_cli import cli_util
13
- from oci_cli import json_skeleton_utils
14
- from oci_cli import custom_types # noqa: F401
15
- from oci_cli.aliasing import CommandGroupWithAlias
16
- from services.os_management.src.oci_cli_os_management.generated import os_management_service_cli
17
-
18
-
19
- @click.command(cli_util.override('os_management.os_management_root_group.command_name', 'os-management'), cls=CommandGroupWithAlias, help=cli_util.override('os_management.os_management_root_group.help', """API for the OS Management service. Use these API operations for working
20
- with Managed instances and Managed instance groups."""), short_help=cli_util.override('os_management.os_management_root_group.short_help', """OS Management API"""))
21
- @cli_util.help_option_group
22
- def os_management_root_group():
23
- pass
24
-
25
-
26
- @click.command(cli_util.override('os_management.erratum_group.command_name', 'erratum'), cls=CommandGroupWithAlias, help="""Details about the erratum.""")
27
- @cli_util.help_option_group
28
- def erratum_group():
29
- pass
30
-
31
-
32
- @click.command(cli_util.override('os_management.module_stream_group.command_name', 'module-stream'), cls=CommandGroupWithAlias, help="""A module stream provided by a software source""")
33
- @cli_util.help_option_group
34
- def module_stream_group():
35
- pass
36
-
37
-
38
- @click.command(cli_util.override('os_management.managed_instance_group_group.command_name', 'managed-instance-group'), cls=CommandGroupWithAlias, help="""Detail information for a managed instance group""")
39
- @cli_util.help_option_group
40
- def managed_instance_group_group():
41
- pass
42
-
43
-
44
- @click.command(cli_util.override('os_management.managed_instance_group.command_name', 'managed-instance'), cls=CommandGroupWithAlias, help="""Detail information for an OCI Compute instance that is being managed""")
45
- @cli_util.help_option_group
46
- def managed_instance_group():
47
- pass
48
-
49
-
50
- @click.command(cli_util.override('os_management.windows_update_group.command_name', 'windows-update'), cls=CommandGroupWithAlias, help="""An update available for a Windows managed instance.""")
51
- @cli_util.help_option_group
52
- def windows_update_group():
53
- pass
54
-
55
-
56
- @click.command(cli_util.override('os_management.module_stream_profile_group.command_name', 'module-stream-profile'), cls=CommandGroupWithAlias, help="""A module stream profile provided by a software source""")
57
- @cli_util.help_option_group
58
- def module_stream_profile_group():
59
- pass
60
-
61
-
62
- @click.command(cli_util.override('os_management.work_request_summary_group.command_name', 'work-request-summary'), cls=CommandGroupWithAlias, help="""A work request summary""")
63
- @cli_util.help_option_group
64
- def work_request_summary_group():
65
- pass
66
-
67
-
68
- @click.command(cli_util.override('os_management.work_request_group.command_name', 'work-request'), cls=CommandGroupWithAlias, help="""A description of workrequest status""")
69
- @cli_util.help_option_group
70
- def work_request_group():
71
- pass
72
-
73
-
74
- @click.command(cli_util.override('os_management.software_source_group.command_name', 'software-source'), cls=CommandGroupWithAlias, help="""A software source contains a collection of packages""")
75
- @cli_util.help_option_group
76
- def software_source_group():
77
- pass
78
-
79
-
80
- @click.command(cli_util.override('os_management.scheduled_job_group.command_name', 'scheduled-job'), cls=CommandGroupWithAlias, help="""Detailed information about a Scheduled Job""")
81
- @cli_util.help_option_group
82
- def scheduled_job_group():
83
- pass
84
-
85
-
86
- @click.command(cli_util.override('os_management.module_stream_details_group.command_name', 'module-stream-details'), cls=CommandGroupWithAlias, help="""Updatable information for a module stream""")
87
- @cli_util.help_option_group
88
- def module_stream_details_group():
89
- pass
90
-
91
-
92
- @click.command(cli_util.override('os_management.update_managed_instance_details_group.command_name', 'update-managed-instance-details'), cls=CommandGroupWithAlias, help="""Information to update a managed instance""")
93
- @cli_util.help_option_group
94
- def update_managed_instance_details_group():
95
- pass
96
-
97
-
98
- @click.command(cli_util.override('os_management.module_stream_profile_details_group.command_name', 'module-stream-profile-details'), cls=CommandGroupWithAlias, help="""Updatable information for a module stream profile""")
99
- @cli_util.help_option_group
100
- def module_stream_profile_details_group():
101
- pass
102
-
103
-
104
- @click.command(cli_util.override('os_management.erratum_summary_group.command_name', 'erratum-summary'), cls=CommandGroupWithAlias, help="""Important changes for software. This can include security | advisories, bug fixes, or enhancements.""")
105
- @cli_util.help_option_group
106
- def erratum_summary_group():
107
- pass
108
-
109
-
110
- os_management_service_cli.os_management_service_group.add_command(os_management_root_group)
111
- os_management_root_group.add_command(erratum_group)
112
- os_management_root_group.add_command(module_stream_group)
113
- os_management_root_group.add_command(managed_instance_group_group)
114
- os_management_root_group.add_command(managed_instance_group)
115
- os_management_root_group.add_command(windows_update_group)
116
- os_management_root_group.add_command(module_stream_profile_group)
117
- os_management_root_group.add_command(work_request_summary_group)
118
- os_management_root_group.add_command(work_request_group)
119
- os_management_root_group.add_command(software_source_group)
120
- os_management_root_group.add_command(scheduled_job_group)
121
- os_management_root_group.add_command(module_stream_details_group)
122
- os_management_root_group.add_command(update_managed_instance_details_group)
123
- os_management_root_group.add_command(module_stream_profile_details_group)
124
- os_management_root_group.add_command(erratum_summary_group)
125
- # oci os_management os_management --> oci os_management
126
- os_management_service_cli.os_management_service_group.commands.pop(os_management_root_group.name)
127
- os_management_service_cli.os_management_service_group.add_command(erratum_group)
128
- os_management_service_cli.os_management_service_group.add_command(module_stream_group)
129
- os_management_service_cli.os_management_service_group.add_command(managed_instance_group_group)
130
- os_management_service_cli.os_management_service_group.add_command(managed_instance_group)
131
- os_management_service_cli.os_management_service_group.add_command(windows_update_group)
132
- os_management_service_cli.os_management_service_group.add_command(module_stream_profile_group)
133
- os_management_service_cli.os_management_service_group.add_command(work_request_summary_group)
134
- os_management_service_cli.os_management_service_group.add_command(work_request_group)
135
- os_management_service_cli.os_management_service_group.add_command(software_source_group)
136
- os_management_service_cli.os_management_service_group.add_command(scheduled_job_group)
137
- os_management_service_cli.os_management_service_group.add_command(module_stream_details_group)
138
- os_management_service_cli.os_management_service_group.add_command(update_managed_instance_details_group)
139
- os_management_service_cli.os_management_service_group.add_command(module_stream_profile_details_group)
140
- os_management_service_cli.os_management_service_group.add_command(erratum_summary_group)
141
-
142
-
143
- @software_source_group.command(name=cli_util.override('os_management.add_packages_to_software_source.command_name', 'add'), help=u"""Adds a given list of Software Packages to a specific Software Source. \n[Command Reference](addPackagesToSoftwareSource)""")
144
- @cli_util.option('--software-source-id', required=True, help=u"""The OCID of the software source.""")
145
- @cli_util.option('--package-names', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""the list of package names""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
146
- @json_skeleton_utils.get_cli_json_input_option({'package-names': {'module': 'os_management', 'class': 'list[string]'}})
147
- @cli_util.help_option
148
- @click.pass_context
149
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'package-names': {'module': 'os_management', 'class': 'list[string]'}})
150
- @cli_util.wrap_exceptions
151
- def add_packages_to_software_source(ctx, from_json, software_source_id, package_names):
152
-
153
- if isinstance(software_source_id, six.string_types) and len(software_source_id.strip()) == 0:
154
- raise click.UsageError('Parameter --software-source-id cannot be whitespace or empty string')
155
-
156
- kwargs = {}
157
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
158
-
159
- _details = {}
160
- _details['packageNames'] = cli_util.parse_json_parameter("package_names", package_names)
161
-
162
- client = cli_util.build_client('os_management', 'os_management', ctx)
163
- result = client.add_packages_to_software_source(
164
- software_source_id=software_source_id,
165
- add_packages_to_software_source_details=_details,
166
- **kwargs
167
- )
168
- cli_util.render_response(result, ctx)
169
-
170
-
171
- @managed_instance_group.command(name=cli_util.override('os_management.attach_child_software_source_to_managed_instance.command_name', 'attach'), help=u"""Adds a child software source to a managed instance. After the software source has been added, then packages from that software source can be installed on the managed instance. \n[Command Reference](attachChildSoftwareSourceToManagedInstance)""")
172
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
173
- @cli_util.option('--software-source-id', required=True, help=u"""OCID for the Software Source""")
174
- @json_skeleton_utils.get_cli_json_input_option({})
175
- @cli_util.help_option
176
- @click.pass_context
177
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
178
- @cli_util.wrap_exceptions
179
- def attach_child_software_source_to_managed_instance(ctx, from_json, managed_instance_id, software_source_id):
180
-
181
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
182
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
183
-
184
- kwargs = {}
185
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
186
-
187
- _details = {}
188
- _details['softwareSourceId'] = software_source_id
189
-
190
- client = cli_util.build_client('os_management', 'os_management', ctx)
191
- result = client.attach_child_software_source_to_managed_instance(
192
- managed_instance_id=managed_instance_id,
193
- attach_child_software_source_to_managed_instance_details=_details,
194
- **kwargs
195
- )
196
- cli_util.render_response(result, ctx)
197
-
198
-
199
- @managed_instance_group_group.command(name=cli_util.override('os_management.attach_managed_instance_to_managed_instance_group.command_name', 'attach'), help=u"""Adds a Managed Instance to a Managed Instance Group. After the Managed Instance has been added, then operations can be performed on the Managed Instance Group which will then apply to all Managed Instances in the group. \n[Command Reference](attachManagedInstanceToManagedInstanceGroup)""")
200
- @cli_util.option('--managed-instance-group-id', required=True, help=u"""OCID for the managed instance group""")
201
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
202
- @json_skeleton_utils.get_cli_json_input_option({})
203
- @cli_util.help_option
204
- @click.pass_context
205
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
206
- @cli_util.wrap_exceptions
207
- def attach_managed_instance_to_managed_instance_group(ctx, from_json, managed_instance_group_id, managed_instance_id):
208
-
209
- if isinstance(managed_instance_group_id, six.string_types) and len(managed_instance_group_id.strip()) == 0:
210
- raise click.UsageError('Parameter --managed-instance-group-id cannot be whitespace or empty string')
211
-
212
- kwargs = {}
213
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
214
- client = cli_util.build_client('os_management', 'os_management', ctx)
215
- result = client.attach_managed_instance_to_managed_instance_group(
216
- managed_instance_group_id=managed_instance_group_id,
217
- managed_instance_id=managed_instance_id,
218
- **kwargs
219
- )
220
- cli_util.render_response(result, ctx)
221
-
222
-
223
- @managed_instance_group.command(name=cli_util.override('os_management.attach_parent_software_source_to_managed_instance.command_name', 'attach'), help=u"""Adds a parent software source to a managed instance. After the software source has been added, then packages from that software source can be installed on the managed instance. Software sources that have this software source as a parent will be able to be added to this managed instance. \n[Command Reference](attachParentSoftwareSourceToManagedInstance)""")
224
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
225
- @cli_util.option('--software-source-id', required=True, help=u"""OCID for the Software Source""")
226
- @json_skeleton_utils.get_cli_json_input_option({})
227
- @cli_util.help_option
228
- @click.pass_context
229
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
230
- @cli_util.wrap_exceptions
231
- def attach_parent_software_source_to_managed_instance(ctx, from_json, managed_instance_id, software_source_id):
232
-
233
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
234
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
235
-
236
- kwargs = {}
237
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
238
-
239
- _details = {}
240
- _details['softwareSourceId'] = software_source_id
241
-
242
- client = cli_util.build_client('os_management', 'os_management', ctx)
243
- result = client.attach_parent_software_source_to_managed_instance(
244
- managed_instance_id=managed_instance_id,
245
- attach_parent_software_source_to_managed_instance_details=_details,
246
- **kwargs
247
- )
248
- cli_util.render_response(result, ctx)
249
-
250
-
251
- @managed_instance_group_group.command(name=cli_util.override('os_management.change_managed_instance_group_compartment.command_name', 'change-compartment'), help=u"""Moves a resource into a different compartment. When provided, If-Match is checked against ETag values of the resource. \n[Command Reference](changeManagedInstanceGroupCompartment)""")
252
- @cli_util.option('--managed-instance-group-id', required=True, help=u"""OCID for the managed instance group""")
253
- @cli_util.option('--compartment-id', help=u"""The [OCID] of the compartment into which the resource should be moved.""")
254
- @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.""")
255
- @json_skeleton_utils.get_cli_json_input_option({})
256
- @cli_util.help_option
257
- @click.pass_context
258
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
259
- @cli_util.wrap_exceptions
260
- def change_managed_instance_group_compartment(ctx, from_json, managed_instance_group_id, compartment_id, if_match):
261
-
262
- if isinstance(managed_instance_group_id, six.string_types) and len(managed_instance_group_id.strip()) == 0:
263
- raise click.UsageError('Parameter --managed-instance-group-id cannot be whitespace or empty string')
264
-
265
- kwargs = {}
266
- if if_match is not None:
267
- kwargs['if_match'] = if_match
268
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
269
-
270
- _details = {}
271
-
272
- if compartment_id is not None:
273
- _details['compartmentId'] = compartment_id
274
-
275
- client = cli_util.build_client('os_management', 'os_management', ctx)
276
- result = client.change_managed_instance_group_compartment(
277
- managed_instance_group_id=managed_instance_group_id,
278
- change_managed_instance_group_compartment_details=_details,
279
- **kwargs
280
- )
281
- cli_util.render_response(result, ctx)
282
-
283
-
284
- @scheduled_job_group.command(name=cli_util.override('os_management.change_scheduled_job_compartment.command_name', 'change-compartment'), help=u"""Moves a resource into a different compartment. When provided, If-Match is checked against ETag values of the resource. \n[Command Reference](changeScheduledJobCompartment)""")
285
- @cli_util.option('--scheduled-job-id', required=True, help=u"""The ID of the scheduled job.""")
286
- @cli_util.option('--compartment-id', help=u"""The [OCID] of the compartment into which the resource should be moved.""")
287
- @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.""")
288
- @json_skeleton_utils.get_cli_json_input_option({})
289
- @cli_util.help_option
290
- @click.pass_context
291
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
292
- @cli_util.wrap_exceptions
293
- def change_scheduled_job_compartment(ctx, from_json, scheduled_job_id, compartment_id, if_match):
294
-
295
- if isinstance(scheduled_job_id, six.string_types) and len(scheduled_job_id.strip()) == 0:
296
- raise click.UsageError('Parameter --scheduled-job-id cannot be whitespace or empty string')
297
-
298
- kwargs = {}
299
- if if_match is not None:
300
- kwargs['if_match'] = if_match
301
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
302
-
303
- _details = {}
304
-
305
- if compartment_id is not None:
306
- _details['compartmentId'] = compartment_id
307
-
308
- client = cli_util.build_client('os_management', 'os_management', ctx)
309
- result = client.change_scheduled_job_compartment(
310
- scheduled_job_id=scheduled_job_id,
311
- change_scheduled_job_compartment_details=_details,
312
- **kwargs
313
- )
314
- cli_util.render_response(result, ctx)
315
-
316
-
317
- @software_source_group.command(name=cli_util.override('os_management.change_software_source_compartment.command_name', 'change-compartment'), help=u"""Moves a resource into a different compartment. When provided, If-Match is checked against ETag values of the resource. \n[Command Reference](changeSoftwareSourceCompartment)""")
318
- @cli_util.option('--software-source-id', required=True, help=u"""The OCID of the software source.""")
319
- @cli_util.option('--compartment-id', help=u"""The [OCID] of the compartment into which the resource should be moved.""")
320
- @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.""")
321
- @json_skeleton_utils.get_cli_json_input_option({})
322
- @cli_util.help_option
323
- @click.pass_context
324
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
325
- @cli_util.wrap_exceptions
326
- def change_software_source_compartment(ctx, from_json, software_source_id, compartment_id, if_match):
327
-
328
- if isinstance(software_source_id, six.string_types) and len(software_source_id.strip()) == 0:
329
- raise click.UsageError('Parameter --software-source-id cannot be whitespace or empty string')
330
-
331
- kwargs = {}
332
- if if_match is not None:
333
- kwargs['if_match'] = if_match
334
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
335
-
336
- _details = {}
337
-
338
- if compartment_id is not None:
339
- _details['compartmentId'] = compartment_id
340
-
341
- client = cli_util.build_client('os_management', 'os_management', ctx)
342
- result = client.change_software_source_compartment(
343
- software_source_id=software_source_id,
344
- change_software_source_compartment_details=_details,
345
- **kwargs
346
- )
347
- cli_util.render_response(result, ctx)
348
-
349
-
350
- @managed_instance_group_group.command(name=cli_util.override('os_management.create_managed_instance_group.command_name', 'create'), help=u"""Creates a new Managed Instance Group on the management system. This will not contain any managed instances after it is first created, and they must be added later. \n[Command Reference](createManagedInstanceGroup)""")
351
- @cli_util.option('--display-name', required=True, help=u"""Managed Instance Group identifier""")
352
- @cli_util.option('--compartment-id', required=True, help=u"""OCID for the Compartment""")
353
- @cli_util.option('--description', help=u"""Information specified by the user about the managed instance group""")
354
- @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
355
- @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
356
- @cli_util.option('--os-family', type=custom_types.CliCaseInsensitiveChoice(["LINUX", "WINDOWS", "ALL"]), help=u"""The Operating System type of the managed instance(s) on which this scheduled job will operate. If not specified, this defaults to Linux.""")
357
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "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.""")
358
- @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.""")
359
- @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.""")
360
- @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'os_management', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'os_management', 'class': 'dict(str, dict(str, object))'}})
361
- @cli_util.help_option
362
- @click.pass_context
363
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'os_management', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'os_management', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'os_management', 'class': 'ManagedInstanceGroup'})
364
- @cli_util.wrap_exceptions
365
- def create_managed_instance_group(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, compartment_id, description, freeform_tags, defined_tags, os_family):
366
-
367
- kwargs = {}
368
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
369
-
370
- _details = {}
371
- _details['displayName'] = display_name
372
- _details['compartmentId'] = compartment_id
373
-
374
- if description is not None:
375
- _details['description'] = description
376
-
377
- if freeform_tags is not None:
378
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
379
-
380
- if defined_tags is not None:
381
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
382
-
383
- if os_family is not None:
384
- _details['osFamily'] = os_family
385
-
386
- client = cli_util.build_client('os_management', 'os_management', ctx)
387
- result = client.create_managed_instance_group(
388
- create_managed_instance_group_details=_details,
389
- **kwargs
390
- )
391
- if wait_for_state:
392
-
393
- if hasattr(client, 'get_managed_instance_group') and callable(getattr(client, 'get_managed_instance_group')):
394
- try:
395
- wait_period_kwargs = {}
396
- if max_wait_seconds is not None:
397
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
398
- if wait_interval_seconds is not None:
399
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
400
-
401
- click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
402
- result = oci.wait_until(client, client.get_managed_instance_group(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
403
- except oci.exceptions.MaximumWaitTimeExceeded as e:
404
- # If we fail, we should show an error, but we should still provide the information to the customer
405
- click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
406
- cli_util.render_response(result, ctx)
407
- sys.exit(2)
408
- except Exception:
409
- click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
410
- cli_util.render_response(result, ctx)
411
- raise
412
- else:
413
- click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
414
- cli_util.render_response(result, ctx)
415
-
416
-
417
- @scheduled_job_group.command(name=cli_util.override('os_management.create_scheduled_job.command_name', 'create'), help=u"""Creates a new Scheduled Job to perform a specific package operation on a set of managed instances or managed instance groups. Can be created as a one-time execution in the future, or as a recurring execution that repeats on a defined interval. \n[Command Reference](createScheduledJob)""")
418
- @cli_util.option('--compartment-id', required=True, help=u"""OCID for the Compartment""")
419
- @cli_util.option('--display-name', required=True, help=u"""Scheduled Job name""")
420
- @cli_util.option('--schedule-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["ONETIME", "RECURRING"]), help=u"""the type of scheduling this Scheduled Job follows""")
421
- @cli_util.option('--time-next-execution', required=True, type=custom_types.CLI_DATETIME, help=u"""the desired time for the next execution of this Scheduled Job""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
422
- @cli_util.option('--operation-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["INSTALL", "UPDATE", "REMOVE", "UPDATEALL", "ENABLEMODULESTREAM", "DISABLEMODULESTREAM", "SWITCHMODULESTREAM", "INSTALLMODULESTREAMPROFILE", "REMOVEMODULESTREAMPROFILE", "COMPOUND"]), help=u"""the type of operation this Scheduled Job performs""")
423
- @cli_util.option('--description', help=u"""Details describing the Scheduled Job.""")
424
- @cli_util.option('--interval-type', type=custom_types.CliCaseInsensitiveChoice(["HOUR", "DAY", "WEEK", "MONTH"]), help=u"""the interval period for a recurring Scheduled Job (only if schedule type is RECURRING)""")
425
- @cli_util.option('--interval-value', help=u"""the value for the interval period for a recurring Scheduled Job (only if schedule type is RECURRING)""")
426
- @cli_util.option('--managed-instances', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of managed instances this scheduled job operates on (mutually exclusive with managedInstanceGroups). Either this or the managedInstanceGroups must be supplied.
427
-
428
- This option is a JSON list with items of type Id. For documentation on Id please see our API reference: https://docs.cloud.oracle.com/api/#/en/osmanagement/20190801/datatypes/Id.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
429
- @cli_util.option('--managed-instance-groups', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of managed instance groups this scheduled job operates on (mutually exclusive with managedInstances). Either this or managedInstances must be supplied.
430
-
431
- This option is a JSON list with items of type Id. For documentation on Id please see our API reference: https://docs.cloud.oracle.com/api/#/en/osmanagement/20190801/datatypes/Id.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
432
- @cli_util.option('--update-type', type=custom_types.CliCaseInsensitiveChoice(["SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL"]), help=u"""Type of the update (only if operation type is UPDATEALL)""")
433
- @cli_util.option('--package-names', type=custom_types.CLI_COMPLEX_TYPE, help=u"""the id of the package (only if operation type is INSTALL/UPDATE/REMOVE)
434
-
435
- This option is a JSON list with items of type PackageName. For documentation on PackageName please see our API reference: https://docs.cloud.oracle.com/api/#/en/osmanagement/20190801/datatypes/PackageName.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
436
- @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
437
- @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
438
- @cli_util.option('--update-names', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The unique names of the Windows Updates (only if operation type is INSTALL). This is only applicable when the osFamily is for Windows managed instances.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
439
- @cli_util.option('--os-family', type=custom_types.CliCaseInsensitiveChoice(["LINUX", "WINDOWS", "ALL"]), help=u"""The Operating System type of the managed instance(s) on which this scheduled job will operate. If not specified, this defaults to Linux.""")
440
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "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.""")
441
- @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.""")
442
- @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.""")
443
- @json_skeleton_utils.get_cli_json_input_option({'managed-instances': {'module': 'os_management', 'class': 'list[Id]'}, 'managed-instance-groups': {'module': 'os_management', 'class': 'list[Id]'}, 'package-names': {'module': 'os_management', 'class': 'list[PackageName]'}, 'freeform-tags': {'module': 'os_management', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'os_management', 'class': 'dict(str, dict(str, object))'}, 'update-names': {'module': 'os_management', 'class': 'list[string]'}})
444
- @cli_util.help_option
445
- @click.pass_context
446
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'managed-instances': {'module': 'os_management', 'class': 'list[Id]'}, 'managed-instance-groups': {'module': 'os_management', 'class': 'list[Id]'}, 'package-names': {'module': 'os_management', 'class': 'list[PackageName]'}, 'freeform-tags': {'module': 'os_management', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'os_management', 'class': 'dict(str, dict(str, object))'}, 'update-names': {'module': 'os_management', 'class': 'list[string]'}}, output_type={'module': 'os_management', 'class': 'ScheduledJob'})
447
- @cli_util.wrap_exceptions
448
- def create_scheduled_job(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, display_name, schedule_type, time_next_execution, operation_type, description, interval_type, interval_value, managed_instances, managed_instance_groups, update_type, package_names, freeform_tags, defined_tags, update_names, os_family):
449
-
450
- kwargs = {}
451
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
452
-
453
- _details = {}
454
- _details['compartmentId'] = compartment_id
455
- _details['displayName'] = display_name
456
- _details['scheduleType'] = schedule_type
457
- _details['timeNextExecution'] = time_next_execution
458
- _details['operationType'] = operation_type
459
-
460
- if description is not None:
461
- _details['description'] = description
462
-
463
- if interval_type is not None:
464
- _details['intervalType'] = interval_type
465
-
466
- if interval_value is not None:
467
- _details['intervalValue'] = interval_value
468
-
469
- if managed_instances is not None:
470
- _details['managedInstances'] = cli_util.parse_json_parameter("managed_instances", managed_instances)
471
-
472
- if managed_instance_groups is not None:
473
- _details['managedInstanceGroups'] = cli_util.parse_json_parameter("managed_instance_groups", managed_instance_groups)
474
-
475
- if update_type is not None:
476
- _details['updateType'] = update_type
477
-
478
- if package_names is not None:
479
- _details['packageNames'] = cli_util.parse_json_parameter("package_names", package_names)
480
-
481
- if freeform_tags is not None:
482
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
483
-
484
- if defined_tags is not None:
485
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
486
-
487
- if update_names is not None:
488
- _details['updateNames'] = cli_util.parse_json_parameter("update_names", update_names)
489
-
490
- if os_family is not None:
491
- _details['osFamily'] = os_family
492
-
493
- client = cli_util.build_client('os_management', 'os_management', ctx)
494
- result = client.create_scheduled_job(
495
- create_scheduled_job_details=_details,
496
- **kwargs
497
- )
498
- if wait_for_state:
499
-
500
- if hasattr(client, 'get_scheduled_job') and callable(getattr(client, 'get_scheduled_job')):
501
- try:
502
- wait_period_kwargs = {}
503
- if max_wait_seconds is not None:
504
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
505
- if wait_interval_seconds is not None:
506
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
507
-
508
- click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
509
- result = oci.wait_until(client, client.get_scheduled_job(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
510
- except oci.exceptions.MaximumWaitTimeExceeded as e:
511
- # If we fail, we should show an error, but we should still provide the information to the customer
512
- click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
513
- cli_util.render_response(result, ctx)
514
- sys.exit(2)
515
- except Exception:
516
- click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
517
- cli_util.render_response(result, ctx)
518
- raise
519
- else:
520
- click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
521
- cli_util.render_response(result, ctx)
522
-
523
-
524
- @software_source_group.command(name=cli_util.override('os_management.create_software_source.command_name', 'create'), help=u"""Creates a new custom Software Source on the management system. This will not contain any packages after it is first created, and they must be added later. \n[Command Reference](createSoftwareSource)""")
525
- @cli_util.option('--compartment-id', required=True, help=u"""OCID for the Compartment""")
526
- @cli_util.option('--display-name', required=True, help=u"""User friendly name for the software source""")
527
- @cli_util.option('--arch-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["IA_32", "X86_64", "AARCH64", "SPARC", "AMD64_DEBIAN"]), help=u"""The architecture type supported by the Software Source""")
528
- @cli_util.option('--description', help=u"""Information specified by the user about the software source""")
529
- @cli_util.option('--maintainer-name', help=u"""Name of the person maintaining this software source""")
530
- @cli_util.option('--maintainer-email', help=u"""Email address of the person maintaining this software source""")
531
- @cli_util.option('--maintainer-phone', help=u"""Phone number of the person maintaining this software source""")
532
- @cli_util.option('--checksum-type', type=custom_types.CliCaseInsensitiveChoice(["SHA1", "SHA256", "SHA384", "SHA512"]), help=u"""The yum repository checksum type used by this software source""")
533
- @cli_util.option('--parent-id', help=u"""OCID for the parent software source, if there is one""")
534
- @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
535
- @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
536
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "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.""")
537
- @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.""")
538
- @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.""")
539
- @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'os_management', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'os_management', 'class': 'dict(str, dict(str, object))'}})
540
- @cli_util.help_option
541
- @click.pass_context
542
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'os_management', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'os_management', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'os_management', 'class': 'SoftwareSource'})
543
- @cli_util.wrap_exceptions
544
- def create_software_source(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, display_name, arch_type, description, maintainer_name, maintainer_email, maintainer_phone, checksum_type, parent_id, freeform_tags, defined_tags):
545
-
546
- kwargs = {}
547
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
548
-
549
- _details = {}
550
- _details['compartmentId'] = compartment_id
551
- _details['displayName'] = display_name
552
- _details['archType'] = arch_type
553
-
554
- if description is not None:
555
- _details['description'] = description
556
-
557
- if maintainer_name is not None:
558
- _details['maintainerName'] = maintainer_name
559
-
560
- if maintainer_email is not None:
561
- _details['maintainerEmail'] = maintainer_email
562
-
563
- if maintainer_phone is not None:
564
- _details['maintainerPhone'] = maintainer_phone
565
-
566
- if checksum_type is not None:
567
- _details['checksumType'] = checksum_type
568
-
569
- if parent_id is not None:
570
- _details['parentId'] = parent_id
571
-
572
- if freeform_tags is not None:
573
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
574
-
575
- if defined_tags is not None:
576
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
577
-
578
- client = cli_util.build_client('os_management', 'os_management', ctx)
579
- result = client.create_software_source(
580
- create_software_source_details=_details,
581
- **kwargs
582
- )
583
- if wait_for_state:
584
-
585
- if hasattr(client, 'get_software_source') and callable(getattr(client, 'get_software_source')):
586
- try:
587
- wait_period_kwargs = {}
588
- if max_wait_seconds is not None:
589
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
590
- if wait_interval_seconds is not None:
591
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
592
-
593
- click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
594
- result = oci.wait_until(client, client.get_software_source(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
595
- except oci.exceptions.MaximumWaitTimeExceeded as e:
596
- # If we fail, we should show an error, but we should still provide the information to the customer
597
- click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
598
- cli_util.render_response(result, ctx)
599
- sys.exit(2)
600
- except Exception:
601
- click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
602
- cli_util.render_response(result, ctx)
603
- raise
604
- else:
605
- click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
606
- cli_util.render_response(result, ctx)
607
-
608
-
609
- @managed_instance_group_group.command(name=cli_util.override('os_management.delete_managed_instance_group.command_name', 'delete'), help=u"""Deletes a Managed Instance Group from the management system \n[Command Reference](deleteManagedInstanceGroup)""")
610
- @cli_util.option('--managed-instance-group-id', required=True, help=u"""OCID for the managed instance group""")
611
- @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.""")
612
- @cli_util.confirm_delete_option
613
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "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.""")
614
- @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.""")
615
- @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.""")
616
- @json_skeleton_utils.get_cli_json_input_option({})
617
- @cli_util.help_option
618
- @click.pass_context
619
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
620
- @cli_util.wrap_exceptions
621
- def delete_managed_instance_group(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_group_id, if_match):
622
-
623
- if isinstance(managed_instance_group_id, six.string_types) and len(managed_instance_group_id.strip()) == 0:
624
- raise click.UsageError('Parameter --managed-instance-group-id cannot be whitespace or empty string')
625
-
626
- kwargs = {}
627
- if if_match is not None:
628
- kwargs['if_match'] = if_match
629
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
630
- client = cli_util.build_client('os_management', 'os_management', ctx)
631
- result = client.delete_managed_instance_group(
632
- managed_instance_group_id=managed_instance_group_id,
633
- **kwargs
634
- )
635
- if wait_for_state:
636
-
637
- if hasattr(client, 'get_managed_instance_group') and callable(getattr(client, 'get_managed_instance_group')):
638
- try:
639
- wait_period_kwargs = {}
640
- if max_wait_seconds is not None:
641
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
642
- if wait_interval_seconds is not None:
643
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
644
-
645
- click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
646
- oci.wait_until(client, client.get_managed_instance_group(managed_instance_group_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
647
- except oci.exceptions.ServiceError as e:
648
- # We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
649
- # outcome of a delete operation it is possible that the resource is already gone and so the initial service call
650
- # will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
651
- # the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
652
- # succeed_on_not_found=True to the waiter).
653
- #
654
- # Any non-404 should still result in the exception being thrown.
655
- if e.status == 404:
656
- pass
657
- else:
658
- raise
659
- except oci.exceptions.MaximumWaitTimeExceeded as e:
660
- # If we fail, we should show an error, but we should still provide the information to the customer
661
- click.echo('Failed to wait until the resource entered the specified state. Please retrieve the resource to find its current state', file=sys.stderr)
662
- cli_util.render_response(result, ctx)
663
- sys.exit(2)
664
- except Exception:
665
- click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
666
- cli_util.render_response(result, ctx)
667
- raise
668
- else:
669
- click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
670
- cli_util.render_response(result, ctx)
671
-
672
-
673
- @scheduled_job_group.command(name=cli_util.override('os_management.delete_scheduled_job.command_name', 'delete'), help=u"""Cancels an existing Scheduled Job on the management system \n[Command Reference](deleteScheduledJob)""")
674
- @cli_util.option('--scheduled-job-id', required=True, help=u"""The ID of the scheduled job.""")
675
- @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.""")
676
- @cli_util.confirm_delete_option
677
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "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.""")
678
- @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.""")
679
- @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.""")
680
- @json_skeleton_utils.get_cli_json_input_option({})
681
- @cli_util.help_option
682
- @click.pass_context
683
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
684
- @cli_util.wrap_exceptions
685
- def delete_scheduled_job(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, scheduled_job_id, if_match):
686
-
687
- if isinstance(scheduled_job_id, six.string_types) and len(scheduled_job_id.strip()) == 0:
688
- raise click.UsageError('Parameter --scheduled-job-id cannot be whitespace or empty string')
689
-
690
- kwargs = {}
691
- if if_match is not None:
692
- kwargs['if_match'] = if_match
693
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
694
- client = cli_util.build_client('os_management', 'os_management', ctx)
695
- result = client.delete_scheduled_job(
696
- scheduled_job_id=scheduled_job_id,
697
- **kwargs
698
- )
699
- if wait_for_state:
700
-
701
- if hasattr(client, 'get_scheduled_job') and callable(getattr(client, 'get_scheduled_job')):
702
- try:
703
- wait_period_kwargs = {}
704
- if max_wait_seconds is not None:
705
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
706
- if wait_interval_seconds is not None:
707
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
708
-
709
- click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
710
- oci.wait_until(client, client.get_scheduled_job(scheduled_job_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
711
- except oci.exceptions.ServiceError as e:
712
- # We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
713
- # outcome of a delete operation it is possible that the resource is already gone and so the initial service call
714
- # will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
715
- # the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
716
- # succeed_on_not_found=True to the waiter).
717
- #
718
- # Any non-404 should still result in the exception being thrown.
719
- if e.status == 404:
720
- pass
721
- else:
722
- raise
723
- except oci.exceptions.MaximumWaitTimeExceeded as e:
724
- # If we fail, we should show an error, but we should still provide the information to the customer
725
- click.echo('Failed to wait until the resource entered the specified state. Please retrieve the resource to find its current state', file=sys.stderr)
726
- cli_util.render_response(result, ctx)
727
- sys.exit(2)
728
- except Exception:
729
- click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
730
- cli_util.render_response(result, ctx)
731
- raise
732
- else:
733
- click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
734
- cli_util.render_response(result, ctx)
735
-
736
-
737
- @software_source_group.command(name=cli_util.override('os_management.delete_software_source.command_name', 'delete'), help=u"""Deletes a custom Software Source on the management system \n[Command Reference](deleteSoftwareSource)""")
738
- @cli_util.option('--software-source-id', required=True, help=u"""The OCID of the software source.""")
739
- @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.""")
740
- @cli_util.confirm_delete_option
741
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "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.""")
742
- @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.""")
743
- @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.""")
744
- @json_skeleton_utils.get_cli_json_input_option({})
745
- @cli_util.help_option
746
- @click.pass_context
747
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
748
- @cli_util.wrap_exceptions
749
- def delete_software_source(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, software_source_id, if_match):
750
-
751
- if isinstance(software_source_id, six.string_types) and len(software_source_id.strip()) == 0:
752
- raise click.UsageError('Parameter --software-source-id cannot be whitespace or empty string')
753
-
754
- kwargs = {}
755
- if if_match is not None:
756
- kwargs['if_match'] = if_match
757
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
758
- client = cli_util.build_client('os_management', 'os_management', ctx)
759
- result = client.delete_software_source(
760
- software_source_id=software_source_id,
761
- **kwargs
762
- )
763
- if wait_for_state:
764
-
765
- if hasattr(client, 'get_software_source') and callable(getattr(client, 'get_software_source')):
766
- try:
767
- wait_period_kwargs = {}
768
- if max_wait_seconds is not None:
769
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
770
- if wait_interval_seconds is not None:
771
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
772
-
773
- click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
774
- oci.wait_until(client, client.get_software_source(software_source_id), 'lifecycle_state', wait_for_state, succeed_on_not_found=True, **wait_period_kwargs)
775
- except oci.exceptions.ServiceError as e:
776
- # We make an initial service call so we can pass the result to oci.wait_until(), however if we are waiting on the
777
- # outcome of a delete operation it is possible that the resource is already gone and so the initial service call
778
- # will result in an exception that reflects a HTTP 404. In this case, we can exit with success (rather than raising
779
- # the exception) since this would have been the behaviour in the waiter anyway (as for delete we provide the argument
780
- # succeed_on_not_found=True to the waiter).
781
- #
782
- # Any non-404 should still result in the exception being thrown.
783
- if e.status == 404:
784
- pass
785
- else:
786
- raise
787
- except oci.exceptions.MaximumWaitTimeExceeded as e:
788
- # If we fail, we should show an error, but we should still provide the information to the customer
789
- click.echo('Failed to wait until the resource entered the specified state. Please retrieve the resource to find its current state', file=sys.stderr)
790
- cli_util.render_response(result, ctx)
791
- sys.exit(2)
792
- except Exception:
793
- click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
794
- cli_util.render_response(result, ctx)
795
- raise
796
- else:
797
- click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
798
- cli_util.render_response(result, ctx)
799
-
800
-
801
- @managed_instance_group.command(name=cli_util.override('os_management.detach_child_software_source_from_managed_instance.command_name', 'detach'), help=u"""Removes a child software source from a managed instance. Packages will no longer be able to be installed from these software sources. \n[Command Reference](detachChildSoftwareSourceFromManagedInstance)""")
802
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
803
- @cli_util.option('--software-source-id', required=True, help=u"""OCID for the Software Source""")
804
- @json_skeleton_utils.get_cli_json_input_option({})
805
- @cli_util.help_option
806
- @click.pass_context
807
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
808
- @cli_util.wrap_exceptions
809
- def detach_child_software_source_from_managed_instance(ctx, from_json, managed_instance_id, software_source_id):
810
-
811
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
812
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
813
-
814
- kwargs = {}
815
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
816
-
817
- _details = {}
818
- _details['softwareSourceId'] = software_source_id
819
-
820
- client = cli_util.build_client('os_management', 'os_management', ctx)
821
- result = client.detach_child_software_source_from_managed_instance(
822
- managed_instance_id=managed_instance_id,
823
- detach_child_software_source_from_managed_instance_details=_details,
824
- **kwargs
825
- )
826
- cli_util.render_response(result, ctx)
827
-
828
-
829
- @managed_instance_group_group.command(name=cli_util.override('os_management.detach_managed_instance_from_managed_instance_group.command_name', 'detach'), help=u"""Removes a Managed Instance from a Managed Instance Group. \n[Command Reference](detachManagedInstanceFromManagedInstanceGroup)""")
830
- @cli_util.option('--managed-instance-group-id', required=True, help=u"""OCID for the managed instance group""")
831
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
832
- @json_skeleton_utils.get_cli_json_input_option({})
833
- @cli_util.help_option
834
- @click.pass_context
835
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
836
- @cli_util.wrap_exceptions
837
- def detach_managed_instance_from_managed_instance_group(ctx, from_json, managed_instance_group_id, managed_instance_id):
838
-
839
- if isinstance(managed_instance_group_id, six.string_types) and len(managed_instance_group_id.strip()) == 0:
840
- raise click.UsageError('Parameter --managed-instance-group-id cannot be whitespace or empty string')
841
-
842
- kwargs = {}
843
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
844
- client = cli_util.build_client('os_management', 'os_management', ctx)
845
- result = client.detach_managed_instance_from_managed_instance_group(
846
- managed_instance_group_id=managed_instance_group_id,
847
- managed_instance_id=managed_instance_id,
848
- **kwargs
849
- )
850
- cli_util.render_response(result, ctx)
851
-
852
-
853
- @managed_instance_group.command(name=cli_util.override('os_management.detach_parent_software_source_from_managed_instance.command_name', 'detach'), help=u"""Removes a software source from a managed instance. All child software sources will also be removed from the managed instance. Packages will no longer be able to be installed from these software sources. \n[Command Reference](detachParentSoftwareSourceFromManagedInstance)""")
854
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
855
- @cli_util.option('--software-source-id', required=True, help=u"""OCID for the Software Source""")
856
- @json_skeleton_utils.get_cli_json_input_option({})
857
- @cli_util.help_option
858
- @click.pass_context
859
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
860
- @cli_util.wrap_exceptions
861
- def detach_parent_software_source_from_managed_instance(ctx, from_json, managed_instance_id, software_source_id):
862
-
863
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
864
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
865
-
866
- kwargs = {}
867
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
868
-
869
- _details = {}
870
- _details['softwareSourceId'] = software_source_id
871
-
872
- client = cli_util.build_client('os_management', 'os_management', ctx)
873
- result = client.detach_parent_software_source_from_managed_instance(
874
- managed_instance_id=managed_instance_id,
875
- detach_parent_software_source_from_managed_instance_details=_details,
876
- **kwargs
877
- )
878
- cli_util.render_response(result, ctx)
879
-
880
-
881
- @module_stream_details_group.command(name=cli_util.override('os_management.disable_module_stream_on_managed_instance.command_name', 'disable-module-stream-on-managed-instance'), help=u"""Disables a module stream on a managed instance. After the stream is disabled, it is no longer possible to install the profiles that are contained by the stream. All installed profiles must be removed prior to disabling a module stream. \n[Command Reference](disableModuleStreamOnManagedInstance)""")
882
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
883
- @cli_util.option('--module-name', required=True, help=u"""The name of a module.""")
884
- @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.""")
885
- @cli_util.option('--stream-name', help=u"""The name of the stream of the containing module. This parameter is required if a profileName is specified.""")
886
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
887
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
888
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
889
- @json_skeleton_utils.get_cli_json_input_option({})
890
- @cli_util.help_option
891
- @click.pass_context
892
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
893
- @cli_util.wrap_exceptions
894
- def disable_module_stream_on_managed_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_id, module_name, if_match, stream_name):
895
-
896
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
897
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
898
-
899
- kwargs = {}
900
- if if_match is not None:
901
- kwargs['if_match'] = if_match
902
- if stream_name is not None:
903
- kwargs['stream_name'] = stream_name
904
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
905
- client = cli_util.build_client('os_management', 'os_management', ctx)
906
- result = client.disable_module_stream_on_managed_instance(
907
- managed_instance_id=managed_instance_id,
908
- module_name=module_name,
909
- **kwargs
910
- )
911
- if wait_for_state:
912
-
913
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
914
- try:
915
- wait_period_kwargs = {}
916
- if max_wait_seconds is not None:
917
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
918
- if wait_interval_seconds is not None:
919
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
920
- if 'opc-work-request-id' not in result.headers:
921
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
922
- cli_util.render_response(result, ctx)
923
- return
924
-
925
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
926
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
927
- except oci.exceptions.MaximumWaitTimeExceeded as e:
928
- # If we fail, we should show an error, but we should still provide the information to the customer
929
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
930
- cli_util.render_response(result, ctx)
931
- sys.exit(2)
932
- except Exception:
933
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
934
- cli_util.render_response(result, ctx)
935
- raise
936
- else:
937
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
938
- cli_util.render_response(result, ctx)
939
-
940
-
941
- @module_stream_details_group.command(name=cli_util.override('os_management.enable_module_stream_on_managed_instance.command_name', 'enable-module-stream-on-managed-instance'), help=u"""Enables a module stream on a managed instance. After the stream is enabled, it is possible to install the profiles that are contained by the stream. Enabling a stream that is already enabled will succeed. Attempting to enable a different stream for a module that already has a stream enabled results in an error. \n[Command Reference](enableModuleStreamOnManagedInstance)""")
942
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
943
- @cli_util.option('--module-name', required=True, help=u"""The name of a module.""")
944
- @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.""")
945
- @cli_util.option('--stream-name', help=u"""The name of the stream of the containing module. This parameter is required if a profileName is specified.""")
946
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
947
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
948
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
949
- @json_skeleton_utils.get_cli_json_input_option({})
950
- @cli_util.help_option
951
- @click.pass_context
952
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
953
- @cli_util.wrap_exceptions
954
- def enable_module_stream_on_managed_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_id, module_name, if_match, stream_name):
955
-
956
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
957
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
958
-
959
- kwargs = {}
960
- if if_match is not None:
961
- kwargs['if_match'] = if_match
962
- if stream_name is not None:
963
- kwargs['stream_name'] = stream_name
964
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
965
- client = cli_util.build_client('os_management', 'os_management', ctx)
966
- result = client.enable_module_stream_on_managed_instance(
967
- managed_instance_id=managed_instance_id,
968
- module_name=module_name,
969
- **kwargs
970
- )
971
- if wait_for_state:
972
-
973
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
974
- try:
975
- wait_period_kwargs = {}
976
- if max_wait_seconds is not None:
977
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
978
- if wait_interval_seconds is not None:
979
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
980
- if 'opc-work-request-id' not in result.headers:
981
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
982
- cli_util.render_response(result, ctx)
983
- return
984
-
985
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
986
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
987
- except oci.exceptions.MaximumWaitTimeExceeded as e:
988
- # If we fail, we should show an error, but we should still provide the information to the customer
989
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
990
- cli_util.render_response(result, ctx)
991
- sys.exit(2)
992
- except Exception:
993
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
994
- cli_util.render_response(result, ctx)
995
- raise
996
- else:
997
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
998
- cli_util.render_response(result, ctx)
999
-
1000
-
1001
- @erratum_group.command(name=cli_util.override('os_management.get_erratum.command_name', 'get'), help=u"""Returns a specific erratum. \n[Command Reference](getErratum)""")
1002
- @cli_util.option('--erratum-id', required=True, help=u"""The OCID of the erratum.""")
1003
- @json_skeleton_utils.get_cli_json_input_option({})
1004
- @cli_util.help_option
1005
- @click.pass_context
1006
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'Erratum'})
1007
- @cli_util.wrap_exceptions
1008
- def get_erratum(ctx, from_json, erratum_id):
1009
-
1010
- if isinstance(erratum_id, six.string_types) and len(erratum_id.strip()) == 0:
1011
- raise click.UsageError('Parameter --erratum-id cannot be whitespace or empty string')
1012
-
1013
- kwargs = {}
1014
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1015
- client = cli_util.build_client('os_management', 'os_management', ctx)
1016
- result = client.get_erratum(
1017
- erratum_id=erratum_id,
1018
- **kwargs
1019
- )
1020
- cli_util.render_response(result, ctx)
1021
-
1022
-
1023
- @managed_instance_group.command(name=cli_util.override('os_management.get_managed_instance.command_name', 'get'), help=u"""Returns a specific Managed Instance. \n[Command Reference](getManagedInstance)""")
1024
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
1025
- @json_skeleton_utils.get_cli_json_input_option({})
1026
- @cli_util.help_option
1027
- @click.pass_context
1028
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'ManagedInstance'})
1029
- @cli_util.wrap_exceptions
1030
- def get_managed_instance(ctx, from_json, managed_instance_id):
1031
-
1032
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
1033
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
1034
-
1035
- kwargs = {}
1036
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1037
- client = cli_util.build_client('os_management', 'os_management', ctx)
1038
- result = client.get_managed_instance(
1039
- managed_instance_id=managed_instance_id,
1040
- **kwargs
1041
- )
1042
- cli_util.render_response(result, ctx)
1043
-
1044
-
1045
- @managed_instance_group_group.command(name=cli_util.override('os_management.get_managed_instance_group.command_name', 'get'), help=u"""Returns a specific Managed Instance Group. \n[Command Reference](getManagedInstanceGroup)""")
1046
- @cli_util.option('--managed-instance-group-id', required=True, help=u"""OCID for the managed instance group""")
1047
- @json_skeleton_utils.get_cli_json_input_option({})
1048
- @cli_util.help_option
1049
- @click.pass_context
1050
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'ManagedInstanceGroup'})
1051
- @cli_util.wrap_exceptions
1052
- def get_managed_instance_group(ctx, from_json, managed_instance_group_id):
1053
-
1054
- if isinstance(managed_instance_group_id, six.string_types) and len(managed_instance_group_id.strip()) == 0:
1055
- raise click.UsageError('Parameter --managed-instance-group-id cannot be whitespace or empty string')
1056
-
1057
- kwargs = {}
1058
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1059
- client = cli_util.build_client('os_management', 'os_management', ctx)
1060
- result = client.get_managed_instance_group(
1061
- managed_instance_group_id=managed_instance_group_id,
1062
- **kwargs
1063
- )
1064
- cli_util.render_response(result, ctx)
1065
-
1066
-
1067
- @module_stream_group.command(name=cli_util.override('os_management.get_module_stream.command_name', 'get'), help=u"""Retrieve a detailed description of a module stream from a software source. \n[Command Reference](getModuleStream)""")
1068
- @cli_util.option('--software-source-id', required=True, help=u"""The OCID of the software source.""")
1069
- @cli_util.option('--module-name', required=True, help=u"""The name of the module""")
1070
- @cli_util.option('--stream-name', required=True, help=u"""The name of the stream of the containing module""")
1071
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1072
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
1073
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
1074
- @json_skeleton_utils.get_cli_json_input_option({})
1075
- @cli_util.help_option
1076
- @click.pass_context
1077
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'ModuleStream'})
1078
- @cli_util.wrap_exceptions
1079
- def get_module_stream(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, software_source_id, module_name, stream_name):
1080
-
1081
- if isinstance(software_source_id, six.string_types) and len(software_source_id.strip()) == 0:
1082
- raise click.UsageError('Parameter --software-source-id cannot be whitespace or empty string')
1083
-
1084
- if isinstance(module_name, six.string_types) and len(module_name.strip()) == 0:
1085
- raise click.UsageError('Parameter --module-name cannot be whitespace or empty string')
1086
-
1087
- if isinstance(stream_name, six.string_types) and len(stream_name.strip()) == 0:
1088
- raise click.UsageError('Parameter --stream-name cannot be whitespace or empty string')
1089
-
1090
- kwargs = {}
1091
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1092
- client = cli_util.build_client('os_management', 'os_management', ctx)
1093
- result = client.get_module_stream(
1094
- software_source_id=software_source_id,
1095
- module_name=module_name,
1096
- stream_name=stream_name,
1097
- **kwargs
1098
- )
1099
- if wait_for_state:
1100
-
1101
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
1102
- try:
1103
- wait_period_kwargs = {}
1104
- if max_wait_seconds is not None:
1105
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1106
- if wait_interval_seconds is not None:
1107
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1108
- if 'opc-work-request-id' not in result.headers:
1109
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
1110
- cli_util.render_response(result, ctx)
1111
- return
1112
-
1113
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
1114
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1115
- except oci.exceptions.MaximumWaitTimeExceeded as e:
1116
- # If we fail, we should show an error, but we should still provide the information to the customer
1117
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
1118
- cli_util.render_response(result, ctx)
1119
- sys.exit(2)
1120
- except Exception:
1121
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
1122
- cli_util.render_response(result, ctx)
1123
- raise
1124
- else:
1125
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1126
- cli_util.render_response(result, ctx)
1127
-
1128
-
1129
- @module_stream_profile_group.command(name=cli_util.override('os_management.get_module_stream_profile.command_name', 'get'), help=u"""Retrieve a detailed description of a module stream profile from a software source. \n[Command Reference](getModuleStreamProfile)""")
1130
- @cli_util.option('--software-source-id', required=True, help=u"""The OCID of the software source.""")
1131
- @cli_util.option('--module-name', required=True, help=u"""The name of the module""")
1132
- @cli_util.option('--stream-name', required=True, help=u"""The name of the stream of the containing module""")
1133
- @cli_util.option('--profile-name', required=True, help=u"""The name of the profile of the containing module stream""")
1134
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1135
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
1136
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
1137
- @json_skeleton_utils.get_cli_json_input_option({})
1138
- @cli_util.help_option
1139
- @click.pass_context
1140
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'ModuleStreamProfile'})
1141
- @cli_util.wrap_exceptions
1142
- def get_module_stream_profile(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, software_source_id, module_name, stream_name, profile_name):
1143
-
1144
- if isinstance(software_source_id, six.string_types) and len(software_source_id.strip()) == 0:
1145
- raise click.UsageError('Parameter --software-source-id cannot be whitespace or empty string')
1146
-
1147
- if isinstance(module_name, six.string_types) and len(module_name.strip()) == 0:
1148
- raise click.UsageError('Parameter --module-name cannot be whitespace or empty string')
1149
-
1150
- if isinstance(stream_name, six.string_types) and len(stream_name.strip()) == 0:
1151
- raise click.UsageError('Parameter --stream-name cannot be whitespace or empty string')
1152
-
1153
- if isinstance(profile_name, six.string_types) and len(profile_name.strip()) == 0:
1154
- raise click.UsageError('Parameter --profile-name cannot be whitespace or empty string')
1155
-
1156
- kwargs = {}
1157
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1158
- client = cli_util.build_client('os_management', 'os_management', ctx)
1159
- result = client.get_module_stream_profile(
1160
- software_source_id=software_source_id,
1161
- module_name=module_name,
1162
- stream_name=stream_name,
1163
- profile_name=profile_name,
1164
- **kwargs
1165
- )
1166
- if wait_for_state:
1167
-
1168
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
1169
- try:
1170
- wait_period_kwargs = {}
1171
- if max_wait_seconds is not None:
1172
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1173
- if wait_interval_seconds is not None:
1174
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1175
- if 'opc-work-request-id' not in result.headers:
1176
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
1177
- cli_util.render_response(result, ctx)
1178
- return
1179
-
1180
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
1181
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1182
- except oci.exceptions.MaximumWaitTimeExceeded as e:
1183
- # If we fail, we should show an error, but we should still provide the information to the customer
1184
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
1185
- cli_util.render_response(result, ctx)
1186
- sys.exit(2)
1187
- except Exception:
1188
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
1189
- cli_util.render_response(result, ctx)
1190
- raise
1191
- else:
1192
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1193
- cli_util.render_response(result, ctx)
1194
-
1195
-
1196
- @scheduled_job_group.command(name=cli_util.override('os_management.get_scheduled_job.command_name', 'get'), help=u"""Gets the detailed information for the Scheduled Job with the given ID. \n[Command Reference](getScheduledJob)""")
1197
- @cli_util.option('--scheduled-job-id', required=True, help=u"""The ID of the scheduled job.""")
1198
- @json_skeleton_utils.get_cli_json_input_option({})
1199
- @cli_util.help_option
1200
- @click.pass_context
1201
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'ScheduledJob'})
1202
- @cli_util.wrap_exceptions
1203
- def get_scheduled_job(ctx, from_json, scheduled_job_id):
1204
-
1205
- if isinstance(scheduled_job_id, six.string_types) and len(scheduled_job_id.strip()) == 0:
1206
- raise click.UsageError('Parameter --scheduled-job-id cannot be whitespace or empty string')
1207
-
1208
- kwargs = {}
1209
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1210
- client = cli_util.build_client('os_management', 'os_management', ctx)
1211
- result = client.get_scheduled_job(
1212
- scheduled_job_id=scheduled_job_id,
1213
- **kwargs
1214
- )
1215
- cli_util.render_response(result, ctx)
1216
-
1217
-
1218
- @software_source_group.command(name=cli_util.override('os_management.get_software_package.command_name', 'get-software-package'), help=u"""Returns a specific Software Package. \n[Command Reference](getSoftwarePackage)""")
1219
- @cli_util.option('--software-source-id', required=True, help=u"""The OCID of the software source.""")
1220
- @cli_util.option('--software-package-name', required=True, help=u"""The id of the software package.""")
1221
- @json_skeleton_utils.get_cli_json_input_option({})
1222
- @cli_util.help_option
1223
- @click.pass_context
1224
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'SoftwarePackage'})
1225
- @cli_util.wrap_exceptions
1226
- def get_software_package(ctx, from_json, software_source_id, software_package_name):
1227
-
1228
- if isinstance(software_source_id, six.string_types) and len(software_source_id.strip()) == 0:
1229
- raise click.UsageError('Parameter --software-source-id cannot be whitespace or empty string')
1230
-
1231
- if isinstance(software_package_name, six.string_types) and len(software_package_name.strip()) == 0:
1232
- raise click.UsageError('Parameter --software-package-name cannot be whitespace or empty string')
1233
-
1234
- kwargs = {}
1235
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1236
- client = cli_util.build_client('os_management', 'os_management', ctx)
1237
- result = client.get_software_package(
1238
- software_source_id=software_source_id,
1239
- software_package_name=software_package_name,
1240
- **kwargs
1241
- )
1242
- cli_util.render_response(result, ctx)
1243
-
1244
-
1245
- @software_source_group.command(name=cli_util.override('os_management.get_software_source.command_name', 'get'), help=u"""Returns a specific Software Source. \n[Command Reference](getSoftwareSource)""")
1246
- @cli_util.option('--software-source-id', required=True, help=u"""The OCID of the software source.""")
1247
- @json_skeleton_utils.get_cli_json_input_option({})
1248
- @cli_util.help_option
1249
- @click.pass_context
1250
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'SoftwareSource'})
1251
- @cli_util.wrap_exceptions
1252
- def get_software_source(ctx, from_json, software_source_id):
1253
-
1254
- if isinstance(software_source_id, six.string_types) and len(software_source_id.strip()) == 0:
1255
- raise click.UsageError('Parameter --software-source-id cannot be whitespace or empty string')
1256
-
1257
- kwargs = {}
1258
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1259
- client = cli_util.build_client('os_management', 'os_management', ctx)
1260
- result = client.get_software_source(
1261
- software_source_id=software_source_id,
1262
- **kwargs
1263
- )
1264
- cli_util.render_response(result, ctx)
1265
-
1266
-
1267
- @windows_update_group.command(name=cli_util.override('os_management.get_windows_update.command_name', 'get'), help=u"""Returns a Windows Update object. \n[Command Reference](getWindowsUpdate)""")
1268
- @cli_util.option('--windows-update', required=True, help=u"""The Windows Update""")
1269
- @json_skeleton_utils.get_cli_json_input_option({})
1270
- @cli_util.help_option
1271
- @click.pass_context
1272
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'WindowsUpdate'})
1273
- @cli_util.wrap_exceptions
1274
- def get_windows_update(ctx, from_json, windows_update):
1275
-
1276
- if isinstance(windows_update, six.string_types) and len(windows_update.strip()) == 0:
1277
- raise click.UsageError('Parameter --windows-update cannot be whitespace or empty string')
1278
-
1279
- kwargs = {}
1280
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1281
- client = cli_util.build_client('os_management', 'os_management', ctx)
1282
- result = client.get_windows_update(
1283
- windows_update=windows_update,
1284
- **kwargs
1285
- )
1286
- cli_util.render_response(result, ctx)
1287
-
1288
-
1289
- @work_request_group.command(name=cli_util.override('os_management.get_work_request.command_name', 'get'), help=u"""Gets the detailed information for the work request with the given ID. \n[Command Reference](getWorkRequest)""")
1290
- @cli_util.option('--work-request-id', required=True, help=u"""The ID of the asynchronous request.""")
1291
- @json_skeleton_utils.get_cli_json_input_option({})
1292
- @cli_util.help_option
1293
- @click.pass_context
1294
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'WorkRequest'})
1295
- @cli_util.wrap_exceptions
1296
- def get_work_request(ctx, from_json, work_request_id):
1297
-
1298
- if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
1299
- raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
1300
-
1301
- kwargs = {}
1302
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1303
- client = cli_util.build_client('os_management', 'os_management', ctx)
1304
- result = client.get_work_request(
1305
- work_request_id=work_request_id,
1306
- **kwargs
1307
- )
1308
- cli_util.render_response(result, ctx)
1309
-
1310
-
1311
- @managed_instance_group.command(name=cli_util.override('os_management.install_all_package_updates_on_managed_instance.command_name', 'install-all-package-updates'), help=u"""Install all of the available package updates for the managed instance. \n[Command Reference](installAllPackageUpdatesOnManagedInstance)""")
1312
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
1313
- @cli_util.option('--update-type', type=custom_types.CliCaseInsensitiveChoice(["SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL"]), help=u"""The type of updates to be applied""")
1314
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1315
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
1316
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
1317
- @json_skeleton_utils.get_cli_json_input_option({})
1318
- @cli_util.help_option
1319
- @click.pass_context
1320
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
1321
- @cli_util.wrap_exceptions
1322
- def install_all_package_updates_on_managed_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_id, update_type):
1323
-
1324
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
1325
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
1326
-
1327
- kwargs = {}
1328
- if update_type is not None:
1329
- kwargs['update_type'] = update_type
1330
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1331
- client = cli_util.build_client('os_management', 'os_management', ctx)
1332
- result = client.install_all_package_updates_on_managed_instance(
1333
- managed_instance_id=managed_instance_id,
1334
- **kwargs
1335
- )
1336
- if wait_for_state:
1337
-
1338
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
1339
- try:
1340
- wait_period_kwargs = {}
1341
- if max_wait_seconds is not None:
1342
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1343
- if wait_interval_seconds is not None:
1344
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1345
- if 'opc-work-request-id' not in result.headers:
1346
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
1347
- cli_util.render_response(result, ctx)
1348
- return
1349
-
1350
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
1351
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1352
- except oci.exceptions.MaximumWaitTimeExceeded as e:
1353
- # If we fail, we should show an error, but we should still provide the information to the customer
1354
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
1355
- cli_util.render_response(result, ctx)
1356
- sys.exit(2)
1357
- except Exception:
1358
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
1359
- cli_util.render_response(result, ctx)
1360
- raise
1361
- else:
1362
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1363
- cli_util.render_response(result, ctx)
1364
-
1365
-
1366
- @managed_instance_group_group.command(name=cli_util.override('os_management.install_all_updates_on_managed_instance_group.command_name', 'install-all-updates'), help=u"""Install all of the available updates for the Managed Instance Group. \n[Command Reference](installAllUpdatesOnManagedInstanceGroup)""")
1367
- @cli_util.option('--managed-instance-group-id', required=True, help=u"""OCID for the managed instance group""")
1368
- @cli_util.option('--update-type', type=custom_types.CliCaseInsensitiveChoice(["SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL"]), help=u"""The type of updates to be applied""")
1369
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1370
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
1371
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
1372
- @json_skeleton_utils.get_cli_json_input_option({})
1373
- @cli_util.help_option
1374
- @click.pass_context
1375
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
1376
- @cli_util.wrap_exceptions
1377
- def install_all_updates_on_managed_instance_group(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_group_id, update_type):
1378
-
1379
- if isinstance(managed_instance_group_id, six.string_types) and len(managed_instance_group_id.strip()) == 0:
1380
- raise click.UsageError('Parameter --managed-instance-group-id cannot be whitespace or empty string')
1381
-
1382
- kwargs = {}
1383
- if update_type is not None:
1384
- kwargs['update_type'] = update_type
1385
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1386
- client = cli_util.build_client('os_management', 'os_management', ctx)
1387
- result = client.install_all_updates_on_managed_instance_group(
1388
- managed_instance_group_id=managed_instance_group_id,
1389
- **kwargs
1390
- )
1391
- if wait_for_state:
1392
-
1393
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
1394
- try:
1395
- wait_period_kwargs = {}
1396
- if max_wait_seconds is not None:
1397
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1398
- if wait_interval_seconds is not None:
1399
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1400
- if 'opc-work-request-id' not in result.headers:
1401
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
1402
- cli_util.render_response(result, ctx)
1403
- return
1404
-
1405
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
1406
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1407
- except oci.exceptions.MaximumWaitTimeExceeded as e:
1408
- # If we fail, we should show an error, but we should still provide the information to the customer
1409
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
1410
- cli_util.render_response(result, ctx)
1411
- sys.exit(2)
1412
- except Exception:
1413
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
1414
- cli_util.render_response(result, ctx)
1415
- raise
1416
- else:
1417
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1418
- cli_util.render_response(result, ctx)
1419
-
1420
-
1421
- @managed_instance_group.command(name=cli_util.override('os_management.install_all_windows_updates_on_managed_instance.command_name', 'install-all-windows-updates'), help=u"""Install all of the available Windows updates for the managed instance. \n[Command Reference](installAllWindowsUpdatesOnManagedInstance)""")
1422
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
1423
- @cli_util.option('--update-type', type=custom_types.CliCaseInsensitiveChoice(["SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL"]), help=u"""The type of updates to be applied""")
1424
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1425
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
1426
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
1427
- @json_skeleton_utils.get_cli_json_input_option({})
1428
- @cli_util.help_option
1429
- @click.pass_context
1430
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
1431
- @cli_util.wrap_exceptions
1432
- def install_all_windows_updates_on_managed_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_id, update_type):
1433
-
1434
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
1435
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
1436
-
1437
- kwargs = {}
1438
- if update_type is not None:
1439
- kwargs['update_type'] = update_type
1440
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1441
- client = cli_util.build_client('os_management', 'os_management', ctx)
1442
- result = client.install_all_windows_updates_on_managed_instance(
1443
- managed_instance_id=managed_instance_id,
1444
- **kwargs
1445
- )
1446
- if wait_for_state:
1447
-
1448
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
1449
- try:
1450
- wait_period_kwargs = {}
1451
- if max_wait_seconds is not None:
1452
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1453
- if wait_interval_seconds is not None:
1454
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1455
- if 'opc-work-request-id' not in result.headers:
1456
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
1457
- cli_util.render_response(result, ctx)
1458
- return
1459
-
1460
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
1461
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1462
- except oci.exceptions.MaximumWaitTimeExceeded as e:
1463
- # If we fail, we should show an error, but we should still provide the information to the customer
1464
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
1465
- cli_util.render_response(result, ctx)
1466
- sys.exit(2)
1467
- except Exception:
1468
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
1469
- cli_util.render_response(result, ctx)
1470
- raise
1471
- else:
1472
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1473
- cli_util.render_response(result, ctx)
1474
-
1475
-
1476
- @module_stream_profile_details_group.command(name=cli_util.override('os_management.install_module_stream_profile_on_managed_instance.command_name', 'install-module-stream-profile-on-managed-instance'), help=u"""Installs a profile for an module stream. The stream must be enabled before a profile can be installed. If a module stream defines multiple profiles, each one can be installed independently. \n[Command Reference](installModuleStreamProfileOnManagedInstance)""")
1477
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
1478
- @cli_util.option('--module-name', required=True, help=u"""The name of a module.""")
1479
- @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.""")
1480
- @cli_util.option('--stream-name', help=u"""The name of the stream of the containing module. This parameter is required if a profileName is specified.""")
1481
- @cli_util.option('--profile-name', help=u"""The name of the profile of the containing module stream""")
1482
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1483
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
1484
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
1485
- @json_skeleton_utils.get_cli_json_input_option({})
1486
- @cli_util.help_option
1487
- @click.pass_context
1488
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
1489
- @cli_util.wrap_exceptions
1490
- def install_module_stream_profile_on_managed_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_id, module_name, if_match, stream_name, profile_name):
1491
-
1492
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
1493
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
1494
-
1495
- kwargs = {}
1496
- if if_match is not None:
1497
- kwargs['if_match'] = if_match
1498
- if stream_name is not None:
1499
- kwargs['stream_name'] = stream_name
1500
- if profile_name is not None:
1501
- kwargs['profile_name'] = profile_name
1502
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1503
- client = cli_util.build_client('os_management', 'os_management', ctx)
1504
- result = client.install_module_stream_profile_on_managed_instance(
1505
- managed_instance_id=managed_instance_id,
1506
- module_name=module_name,
1507
- **kwargs
1508
- )
1509
- if wait_for_state:
1510
-
1511
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
1512
- try:
1513
- wait_period_kwargs = {}
1514
- if max_wait_seconds is not None:
1515
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1516
- if wait_interval_seconds is not None:
1517
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1518
- if 'opc-work-request-id' not in result.headers:
1519
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
1520
- cli_util.render_response(result, ctx)
1521
- return
1522
-
1523
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
1524
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1525
- except oci.exceptions.MaximumWaitTimeExceeded as e:
1526
- # If we fail, we should show an error, but we should still provide the information to the customer
1527
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
1528
- cli_util.render_response(result, ctx)
1529
- sys.exit(2)
1530
- except Exception:
1531
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
1532
- cli_util.render_response(result, ctx)
1533
- raise
1534
- else:
1535
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1536
- cli_util.render_response(result, ctx)
1537
-
1538
-
1539
- @managed_instance_group.command(name=cli_util.override('os_management.install_package_on_managed_instance.command_name', 'install-package'), help=u"""Installs a package on a managed instance. \n[Command Reference](installPackageOnManagedInstance)""")
1540
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
1541
- @cli_util.option('--software-package-name', required=True, help=u"""Package name""")
1542
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1543
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
1544
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
1545
- @json_skeleton_utils.get_cli_json_input_option({})
1546
- @cli_util.help_option
1547
- @click.pass_context
1548
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
1549
- @cli_util.wrap_exceptions
1550
- def install_package_on_managed_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_id, software_package_name):
1551
-
1552
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
1553
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
1554
-
1555
- kwargs = {}
1556
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1557
- client = cli_util.build_client('os_management', 'os_management', ctx)
1558
- result = client.install_package_on_managed_instance(
1559
- managed_instance_id=managed_instance_id,
1560
- software_package_name=software_package_name,
1561
- **kwargs
1562
- )
1563
- if wait_for_state:
1564
-
1565
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
1566
- try:
1567
- wait_period_kwargs = {}
1568
- if max_wait_seconds is not None:
1569
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1570
- if wait_interval_seconds is not None:
1571
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1572
- if 'opc-work-request-id' not in result.headers:
1573
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
1574
- cli_util.render_response(result, ctx)
1575
- return
1576
-
1577
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
1578
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1579
- except oci.exceptions.MaximumWaitTimeExceeded as e:
1580
- # If we fail, we should show an error, but we should still provide the information to the customer
1581
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
1582
- cli_util.render_response(result, ctx)
1583
- sys.exit(2)
1584
- except Exception:
1585
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
1586
- cli_util.render_response(result, ctx)
1587
- raise
1588
- else:
1589
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1590
- cli_util.render_response(result, ctx)
1591
-
1592
-
1593
- @managed_instance_group.command(name=cli_util.override('os_management.install_package_update_on_managed_instance.command_name', 'install-package-update'), help=u"""Updates a package on a managed instance. \n[Command Reference](installPackageUpdateOnManagedInstance)""")
1594
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
1595
- @cli_util.option('--software-package-name', required=True, help=u"""Package name""")
1596
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1597
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
1598
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
1599
- @json_skeleton_utils.get_cli_json_input_option({})
1600
- @cli_util.help_option
1601
- @click.pass_context
1602
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
1603
- @cli_util.wrap_exceptions
1604
- def install_package_update_on_managed_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_id, software_package_name):
1605
-
1606
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
1607
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
1608
-
1609
- kwargs = {}
1610
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1611
- client = cli_util.build_client('os_management', 'os_management', ctx)
1612
- result = client.install_package_update_on_managed_instance(
1613
- managed_instance_id=managed_instance_id,
1614
- software_package_name=software_package_name,
1615
- **kwargs
1616
- )
1617
- if wait_for_state:
1618
-
1619
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
1620
- try:
1621
- wait_period_kwargs = {}
1622
- if max_wait_seconds is not None:
1623
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1624
- if wait_interval_seconds is not None:
1625
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1626
- if 'opc-work-request-id' not in result.headers:
1627
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
1628
- cli_util.render_response(result, ctx)
1629
- return
1630
-
1631
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
1632
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1633
- except oci.exceptions.MaximumWaitTimeExceeded as e:
1634
- # If we fail, we should show an error, but we should still provide the information to the customer
1635
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
1636
- cli_util.render_response(result, ctx)
1637
- sys.exit(2)
1638
- except Exception:
1639
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
1640
- cli_util.render_response(result, ctx)
1641
- raise
1642
- else:
1643
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1644
- cli_util.render_response(result, ctx)
1645
-
1646
-
1647
- @managed_instance_group.command(name=cli_util.override('os_management.install_windows_update_on_managed_instance.command_name', 'install-windows-update'), help=u"""Installs a Windows update on a managed instance. \n[Command Reference](installWindowsUpdateOnManagedInstance)""")
1648
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
1649
- @cli_util.option('--windows-update-name', required=True, help=u"""Unique identifier for the Windows update. NOTE - This is not an OCID, but is a unique identifier assigned by Microsoft. Example: `6981d463-cd91-4a26-b7c4-ea4ded9183ed`""")
1650
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
1651
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
1652
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
1653
- @json_skeleton_utils.get_cli_json_input_option({})
1654
- @cli_util.help_option
1655
- @click.pass_context
1656
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
1657
- @cli_util.wrap_exceptions
1658
- def install_windows_update_on_managed_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_id, windows_update_name):
1659
-
1660
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
1661
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
1662
-
1663
- kwargs = {}
1664
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1665
- client = cli_util.build_client('os_management', 'os_management', ctx)
1666
- result = client.install_windows_update_on_managed_instance(
1667
- managed_instance_id=managed_instance_id,
1668
- windows_update_name=windows_update_name,
1669
- **kwargs
1670
- )
1671
- if wait_for_state:
1672
-
1673
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
1674
- try:
1675
- wait_period_kwargs = {}
1676
- if max_wait_seconds is not None:
1677
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
1678
- if wait_interval_seconds is not None:
1679
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
1680
- if 'opc-work-request-id' not in result.headers:
1681
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
1682
- cli_util.render_response(result, ctx)
1683
- return
1684
-
1685
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
1686
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
1687
- except oci.exceptions.MaximumWaitTimeExceeded as e:
1688
- # If we fail, we should show an error, but we should still provide the information to the customer
1689
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
1690
- cli_util.render_response(result, ctx)
1691
- sys.exit(2)
1692
- except Exception:
1693
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
1694
- cli_util.render_response(result, ctx)
1695
- raise
1696
- else:
1697
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
1698
- cli_util.render_response(result, ctx)
1699
-
1700
-
1701
- @managed_instance_group.command(name=cli_util.override('os_management.list_available_packages_for_managed_instance.command_name', 'list-available-packages-for'), help=u"""Returns a list of packages available for install on the Managed Instance. \n[Command Reference](listAvailablePackagesForManagedInstance)""")
1702
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
1703
- @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
1704
-
1705
- Example: `My new resource`""")
1706
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources. This parameter is optional and in some cases may have no effect.""")
1707
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
1708
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
1709
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
1710
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
1711
- @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.""")
1712
- @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.""")
1713
- @json_skeleton_utils.get_cli_json_input_option({})
1714
- @cli_util.help_option
1715
- @click.pass_context
1716
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[InstallablePackageSummary]'})
1717
- @cli_util.wrap_exceptions
1718
- def list_available_packages_for_managed_instance(ctx, from_json, all_pages, page_size, managed_instance_id, display_name, compartment_id, limit, page, sort_order, sort_by):
1719
-
1720
- if all_pages and limit:
1721
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
1722
-
1723
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
1724
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
1725
-
1726
- kwargs = {}
1727
- if display_name is not None:
1728
- kwargs['display_name'] = display_name
1729
- if compartment_id is not None:
1730
- kwargs['compartment_id'] = compartment_id
1731
- if limit is not None:
1732
- kwargs['limit'] = limit
1733
- if page is not None:
1734
- kwargs['page'] = page
1735
- if sort_order is not None:
1736
- kwargs['sort_order'] = sort_order
1737
- if sort_by is not None:
1738
- kwargs['sort_by'] = sort_by
1739
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1740
- client = cli_util.build_client('os_management', 'os_management', ctx)
1741
- if all_pages:
1742
- if page_size:
1743
- kwargs['limit'] = page_size
1744
-
1745
- result = cli_util.list_call_get_all_results(
1746
- client.list_available_packages_for_managed_instance,
1747
- managed_instance_id=managed_instance_id,
1748
- **kwargs
1749
- )
1750
- elif limit is not None:
1751
- result = cli_util.list_call_get_up_to_limit(
1752
- client.list_available_packages_for_managed_instance,
1753
- limit,
1754
- page_size,
1755
- managed_instance_id=managed_instance_id,
1756
- **kwargs
1757
- )
1758
- else:
1759
- result = client.list_available_packages_for_managed_instance(
1760
- managed_instance_id=managed_instance_id,
1761
- **kwargs
1762
- )
1763
- cli_util.render_response(result, ctx)
1764
-
1765
-
1766
- @managed_instance_group.command(name=cli_util.override('os_management.list_available_software_sources_for_managed_instance.command_name', 'list-available-software-sources-for'), help=u"""Returns a list of available software sources for a Managed Instance. \n[Command Reference](listAvailableSoftwareSourcesForManagedInstance)""")
1767
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
1768
- @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
1769
-
1770
- Example: `My new resource`""")
1771
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources. This parameter is optional and in some cases may have no effect.""")
1772
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
1773
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
1774
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
1775
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
1776
- @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.""")
1777
- @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.""")
1778
- @json_skeleton_utils.get_cli_json_input_option({})
1779
- @cli_util.help_option
1780
- @click.pass_context
1781
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[AvailableSoftwareSourceSummary]'})
1782
- @cli_util.wrap_exceptions
1783
- def list_available_software_sources_for_managed_instance(ctx, from_json, all_pages, page_size, managed_instance_id, display_name, compartment_id, limit, page, sort_order, sort_by):
1784
-
1785
- if all_pages and limit:
1786
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
1787
-
1788
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
1789
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
1790
-
1791
- kwargs = {}
1792
- if display_name is not None:
1793
- kwargs['display_name'] = display_name
1794
- if compartment_id is not None:
1795
- kwargs['compartment_id'] = compartment_id
1796
- if limit is not None:
1797
- kwargs['limit'] = limit
1798
- if page is not None:
1799
- kwargs['page'] = page
1800
- if sort_order is not None:
1801
- kwargs['sort_order'] = sort_order
1802
- if sort_by is not None:
1803
- kwargs['sort_by'] = sort_by
1804
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1805
- client = cli_util.build_client('os_management', 'os_management', ctx)
1806
- if all_pages:
1807
- if page_size:
1808
- kwargs['limit'] = page_size
1809
-
1810
- result = cli_util.list_call_get_all_results(
1811
- client.list_available_software_sources_for_managed_instance,
1812
- managed_instance_id=managed_instance_id,
1813
- **kwargs
1814
- )
1815
- elif limit is not None:
1816
- result = cli_util.list_call_get_up_to_limit(
1817
- client.list_available_software_sources_for_managed_instance,
1818
- limit,
1819
- page_size,
1820
- managed_instance_id=managed_instance_id,
1821
- **kwargs
1822
- )
1823
- else:
1824
- result = client.list_available_software_sources_for_managed_instance(
1825
- managed_instance_id=managed_instance_id,
1826
- **kwargs
1827
- )
1828
- cli_util.render_response(result, ctx)
1829
-
1830
-
1831
- @managed_instance_group.command(name=cli_util.override('os_management.list_available_updates_for_managed_instance.command_name', 'list-available-updates-for'), help=u"""Returns a list of available updates for a Managed Instance. \n[Command Reference](listAvailableUpdatesForManagedInstance)""")
1832
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
1833
- @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
1834
-
1835
- Example: `My new resource`""")
1836
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources. This parameter is optional and in some cases may have no effect.""")
1837
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
1838
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
1839
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
1840
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
1841
- @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.""")
1842
- @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.""")
1843
- @json_skeleton_utils.get_cli_json_input_option({})
1844
- @cli_util.help_option
1845
- @click.pass_context
1846
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[AvailableUpdateSummary]'})
1847
- @cli_util.wrap_exceptions
1848
- def list_available_updates_for_managed_instance(ctx, from_json, all_pages, page_size, managed_instance_id, display_name, compartment_id, limit, page, sort_order, sort_by):
1849
-
1850
- if all_pages and limit:
1851
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
1852
-
1853
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
1854
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
1855
-
1856
- kwargs = {}
1857
- if display_name is not None:
1858
- kwargs['display_name'] = display_name
1859
- if compartment_id is not None:
1860
- kwargs['compartment_id'] = compartment_id
1861
- if limit is not None:
1862
- kwargs['limit'] = limit
1863
- if page is not None:
1864
- kwargs['page'] = page
1865
- if sort_order is not None:
1866
- kwargs['sort_order'] = sort_order
1867
- if sort_by is not None:
1868
- kwargs['sort_by'] = sort_by
1869
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1870
- client = cli_util.build_client('os_management', 'os_management', ctx)
1871
- if all_pages:
1872
- if page_size:
1873
- kwargs['limit'] = page_size
1874
-
1875
- result = cli_util.list_call_get_all_results(
1876
- client.list_available_updates_for_managed_instance,
1877
- managed_instance_id=managed_instance_id,
1878
- **kwargs
1879
- )
1880
- elif limit is not None:
1881
- result = cli_util.list_call_get_up_to_limit(
1882
- client.list_available_updates_for_managed_instance,
1883
- limit,
1884
- page_size,
1885
- managed_instance_id=managed_instance_id,
1886
- **kwargs
1887
- )
1888
- else:
1889
- result = client.list_available_updates_for_managed_instance(
1890
- managed_instance_id=managed_instance_id,
1891
- **kwargs
1892
- )
1893
- cli_util.render_response(result, ctx)
1894
-
1895
-
1896
- @managed_instance_group.command(name=cli_util.override('os_management.list_available_windows_updates_for_managed_instance.command_name', 'list-available-windows-updates-for'), help=u"""Returns a list of available Windows updates for a Managed Instance. This is only applicable to Windows instances. \n[Command Reference](listAvailableWindowsUpdatesForManagedInstance)""")
1897
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
1898
- @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
1899
-
1900
- Example: `My new resource`""")
1901
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources. This parameter is optional and in some cases may have no effect.""")
1902
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
1903
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
1904
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
1905
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
1906
- @cli_util.option('--is-eligible-for-installation', type=custom_types.CliCaseInsensitiveChoice(["INSTALLABLE", "NOT_INSTALLABLE", "UNKNOWN"]), help=u"""Indicator of whether the update can be installed using OSMS.""")
1907
- @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.""")
1908
- @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.""")
1909
- @json_skeleton_utils.get_cli_json_input_option({})
1910
- @cli_util.help_option
1911
- @click.pass_context
1912
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[AvailableWindowsUpdateSummary]'})
1913
- @cli_util.wrap_exceptions
1914
- def list_available_windows_updates_for_managed_instance(ctx, from_json, all_pages, page_size, managed_instance_id, display_name, compartment_id, limit, page, sort_order, sort_by, is_eligible_for_installation):
1915
-
1916
- if all_pages and limit:
1917
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
1918
-
1919
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
1920
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
1921
-
1922
- kwargs = {}
1923
- if display_name is not None:
1924
- kwargs['display_name'] = display_name
1925
- if compartment_id is not None:
1926
- kwargs['compartment_id'] = compartment_id
1927
- if limit is not None:
1928
- kwargs['limit'] = limit
1929
- if page is not None:
1930
- kwargs['page'] = page
1931
- if sort_order is not None:
1932
- kwargs['sort_order'] = sort_order
1933
- if sort_by is not None:
1934
- kwargs['sort_by'] = sort_by
1935
- if is_eligible_for_installation is not None:
1936
- kwargs['is_eligible_for_installation'] = is_eligible_for_installation
1937
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
1938
- client = cli_util.build_client('os_management', 'os_management', ctx)
1939
- if all_pages:
1940
- if page_size:
1941
- kwargs['limit'] = page_size
1942
-
1943
- result = cli_util.list_call_get_all_results(
1944
- client.list_available_windows_updates_for_managed_instance,
1945
- managed_instance_id=managed_instance_id,
1946
- **kwargs
1947
- )
1948
- elif limit is not None:
1949
- result = cli_util.list_call_get_up_to_limit(
1950
- client.list_available_windows_updates_for_managed_instance,
1951
- limit,
1952
- page_size,
1953
- managed_instance_id=managed_instance_id,
1954
- **kwargs
1955
- )
1956
- else:
1957
- result = client.list_available_windows_updates_for_managed_instance(
1958
- managed_instance_id=managed_instance_id,
1959
- **kwargs
1960
- )
1961
- cli_util.render_response(result, ctx)
1962
-
1963
-
1964
- @erratum_summary_group.command(name=cli_util.override('os_management.list_errata.command_name', 'list-errata'), help=u"""Returns a list of all of the currently available Errata in the system \n[Command Reference](listErrata)""")
1965
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources. This parameter is optional and in some cases may have no effect.""")
1966
- @cli_util.option('--erratum-id', help=u"""The OCID of the erratum.""")
1967
- @cli_util.option('--advisory-name', help=u"""The assigned erratum name. It's unique and not changeable.
1968
-
1969
- Example: `ELSA-2020-5804`""")
1970
- @cli_util.option('--time-issue-date-start', type=custom_types.CLI_DATETIME, help=u"""The issue date after which to list all errata, in ISO 8601 format
1971
-
1972
- Example: 2017-07-14T02:40:00.000Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
1973
- @cli_util.option('--time-issue-date-end', type=custom_types.CLI_DATETIME, help=u"""The issue date before which to list all errata, in ISO 8601 format
1974
-
1975
- Example: 2017-07-14T02:40:00.000Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
1976
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
1977
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
1978
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
1979
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["ISSUEDATE", "ADVISORYNAME"]), help=u"""The field to sort errata by. Only one sort order may be provided. Default order for ISSUEDATE is descending. Default order for ADVISORYNAME is ascending. If no value is specified ISSUEDATE is default.""")
1980
- @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.""")
1981
- @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.""")
1982
- @json_skeleton_utils.get_cli_json_input_option({})
1983
- @cli_util.help_option
1984
- @click.pass_context
1985
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[ErratumSummary]'})
1986
- @cli_util.wrap_exceptions
1987
- def list_errata(ctx, from_json, all_pages, page_size, compartment_id, erratum_id, advisory_name, time_issue_date_start, time_issue_date_end, limit, page, sort_order, sort_by):
1988
-
1989
- if all_pages and limit:
1990
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
1991
-
1992
- kwargs = {}
1993
- if compartment_id is not None:
1994
- kwargs['compartment_id'] = compartment_id
1995
- if erratum_id is not None:
1996
- kwargs['erratum_id'] = erratum_id
1997
- if advisory_name is not None:
1998
- kwargs['advisory_name'] = advisory_name
1999
- if time_issue_date_start is not None:
2000
- kwargs['time_issue_date_start'] = time_issue_date_start
2001
- if time_issue_date_end is not None:
2002
- kwargs['time_issue_date_end'] = time_issue_date_end
2003
- if limit is not None:
2004
- kwargs['limit'] = limit
2005
- if page is not None:
2006
- kwargs['page'] = page
2007
- if sort_order is not None:
2008
- kwargs['sort_order'] = sort_order
2009
- if sort_by is not None:
2010
- kwargs['sort_by'] = sort_by
2011
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2012
- client = cli_util.build_client('os_management', 'os_management', ctx)
2013
- if all_pages:
2014
- if page_size:
2015
- kwargs['limit'] = page_size
2016
-
2017
- result = cli_util.list_call_get_all_results(
2018
- client.list_errata,
2019
- **kwargs
2020
- )
2021
- elif limit is not None:
2022
- result = cli_util.list_call_get_up_to_limit(
2023
- client.list_errata,
2024
- limit,
2025
- page_size,
2026
- **kwargs
2027
- )
2028
- else:
2029
- result = client.list_errata(
2030
- **kwargs
2031
- )
2032
- cli_util.render_response(result, ctx)
2033
-
2034
-
2035
- @managed_instance_group.command(name=cli_util.override('os_management.list_managed_instance_errata.command_name', 'list-managed-instance-errata'), help=u"""Returns a list of errata relevant to the Managed Instance. \n[Command Reference](listManagedInstanceErrata)""")
2036
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
2037
- @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
2038
-
2039
- Example: `My new resource`""")
2040
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources. This parameter is optional and in some cases may have no effect.""")
2041
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2042
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
2043
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
2044
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
2045
- @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.""")
2046
- @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.""")
2047
- @json_skeleton_utils.get_cli_json_input_option({})
2048
- @cli_util.help_option
2049
- @click.pass_context
2050
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[ErratumSummary]'})
2051
- @cli_util.wrap_exceptions
2052
- def list_managed_instance_errata(ctx, from_json, all_pages, page_size, managed_instance_id, display_name, compartment_id, limit, page, sort_order, sort_by):
2053
-
2054
- if all_pages and limit:
2055
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2056
-
2057
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
2058
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
2059
-
2060
- kwargs = {}
2061
- if display_name is not None:
2062
- kwargs['display_name'] = display_name
2063
- if compartment_id is not None:
2064
- kwargs['compartment_id'] = compartment_id
2065
- if limit is not None:
2066
- kwargs['limit'] = limit
2067
- if page is not None:
2068
- kwargs['page'] = page
2069
- if sort_order is not None:
2070
- kwargs['sort_order'] = sort_order
2071
- if sort_by is not None:
2072
- kwargs['sort_by'] = sort_by
2073
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2074
- client = cli_util.build_client('os_management', 'os_management', ctx)
2075
- if all_pages:
2076
- if page_size:
2077
- kwargs['limit'] = page_size
2078
-
2079
- result = cli_util.list_call_get_all_results(
2080
- client.list_managed_instance_errata,
2081
- managed_instance_id=managed_instance_id,
2082
- **kwargs
2083
- )
2084
- elif limit is not None:
2085
- result = cli_util.list_call_get_up_to_limit(
2086
- client.list_managed_instance_errata,
2087
- limit,
2088
- page_size,
2089
- managed_instance_id=managed_instance_id,
2090
- **kwargs
2091
- )
2092
- else:
2093
- result = client.list_managed_instance_errata(
2094
- managed_instance_id=managed_instance_id,
2095
- **kwargs
2096
- )
2097
- cli_util.render_response(result, ctx)
2098
-
2099
-
2100
- @managed_instance_group_group.command(name=cli_util.override('os_management.list_managed_instance_groups.command_name', 'list'), help=u"""Returns a list of all Managed Instance Groups. \n[Command Reference](listManagedInstanceGroups)""")
2101
- @cli_util.option('--compartment-id', required=True, help=u"""The ID of the compartment in which to list resources.""")
2102
- @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
2103
-
2104
- Example: `My new resource`""")
2105
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2106
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
2107
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
2108
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
2109
- @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""The current lifecycle state for the object.""")
2110
- @cli_util.option('--os-family', type=custom_types.CliCaseInsensitiveChoice(["LINUX", "WINDOWS", "ALL"]), help=u"""The OS family for which to list resources.""")
2111
- @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.""")
2112
- @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.""")
2113
- @json_skeleton_utils.get_cli_json_input_option({})
2114
- @cli_util.help_option
2115
- @click.pass_context
2116
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[ManagedInstanceGroupSummary]'})
2117
- @cli_util.wrap_exceptions
2118
- def list_managed_instance_groups(ctx, from_json, all_pages, page_size, compartment_id, display_name, limit, page, sort_order, sort_by, lifecycle_state, os_family):
2119
-
2120
- if all_pages and limit:
2121
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2122
-
2123
- kwargs = {}
2124
- if display_name is not None:
2125
- kwargs['display_name'] = display_name
2126
- if limit is not None:
2127
- kwargs['limit'] = limit
2128
- if page is not None:
2129
- kwargs['page'] = page
2130
- if sort_order is not None:
2131
- kwargs['sort_order'] = sort_order
2132
- if sort_by is not None:
2133
- kwargs['sort_by'] = sort_by
2134
- if lifecycle_state is not None:
2135
- kwargs['lifecycle_state'] = lifecycle_state
2136
- if os_family is not None:
2137
- kwargs['os_family'] = os_family
2138
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2139
- client = cli_util.build_client('os_management', 'os_management', ctx)
2140
- if all_pages:
2141
- if page_size:
2142
- kwargs['limit'] = page_size
2143
-
2144
- result = cli_util.list_call_get_all_results(
2145
- client.list_managed_instance_groups,
2146
- compartment_id=compartment_id,
2147
- **kwargs
2148
- )
2149
- elif limit is not None:
2150
- result = cli_util.list_call_get_up_to_limit(
2151
- client.list_managed_instance_groups,
2152
- limit,
2153
- page_size,
2154
- compartment_id=compartment_id,
2155
- **kwargs
2156
- )
2157
- else:
2158
- result = client.list_managed_instance_groups(
2159
- compartment_id=compartment_id,
2160
- **kwargs
2161
- )
2162
- cli_util.render_response(result, ctx)
2163
-
2164
-
2165
- @managed_instance_group.command(name=cli_util.override('os_management.list_managed_instances.command_name', 'list'), help=u"""Returns a list of all Managed Instances. \n[Command Reference](listManagedInstances)""")
2166
- @cli_util.option('--compartment-id', required=True, help=u"""The ID of the compartment in which to list resources.""")
2167
- @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
2168
-
2169
- Example: `My new resource`""")
2170
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2171
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
2172
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
2173
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
2174
- @cli_util.option('--os-family', type=custom_types.CliCaseInsensitiveChoice(["LINUX", "WINDOWS", "ALL"]), help=u"""The OS family for which to list resources.""")
2175
- @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.""")
2176
- @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.""")
2177
- @json_skeleton_utils.get_cli_json_input_option({})
2178
- @cli_util.help_option
2179
- @click.pass_context
2180
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[ManagedInstanceSummary]'})
2181
- @cli_util.wrap_exceptions
2182
- def list_managed_instances(ctx, from_json, all_pages, page_size, compartment_id, display_name, limit, page, sort_order, sort_by, os_family):
2183
-
2184
- if all_pages and limit:
2185
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2186
-
2187
- kwargs = {}
2188
- if display_name is not None:
2189
- kwargs['display_name'] = display_name
2190
- if limit is not None:
2191
- kwargs['limit'] = limit
2192
- if page is not None:
2193
- kwargs['page'] = page
2194
- if sort_order is not None:
2195
- kwargs['sort_order'] = sort_order
2196
- if sort_by is not None:
2197
- kwargs['sort_by'] = sort_by
2198
- if os_family is not None:
2199
- kwargs['os_family'] = os_family
2200
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2201
- client = cli_util.build_client('os_management', 'os_management', ctx)
2202
- if all_pages:
2203
- if page_size:
2204
- kwargs['limit'] = page_size
2205
-
2206
- result = cli_util.list_call_get_all_results(
2207
- client.list_managed_instances,
2208
- compartment_id=compartment_id,
2209
- **kwargs
2210
- )
2211
- elif limit is not None:
2212
- result = cli_util.list_call_get_up_to_limit(
2213
- client.list_managed_instances,
2214
- limit,
2215
- page_size,
2216
- compartment_id=compartment_id,
2217
- **kwargs
2218
- )
2219
- else:
2220
- result = client.list_managed_instances(
2221
- compartment_id=compartment_id,
2222
- **kwargs
2223
- )
2224
- cli_util.render_response(result, ctx)
2225
-
2226
-
2227
- @module_stream_profile_group.command(name=cli_util.override('os_management.list_module_stream_profiles.command_name', 'list'), help=u"""Retrieve a list of module stream profiles from a software source. Filters may be applied to select a subset of module stream profiles based on the filter criteria.
2228
-
2229
- The \"moduleName\", \"streamName\", and \"profileName\" attributes combine to form a set of filters on the list of module stream profiles. If a \"moduleName\" is provided, only profiles that belong to that module are returned. If both a \"moduleName\" and \"streamName\" are given, only profiles belonging to that module stream are returned. Finally, if all three are given then only the particular profile indicated by the triple is returned. It is not valid to supply a \"streamName\" without a \"moduleName\". It is also not valid to supply a \"profileName\" without a \"streamName\". \n[Command Reference](listModuleStreamProfiles)""")
2230
- @cli_util.option('--software-source-id', required=True, help=u"""The OCID of the software source.""")
2231
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources. This parameter is optional and in some cases may have no effect.""")
2232
- @cli_util.option('--module-name', help=u"""The name of a module. This parameter is required if a streamName is specified.""")
2233
- @cli_util.option('--stream-name', help=u"""The name of the stream of the containing module. This parameter is required if a profileName is specified.""")
2234
- @cli_util.option('--profile-name', help=u"""The name of the profile of the containing module stream""")
2235
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2236
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
2237
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
2238
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
2239
- @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.""")
2240
- @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.""")
2241
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
2242
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
2243
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
2244
- @json_skeleton_utils.get_cli_json_input_option({})
2245
- @cli_util.help_option
2246
- @click.pass_context
2247
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[ModuleStreamProfileSummary]'})
2248
- @cli_util.wrap_exceptions
2249
- def list_module_stream_profiles(ctx, from_json, all_pages, page_size, wait_for_state, max_wait_seconds, wait_interval_seconds, software_source_id, compartment_id, module_name, stream_name, profile_name, limit, page, sort_order, sort_by):
2250
-
2251
- if all_pages and limit:
2252
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2253
-
2254
- if isinstance(software_source_id, six.string_types) and len(software_source_id.strip()) == 0:
2255
- raise click.UsageError('Parameter --software-source-id cannot be whitespace or empty string')
2256
-
2257
- kwargs = {}
2258
- if compartment_id is not None:
2259
- kwargs['compartment_id'] = compartment_id
2260
- if module_name is not None:
2261
- kwargs['module_name'] = module_name
2262
- if stream_name is not None:
2263
- kwargs['stream_name'] = stream_name
2264
- if profile_name is not None:
2265
- kwargs['profile_name'] = profile_name
2266
- if limit is not None:
2267
- kwargs['limit'] = limit
2268
- if page is not None:
2269
- kwargs['page'] = page
2270
- if sort_order is not None:
2271
- kwargs['sort_order'] = sort_order
2272
- if sort_by is not None:
2273
- kwargs['sort_by'] = sort_by
2274
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2275
- client = cli_util.build_client('os_management', 'os_management', ctx)
2276
- if all_pages:
2277
- if page_size:
2278
- kwargs['limit'] = page_size
2279
-
2280
- result = cli_util.list_call_get_all_results(
2281
- client.list_module_stream_profiles,
2282
- software_source_id=software_source_id,
2283
- **kwargs
2284
- )
2285
- elif limit is not None:
2286
- result = cli_util.list_call_get_up_to_limit(
2287
- client.list_module_stream_profiles,
2288
- limit,
2289
- page_size,
2290
- software_source_id=software_source_id,
2291
- **kwargs
2292
- )
2293
- else:
2294
- result = client.list_module_stream_profiles(
2295
- software_source_id=software_source_id,
2296
- **kwargs
2297
- )
2298
- if wait_for_state:
2299
-
2300
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
2301
- try:
2302
- wait_period_kwargs = {}
2303
- if max_wait_seconds is not None:
2304
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2305
- if wait_interval_seconds is not None:
2306
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2307
- if 'opc-work-request-id' not in result.headers:
2308
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
2309
- cli_util.render_response(result, ctx)
2310
- return
2311
-
2312
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
2313
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
2314
- except oci.exceptions.MaximumWaitTimeExceeded as e:
2315
- # If we fail, we should show an error, but we should still provide the information to the customer
2316
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
2317
- cli_util.render_response(result, ctx)
2318
- sys.exit(2)
2319
- except Exception:
2320
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
2321
- cli_util.render_response(result, ctx)
2322
- raise
2323
- else:
2324
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
2325
- cli_util.render_response(result, ctx)
2326
-
2327
-
2328
- @managed_instance_group.command(name=cli_util.override('os_management.list_module_stream_profiles_on_managed_instance.command_name', 'list-module-stream-profiles'), help=u"""Retrieve a list of module stream profiles, along with a summary of their of their status, from a managed instance. Filters may be applied to select a subset of profiles based on the filter criteria.
2329
-
2330
- The \"moduleName\", \"streamName\", and \"profileName\" attributes combine to form a set of filters on the list of module stream profiles. If a \"modulName\" is provided, only profiles that belong to that module are returned. If both a \"moduleName\" and \"streamName\" are given, only profiles belonging to that module stream are returned. Finally, if all three are given then only the particular profile indicated by the triple is returned. It is not valid to supply a \"streamName\" without a \"moduleName\". It is also not valid to supply a \"profileName\" without a \"streamName\".
2331
-
2332
- The \"status\" attribute filters against the state of a module stream profile. Valid values are \"INSTALLED\" and \"AVAILABLE\". If the attribute is set to \"INSTALLED\", only module stream profiles that are installed are included in the result set. If the attribute is set to \"AVAILABLE\", only module stream profiles that are not installed are included in the result set. If the attribute is not defined, the request is not subject to this filter.
2333
-
2334
- When sorting by display name, the result set is sorted first by module name, then by stream name, and finally by profile name. \n[Command Reference](listModuleStreamProfilesOnManagedInstance)""")
2335
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
2336
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources. This parameter is optional and in some cases may have no effect.""")
2337
- @cli_util.option('--module-name', help=u"""The name of a module. This parameter is required if a streamName is specified.""")
2338
- @cli_util.option('--stream-name', help=u"""The name of the stream of the containing module. This parameter is required if a profileName is specified.""")
2339
- @cli_util.option('--profile-name', help=u"""The name of the profile of the containing module stream""")
2340
- @cli_util.option('--profile-status', type=custom_types.CliCaseInsensitiveChoice(["INSTALLED", "AVAILABLE"]), help=u"""The status of the profile.
2341
-
2342
- A profile with the \"INSTALLED\" status indicates that the profile has been installed.
2343
-
2344
- A profile with the \"AVAILABLE\" status indicates that the profile is not installed, but can be.""")
2345
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2346
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
2347
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
2348
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
2349
- @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.""")
2350
- @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.""")
2351
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
2352
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
2353
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
2354
- @json_skeleton_utils.get_cli_json_input_option({})
2355
- @cli_util.help_option
2356
- @click.pass_context
2357
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[ModuleStreamProfileOnManagedInstanceSummary]'})
2358
- @cli_util.wrap_exceptions
2359
- def list_module_stream_profiles_on_managed_instance(ctx, from_json, all_pages, page_size, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_id, compartment_id, module_name, stream_name, profile_name, profile_status, limit, page, sort_order, sort_by):
2360
-
2361
- if all_pages and limit:
2362
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2363
-
2364
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
2365
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
2366
-
2367
- kwargs = {}
2368
- if compartment_id is not None:
2369
- kwargs['compartment_id'] = compartment_id
2370
- if module_name is not None:
2371
- kwargs['module_name'] = module_name
2372
- if stream_name is not None:
2373
- kwargs['stream_name'] = stream_name
2374
- if profile_name is not None:
2375
- kwargs['profile_name'] = profile_name
2376
- if profile_status is not None:
2377
- kwargs['profile_status'] = profile_status
2378
- if limit is not None:
2379
- kwargs['limit'] = limit
2380
- if page is not None:
2381
- kwargs['page'] = page
2382
- if sort_order is not None:
2383
- kwargs['sort_order'] = sort_order
2384
- if sort_by is not None:
2385
- kwargs['sort_by'] = sort_by
2386
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2387
- client = cli_util.build_client('os_management', 'os_management', ctx)
2388
- if all_pages:
2389
- if page_size:
2390
- kwargs['limit'] = page_size
2391
-
2392
- result = cli_util.list_call_get_all_results(
2393
- client.list_module_stream_profiles_on_managed_instance,
2394
- managed_instance_id=managed_instance_id,
2395
- **kwargs
2396
- )
2397
- elif limit is not None:
2398
- result = cli_util.list_call_get_up_to_limit(
2399
- client.list_module_stream_profiles_on_managed_instance,
2400
- limit,
2401
- page_size,
2402
- managed_instance_id=managed_instance_id,
2403
- **kwargs
2404
- )
2405
- else:
2406
- result = client.list_module_stream_profiles_on_managed_instance(
2407
- managed_instance_id=managed_instance_id,
2408
- **kwargs
2409
- )
2410
- if wait_for_state:
2411
-
2412
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
2413
- try:
2414
- wait_period_kwargs = {}
2415
- if max_wait_seconds is not None:
2416
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2417
- if wait_interval_seconds is not None:
2418
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2419
- if 'opc-work-request-id' not in result.headers:
2420
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
2421
- cli_util.render_response(result, ctx)
2422
- return
2423
-
2424
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
2425
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
2426
- except oci.exceptions.MaximumWaitTimeExceeded as e:
2427
- # If we fail, we should show an error, but we should still provide the information to the customer
2428
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
2429
- cli_util.render_response(result, ctx)
2430
- sys.exit(2)
2431
- except Exception:
2432
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
2433
- cli_util.render_response(result, ctx)
2434
- raise
2435
- else:
2436
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
2437
- cli_util.render_response(result, ctx)
2438
-
2439
-
2440
- @module_stream_group.command(name=cli_util.override('os_management.list_module_streams.command_name', 'list'), help=u"""Retrieve a list of module streams from a software source. Filters may be applied to select a subset of module streams based on the filter criteria.
2441
-
2442
- The 'moduleName' attribute filters against the name of a module. It accepts strings of the format \"<module>\". If this attribute is defined, only streams that belong to the specified module are included in the result set. If it is not defined, the request is not subject to this filter. The 'streamName' attribute filters against the name of a stream of a module. If this attribute is defined, only the particular module stream that matches both the module and stream names is included in the result set. It is not valid to supply 'streamName' without also supplying a 'moduleName'.
2443
-
2444
- When sorting by display name, the result set is sorted first by module name, then by stream name. \n[Command Reference](listModuleStreams)""")
2445
- @cli_util.option('--software-source-id', required=True, help=u"""The OCID of the software source.""")
2446
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources. This parameter is optional and in some cases may have no effect.""")
2447
- @cli_util.option('--module-name', help=u"""The name of a module. This parameter is required if a streamName is specified.""")
2448
- @cli_util.option('--stream-name', help=u"""The name of the stream of the containing module. This parameter is required if a profileName is specified.""")
2449
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2450
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
2451
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
2452
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
2453
- @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.""")
2454
- @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.""")
2455
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
2456
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
2457
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
2458
- @json_skeleton_utils.get_cli_json_input_option({})
2459
- @cli_util.help_option
2460
- @click.pass_context
2461
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[ModuleStreamSummary]'})
2462
- @cli_util.wrap_exceptions
2463
- def list_module_streams(ctx, from_json, all_pages, page_size, wait_for_state, max_wait_seconds, wait_interval_seconds, software_source_id, compartment_id, module_name, stream_name, limit, page, sort_order, sort_by):
2464
-
2465
- if all_pages and limit:
2466
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2467
-
2468
- if isinstance(software_source_id, six.string_types) and len(software_source_id.strip()) == 0:
2469
- raise click.UsageError('Parameter --software-source-id cannot be whitespace or empty string')
2470
-
2471
- kwargs = {}
2472
- if compartment_id is not None:
2473
- kwargs['compartment_id'] = compartment_id
2474
- if module_name is not None:
2475
- kwargs['module_name'] = module_name
2476
- if stream_name is not None:
2477
- kwargs['stream_name'] = stream_name
2478
- if limit is not None:
2479
- kwargs['limit'] = limit
2480
- if page is not None:
2481
- kwargs['page'] = page
2482
- if sort_order is not None:
2483
- kwargs['sort_order'] = sort_order
2484
- if sort_by is not None:
2485
- kwargs['sort_by'] = sort_by
2486
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2487
- client = cli_util.build_client('os_management', 'os_management', ctx)
2488
- if all_pages:
2489
- if page_size:
2490
- kwargs['limit'] = page_size
2491
-
2492
- result = cli_util.list_call_get_all_results(
2493
- client.list_module_streams,
2494
- software_source_id=software_source_id,
2495
- **kwargs
2496
- )
2497
- elif limit is not None:
2498
- result = cli_util.list_call_get_up_to_limit(
2499
- client.list_module_streams,
2500
- limit,
2501
- page_size,
2502
- software_source_id=software_source_id,
2503
- **kwargs
2504
- )
2505
- else:
2506
- result = client.list_module_streams(
2507
- software_source_id=software_source_id,
2508
- **kwargs
2509
- )
2510
- if wait_for_state:
2511
-
2512
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
2513
- try:
2514
- wait_period_kwargs = {}
2515
- if max_wait_seconds is not None:
2516
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2517
- if wait_interval_seconds is not None:
2518
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2519
- if 'opc-work-request-id' not in result.headers:
2520
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
2521
- cli_util.render_response(result, ctx)
2522
- return
2523
-
2524
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
2525
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
2526
- except oci.exceptions.MaximumWaitTimeExceeded as e:
2527
- # If we fail, we should show an error, but we should still provide the information to the customer
2528
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
2529
- cli_util.render_response(result, ctx)
2530
- sys.exit(2)
2531
- except Exception:
2532
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
2533
- cli_util.render_response(result, ctx)
2534
- raise
2535
- else:
2536
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
2537
- cli_util.render_response(result, ctx)
2538
-
2539
-
2540
- @managed_instance_group.command(name=cli_util.override('os_management.list_module_streams_on_managed_instance.command_name', 'list-module-streams'), help=u"""Retrieve a list of module streams, along with a summary of their status, from a managed instance. Filters may be applied to select a subset of module streams based on the filter criteria.
2541
-
2542
- The 'moduleName' attribute filters against the name of a module. It accepts strings of the format \"<module>\". If this attribute is defined, only streams that belong to the specified module are included in the result set. If it is not defined, the request is not subject to this filter.
2543
-
2544
- The \"status\" attribute filters against the state of a module stream. Valid values are \"ENABLED\", \"DISABLED\", and \"ACTIVE\". If the attribute is set to \"ENABLED\", only module streams that are enabled are included in the result set. If the attribute is set to \"DISABLED\", only module streams that are not enabled are included in the result set. If the attribute is set to \"ACTIVE\", only module streams that are active are included in the result set. If the attribute is not defined, the request is not subject to this filter.
2545
-
2546
- When sorting by the display name, the result set is sorted first by the module name and then by the stream name. \n[Command Reference](listModuleStreamsOnManagedInstance)""")
2547
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
2548
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources. This parameter is optional and in some cases may have no effect.""")
2549
- @cli_util.option('--module-name', help=u"""The name of a module. This parameter is required if a streamName is specified.""")
2550
- @cli_util.option('--stream-name', help=u"""The name of the stream of the containing module. This parameter is required if a profileName is specified.""")
2551
- @cli_util.option('--stream-status', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED", "ACTIVE"]), help=u"""The status of the stream
2552
-
2553
- A stream with the \"ENABLED\" status can be used as a source for installing profiles. Streams with this status are also \"ACTIVE\".
2554
-
2555
- A stream with the \"DISABLED\" status cannot be the source for installing profiles. To install profiles and packages from this stream, it must be enabled.
2556
-
2557
- A stream with the \"ACTIVE\" status can be used as a source for installing profiles. The packages that comprise the stream are also used when a matching package is installed directly. In general, a stream can have this status if it is the default stream for the module and no stream has been explicitly enabled.""")
2558
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2559
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
2560
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
2561
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
2562
- @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.""")
2563
- @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.""")
2564
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
2565
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
2566
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
2567
- @json_skeleton_utils.get_cli_json_input_option({})
2568
- @cli_util.help_option
2569
- @click.pass_context
2570
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[ModuleStreamOnManagedInstanceSummary]'})
2571
- @cli_util.wrap_exceptions
2572
- def list_module_streams_on_managed_instance(ctx, from_json, all_pages, page_size, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_id, compartment_id, module_name, stream_name, stream_status, limit, page, sort_order, sort_by):
2573
-
2574
- if all_pages and limit:
2575
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2576
-
2577
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
2578
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
2579
-
2580
- kwargs = {}
2581
- if compartment_id is not None:
2582
- kwargs['compartment_id'] = compartment_id
2583
- if module_name is not None:
2584
- kwargs['module_name'] = module_name
2585
- if stream_name is not None:
2586
- kwargs['stream_name'] = stream_name
2587
- if stream_status is not None:
2588
- kwargs['stream_status'] = stream_status
2589
- if limit is not None:
2590
- kwargs['limit'] = limit
2591
- if page is not None:
2592
- kwargs['page'] = page
2593
- if sort_order is not None:
2594
- kwargs['sort_order'] = sort_order
2595
- if sort_by is not None:
2596
- kwargs['sort_by'] = sort_by
2597
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2598
- client = cli_util.build_client('os_management', 'os_management', ctx)
2599
- if all_pages:
2600
- if page_size:
2601
- kwargs['limit'] = page_size
2602
-
2603
- result = cli_util.list_call_get_all_results(
2604
- client.list_module_streams_on_managed_instance,
2605
- managed_instance_id=managed_instance_id,
2606
- **kwargs
2607
- )
2608
- elif limit is not None:
2609
- result = cli_util.list_call_get_up_to_limit(
2610
- client.list_module_streams_on_managed_instance,
2611
- limit,
2612
- page_size,
2613
- managed_instance_id=managed_instance_id,
2614
- **kwargs
2615
- )
2616
- else:
2617
- result = client.list_module_streams_on_managed_instance(
2618
- managed_instance_id=managed_instance_id,
2619
- **kwargs
2620
- )
2621
- if wait_for_state:
2622
-
2623
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
2624
- try:
2625
- wait_period_kwargs = {}
2626
- if max_wait_seconds is not None:
2627
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
2628
- if wait_interval_seconds is not None:
2629
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
2630
- if 'opc-work-request-id' not in result.headers:
2631
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
2632
- cli_util.render_response(result, ctx)
2633
- return
2634
-
2635
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
2636
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
2637
- except oci.exceptions.MaximumWaitTimeExceeded as e:
2638
- # If we fail, we should show an error, but we should still provide the information to the customer
2639
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
2640
- cli_util.render_response(result, ctx)
2641
- sys.exit(2)
2642
- except Exception:
2643
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
2644
- cli_util.render_response(result, ctx)
2645
- raise
2646
- else:
2647
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
2648
- cli_util.render_response(result, ctx)
2649
-
2650
-
2651
- @managed_instance_group.command(name=cli_util.override('os_management.list_packages_installed_on_managed_instance.command_name', 'list-packages-installed'), help=u"""Returns a list of installed packages on the Managed Instance. \n[Command Reference](listPackagesInstalledOnManagedInstance)""")
2652
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
2653
- @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
2654
-
2655
- Example: `My new resource`""")
2656
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources. This parameter is optional and in some cases may have no effect.""")
2657
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2658
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
2659
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
2660
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
2661
- @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.""")
2662
- @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.""")
2663
- @json_skeleton_utils.get_cli_json_input_option({})
2664
- @cli_util.help_option
2665
- @click.pass_context
2666
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[InstalledPackageSummary]'})
2667
- @cli_util.wrap_exceptions
2668
- def list_packages_installed_on_managed_instance(ctx, from_json, all_pages, page_size, managed_instance_id, display_name, compartment_id, limit, page, sort_order, sort_by):
2669
-
2670
- if all_pages and limit:
2671
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2672
-
2673
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
2674
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
2675
-
2676
- kwargs = {}
2677
- if display_name is not None:
2678
- kwargs['display_name'] = display_name
2679
- if compartment_id is not None:
2680
- kwargs['compartment_id'] = compartment_id
2681
- if limit is not None:
2682
- kwargs['limit'] = limit
2683
- if page is not None:
2684
- kwargs['page'] = page
2685
- if sort_order is not None:
2686
- kwargs['sort_order'] = sort_order
2687
- if sort_by is not None:
2688
- kwargs['sort_by'] = sort_by
2689
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2690
- client = cli_util.build_client('os_management', 'os_management', ctx)
2691
- if all_pages:
2692
- if page_size:
2693
- kwargs['limit'] = page_size
2694
-
2695
- result = cli_util.list_call_get_all_results(
2696
- client.list_packages_installed_on_managed_instance,
2697
- managed_instance_id=managed_instance_id,
2698
- **kwargs
2699
- )
2700
- elif limit is not None:
2701
- result = cli_util.list_call_get_up_to_limit(
2702
- client.list_packages_installed_on_managed_instance,
2703
- limit,
2704
- page_size,
2705
- managed_instance_id=managed_instance_id,
2706
- **kwargs
2707
- )
2708
- else:
2709
- result = client.list_packages_installed_on_managed_instance(
2710
- managed_instance_id=managed_instance_id,
2711
- **kwargs
2712
- )
2713
- cli_util.render_response(result, ctx)
2714
-
2715
-
2716
- @scheduled_job_group.command(name=cli_util.override('os_management.list_scheduled_jobs.command_name', 'list'), help=u"""Returns a list of all of the currently active Scheduled Jobs in the system \n[Command Reference](listScheduledJobs)""")
2717
- @cli_util.option('--compartment-id', required=True, help=u"""The ID of the compartment in which to list resources.""")
2718
- @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
2719
-
2720
- Example: `My new resource`""")
2721
- @cli_util.option('--managed-instance-id', help=u"""The ID of the managed instance for which to list resources.""")
2722
- @cli_util.option('--managed-instance-group-id', help=u"""The ID of the managed instace group for which to list resources.""")
2723
- @cli_util.option('--operation-type', type=custom_types.CliCaseInsensitiveChoice(["INSTALL", "UPDATE", "REMOVE", "UPDATEALL", "ENABLEMODULESTREAM", "DISABLEMODULESTREAM", "SWITCHMODULESTREAM", "INSTALLMODULESTREAMPROFILE", "REMOVEMODULESTREAMPROFILE", "COMPOUND"]), help=u"""The operation type for which to list resources""")
2724
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2725
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
2726
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
2727
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
2728
- @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""The current lifecycle state for the object.""")
2729
- @cli_util.option('--os-family', type=custom_types.CliCaseInsensitiveChoice(["LINUX", "WINDOWS", "ALL"]), help=u"""The OS family for which to list resources.""")
2730
- @cli_util.option('--is-restricted', type=click.BOOL, help=u"""If true, will only filter out restricted Autonomous Linux Scheduled Job""")
2731
- @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.""")
2732
- @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.""")
2733
- @json_skeleton_utils.get_cli_json_input_option({})
2734
- @cli_util.help_option
2735
- @click.pass_context
2736
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[ScheduledJobSummary]'})
2737
- @cli_util.wrap_exceptions
2738
- def list_scheduled_jobs(ctx, from_json, all_pages, page_size, compartment_id, display_name, managed_instance_id, managed_instance_group_id, operation_type, limit, page, sort_order, sort_by, lifecycle_state, os_family, is_restricted):
2739
-
2740
- if all_pages and limit:
2741
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2742
-
2743
- kwargs = {}
2744
- if display_name is not None:
2745
- kwargs['display_name'] = display_name
2746
- if managed_instance_id is not None:
2747
- kwargs['managed_instance_id'] = managed_instance_id
2748
- if managed_instance_group_id is not None:
2749
- kwargs['managed_instance_group_id'] = managed_instance_group_id
2750
- if operation_type is not None:
2751
- kwargs['operation_type'] = operation_type
2752
- if limit is not None:
2753
- kwargs['limit'] = limit
2754
- if page is not None:
2755
- kwargs['page'] = page
2756
- if sort_order is not None:
2757
- kwargs['sort_order'] = sort_order
2758
- if sort_by is not None:
2759
- kwargs['sort_by'] = sort_by
2760
- if lifecycle_state is not None:
2761
- kwargs['lifecycle_state'] = lifecycle_state
2762
- if os_family is not None:
2763
- kwargs['os_family'] = os_family
2764
- if is_restricted is not None:
2765
- kwargs['is_restricted'] = is_restricted
2766
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2767
- client = cli_util.build_client('os_management', 'os_management', ctx)
2768
- if all_pages:
2769
- if page_size:
2770
- kwargs['limit'] = page_size
2771
-
2772
- result = cli_util.list_call_get_all_results(
2773
- client.list_scheduled_jobs,
2774
- compartment_id=compartment_id,
2775
- **kwargs
2776
- )
2777
- elif limit is not None:
2778
- result = cli_util.list_call_get_up_to_limit(
2779
- client.list_scheduled_jobs,
2780
- limit,
2781
- page_size,
2782
- compartment_id=compartment_id,
2783
- **kwargs
2784
- )
2785
- else:
2786
- result = client.list_scheduled_jobs(
2787
- compartment_id=compartment_id,
2788
- **kwargs
2789
- )
2790
- cli_util.render_response(result, ctx)
2791
-
2792
-
2793
- @software_source_group.command(name=cli_util.override('os_management.list_software_source_packages.command_name', 'list-software-source-packages'), help=u"""Lists Software Packages in a Software Source \n[Command Reference](listSoftwareSourcePackages)""")
2794
- @cli_util.option('--software-source-id', required=True, help=u"""The OCID of the software source.""")
2795
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources. This parameter is optional and in some cases may have no effect.""")
2796
- @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
2797
-
2798
- Example: `My new resource`""")
2799
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2800
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
2801
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
2802
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
2803
- @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.""")
2804
- @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.""")
2805
- @json_skeleton_utils.get_cli_json_input_option({})
2806
- @cli_util.help_option
2807
- @click.pass_context
2808
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[SoftwarePackageSummary]'})
2809
- @cli_util.wrap_exceptions
2810
- def list_software_source_packages(ctx, from_json, all_pages, page_size, software_source_id, compartment_id, display_name, limit, page, sort_order, sort_by):
2811
-
2812
- if all_pages and limit:
2813
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2814
-
2815
- if isinstance(software_source_id, six.string_types) and len(software_source_id.strip()) == 0:
2816
- raise click.UsageError('Parameter --software-source-id cannot be whitespace or empty string')
2817
-
2818
- kwargs = {}
2819
- if compartment_id is not None:
2820
- kwargs['compartment_id'] = compartment_id
2821
- if display_name is not None:
2822
- kwargs['display_name'] = display_name
2823
- if limit is not None:
2824
- kwargs['limit'] = limit
2825
- if page is not None:
2826
- kwargs['page'] = page
2827
- if sort_order is not None:
2828
- kwargs['sort_order'] = sort_order
2829
- if sort_by is not None:
2830
- kwargs['sort_by'] = sort_by
2831
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2832
- client = cli_util.build_client('os_management', 'os_management', ctx)
2833
- if all_pages:
2834
- if page_size:
2835
- kwargs['limit'] = page_size
2836
-
2837
- result = cli_util.list_call_get_all_results(
2838
- client.list_software_source_packages,
2839
- software_source_id=software_source_id,
2840
- **kwargs
2841
- )
2842
- elif limit is not None:
2843
- result = cli_util.list_call_get_up_to_limit(
2844
- client.list_software_source_packages,
2845
- limit,
2846
- page_size,
2847
- software_source_id=software_source_id,
2848
- **kwargs
2849
- )
2850
- else:
2851
- result = client.list_software_source_packages(
2852
- software_source_id=software_source_id,
2853
- **kwargs
2854
- )
2855
- cli_util.render_response(result, ctx)
2856
-
2857
-
2858
- @software_source_group.command(name=cli_util.override('os_management.list_software_sources.command_name', 'list'), help=u"""Returns a list of all Software Sources. \n[Command Reference](listSoftwareSources)""")
2859
- @cli_util.option('--compartment-id', required=True, help=u"""The ID of the compartment in which to list resources.""")
2860
- @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
2861
-
2862
- Example: `My new resource`""")
2863
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2864
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
2865
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
2866
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
2867
- @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""The current lifecycle state for the object.""")
2868
- @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.""")
2869
- @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.""")
2870
- @json_skeleton_utils.get_cli_json_input_option({})
2871
- @cli_util.help_option
2872
- @click.pass_context
2873
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[SoftwareSourceSummary]'})
2874
- @cli_util.wrap_exceptions
2875
- def list_software_sources(ctx, from_json, all_pages, page_size, compartment_id, display_name, limit, page, sort_order, sort_by, lifecycle_state):
2876
-
2877
- if all_pages and limit:
2878
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2879
-
2880
- kwargs = {}
2881
- if display_name is not None:
2882
- kwargs['display_name'] = display_name
2883
- if limit is not None:
2884
- kwargs['limit'] = limit
2885
- if page is not None:
2886
- kwargs['page'] = page
2887
- if sort_order is not None:
2888
- kwargs['sort_order'] = sort_order
2889
- if sort_by is not None:
2890
- kwargs['sort_by'] = sort_by
2891
- if lifecycle_state is not None:
2892
- kwargs['lifecycle_state'] = lifecycle_state
2893
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2894
- client = cli_util.build_client('os_management', 'os_management', ctx)
2895
- if all_pages:
2896
- if page_size:
2897
- kwargs['limit'] = page_size
2898
-
2899
- result = cli_util.list_call_get_all_results(
2900
- client.list_software_sources,
2901
- compartment_id=compartment_id,
2902
- **kwargs
2903
- )
2904
- elif limit is not None:
2905
- result = cli_util.list_call_get_up_to_limit(
2906
- client.list_software_sources,
2907
- limit,
2908
- page_size,
2909
- compartment_id=compartment_id,
2910
- **kwargs
2911
- )
2912
- else:
2913
- result = client.list_software_sources(
2914
- compartment_id=compartment_id,
2915
- **kwargs
2916
- )
2917
- cli_util.render_response(result, ctx)
2918
-
2919
-
2920
- @scheduled_job_group.command(name=cli_util.override('os_management.list_upcoming_scheduled_jobs.command_name', 'list-upcoming'), help=u"""Returns a list of all of the Scheduled Jobs whose next execution time is at or before the specified time. \n[Command Reference](listUpcomingScheduledJobs)""")
2921
- @cli_util.option('--compartment-id', required=True, help=u"""The ID of the compartment in which to list resources.""")
2922
- @cli_util.option('--time-end', required=True, type=custom_types.CLI_DATETIME, help=u"""The cut-off time before which to list all upcoming schedules, in ISO 8601 format
2923
-
2924
- Example: 2017-07-14T02:40:00.000Z""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
2925
- @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
2926
-
2927
- Example: `My new resource`""")
2928
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
2929
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
2930
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
2931
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
2932
- @cli_util.option('--tag-name', help=u"""The name of the tag.""")
2933
- @cli_util.option('--tag-value', help=u"""The value for the tag.""")
2934
- @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""The current lifecycle state for the object.""")
2935
- @cli_util.option('--os-family', type=custom_types.CliCaseInsensitiveChoice(["LINUX", "WINDOWS", "ALL"]), help=u"""The OS family for which to list resources.""")
2936
- @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.""")
2937
- @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.""")
2938
- @json_skeleton_utils.get_cli_json_input_option({})
2939
- @cli_util.help_option
2940
- @click.pass_context
2941
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[ScheduledJobSummary]'})
2942
- @cli_util.wrap_exceptions
2943
- def list_upcoming_scheduled_jobs(ctx, from_json, all_pages, page_size, compartment_id, time_end, display_name, limit, page, sort_order, sort_by, tag_name, tag_value, lifecycle_state, os_family):
2944
-
2945
- if all_pages and limit:
2946
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
2947
-
2948
- kwargs = {}
2949
- if display_name is not None:
2950
- kwargs['display_name'] = display_name
2951
- if limit is not None:
2952
- kwargs['limit'] = limit
2953
- if page is not None:
2954
- kwargs['page'] = page
2955
- if sort_order is not None:
2956
- kwargs['sort_order'] = sort_order
2957
- if sort_by is not None:
2958
- kwargs['sort_by'] = sort_by
2959
- if tag_name is not None:
2960
- kwargs['tag_name'] = tag_name
2961
- if tag_value is not None:
2962
- kwargs['tag_value'] = tag_value
2963
- if lifecycle_state is not None:
2964
- kwargs['lifecycle_state'] = lifecycle_state
2965
- if os_family is not None:
2966
- kwargs['os_family'] = os_family
2967
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
2968
- client = cli_util.build_client('os_management', 'os_management', ctx)
2969
- if all_pages:
2970
- if page_size:
2971
- kwargs['limit'] = page_size
2972
-
2973
- result = cli_util.list_call_get_all_results(
2974
- client.list_upcoming_scheduled_jobs,
2975
- compartment_id=compartment_id,
2976
- time_end=time_end,
2977
- **kwargs
2978
- )
2979
- elif limit is not None:
2980
- result = cli_util.list_call_get_up_to_limit(
2981
- client.list_upcoming_scheduled_jobs,
2982
- limit,
2983
- page_size,
2984
- compartment_id=compartment_id,
2985
- time_end=time_end,
2986
- **kwargs
2987
- )
2988
- else:
2989
- result = client.list_upcoming_scheduled_jobs(
2990
- compartment_id=compartment_id,
2991
- time_end=time_end,
2992
- **kwargs
2993
- )
2994
- cli_util.render_response(result, ctx)
2995
-
2996
-
2997
- @windows_update_group.command(name=cli_util.override('os_management.list_windows_updates.command_name', 'list'), help=u"""Returns a list of Windows Updates. \n[Command Reference](listWindowsUpdates)""")
2998
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources. This parameter is optional and in some cases may have no effect.""")
2999
- @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
3000
-
3001
- Example: `My new resource`""")
3002
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
3003
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
3004
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
3005
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
3006
- @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.""")
3007
- @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.""")
3008
- @json_skeleton_utils.get_cli_json_input_option({})
3009
- @cli_util.help_option
3010
- @click.pass_context
3011
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[WindowsUpdateSummary]'})
3012
- @cli_util.wrap_exceptions
3013
- def list_windows_updates(ctx, from_json, all_pages, page_size, compartment_id, display_name, limit, page, sort_order, sort_by):
3014
-
3015
- if all_pages and limit:
3016
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
3017
-
3018
- kwargs = {}
3019
- if compartment_id is not None:
3020
- kwargs['compartment_id'] = compartment_id
3021
- if display_name is not None:
3022
- kwargs['display_name'] = display_name
3023
- if limit is not None:
3024
- kwargs['limit'] = limit
3025
- if page is not None:
3026
- kwargs['page'] = page
3027
- if sort_order is not None:
3028
- kwargs['sort_order'] = sort_order
3029
- if sort_by is not None:
3030
- kwargs['sort_by'] = sort_by
3031
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3032
- client = cli_util.build_client('os_management', 'os_management', ctx)
3033
- if all_pages:
3034
- if page_size:
3035
- kwargs['limit'] = page_size
3036
-
3037
- result = cli_util.list_call_get_all_results(
3038
- client.list_windows_updates,
3039
- **kwargs
3040
- )
3041
- elif limit is not None:
3042
- result = cli_util.list_call_get_up_to_limit(
3043
- client.list_windows_updates,
3044
- limit,
3045
- page_size,
3046
- **kwargs
3047
- )
3048
- else:
3049
- result = client.list_windows_updates(
3050
- **kwargs
3051
- )
3052
- cli_util.render_response(result, ctx)
3053
-
3054
-
3055
- @managed_instance_group.command(name=cli_util.override('os_management.list_windows_updates_installed_on_managed_instance.command_name', 'list-windows-updates-installed'), help=u"""Returns a list of installed Windows updates for a Managed Instance. This is only applicable to Windows instances. \n[Command Reference](listWindowsUpdatesInstalledOnManagedInstance)""")
3056
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
3057
- @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
3058
-
3059
- Example: `My new resource`""")
3060
- @cli_util.option('--compartment-id', help=u"""The ID of the compartment in which to list resources. This parameter is optional and in some cases may have no effect.""")
3061
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
3062
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
3063
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
3064
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
3065
- @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.""")
3066
- @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.""")
3067
- @json_skeleton_utils.get_cli_json_input_option({})
3068
- @cli_util.help_option
3069
- @click.pass_context
3070
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[InstalledWindowsUpdateSummary]'})
3071
- @cli_util.wrap_exceptions
3072
- def list_windows_updates_installed_on_managed_instance(ctx, from_json, all_pages, page_size, managed_instance_id, display_name, compartment_id, limit, page, sort_order, sort_by):
3073
-
3074
- if all_pages and limit:
3075
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
3076
-
3077
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
3078
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
3079
-
3080
- kwargs = {}
3081
- if display_name is not None:
3082
- kwargs['display_name'] = display_name
3083
- if compartment_id is not None:
3084
- kwargs['compartment_id'] = compartment_id
3085
- if limit is not None:
3086
- kwargs['limit'] = limit
3087
- if page is not None:
3088
- kwargs['page'] = page
3089
- if sort_order is not None:
3090
- kwargs['sort_order'] = sort_order
3091
- if sort_by is not None:
3092
- kwargs['sort_by'] = sort_by
3093
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3094
- client = cli_util.build_client('os_management', 'os_management', ctx)
3095
- if all_pages:
3096
- if page_size:
3097
- kwargs['limit'] = page_size
3098
-
3099
- result = cli_util.list_call_get_all_results(
3100
- client.list_windows_updates_installed_on_managed_instance,
3101
- managed_instance_id=managed_instance_id,
3102
- **kwargs
3103
- )
3104
- elif limit is not None:
3105
- result = cli_util.list_call_get_up_to_limit(
3106
- client.list_windows_updates_installed_on_managed_instance,
3107
- limit,
3108
- page_size,
3109
- managed_instance_id=managed_instance_id,
3110
- **kwargs
3111
- )
3112
- else:
3113
- result = client.list_windows_updates_installed_on_managed_instance(
3114
- managed_instance_id=managed_instance_id,
3115
- **kwargs
3116
- )
3117
- cli_util.render_response(result, ctx)
3118
-
3119
-
3120
- @work_request_group.command(name=cli_util.override('os_management.list_work_request_errors.command_name', 'list-work-request-errors'), help=u"""Gets the errors for the work request with the given ID. \n[Command Reference](listWorkRequestErrors)""")
3121
- @cli_util.option('--work-request-id', required=True, help=u"""The ID of the asynchronous request.""")
3122
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
3123
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
3124
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
3125
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
3126
- @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.""")
3127
- @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.""")
3128
- @json_skeleton_utils.get_cli_json_input_option({})
3129
- @cli_util.help_option
3130
- @click.pass_context
3131
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[WorkRequestError]'})
3132
- @cli_util.wrap_exceptions
3133
- def list_work_request_errors(ctx, from_json, all_pages, page_size, work_request_id, limit, page, sort_order, sort_by):
3134
-
3135
- if all_pages and limit:
3136
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
3137
-
3138
- if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
3139
- raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
3140
-
3141
- kwargs = {}
3142
- if limit is not None:
3143
- kwargs['limit'] = limit
3144
- if page is not None:
3145
- kwargs['page'] = page
3146
- if sort_order is not None:
3147
- kwargs['sort_order'] = sort_order
3148
- if sort_by is not None:
3149
- kwargs['sort_by'] = sort_by
3150
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3151
- client = cli_util.build_client('os_management', 'os_management', ctx)
3152
- if all_pages:
3153
- if page_size:
3154
- kwargs['limit'] = page_size
3155
-
3156
- result = cli_util.list_call_get_all_results(
3157
- client.list_work_request_errors,
3158
- work_request_id=work_request_id,
3159
- **kwargs
3160
- )
3161
- elif limit is not None:
3162
- result = cli_util.list_call_get_up_to_limit(
3163
- client.list_work_request_errors,
3164
- limit,
3165
- page_size,
3166
- work_request_id=work_request_id,
3167
- **kwargs
3168
- )
3169
- else:
3170
- result = client.list_work_request_errors(
3171
- work_request_id=work_request_id,
3172
- **kwargs
3173
- )
3174
- cli_util.render_response(result, ctx)
3175
-
3176
-
3177
- @work_request_group.command(name=cli_util.override('os_management.list_work_request_logs.command_name', 'list-work-request-logs'), help=u"""Lists the log entries for the work request with the given ID. \n[Command Reference](listWorkRequestLogs)""")
3178
- @cli_util.option('--work-request-id', required=True, help=u"""The ID of the asynchronous request.""")
3179
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
3180
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
3181
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
3182
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
3183
- @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.""")
3184
- @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.""")
3185
- @json_skeleton_utils.get_cli_json_input_option({})
3186
- @cli_util.help_option
3187
- @click.pass_context
3188
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[WorkRequestLogEntry]'})
3189
- @cli_util.wrap_exceptions
3190
- def list_work_request_logs(ctx, from_json, all_pages, page_size, work_request_id, limit, page, sort_order, sort_by):
3191
-
3192
- if all_pages and limit:
3193
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
3194
-
3195
- if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
3196
- raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')
3197
-
3198
- kwargs = {}
3199
- if limit is not None:
3200
- kwargs['limit'] = limit
3201
- if page is not None:
3202
- kwargs['page'] = page
3203
- if sort_order is not None:
3204
- kwargs['sort_order'] = sort_order
3205
- if sort_by is not None:
3206
- kwargs['sort_by'] = sort_by
3207
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3208
- client = cli_util.build_client('os_management', 'os_management', ctx)
3209
- if all_pages:
3210
- if page_size:
3211
- kwargs['limit'] = page_size
3212
-
3213
- result = cli_util.list_call_get_all_results(
3214
- client.list_work_request_logs,
3215
- work_request_id=work_request_id,
3216
- **kwargs
3217
- )
3218
- elif limit is not None:
3219
- result = cli_util.list_call_get_up_to_limit(
3220
- client.list_work_request_logs,
3221
- limit,
3222
- page_size,
3223
- work_request_id=work_request_id,
3224
- **kwargs
3225
- )
3226
- else:
3227
- result = client.list_work_request_logs(
3228
- work_request_id=work_request_id,
3229
- **kwargs
3230
- )
3231
- cli_util.render_response(result, ctx)
3232
-
3233
-
3234
- @work_request_summary_group.command(name=cli_util.override('os_management.list_work_requests.command_name', 'list-work-requests'), help=u"""Lists the work requests in a compartment. \n[Command Reference](listWorkRequests)""")
3235
- @cli_util.option('--compartment-id', required=True, help=u"""The ID of the compartment in which to list resources.""")
3236
- @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
3237
-
3238
- Example: `My new resource`""")
3239
- @cli_util.option('--managed-instance-id', help=u"""The ID of the managed instance for which to list resources.""")
3240
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
3241
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
3242
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
3243
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
3244
- @cli_util.option('--os-family', type=custom_types.CliCaseInsensitiveChoice(["LINUX", "WINDOWS", "ALL"]), help=u"""The OS family for which to list resources.""")
3245
- @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.""")
3246
- @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.""")
3247
- @json_skeleton_utils.get_cli_json_input_option({})
3248
- @cli_util.help_option
3249
- @click.pass_context
3250
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[WorkRequestSummary]'})
3251
- @cli_util.wrap_exceptions
3252
- def list_work_requests(ctx, from_json, all_pages, page_size, compartment_id, display_name, managed_instance_id, limit, page, sort_order, sort_by, os_family):
3253
-
3254
- if all_pages and limit:
3255
- raise click.UsageError('If you provide the --all option you cannot provide the --limit option')
3256
-
3257
- kwargs = {}
3258
- if display_name is not None:
3259
- kwargs['display_name'] = display_name
3260
- if managed_instance_id is not None:
3261
- kwargs['managed_instance_id'] = managed_instance_id
3262
- if limit is not None:
3263
- kwargs['limit'] = limit
3264
- if page is not None:
3265
- kwargs['page'] = page
3266
- if sort_order is not None:
3267
- kwargs['sort_order'] = sort_order
3268
- if sort_by is not None:
3269
- kwargs['sort_by'] = sort_by
3270
- if os_family is not None:
3271
- kwargs['os_family'] = os_family
3272
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3273
- client = cli_util.build_client('os_management', 'os_management', ctx)
3274
- if all_pages:
3275
- if page_size:
3276
- kwargs['limit'] = page_size
3277
-
3278
- result = cli_util.list_call_get_all_results(
3279
- client.list_work_requests,
3280
- compartment_id=compartment_id,
3281
- **kwargs
3282
- )
3283
- elif limit is not None:
3284
- result = cli_util.list_call_get_up_to_limit(
3285
- client.list_work_requests,
3286
- limit,
3287
- page_size,
3288
- compartment_id=compartment_id,
3289
- **kwargs
3290
- )
3291
- else:
3292
- result = client.list_work_requests(
3293
- compartment_id=compartment_id,
3294
- **kwargs
3295
- )
3296
- cli_util.render_response(result, ctx)
3297
-
3298
-
3299
- @managed_instance_group.command(name=cli_util.override('os_management.manage_module_streams_on_managed_instance.command_name', 'manage-module-streams'), help=u"""Perform an operation involving modules, streams, and profiles on a managed instance. Each operation may enable or disable an arbitrary amount of module streams, and install or remove an arbitrary number of module stream profiles. When the operation is complete, the state of the modules, streams, and profiles on the managed instance will match the state indicated in the operation.
3300
-
3301
- Each module stream specified in the list of module streams to enable will be in the \"ENABLED\" state upon completion of the operation. If there was already a stream of that module enabled, any work required to switch from the current stream to the new stream is performed implicitly.
3302
-
3303
- Each module stream specified in the list of module streams to disable will be in the \"DISABLED\" state upon completion of the operation. Any profiles that are installed for the module stream will be removed as part of the operation.
3304
-
3305
- Each module stream profile specified in the list of profiles to install will be in the \"INSTALLED\" state upon completion of the operation, indicating that any packages that are part of the profile are installed on the managed instance. If the module stream containing the profile is not enabled, it will be enabled as part of the operation. There is an exception when attempting to install a stream of a profile when another stream of the same module is enabled. It is an error to attempt to install a profile of another module stream, unless enabling the new module stream is explicitly included in this operation.
3306
-
3307
- Each module stream profile specified in the list of profiles to remove will be in the \"AVAILABLE\" state upon completion of the operation. The status of packages within the profile after the operation is complete is defined by the package manager on the managed instance.
3308
-
3309
- Operations that contain one or more elements that are not allowed are rejected.
3310
-
3311
- The result of this request is a WorkRequest object. The returned WorkRequest is the parent of a structure of other WorkRequests. Taken as a whole, this structure indicates the entire set of work to be performed to complete the operation.
3312
-
3313
- This interface can also be used to perform a dry run of the operation rather than committing it to a managed instance. If a dry run is requested, the OS Management Service will evaluate the operation against the current module, stream, and profile state on the managed instance. It will calculate the impact of the operation on all modules, streams, and profiles on the managed instance, including those that are implicitly impacted by the operation.
3314
-
3315
- The WorkRequest resulting from a dry run behaves differently than a WorkRequest resulting from a committable operation. Dry run WorkRequests are always singletons and never have children. The impact of the operation is returned using the log and error facilities of WorkRequests. The impact of operations that are allowed by the OS Management Service are communicated as one or more work request log entries. Operations that are not allowed by the OS Management Service are communicated as one or more work requst error entries. Each entry, for either logs or errors, contains a structured message containing the results of one or more operations. \n[Command Reference](manageModuleStreamsOnManagedInstance)""")
3316
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
3317
- @cli_util.option('--is-dry-run', type=click.BOOL, help=u"""Indicates if this operation is a dry run or if the operation should be commited. If set to true, the result of the operation will be evaluated but not committed. If set to false, the operation is committed to the managed instance. The default is false.""")
3318
- @cli_util.option('--enable', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The set of module streams to enable.
3319
-
3320
- This option is a JSON list with items of type ModuleStreamDetails. For documentation on ModuleStreamDetails please see our API reference: https://docs.cloud.oracle.com/api/#/en/osmanagement/20190801/datatypes/ModuleStreamDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3321
- @cli_util.option('--disable', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The set of module streams to disable.
3322
-
3323
- This option is a JSON list with items of type ModuleStreamDetails. For documentation on ModuleStreamDetails please see our API reference: https://docs.cloud.oracle.com/api/#/en/osmanagement/20190801/datatypes/ModuleStreamDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3324
- @cli_util.option('--install', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The set of module stream profiles to install.
3325
-
3326
- This option is a JSON list with items of type ModuleStreamProfileDetails. For documentation on ModuleStreamProfileDetails please see our API reference: https://docs.cloud.oracle.com/api/#/en/osmanagement/20190801/datatypes/ModuleStreamProfileDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3327
- @cli_util.option('--remove', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The set of module stream profiles to remove.
3328
-
3329
- This option is a JSON list with items of type ModuleStreamProfileDetails. For documentation on ModuleStreamProfileDetails please see our API reference: https://docs.cloud.oracle.com/api/#/en/osmanagement/20190801/datatypes/ModuleStreamProfileDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3330
- @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.""")
3331
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
3332
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
3333
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
3334
- @json_skeleton_utils.get_cli_json_input_option({'enable': {'module': 'os_management', 'class': 'list[ModuleStreamDetails]'}, 'disable': {'module': 'os_management', 'class': 'list[ModuleStreamDetails]'}, 'install': {'module': 'os_management', 'class': 'list[ModuleStreamProfileDetails]'}, 'remove': {'module': 'os_management', 'class': 'list[ModuleStreamProfileDetails]'}})
3335
- @cli_util.help_option
3336
- @click.pass_context
3337
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'enable': {'module': 'os_management', 'class': 'list[ModuleStreamDetails]'}, 'disable': {'module': 'os_management', 'class': 'list[ModuleStreamDetails]'}, 'install': {'module': 'os_management', 'class': 'list[ModuleStreamProfileDetails]'}, 'remove': {'module': 'os_management', 'class': 'list[ModuleStreamProfileDetails]'}})
3338
- @cli_util.wrap_exceptions
3339
- def manage_module_streams_on_managed_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_id, is_dry_run, enable, disable, install, remove, if_match):
3340
-
3341
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
3342
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
3343
-
3344
- kwargs = {}
3345
- if if_match is not None:
3346
- kwargs['if_match'] = if_match
3347
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3348
-
3349
- _details = {}
3350
-
3351
- if is_dry_run is not None:
3352
- _details['isDryRun'] = is_dry_run
3353
-
3354
- if enable is not None:
3355
- _details['enable'] = cli_util.parse_json_parameter("enable", enable)
3356
-
3357
- if disable is not None:
3358
- _details['disable'] = cli_util.parse_json_parameter("disable", disable)
3359
-
3360
- if install is not None:
3361
- _details['install'] = cli_util.parse_json_parameter("install", install)
3362
-
3363
- if remove is not None:
3364
- _details['remove'] = cli_util.parse_json_parameter("remove", remove)
3365
-
3366
- client = cli_util.build_client('os_management', 'os_management', ctx)
3367
- result = client.manage_module_streams_on_managed_instance(
3368
- managed_instance_id=managed_instance_id,
3369
- manage_module_streams_on_managed_instance_details=_details,
3370
- **kwargs
3371
- )
3372
- if wait_for_state:
3373
-
3374
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
3375
- try:
3376
- wait_period_kwargs = {}
3377
- if max_wait_seconds is not None:
3378
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
3379
- if wait_interval_seconds is not None:
3380
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
3381
- if 'opc-work-request-id' not in result.headers:
3382
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
3383
- cli_util.render_response(result, ctx)
3384
- return
3385
-
3386
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
3387
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
3388
- except oci.exceptions.MaximumWaitTimeExceeded as e:
3389
- # If we fail, we should show an error, but we should still provide the information to the customer
3390
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
3391
- cli_util.render_response(result, ctx)
3392
- sys.exit(2)
3393
- except Exception:
3394
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
3395
- cli_util.render_response(result, ctx)
3396
- raise
3397
- else:
3398
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
3399
- cli_util.render_response(result, ctx)
3400
-
3401
-
3402
- @module_stream_profile_details_group.command(name=cli_util.override('os_management.remove_module_stream_profile_from_managed_instance.command_name', 'remove'), help=u"""Removes a profile for a module stream that is installed on a managed instance. If a module stream is provided, rather than a fully qualified profile, all profiles that have been installed for the module stream will be removed. \n[Command Reference](removeModuleStreamProfileFromManagedInstance)""")
3403
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
3404
- @cli_util.option('--module-name', required=True, help=u"""The name of a module.""")
3405
- @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.""")
3406
- @cli_util.option('--stream-name', help=u"""The name of the stream of the containing module. This parameter is required if a profileName is specified.""")
3407
- @cli_util.option('--profile-name', help=u"""The name of the profile of the containing module stream""")
3408
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
3409
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
3410
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
3411
- @json_skeleton_utils.get_cli_json_input_option({})
3412
- @cli_util.help_option
3413
- @click.pass_context
3414
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
3415
- @cli_util.wrap_exceptions
3416
- def remove_module_stream_profile_from_managed_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_id, module_name, if_match, stream_name, profile_name):
3417
-
3418
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
3419
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
3420
-
3421
- kwargs = {}
3422
- if if_match is not None:
3423
- kwargs['if_match'] = if_match
3424
- if stream_name is not None:
3425
- kwargs['stream_name'] = stream_name
3426
- if profile_name is not None:
3427
- kwargs['profile_name'] = profile_name
3428
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3429
- client = cli_util.build_client('os_management', 'os_management', ctx)
3430
- result = client.remove_module_stream_profile_from_managed_instance(
3431
- managed_instance_id=managed_instance_id,
3432
- module_name=module_name,
3433
- **kwargs
3434
- )
3435
- if wait_for_state:
3436
-
3437
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
3438
- try:
3439
- wait_period_kwargs = {}
3440
- if max_wait_seconds is not None:
3441
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
3442
- if wait_interval_seconds is not None:
3443
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
3444
- if 'opc-work-request-id' not in result.headers:
3445
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
3446
- cli_util.render_response(result, ctx)
3447
- return
3448
-
3449
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
3450
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
3451
- except oci.exceptions.MaximumWaitTimeExceeded as e:
3452
- # If we fail, we should show an error, but we should still provide the information to the customer
3453
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
3454
- cli_util.render_response(result, ctx)
3455
- sys.exit(2)
3456
- except Exception:
3457
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
3458
- cli_util.render_response(result, ctx)
3459
- raise
3460
- else:
3461
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
3462
- cli_util.render_response(result, ctx)
3463
-
3464
-
3465
- @managed_instance_group.command(name=cli_util.override('os_management.remove_package_from_managed_instance.command_name', 'remove'), help=u"""Removes an installed package from a managed instance. \n[Command Reference](removePackageFromManagedInstance)""")
3466
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
3467
- @cli_util.option('--software-package-name', required=True, help=u"""Package name""")
3468
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
3469
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
3470
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
3471
- @json_skeleton_utils.get_cli_json_input_option({})
3472
- @cli_util.help_option
3473
- @click.pass_context
3474
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
3475
- @cli_util.wrap_exceptions
3476
- def remove_package_from_managed_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_id, software_package_name):
3477
-
3478
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
3479
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
3480
-
3481
- kwargs = {}
3482
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3483
- client = cli_util.build_client('os_management', 'os_management', ctx)
3484
- result = client.remove_package_from_managed_instance(
3485
- managed_instance_id=managed_instance_id,
3486
- software_package_name=software_package_name,
3487
- **kwargs
3488
- )
3489
- if wait_for_state:
3490
-
3491
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
3492
- try:
3493
- wait_period_kwargs = {}
3494
- if max_wait_seconds is not None:
3495
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
3496
- if wait_interval_seconds is not None:
3497
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
3498
- if 'opc-work-request-id' not in result.headers:
3499
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
3500
- cli_util.render_response(result, ctx)
3501
- return
3502
-
3503
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
3504
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
3505
- except oci.exceptions.MaximumWaitTimeExceeded as e:
3506
- # If we fail, we should show an error, but we should still provide the information to the customer
3507
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
3508
- cli_util.render_response(result, ctx)
3509
- sys.exit(2)
3510
- except Exception:
3511
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
3512
- cli_util.render_response(result, ctx)
3513
- raise
3514
- else:
3515
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
3516
- cli_util.render_response(result, ctx)
3517
-
3518
-
3519
- @software_source_group.command(name=cli_util.override('os_management.remove_packages_from_software_source.command_name', 'remove'), help=u"""Removes a given list of Software Packages from a specific Software Source. \n[Command Reference](removePackagesFromSoftwareSource)""")
3520
- @cli_util.option('--software-source-id', required=True, help=u"""The OCID of the software source.""")
3521
- @cli_util.option('--package-names', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""the list of package names""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3522
- @json_skeleton_utils.get_cli_json_input_option({'package-names': {'module': 'os_management', 'class': 'list[string]'}})
3523
- @cli_util.help_option
3524
- @click.pass_context
3525
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'package-names': {'module': 'os_management', 'class': 'list[string]'}})
3526
- @cli_util.wrap_exceptions
3527
- def remove_packages_from_software_source(ctx, from_json, software_source_id, package_names):
3528
-
3529
- if isinstance(software_source_id, six.string_types) and len(software_source_id.strip()) == 0:
3530
- raise click.UsageError('Parameter --software-source-id cannot be whitespace or empty string')
3531
-
3532
- kwargs = {}
3533
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3534
-
3535
- _details = {}
3536
- _details['packageNames'] = cli_util.parse_json_parameter("package_names", package_names)
3537
-
3538
- client = cli_util.build_client('os_management', 'os_management', ctx)
3539
- result = client.remove_packages_from_software_source(
3540
- software_source_id=software_source_id,
3541
- remove_packages_from_software_source_details=_details,
3542
- **kwargs
3543
- )
3544
- cli_util.render_response(result, ctx)
3545
-
3546
-
3547
- @scheduled_job_group.command(name=cli_util.override('os_management.run_scheduled_job_now.command_name', 'run-scheduled-job-now'), help=u"""This will trigger an already created Scheduled Job to being executing immediately instead of waiting for its next regularly scheduled time. \n[Command Reference](runScheduledJobNow)""")
3548
- @cli_util.option('--scheduled-job-id', required=True, help=u"""The ID of the scheduled job.""")
3549
- @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.""")
3550
- @json_skeleton_utils.get_cli_json_input_option({})
3551
- @cli_util.help_option
3552
- @click.pass_context
3553
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
3554
- @cli_util.wrap_exceptions
3555
- def run_scheduled_job_now(ctx, from_json, scheduled_job_id, if_match):
3556
-
3557
- if isinstance(scheduled_job_id, six.string_types) and len(scheduled_job_id.strip()) == 0:
3558
- raise click.UsageError('Parameter --scheduled-job-id cannot be whitespace or empty string')
3559
-
3560
- kwargs = {}
3561
- if if_match is not None:
3562
- kwargs['if_match'] = if_match
3563
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3564
- client = cli_util.build_client('os_management', 'os_management', ctx)
3565
- result = client.run_scheduled_job_now(
3566
- scheduled_job_id=scheduled_job_id,
3567
- **kwargs
3568
- )
3569
- cli_util.render_response(result, ctx)
3570
-
3571
-
3572
- @software_source_group.command(name=cli_util.override('os_management.search_software_packages.command_name', 'search-software-packages'), help=u"""Searches all of the available Software Sources and returns any/all Software Packages matching the search criteria. \n[Command Reference](searchSoftwarePackages)""")
3573
- @cli_util.option('--software-package-name', help=u"""the identifier for the software package (not an OCID)""")
3574
- @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.
3575
-
3576
- Example: `My new resource`""")
3577
- @cli_util.option('--cve-name', help=u"""The name of the CVE as published. Example: `CVE-2006-4535`""")
3578
- @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
3579
- @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
3580
- @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
3581
- @cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["TIMECREATED", "DISPLAYNAME"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If no value is specified TIMECREATED is default.""")
3582
- @json_skeleton_utils.get_cli_json_input_option({})
3583
- @cli_util.help_option
3584
- @click.pass_context
3585
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'list[SoftwarePackageSearchSummary]'})
3586
- @cli_util.wrap_exceptions
3587
- def search_software_packages(ctx, from_json, software_package_name, display_name, cve_name, limit, page, sort_order, sort_by):
3588
-
3589
- kwargs = {}
3590
- if software_package_name is not None:
3591
- kwargs['software_package_name'] = software_package_name
3592
- if display_name is not None:
3593
- kwargs['display_name'] = display_name
3594
- if cve_name is not None:
3595
- kwargs['cve_name'] = cve_name
3596
- if limit is not None:
3597
- kwargs['limit'] = limit
3598
- if page is not None:
3599
- kwargs['page'] = page
3600
- if sort_order is not None:
3601
- kwargs['sort_order'] = sort_order
3602
- if sort_by is not None:
3603
- kwargs['sort_by'] = sort_by
3604
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3605
- client = cli_util.build_client('os_management', 'os_management', ctx)
3606
- result = client.search_software_packages(
3607
- **kwargs
3608
- )
3609
- cli_util.render_response(result, ctx)
3610
-
3611
-
3612
- @scheduled_job_group.command(name=cli_util.override('os_management.skip_next_scheduled_job_execution.command_name', 'skip-next-scheduled-job-execution'), help=u"""This will force an already created Scheduled Job to skip its next regularly scheduled execution \n[Command Reference](skipNextScheduledJobExecution)""")
3613
- @cli_util.option('--scheduled-job-id', required=True, help=u"""The ID of the scheduled job.""")
3614
- @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.""")
3615
- @json_skeleton_utils.get_cli_json_input_option({})
3616
- @cli_util.help_option
3617
- @click.pass_context
3618
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
3619
- @cli_util.wrap_exceptions
3620
- def skip_next_scheduled_job_execution(ctx, from_json, scheduled_job_id, if_match):
3621
-
3622
- if isinstance(scheduled_job_id, six.string_types) and len(scheduled_job_id.strip()) == 0:
3623
- raise click.UsageError('Parameter --scheduled-job-id cannot be whitespace or empty string')
3624
-
3625
- kwargs = {}
3626
- if if_match is not None:
3627
- kwargs['if_match'] = if_match
3628
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3629
- client = cli_util.build_client('os_management', 'os_management', ctx)
3630
- result = client.skip_next_scheduled_job_execution(
3631
- scheduled_job_id=scheduled_job_id,
3632
- **kwargs
3633
- )
3634
- cli_util.render_response(result, ctx)
3635
-
3636
-
3637
- @module_stream_details_group.command(name=cli_util.override('os_management.switch_module_stream_on_managed_instance.command_name', 'switch-module-stream-on-managed-instance'), help=u"""Enables a new stream for a module that already has a stream enabled. If any profiles or packages from the original module are installed, switching to a new stream will remove the existing packages and install their counterparts in the new stream. \n[Command Reference](switchModuleStreamOnManagedInstance)""")
3638
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
3639
- @cli_util.option('--module-name', required=True, help=u"""The name of a module.""")
3640
- @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.""")
3641
- @cli_util.option('--stream-name', help=u"""The name of the stream of the containing module. This parameter is required if a profileName is specified.""")
3642
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
3643
- @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
3644
- @cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
3645
- @json_skeleton_utils.get_cli_json_input_option({})
3646
- @cli_util.help_option
3647
- @click.pass_context
3648
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
3649
- @cli_util.wrap_exceptions
3650
- def switch_module_stream_on_managed_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_id, module_name, if_match, stream_name):
3651
-
3652
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
3653
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
3654
-
3655
- kwargs = {}
3656
- if if_match is not None:
3657
- kwargs['if_match'] = if_match
3658
- if stream_name is not None:
3659
- kwargs['stream_name'] = stream_name
3660
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3661
- client = cli_util.build_client('os_management', 'os_management', ctx)
3662
- result = client.switch_module_stream_on_managed_instance(
3663
- managed_instance_id=managed_instance_id,
3664
- module_name=module_name,
3665
- **kwargs
3666
- )
3667
- if wait_for_state:
3668
-
3669
- if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
3670
- try:
3671
- wait_period_kwargs = {}
3672
- if max_wait_seconds is not None:
3673
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
3674
- if wait_interval_seconds is not None:
3675
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
3676
- if 'opc-work-request-id' not in result.headers:
3677
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
3678
- cli_util.render_response(result, ctx)
3679
- return
3680
-
3681
- click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
3682
- result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
3683
- except oci.exceptions.MaximumWaitTimeExceeded as e:
3684
- # If we fail, we should show an error, but we should still provide the information to the customer
3685
- click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
3686
- cli_util.render_response(result, ctx)
3687
- sys.exit(2)
3688
- except Exception:
3689
- click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
3690
- cli_util.render_response(result, ctx)
3691
- raise
3692
- else:
3693
- click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
3694
- cli_util.render_response(result, ctx)
3695
-
3696
-
3697
- @update_managed_instance_details_group.command(name=cli_util.override('os_management.update_managed_instance.command_name', 'update-managed-instance'), help=u"""Updates a specific Managed Instance. \n[Command Reference](updateManagedInstance)""")
3698
- @cli_util.option('--managed-instance-id', required=True, help=u"""OCID for the managed instance""")
3699
- @cli_util.option('--notification-topic-id', help=u"""OCID of the ONS topic used to send notification to users""")
3700
- @cli_util.option('--is-data-collection-authorized', type=click.BOOL, help=u"""True if user allow data collection for this instance""")
3701
- @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.""")
3702
- @json_skeleton_utils.get_cli_json_input_option({})
3703
- @cli_util.help_option
3704
- @click.pass_context
3705
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'os_management', 'class': 'ManagedInstance'})
3706
- @cli_util.wrap_exceptions
3707
- def update_managed_instance(ctx, from_json, managed_instance_id, notification_topic_id, is_data_collection_authorized, if_match):
3708
-
3709
- if isinstance(managed_instance_id, six.string_types) and len(managed_instance_id.strip()) == 0:
3710
- raise click.UsageError('Parameter --managed-instance-id cannot be whitespace or empty string')
3711
-
3712
- kwargs = {}
3713
- if if_match is not None:
3714
- kwargs['if_match'] = if_match
3715
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3716
-
3717
- _details = {}
3718
-
3719
- if notification_topic_id is not None:
3720
- _details['notificationTopicId'] = notification_topic_id
3721
-
3722
- if is_data_collection_authorized is not None:
3723
- _details['isDataCollectionAuthorized'] = is_data_collection_authorized
3724
-
3725
- client = cli_util.build_client('os_management', 'os_management', ctx)
3726
- result = client.update_managed_instance(
3727
- managed_instance_id=managed_instance_id,
3728
- update_managed_instance_details=_details,
3729
- **kwargs
3730
- )
3731
- cli_util.render_response(result, ctx)
3732
-
3733
-
3734
- @managed_instance_group_group.command(name=cli_util.override('os_management.update_managed_instance_group.command_name', 'update'), help=u"""Updates a specific Managed Instance Group. \n[Command Reference](updateManagedInstanceGroup)""")
3735
- @cli_util.option('--managed-instance-group-id', required=True, help=u"""OCID for the managed instance group""")
3736
- @cli_util.option('--display-name', help=u"""Managed Instance Group identifier""")
3737
- @cli_util.option('--description', help=u"""Information specified by the user about the managed instance group""")
3738
- @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3739
- @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3740
- @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.""")
3741
- @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
3742
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "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.""")
3743
- @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.""")
3744
- @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.""")
3745
- @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'os_management', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'os_management', 'class': 'dict(str, dict(str, object))'}})
3746
- @cli_util.help_option
3747
- @click.pass_context
3748
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'os_management', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'os_management', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'os_management', 'class': 'ManagedInstanceGroup'})
3749
- @cli_util.wrap_exceptions
3750
- def update_managed_instance_group(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, managed_instance_group_id, display_name, description, freeform_tags, defined_tags, if_match):
3751
-
3752
- if isinstance(managed_instance_group_id, six.string_types) and len(managed_instance_group_id.strip()) == 0:
3753
- raise click.UsageError('Parameter --managed-instance-group-id cannot be whitespace or empty string')
3754
- if not force:
3755
- if freeform_tags or defined_tags:
3756
- if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
3757
- ctx.abort()
3758
-
3759
- kwargs = {}
3760
- if if_match is not None:
3761
- kwargs['if_match'] = if_match
3762
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3763
-
3764
- _details = {}
3765
-
3766
- if display_name is not None:
3767
- _details['displayName'] = display_name
3768
-
3769
- if description is not None:
3770
- _details['description'] = description
3771
-
3772
- if freeform_tags is not None:
3773
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
3774
-
3775
- if defined_tags is not None:
3776
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
3777
-
3778
- client = cli_util.build_client('os_management', 'os_management', ctx)
3779
- result = client.update_managed_instance_group(
3780
- managed_instance_group_id=managed_instance_group_id,
3781
- update_managed_instance_group_details=_details,
3782
- **kwargs
3783
- )
3784
- if wait_for_state:
3785
-
3786
- if hasattr(client, 'get_managed_instance_group') and callable(getattr(client, 'get_managed_instance_group')):
3787
- try:
3788
- wait_period_kwargs = {}
3789
- if max_wait_seconds is not None:
3790
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
3791
- if wait_interval_seconds is not None:
3792
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
3793
-
3794
- click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
3795
- result = oci.wait_until(client, client.get_managed_instance_group(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
3796
- except oci.exceptions.MaximumWaitTimeExceeded as e:
3797
- # If we fail, we should show an error, but we should still provide the information to the customer
3798
- click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
3799
- cli_util.render_response(result, ctx)
3800
- sys.exit(2)
3801
- except Exception:
3802
- click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
3803
- cli_util.render_response(result, ctx)
3804
- raise
3805
- else:
3806
- click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
3807
- cli_util.render_response(result, ctx)
3808
-
3809
-
3810
- @scheduled_job_group.command(name=cli_util.override('os_management.update_scheduled_job.command_name', 'update'), help=u"""Updates an existing Scheduled Job on the management system. \n[Command Reference](updateScheduledJob)""")
3811
- @cli_util.option('--scheduled-job-id', required=True, help=u"""The ID of the scheduled job.""")
3812
- @cli_util.option('--display-name', help=u"""Scheduled Job name""")
3813
- @cli_util.option('--description', help=u"""Details describing the Scheduled Job.""")
3814
- @cli_util.option('--schedule-type', type=custom_types.CliCaseInsensitiveChoice(["ONETIME", "RECURRING"]), help=u"""the type of scheduling this Scheduled Job follows""")
3815
- @cli_util.option('--time-next-execution', type=custom_types.CLI_DATETIME, help=u"""the desired time for the next execution of this Scheduled Job""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
3816
- @cli_util.option('--interval-type', type=custom_types.CliCaseInsensitiveChoice(["HOUR", "DAY", "WEEK", "MONTH"]), help=u"""the interval period for a recurring Scheduled Job (only if schedule type is RECURRING)""")
3817
- @cli_util.option('--interval-value', help=u"""the value for the interval period for a recurring Scheduled Job (only if schedule type is RECURRING)""")
3818
- @cli_util.option('--operation-type', type=custom_types.CliCaseInsensitiveChoice(["INSTALL", "UPDATE", "REMOVE", "UPDATEALL", "ENABLEMODULESTREAM", "DISABLEMODULESTREAM", "SWITCHMODULESTREAM", "INSTALLMODULESTREAMPROFILE", "REMOVEMODULESTREAMPROFILE", "COMPOUND"]), help=u"""the type of operation this Scheduled Job performs""")
3819
- @cli_util.option('--update-type', type=custom_types.CliCaseInsensitiveChoice(["SECURITY", "BUGFIX", "ENHANCEMENT", "OTHER", "KSPLICE", "ALL"]), help=u"""Type of the update (only if operation type is UPDATEALL)""")
3820
- @cli_util.option('--package-names', type=custom_types.CLI_COMPLEX_TYPE, help=u"""the id of the package (only if operation type is INSTALL/UPDATE/REMOVE)
3821
-
3822
- This option is a JSON list with items of type PackageName. For documentation on PackageName please see our API reference: https://docs.cloud.oracle.com/api/#/en/osmanagement/20190801/datatypes/PackageName.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3823
- @cli_util.option('--update-names', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The unique names of the Windows Updates (only if operation type is INSTALL). This is only applicable when the osFamily is for Windows managed instances.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3824
- @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3825
- @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3826
- @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.""")
3827
- @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
3828
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "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.""")
3829
- @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.""")
3830
- @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.""")
3831
- @json_skeleton_utils.get_cli_json_input_option({'package-names': {'module': 'os_management', 'class': 'list[PackageName]'}, 'update-names': {'module': 'os_management', 'class': 'list[string]'}, 'freeform-tags': {'module': 'os_management', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'os_management', 'class': 'dict(str, dict(str, object))'}})
3832
- @cli_util.help_option
3833
- @click.pass_context
3834
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'package-names': {'module': 'os_management', 'class': 'list[PackageName]'}, 'update-names': {'module': 'os_management', 'class': 'list[string]'}, 'freeform-tags': {'module': 'os_management', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'os_management', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'os_management', 'class': 'ScheduledJob'})
3835
- @cli_util.wrap_exceptions
3836
- def update_scheduled_job(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, scheduled_job_id, display_name, description, schedule_type, time_next_execution, interval_type, interval_value, operation_type, update_type, package_names, update_names, freeform_tags, defined_tags, if_match):
3837
-
3838
- if isinstance(scheduled_job_id, six.string_types) and len(scheduled_job_id.strip()) == 0:
3839
- raise click.UsageError('Parameter --scheduled-job-id cannot be whitespace or empty string')
3840
- if not force:
3841
- if package_names or update_names or freeform_tags or defined_tags:
3842
- if not click.confirm("WARNING: Updates to package-names and update-names and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
3843
- ctx.abort()
3844
-
3845
- kwargs = {}
3846
- if if_match is not None:
3847
- kwargs['if_match'] = if_match
3848
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3849
-
3850
- _details = {}
3851
-
3852
- if display_name is not None:
3853
- _details['displayName'] = display_name
3854
-
3855
- if description is not None:
3856
- _details['description'] = description
3857
-
3858
- if schedule_type is not None:
3859
- _details['scheduleType'] = schedule_type
3860
-
3861
- if time_next_execution is not None:
3862
- _details['timeNextExecution'] = time_next_execution
3863
-
3864
- if interval_type is not None:
3865
- _details['intervalType'] = interval_type
3866
-
3867
- if interval_value is not None:
3868
- _details['intervalValue'] = interval_value
3869
-
3870
- if operation_type is not None:
3871
- _details['operationType'] = operation_type
3872
-
3873
- if update_type is not None:
3874
- _details['updateType'] = update_type
3875
-
3876
- if package_names is not None:
3877
- _details['packageNames'] = cli_util.parse_json_parameter("package_names", package_names)
3878
-
3879
- if update_names is not None:
3880
- _details['updateNames'] = cli_util.parse_json_parameter("update_names", update_names)
3881
-
3882
- if freeform_tags is not None:
3883
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
3884
-
3885
- if defined_tags is not None:
3886
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
3887
-
3888
- client = cli_util.build_client('os_management', 'os_management', ctx)
3889
- result = client.update_scheduled_job(
3890
- scheduled_job_id=scheduled_job_id,
3891
- update_scheduled_job_details=_details,
3892
- **kwargs
3893
- )
3894
- if wait_for_state:
3895
-
3896
- if hasattr(client, 'get_scheduled_job') and callable(getattr(client, 'get_scheduled_job')):
3897
- try:
3898
- wait_period_kwargs = {}
3899
- if max_wait_seconds is not None:
3900
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
3901
- if wait_interval_seconds is not None:
3902
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
3903
-
3904
- click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
3905
- result = oci.wait_until(client, client.get_scheduled_job(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
3906
- except oci.exceptions.MaximumWaitTimeExceeded as e:
3907
- # If we fail, we should show an error, but we should still provide the information to the customer
3908
- click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
3909
- cli_util.render_response(result, ctx)
3910
- sys.exit(2)
3911
- except Exception:
3912
- click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
3913
- cli_util.render_response(result, ctx)
3914
- raise
3915
- else:
3916
- click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
3917
- cli_util.render_response(result, ctx)
3918
-
3919
-
3920
- @software_source_group.command(name=cli_util.override('os_management.update_software_source.command_name', 'update'), help=u"""Updates an existing custom Software Source on the management system. \n[Command Reference](updateSoftwareSource)""")
3921
- @cli_util.option('--software-source-id', required=True, help=u"""The OCID of the software source.""")
3922
- @cli_util.option('--display-name', help=u"""User friendly name for the software source""")
3923
- @cli_util.option('--description', help=u"""Information specified by the user about the software source""")
3924
- @cli_util.option('--maintainer-name', help=u"""Name of the person maintaining this software source""")
3925
- @cli_util.option('--maintainer-email', help=u"""Email address of the person maintaining this software source""")
3926
- @cli_util.option('--maintainer-phone', help=u"""Phone number of the person maintaining this software source""")
3927
- @cli_util.option('--checksum-type', type=custom_types.CliCaseInsensitiveChoice(["SHA1", "SHA256", "SHA384", "SHA512"]), help=u"""The yum repository checksum type used by this software source""")
3928
- @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3929
- @cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
3930
- @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.""")
3931
- @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
3932
- @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "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.""")
3933
- @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.""")
3934
- @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.""")
3935
- @json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'os_management', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'os_management', 'class': 'dict(str, dict(str, object))'}})
3936
- @cli_util.help_option
3937
- @click.pass_context
3938
- @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'os_management', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'os_management', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'os_management', 'class': 'SoftwareSource'})
3939
- @cli_util.wrap_exceptions
3940
- def update_software_source(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, software_source_id, display_name, description, maintainer_name, maintainer_email, maintainer_phone, checksum_type, freeform_tags, defined_tags, if_match):
3941
-
3942
- if isinstance(software_source_id, six.string_types) and len(software_source_id.strip()) == 0:
3943
- raise click.UsageError('Parameter --software-source-id cannot be whitespace or empty string')
3944
- if not force:
3945
- if freeform_tags or defined_tags:
3946
- if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"):
3947
- ctx.abort()
3948
-
3949
- kwargs = {}
3950
- if if_match is not None:
3951
- kwargs['if_match'] = if_match
3952
- kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
3953
-
3954
- _details = {}
3955
-
3956
- if display_name is not None:
3957
- _details['displayName'] = display_name
3958
-
3959
- if description is not None:
3960
- _details['description'] = description
3961
-
3962
- if maintainer_name is not None:
3963
- _details['maintainerName'] = maintainer_name
3964
-
3965
- if maintainer_email is not None:
3966
- _details['maintainerEmail'] = maintainer_email
3967
-
3968
- if maintainer_phone is not None:
3969
- _details['maintainerPhone'] = maintainer_phone
3970
-
3971
- if checksum_type is not None:
3972
- _details['checksumType'] = checksum_type
3973
-
3974
- if freeform_tags is not None:
3975
- _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags)
3976
-
3977
- if defined_tags is not None:
3978
- _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags)
3979
-
3980
- client = cli_util.build_client('os_management', 'os_management', ctx)
3981
- result = client.update_software_source(
3982
- software_source_id=software_source_id,
3983
- update_software_source_details=_details,
3984
- **kwargs
3985
- )
3986
- if wait_for_state:
3987
-
3988
- if hasattr(client, 'get_software_source') and callable(getattr(client, 'get_software_source')):
3989
- try:
3990
- wait_period_kwargs = {}
3991
- if max_wait_seconds is not None:
3992
- wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
3993
- if wait_interval_seconds is not None:
3994
- wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
3995
-
3996
- click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr)
3997
- result = oci.wait_until(client, client.get_software_source(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs)
3998
- except oci.exceptions.MaximumWaitTimeExceeded as e:
3999
- # If we fail, we should show an error, but we should still provide the information to the customer
4000
- click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr)
4001
- cli_util.render_response(result, ctx)
4002
- sys.exit(2)
4003
- except Exception:
4004
- click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr)
4005
- cli_util.render_response(result, ctx)
4006
- raise
4007
- else:
4008
- click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr)
4009
- cli_util.render_response(result, ctx)