diff --git a/CHANGELOG.rst b/CHANGELOG.rst index adec9c6367..ac4b13dc27 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,6 +3,20 @@ Change Log All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `_. +==================== +2.23.4 - 2020-10-03 +==================== + +Added +----- +* Support for calling Oracle Cloud Infrastructure services in the uk-cardiff-1 region +* Support for the Organizations service +* Support for the Optimizer service +* Support for tenancy ID and name on responses in the Usage service +* Support for object versioning in object lifecycle management in the Object Storage service +* Support for specifying a syslog URL for applications in the Functions service +* Support for creation of always-free NoSQL database tables in the NoSQL Database service + ==================== 2.23.3 - 2020-10-29 ==================== diff --git a/docs/api/landing.rst b/docs/api/landing.rst index 445a2233aa..24b5b3b381 100644 --- a/docs/api/landing.rst +++ b/docs/api/landing.rst @@ -74,6 +74,7 @@ API Reference * :doc:`Notification Control Plane ` * :doc:`Notification Data Plane ` * :doc:`Operations Insights ` +* :doc:`Optimizer ` * :doc:`Os Management ` * :doc:`Resource Manager ` * :doc:`Resource Search ` @@ -81,6 +82,10 @@ API Reference * :doc:`Secrets ` * :doc:`Stream Admin ` * :doc:`Stream ` +* :doc:`Link ` +* :doc:`Recipient Invitation ` +* :doc:`Sender Invitation ` +* :doc:`Work Request ` * :doc:`Usageapi ` * :doc:`Vaults ` * :doc:`Redirect ` @@ -152,12 +157,14 @@ API Reference oda ons opsi + optimizer os_management resource_manager resource_search sch secrets streaming + tenant_manager_control_plane usage_api vault waas diff --git a/docs/api/optimizer.rst b/docs/api/optimizer.rst new file mode 100644 index 0000000000..8b8b4a0784 --- /dev/null +++ b/docs/api/optimizer.rst @@ -0,0 +1,57 @@ +Optimizer +========= + +.. autosummary:: + :toctree: optimizer/client + :nosignatures: + :template: autosummary/service_client.rst + + oci.optimizer.OptimizerClient + oci.optimizer.OptimizerClientCompositeOperations + +-------- + Models +-------- + +.. autosummary:: + :toctree: optimizer/models + :nosignatures: + :template: autosummary/model_class.rst + + oci.optimizer.models.Action + oci.optimizer.models.BulkApplyRecommendationsDetails + oci.optimizer.models.Category + oci.optimizer.models.CategoryCollection + oci.optimizer.models.CategorySummary + oci.optimizer.models.CreateProfileDetails + oci.optimizer.models.EnrollmentStatus + oci.optimizer.models.EnrollmentStatusCollection + oci.optimizer.models.EnrollmentStatusSummary + oci.optimizer.models.HistoryCollection + oci.optimizer.models.HistorySummary + oci.optimizer.models.LevelConfiguration + oci.optimizer.models.LevelsConfiguration + oci.optimizer.models.Profile + oci.optimizer.models.ProfileCollection + oci.optimizer.models.ProfileSummary + oci.optimizer.models.Recommendation + oci.optimizer.models.RecommendationCollection + oci.optimizer.models.RecommendationCount + oci.optimizer.models.RecommendationSummary + oci.optimizer.models.ResourceAction + oci.optimizer.models.ResourceActionCollection + oci.optimizer.models.ResourceActionSummary + oci.optimizer.models.ResourceCount + oci.optimizer.models.SupportedLevel + oci.optimizer.models.SupportedLevels + oci.optimizer.models.UpdateEnrollmentStatusDetails + oci.optimizer.models.UpdateProfileDetails + oci.optimizer.models.UpdateRecommendationDetails + oci.optimizer.models.UpdateResourceActionDetails + oci.optimizer.models.WorkRequest + oci.optimizer.models.WorkRequestCollection + oci.optimizer.models.WorkRequestError + oci.optimizer.models.WorkRequestErrorCollection + oci.optimizer.models.WorkRequestLogEntry + oci.optimizer.models.WorkRequestLogEntryCollection + oci.optimizer.models.WorkRequestResource diff --git a/docs/api/optimizer/client/oci.optimizer.OptimizerClient.rst b/docs/api/optimizer/client/oci.optimizer.OptimizerClient.rst new file mode 100644 index 0000000000..7833564e22 --- /dev/null +++ b/docs/api/optimizer/client/oci.optimizer.OptimizerClient.rst @@ -0,0 +1,8 @@ +OptimizerClient +=============== + +.. currentmodule:: oci.optimizer + +.. autoclass:: OptimizerClient + :special-members: __init__ + :members: \ No newline at end of file diff --git a/docs/api/optimizer/client/oci.optimizer.OptimizerClientCompositeOperations.rst b/docs/api/optimizer/client/oci.optimizer.OptimizerClientCompositeOperations.rst new file mode 100644 index 0000000000..7b41c77ae9 --- /dev/null +++ b/docs/api/optimizer/client/oci.optimizer.OptimizerClientCompositeOperations.rst @@ -0,0 +1,8 @@ +OptimizerClientCompositeOperations +================================== + +.. currentmodule:: oci.optimizer + +.. autoclass:: OptimizerClientCompositeOperations + :special-members: __init__ + :members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.Action.rst b/docs/api/optimizer/models/oci.optimizer.models.Action.rst new file mode 100644 index 0000000000..a95b5b20a7 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.Action.rst @@ -0,0 +1,11 @@ +Action +====== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: Action + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.BulkApplyRecommendationsDetails.rst b/docs/api/optimizer/models/oci.optimizer.models.BulkApplyRecommendationsDetails.rst new file mode 100644 index 0000000000..a5ad7622cb --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.BulkApplyRecommendationsDetails.rst @@ -0,0 +1,11 @@ +BulkApplyRecommendationsDetails +=============================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: BulkApplyRecommendationsDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.Category.rst b/docs/api/optimizer/models/oci.optimizer.models.Category.rst new file mode 100644 index 0000000000..87174a9f56 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.Category.rst @@ -0,0 +1,11 @@ +Category +======== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: Category + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.CategoryCollection.rst b/docs/api/optimizer/models/oci.optimizer.models.CategoryCollection.rst new file mode 100644 index 0000000000..b8779b82e6 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.CategoryCollection.rst @@ -0,0 +1,11 @@ +CategoryCollection +================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: CategoryCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.CategorySummary.rst b/docs/api/optimizer/models/oci.optimizer.models.CategorySummary.rst new file mode 100644 index 0000000000..4596ad4595 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.CategorySummary.rst @@ -0,0 +1,11 @@ +CategorySummary +=============== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: CategorySummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.CreateProfileDetails.rst b/docs/api/optimizer/models/oci.optimizer.models.CreateProfileDetails.rst new file mode 100644 index 0000000000..3b4722a297 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.CreateProfileDetails.rst @@ -0,0 +1,11 @@ +CreateProfileDetails +==================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: CreateProfileDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.EnrollmentStatus.rst b/docs/api/optimizer/models/oci.optimizer.models.EnrollmentStatus.rst new file mode 100644 index 0000000000..fe2ca87474 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.EnrollmentStatus.rst @@ -0,0 +1,11 @@ +EnrollmentStatus +================ + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: EnrollmentStatus + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.EnrollmentStatusCollection.rst b/docs/api/optimizer/models/oci.optimizer.models.EnrollmentStatusCollection.rst new file mode 100644 index 0000000000..e9d2fd2693 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.EnrollmentStatusCollection.rst @@ -0,0 +1,11 @@ +EnrollmentStatusCollection +========================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: EnrollmentStatusCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.EnrollmentStatusSummary.rst b/docs/api/optimizer/models/oci.optimizer.models.EnrollmentStatusSummary.rst new file mode 100644 index 0000000000..f676e87d3a --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.EnrollmentStatusSummary.rst @@ -0,0 +1,11 @@ +EnrollmentStatusSummary +======================= + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: EnrollmentStatusSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.HistoryCollection.rst b/docs/api/optimizer/models/oci.optimizer.models.HistoryCollection.rst new file mode 100644 index 0000000000..61d37389e6 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.HistoryCollection.rst @@ -0,0 +1,11 @@ +HistoryCollection +================= + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: HistoryCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.HistorySummary.rst b/docs/api/optimizer/models/oci.optimizer.models.HistorySummary.rst new file mode 100644 index 0000000000..1970f55748 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.HistorySummary.rst @@ -0,0 +1,11 @@ +HistorySummary +============== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: HistorySummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.LevelConfiguration.rst b/docs/api/optimizer/models/oci.optimizer.models.LevelConfiguration.rst new file mode 100644 index 0000000000..65d3265344 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.LevelConfiguration.rst @@ -0,0 +1,11 @@ +LevelConfiguration +================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: LevelConfiguration + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.LevelsConfiguration.rst b/docs/api/optimizer/models/oci.optimizer.models.LevelsConfiguration.rst new file mode 100644 index 0000000000..012cd9d529 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.LevelsConfiguration.rst @@ -0,0 +1,11 @@ +LevelsConfiguration +=================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: LevelsConfiguration + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.Profile.rst b/docs/api/optimizer/models/oci.optimizer.models.Profile.rst new file mode 100644 index 0000000000..e040d49684 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.Profile.rst @@ -0,0 +1,11 @@ +Profile +======= + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: Profile + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.ProfileCollection.rst b/docs/api/optimizer/models/oci.optimizer.models.ProfileCollection.rst new file mode 100644 index 0000000000..011880389a --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.ProfileCollection.rst @@ -0,0 +1,11 @@ +ProfileCollection +================= + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: ProfileCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.ProfileSummary.rst b/docs/api/optimizer/models/oci.optimizer.models.ProfileSummary.rst new file mode 100644 index 0000000000..b030786864 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.ProfileSummary.rst @@ -0,0 +1,11 @@ +ProfileSummary +============== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: ProfileSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.Recommendation.rst b/docs/api/optimizer/models/oci.optimizer.models.Recommendation.rst new file mode 100644 index 0000000000..f20d15b03c --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.Recommendation.rst @@ -0,0 +1,11 @@ +Recommendation +============== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: Recommendation + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.RecommendationCollection.rst b/docs/api/optimizer/models/oci.optimizer.models.RecommendationCollection.rst new file mode 100644 index 0000000000..5681e144a3 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.RecommendationCollection.rst @@ -0,0 +1,11 @@ +RecommendationCollection +======================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: RecommendationCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.RecommendationCount.rst b/docs/api/optimizer/models/oci.optimizer.models.RecommendationCount.rst new file mode 100644 index 0000000000..df3e79fc74 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.RecommendationCount.rst @@ -0,0 +1,11 @@ +RecommendationCount +=================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: RecommendationCount + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.RecommendationSummary.rst b/docs/api/optimizer/models/oci.optimizer.models.RecommendationSummary.rst new file mode 100644 index 0000000000..fe0b97e291 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.RecommendationSummary.rst @@ -0,0 +1,11 @@ +RecommendationSummary +===================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: RecommendationSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.ResourceAction.rst b/docs/api/optimizer/models/oci.optimizer.models.ResourceAction.rst new file mode 100644 index 0000000000..d14fceddf6 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.ResourceAction.rst @@ -0,0 +1,11 @@ +ResourceAction +============== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: ResourceAction + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.ResourceActionCollection.rst b/docs/api/optimizer/models/oci.optimizer.models.ResourceActionCollection.rst new file mode 100644 index 0000000000..0b8e33f81c --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.ResourceActionCollection.rst @@ -0,0 +1,11 @@ +ResourceActionCollection +======================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: ResourceActionCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.ResourceActionSummary.rst b/docs/api/optimizer/models/oci.optimizer.models.ResourceActionSummary.rst new file mode 100644 index 0000000000..87d51d9e97 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.ResourceActionSummary.rst @@ -0,0 +1,11 @@ +ResourceActionSummary +===================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: ResourceActionSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.ResourceCount.rst b/docs/api/optimizer/models/oci.optimizer.models.ResourceCount.rst new file mode 100644 index 0000000000..8386e72b68 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.ResourceCount.rst @@ -0,0 +1,11 @@ +ResourceCount +============= + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: ResourceCount + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.SupportedLevel.rst b/docs/api/optimizer/models/oci.optimizer.models.SupportedLevel.rst new file mode 100644 index 0000000000..1ca8627cfc --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.SupportedLevel.rst @@ -0,0 +1,11 @@ +SupportedLevel +============== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: SupportedLevel + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.SupportedLevels.rst b/docs/api/optimizer/models/oci.optimizer.models.SupportedLevels.rst new file mode 100644 index 0000000000..92c589bbe4 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.SupportedLevels.rst @@ -0,0 +1,11 @@ +SupportedLevels +=============== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: SupportedLevels + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.UpdateEnrollmentStatusDetails.rst b/docs/api/optimizer/models/oci.optimizer.models.UpdateEnrollmentStatusDetails.rst new file mode 100644 index 0000000000..13c0381fbd --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.UpdateEnrollmentStatusDetails.rst @@ -0,0 +1,11 @@ +UpdateEnrollmentStatusDetails +============================= + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: UpdateEnrollmentStatusDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.UpdateProfileDetails.rst b/docs/api/optimizer/models/oci.optimizer.models.UpdateProfileDetails.rst new file mode 100644 index 0000000000..f3a26ce1b3 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.UpdateProfileDetails.rst @@ -0,0 +1,11 @@ +UpdateProfileDetails +==================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: UpdateProfileDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.UpdateRecommendationDetails.rst b/docs/api/optimizer/models/oci.optimizer.models.UpdateRecommendationDetails.rst new file mode 100644 index 0000000000..3b3a488f2c --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.UpdateRecommendationDetails.rst @@ -0,0 +1,11 @@ +UpdateRecommendationDetails +=========================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: UpdateRecommendationDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.UpdateResourceActionDetails.rst b/docs/api/optimizer/models/oci.optimizer.models.UpdateResourceActionDetails.rst new file mode 100644 index 0000000000..4de8bd0342 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.UpdateResourceActionDetails.rst @@ -0,0 +1,11 @@ +UpdateResourceActionDetails +=========================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: UpdateResourceActionDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.WorkRequest.rst b/docs/api/optimizer/models/oci.optimizer.models.WorkRequest.rst new file mode 100644 index 0000000000..fba8ba1184 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.WorkRequest.rst @@ -0,0 +1,11 @@ +WorkRequest +=========== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: WorkRequest + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.WorkRequestCollection.rst b/docs/api/optimizer/models/oci.optimizer.models.WorkRequestCollection.rst new file mode 100644 index 0000000000..f587193333 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.WorkRequestCollection.rst @@ -0,0 +1,11 @@ +WorkRequestCollection +===================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: WorkRequestCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.WorkRequestError.rst b/docs/api/optimizer/models/oci.optimizer.models.WorkRequestError.rst new file mode 100644 index 0000000000..4f5bb59272 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.WorkRequestError.rst @@ -0,0 +1,11 @@ +WorkRequestError +================ + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: WorkRequestError + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.WorkRequestErrorCollection.rst b/docs/api/optimizer/models/oci.optimizer.models.WorkRequestErrorCollection.rst new file mode 100644 index 0000000000..428efe3313 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.WorkRequestErrorCollection.rst @@ -0,0 +1,11 @@ +WorkRequestErrorCollection +========================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: WorkRequestErrorCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.WorkRequestLogEntry.rst b/docs/api/optimizer/models/oci.optimizer.models.WorkRequestLogEntry.rst new file mode 100644 index 0000000000..47c793abae --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.WorkRequestLogEntry.rst @@ -0,0 +1,11 @@ +WorkRequestLogEntry +=================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: WorkRequestLogEntry + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.WorkRequestLogEntryCollection.rst b/docs/api/optimizer/models/oci.optimizer.models.WorkRequestLogEntryCollection.rst new file mode 100644 index 0000000000..d1d76abcfd --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.WorkRequestLogEntryCollection.rst @@ -0,0 +1,11 @@ +WorkRequestLogEntryCollection +============================= + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: WorkRequestLogEntryCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/optimizer/models/oci.optimizer.models.WorkRequestResource.rst b/docs/api/optimizer/models/oci.optimizer.models.WorkRequestResource.rst new file mode 100644 index 0000000000..cfd65ffde8 --- /dev/null +++ b/docs/api/optimizer/models/oci.optimizer.models.WorkRequestResource.rst @@ -0,0 +1,11 @@ +WorkRequestResource +=================== + +.. currentmodule:: oci.optimizer.models + +.. autoclass:: WorkRequestResource + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane.rst b/docs/api/tenant_manager_control_plane.rst new file mode 100644 index 0000000000..00cad407c1 --- /dev/null +++ b/docs/api/tenant_manager_control_plane.rst @@ -0,0 +1,46 @@ +Tenant Manager Control Plane +============================ + +.. autosummary:: + :toctree: tenant_manager_control_plane/client + :nosignatures: + :template: autosummary/service_client.rst + + oci.tenant_manager_control_plane.LinkClient + oci.tenant_manager_control_plane.RecipientInvitationClient + oci.tenant_manager_control_plane.SenderInvitationClient + oci.tenant_manager_control_plane.WorkRequestClient + oci.tenant_manager_control_plane.LinkClientCompositeOperations + oci.tenant_manager_control_plane.RecipientInvitationClientCompositeOperations + oci.tenant_manager_control_plane.SenderInvitationClientCompositeOperations + oci.tenant_manager_control_plane.WorkRequestClientCompositeOperations + +-------- + Models +-------- + +.. autosummary:: + :toctree: tenant_manager_control_plane/models + :nosignatures: + :template: autosummary/model_class.rst + + oci.tenant_manager_control_plane.models.CreateSenderInvitationDetails + oci.tenant_manager_control_plane.models.Link + oci.tenant_manager_control_plane.models.LinkCollection + oci.tenant_manager_control_plane.models.LinkSummary + oci.tenant_manager_control_plane.models.RecipientInvitation + oci.tenant_manager_control_plane.models.RecipientInvitationCollection + oci.tenant_manager_control_plane.models.RecipientInvitationSummary + oci.tenant_manager_control_plane.models.SenderInvitation + oci.tenant_manager_control_plane.models.SenderInvitationCollection + oci.tenant_manager_control_plane.models.SenderInvitationSummary + oci.tenant_manager_control_plane.models.UpdateRecipientInvitationDetails + oci.tenant_manager_control_plane.models.UpdateSenderInvitationDetails + oci.tenant_manager_control_plane.models.WorkRequest + oci.tenant_manager_control_plane.models.WorkRequestCollection + oci.tenant_manager_control_plane.models.WorkRequestError + oci.tenant_manager_control_plane.models.WorkRequestErrorCollection + oci.tenant_manager_control_plane.models.WorkRequestLogEntry + oci.tenant_manager_control_plane.models.WorkRequestLogEntryCollection + oci.tenant_manager_control_plane.models.WorkRequestResource + oci.tenant_manager_control_plane.models.WorkRequestSummary diff --git a/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.LinkClient.rst b/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.LinkClient.rst new file mode 100644 index 0000000000..fa91d333de --- /dev/null +++ b/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.LinkClient.rst @@ -0,0 +1,8 @@ +LinkClient +========== + +.. currentmodule:: oci.tenant_manager_control_plane + +.. autoclass:: LinkClient + :special-members: __init__ + :members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.LinkClientCompositeOperations.rst b/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.LinkClientCompositeOperations.rst new file mode 100644 index 0000000000..e30c1e1c54 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.LinkClientCompositeOperations.rst @@ -0,0 +1,8 @@ +LinkClientCompositeOperations +============================= + +.. currentmodule:: oci.tenant_manager_control_plane + +.. autoclass:: LinkClientCompositeOperations + :special-members: __init__ + :members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.RecipientInvitationClient.rst b/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.RecipientInvitationClient.rst new file mode 100644 index 0000000000..e5b4efda73 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.RecipientInvitationClient.rst @@ -0,0 +1,8 @@ +RecipientInvitationClient +========================= + +.. currentmodule:: oci.tenant_manager_control_plane + +.. autoclass:: RecipientInvitationClient + :special-members: __init__ + :members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.RecipientInvitationClientCompositeOperations.rst b/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.RecipientInvitationClientCompositeOperations.rst new file mode 100644 index 0000000000..80e11f0fd9 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.RecipientInvitationClientCompositeOperations.rst @@ -0,0 +1,8 @@ +RecipientInvitationClientCompositeOperations +============================================ + +.. currentmodule:: oci.tenant_manager_control_plane + +.. autoclass:: RecipientInvitationClientCompositeOperations + :special-members: __init__ + :members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.SenderInvitationClient.rst b/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.SenderInvitationClient.rst new file mode 100644 index 0000000000..58b1fbcd0d --- /dev/null +++ b/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.SenderInvitationClient.rst @@ -0,0 +1,8 @@ +SenderInvitationClient +====================== + +.. currentmodule:: oci.tenant_manager_control_plane + +.. autoclass:: SenderInvitationClient + :special-members: __init__ + :members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.SenderInvitationClientCompositeOperations.rst b/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.SenderInvitationClientCompositeOperations.rst new file mode 100644 index 0000000000..d1d7b4de59 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.SenderInvitationClientCompositeOperations.rst @@ -0,0 +1,8 @@ +SenderInvitationClientCompositeOperations +========================================= + +.. currentmodule:: oci.tenant_manager_control_plane + +.. autoclass:: SenderInvitationClientCompositeOperations + :special-members: __init__ + :members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.WorkRequestClient.rst b/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.WorkRequestClient.rst new file mode 100644 index 0000000000..b74eb26a91 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.WorkRequestClient.rst @@ -0,0 +1,8 @@ +WorkRequestClient +================= + +.. currentmodule:: oci.tenant_manager_control_plane + +.. autoclass:: WorkRequestClient + :special-members: __init__ + :members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.WorkRequestClientCompositeOperations.rst b/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.WorkRequestClientCompositeOperations.rst new file mode 100644 index 0000000000..2d09397ad5 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/client/oci.tenant_manager_control_plane.WorkRequestClientCompositeOperations.rst @@ -0,0 +1,8 @@ +WorkRequestClientCompositeOperations +==================================== + +.. currentmodule:: oci.tenant_manager_control_plane + +.. autoclass:: WorkRequestClientCompositeOperations + :special-members: __init__ + :members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.CreateSenderInvitationDetails.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.CreateSenderInvitationDetails.rst new file mode 100644 index 0000000000..3e539516d9 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.CreateSenderInvitationDetails.rst @@ -0,0 +1,11 @@ +CreateSenderInvitationDetails +============================= + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: CreateSenderInvitationDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.Link.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.Link.rst new file mode 100644 index 0000000000..37fe7372e9 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.Link.rst @@ -0,0 +1,11 @@ +Link +==== + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: Link + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.LinkCollection.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.LinkCollection.rst new file mode 100644 index 0000000000..4873ba9ae7 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.LinkCollection.rst @@ -0,0 +1,11 @@ +LinkCollection +============== + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: LinkCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.LinkSummary.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.LinkSummary.rst new file mode 100644 index 0000000000..719411d819 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.LinkSummary.rst @@ -0,0 +1,11 @@ +LinkSummary +=========== + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: LinkSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.RecipientInvitation.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.RecipientInvitation.rst new file mode 100644 index 0000000000..848b1bcf70 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.RecipientInvitation.rst @@ -0,0 +1,11 @@ +RecipientInvitation +=================== + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: RecipientInvitation + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.RecipientInvitationCollection.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.RecipientInvitationCollection.rst new file mode 100644 index 0000000000..59c6f199ea --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.RecipientInvitationCollection.rst @@ -0,0 +1,11 @@ +RecipientInvitationCollection +============================= + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: RecipientInvitationCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.RecipientInvitationSummary.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.RecipientInvitationSummary.rst new file mode 100644 index 0000000000..5448298456 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.RecipientInvitationSummary.rst @@ -0,0 +1,11 @@ +RecipientInvitationSummary +========================== + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: RecipientInvitationSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.SenderInvitation.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.SenderInvitation.rst new file mode 100644 index 0000000000..29d103ef1c --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.SenderInvitation.rst @@ -0,0 +1,11 @@ +SenderInvitation +================ + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: SenderInvitation + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.SenderInvitationCollection.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.SenderInvitationCollection.rst new file mode 100644 index 0000000000..d591046144 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.SenderInvitationCollection.rst @@ -0,0 +1,11 @@ +SenderInvitationCollection +========================== + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: SenderInvitationCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.SenderInvitationSummary.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.SenderInvitationSummary.rst new file mode 100644 index 0000000000..a83deeced5 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.SenderInvitationSummary.rst @@ -0,0 +1,11 @@ +SenderInvitationSummary +======================= + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: SenderInvitationSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.UpdateRecipientInvitationDetails.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.UpdateRecipientInvitationDetails.rst new file mode 100644 index 0000000000..ceb157724c --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.UpdateRecipientInvitationDetails.rst @@ -0,0 +1,11 @@ +UpdateRecipientInvitationDetails +================================ + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: UpdateRecipientInvitationDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.UpdateSenderInvitationDetails.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.UpdateSenderInvitationDetails.rst new file mode 100644 index 0000000000..10c7f018da --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.UpdateSenderInvitationDetails.rst @@ -0,0 +1,11 @@ +UpdateSenderInvitationDetails +============================= + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: UpdateSenderInvitationDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequest.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequest.rst new file mode 100644 index 0000000000..78a6167678 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequest.rst @@ -0,0 +1,11 @@ +WorkRequest +=========== + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: WorkRequest + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestCollection.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestCollection.rst new file mode 100644 index 0000000000..6541bde8d5 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestCollection.rst @@ -0,0 +1,11 @@ +WorkRequestCollection +===================== + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: WorkRequestCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestError.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestError.rst new file mode 100644 index 0000000000..ec33b3a306 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestError.rst @@ -0,0 +1,11 @@ +WorkRequestError +================ + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: WorkRequestError + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestErrorCollection.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestErrorCollection.rst new file mode 100644 index 0000000000..52d35beeee --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestErrorCollection.rst @@ -0,0 +1,11 @@ +WorkRequestErrorCollection +========================== + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: WorkRequestErrorCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestLogEntry.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestLogEntry.rst new file mode 100644 index 0000000000..bfaf510c5a --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestLogEntry.rst @@ -0,0 +1,11 @@ +WorkRequestLogEntry +=================== + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: WorkRequestLogEntry + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestLogEntryCollection.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestLogEntryCollection.rst new file mode 100644 index 0000000000..b23cba03ae --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestLogEntryCollection.rst @@ -0,0 +1,11 @@ +WorkRequestLogEntryCollection +============================= + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: WorkRequestLogEntryCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestResource.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestResource.rst new file mode 100644 index 0000000000..12bb54aee9 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestResource.rst @@ -0,0 +1,11 @@ +WorkRequestResource +=================== + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: WorkRequestResource + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestSummary.rst b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestSummary.rst new file mode 100644 index 0000000000..0ffdf92f00 --- /dev/null +++ b/docs/api/tenant_manager_control_plane/models/oci.tenant_manager_control_plane.models.WorkRequestSummary.rst @@ -0,0 +1,11 @@ +WorkRequestSummary +================== + +.. currentmodule:: oci.tenant_manager_control_plane.models + +.. autoclass:: WorkRequestSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/examples/list_resources_in_tenancy/object_storage_list_objects.py b/examples/list_resources_in_tenancy/object_storage_list_objects.py index ac558b4497..11c44b3f33 100644 --- a/examples/list_resources_in_tenancy/object_storage_list_objects.py +++ b/examples/list_resources_in_tenancy/object_storage_list_objects.py @@ -1,29 +1,7 @@ # coding: utf-8 # Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. # 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. -########################################################################## -# object_storage_list_objects.py -# -# @author: Adi Zohar, Oct 18th 2020 -# -# Supports Python 3 -########################################################################## -# Info: -# count objects or list objects with option to filter by prefix and write to file -# -########################################################################## -# Application Command line parameters -# -# -c config - Config file section to use (tenancy profile) -# -t profile - Profile in config file, DEFAULT as default -# -p proxy - Set Proxy (i.e. www-proxy-server.com:80) -# -ip - Use Instance Principals for Authentication -# -dt - Use Instance Principals with delegation token for cloud shell -# -co - count only -# -f - write to file -# -sb source_bucket -# -sp source_prefix_include -########################################################################## + import oci import argparse import datetime diff --git a/examples/showoci/CHANGELOG.rst b/examples/showoci/CHANGELOG.rst index 602bf06cf0..41d750d961 100755 --- a/examples/showoci/CHANGELOG.rst +++ b/examples/showoci/CHANGELOG.rst @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `_. +===================== +20.11.03 - 20.11.03 +===================== +* Added metadata and extended metadata for instances using json output +* Added tags to load balancer resource + ===================== 20.10.20 - 20.10.20 ===================== diff --git a/examples/showoci/showoci.py b/examples/showoci/showoci.py index f946cd5fc8..233aca512b 100755 --- a/examples/showoci/showoci.py +++ b/examples/showoci/showoci.py @@ -91,7 +91,7 @@ import argparse import datetime -version = "20.10.20" +version = "20.11.03" ########################################################################## # check OCI version diff --git a/examples/showoci/showoci_data.py b/examples/showoci/showoci_data.py index bbd8aa6644..394749ef4f 100755 --- a/examples/showoci/showoci_data.py +++ b/examples/showoci/showoci_data.py @@ -1428,7 +1428,9 @@ def __get_core_compute_instances(self, region_name, compartment): 'agent_is_management_disabled': instance['agent_is_management_disabled'], 'agent_is_monitoring_disabled': instance['agent_is_monitoring_disabled'], 'defined_tags': instance['defined_tags'], - 'freeform_tags': instance['freeform_tags'] + 'freeform_tags': instance['freeform_tags'], + 'metadata': instance['metadata'], + 'extended_metadata': instance['extended_metadata'] } # boot volumes attachments @@ -2330,6 +2332,8 @@ def __get_load_balancer_details(self, load_balance_obj): data['compartment_name'] = lb['compartment_name'] data['compartment_id'] = lb['compartment_id'] data['subnet_ids'] = lb['subnet_ids'] + data['defined_tags'] = lb['defined_tags'] + data['freeform_tags'] = lb['freeform_tags'] # subnets datasub = [] diff --git a/examples/showoci/showoci_service.py b/examples/showoci/showoci_service.py index 86a7dab0af..35a888b684 100755 --- a/examples/showoci/showoci_service.py +++ b/examples/showoci/showoci_service.py @@ -3478,7 +3478,9 @@ def __load_core_compute_instances(self, compute, compartments): 'image': "Not Found", 'image_os': "Oracle Linux", 'agent_is_management_disabled ': "", - 'agent_is_monitoring_disabled': "" + 'agent_is_monitoring_disabled': "", + 'metadata': arr.metadata, + 'extended_metadata': arr.extended_metadata } # agent_config diff --git a/examples/showoci/step_by_step_installation.md b/examples/showoci/step_by_step_installation.md old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/CHANGELOG.rst b/examples/usage_reports_to_adw/CHANGELOG.rst index ce5868ba88..3dd57651ca 100755 --- a/examples/usage_reports_to_adw/CHANGELOG.rst +++ b/examples/usage_reports_to_adw/CHANGELOG.rst @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `_. +===================== +20.11.03 - 2020-11-03 +===================== +* Added functionality for faster deployment (Step by Step installation amended) +* Added functionality to support Market Place Image with automatic deployment +* Changed shell scripts to support credential at file config.user + ===================== 20.10.27 - 2020-10.27 ===================== diff --git a/examples/usage_reports_to_adw/img/Image_01.png b/examples/usage_reports_to_adw/img/Image_01.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_02.png b/examples/usage_reports_to_adw/img/Image_02.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_03.png b/examples/usage_reports_to_adw/img/Image_03.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_04.png b/examples/usage_reports_to_adw/img/Image_04.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_05.png b/examples/usage_reports_to_adw/img/Image_05.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_06.png b/examples/usage_reports_to_adw/img/Image_06.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_07.png b/examples/usage_reports_to_adw/img/Image_07.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_08.png b/examples/usage_reports_to_adw/img/Image_08.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_09.png b/examples/usage_reports_to_adw/img/Image_09.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_10.png b/examples/usage_reports_to_adw/img/Image_10.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_11.png b/examples/usage_reports_to_adw/img/Image_11.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_12.png b/examples/usage_reports_to_adw/img/Image_12.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_13.png b/examples/usage_reports_to_adw/img/Image_13.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_14.png b/examples/usage_reports_to_adw/img/Image_14.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_15.png b/examples/usage_reports_to_adw/img/Image_15.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_16.png b/examples/usage_reports_to_adw/img/Image_16.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_17.png b/examples/usage_reports_to_adw/img/Image_17.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_18.png b/examples/usage_reports_to_adw/img/Image_18.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_19.png b/examples/usage_reports_to_adw/img/Image_19.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_20.png b/examples/usage_reports_to_adw/img/Image_20.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_21.png b/examples/usage_reports_to_adw/img/Image_21.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_22.png b/examples/usage_reports_to_adw/img/Image_22.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_23.png b/examples/usage_reports_to_adw/img/Image_23.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_24.png b/examples/usage_reports_to_adw/img/Image_24.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_25.png b/examples/usage_reports_to_adw/img/Image_25.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_26.png b/examples/usage_reports_to_adw/img/Image_26.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_27.png b/examples/usage_reports_to_adw/img/Image_27.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_28.png b/examples/usage_reports_to_adw/img/Image_28.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_29.png b/examples/usage_reports_to_adw/img/Image_29.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_30.png b/examples/usage_reports_to_adw/img/Image_30.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_31.png b/examples/usage_reports_to_adw/img/Image_31.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/Image_32.png b/examples/usage_reports_to_adw/img/Image_32.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/report_01.png b/examples/usage_reports_to_adw/img/report_01.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/report_02.png b/examples/usage_reports_to_adw/img/report_02.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/report_03.png b/examples/usage_reports_to_adw/img/report_03.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/report_04.png b/examples/usage_reports_to_adw/img/report_04.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/report_05.png b/examples/usage_reports_to_adw/img/report_05.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/screen_1.png b/examples/usage_reports_to_adw/img/screen_1.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/screen_2.png b/examples/usage_reports_to_adw/img/screen_2.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/screen_3.png b/examples/usage_reports_to_adw/img/screen_3.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/screen_4.png b/examples/usage_reports_to_adw/img/screen_4.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/screen_5.png b/examples/usage_reports_to_adw/img/screen_5.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/screen_6.png b/examples/usage_reports_to_adw/img/screen_6.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/screen_7.png b/examples/usage_reports_to_adw/img/screen_7.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/screen_8.png b/examples/usage_reports_to_adw/img/screen_8.png old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/img/stack_1.png b/examples/usage_reports_to_adw/img/stack_1.png new file mode 100755 index 0000000000..af1dff3f40 Binary files /dev/null and b/examples/usage_reports_to_adw/img/stack_1.png differ diff --git a/examples/usage_reports_to_adw/img/stack_2.png b/examples/usage_reports_to_adw/img/stack_2.png new file mode 100755 index 0000000000..aa79002977 Binary files /dev/null and b/examples/usage_reports_to_adw/img/stack_2.png differ diff --git a/examples/usage_reports_to_adw/img/stack_3.png b/examples/usage_reports_to_adw/img/stack_3.png new file mode 100755 index 0000000000..03e5c474cb Binary files /dev/null and b/examples/usage_reports_to_adw/img/stack_3.png differ diff --git a/examples/usage_reports_to_adw/img/stack_4.png b/examples/usage_reports_to_adw/img/stack_4.png new file mode 100755 index 0000000000..9e1995bd94 Binary files /dev/null and b/examples/usage_reports_to_adw/img/stack_4.png differ diff --git a/examples/usage_reports_to_adw/img/stack_5.png b/examples/usage_reports_to_adw/img/stack_5.png new file mode 100755 index 0000000000..ac5cf038f0 Binary files /dev/null and b/examples/usage_reports_to_adw/img/stack_5.png differ diff --git a/examples/usage_reports_to_adw/img/stack_6.png b/examples/usage_reports_to_adw/img/stack_6.png new file mode 100755 index 0000000000..5bbe7d0f9d Binary files /dev/null and b/examples/usage_reports_to_adw/img/stack_6.png differ diff --git a/examples/usage_reports_to_adw/setup/check_connectivity.py b/examples/usage_reports_to_adw/setup/check_connectivity.py new file mode 100755 index 0000000000..d09ffbb72a --- /dev/null +++ b/examples/usage_reports_to_adw/setup/check_connectivity.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +########################################################################## +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. +# +# check_connectivity.py - to check if policies granted the proper roles +# @author: Adi Zohar +# +# Supports Python 3 and above +# +# coding: utf-8 +########################################################################## +import oci +import requests + +# Get Instance Principles Signer +signer = oci.auth.signers.InstancePrincipalsSecurityTokenSigner() +config = {'region': signer.region, 'tenancy': signer.tenancy_id} +tenancy_id = signer.tenancy_id + +try: + print("\n Connecting to Identity Service...") + identity = oci.identity.IdentityClient(config, signer=signer) + print(" Okay.") + + print("\n Check Tenancy Details Access...") + tenancy = identity.get_tenancy(tenancy_id).data + print(" Okay.") + + print("\n Check Compartment List Access...") + all_compartments = identity.list_compartments(tenancy_id, compartment_id_in_subtree=True).data + print(" Okay...") + + print("\n Check Access to Cost and Usage Object Storage...") + object_storage = oci.object_storage.ObjectStorageClient(config, signer=signer) + objects = object_storage.list_objects("bling", tenancy_id, fields="timeCreated,size").data + print(" Okay.") + + print("\n Check Access to OCI Public Rates URL (Required Internet Access)...") + api_url = "https://itra.oraclecloud.com/itas/.anon/myservices/api/v1/products?partNumber=B88206" + resp = requests.get(api_url, headers={'X-Oracle-Accept-CurrencyCode': 'USD'}) + print(" Okay.") + + print("\n Check Completed Successfully.") + print(" Tenant Name : " + str(tenancy.name)) + print(" Tenant Id : " + tenancy.id) + print("") + +except oci.exceptions.ServiceError as e: + print("Error oci.exceptions.ServiceError") + print(e) +except oci.exceptions.RequestException as e: + print("Error oci.exceptions.RequestException") + print(e) +except Exception as e: + print("Error Exception") + print(e) diff --git a/examples/usage_reports_to_adw/setup/create_tables.sql b/examples/usage_reports_to_adw/setup/create_tables.sql new file mode 100755 index 0000000000..aca6baa81b --- /dev/null +++ b/examples/usage_reports_to_adw/setup/create_tables.sql @@ -0,0 +1,135 @@ + +------------------------------- +-- OCI_USAGE +------------------------------- +create table OCI_USAGE ( + TENANT_NAME VARCHAR2(100), + TENANT_ID VARCHAR2(100), + FILE_ID VARCHAR2(30), + USAGE_INTERVAL_START DATE, + USAGE_INTERVAL_END DATE, + PRD_SERVICE VARCHAR2(100), + PRD_RESOURCE VARCHAR2(100), + PRD_COMPARTMENT_ID VARCHAR2(100), + PRD_COMPARTMENT_NAME VARCHAR2(100), + PRD_COMPARTMENT_PATH VARCHAR2(1000), + PRD_REGION VARCHAR2(100), + PRD_AVAILABILITY_DOMAIN VARCHAR2(100), + USG_RESOURCE_ID VARCHAR2(1000), + USG_BILLED_QUANTITY NUMBER, + USG_CONSUMED_QUANTITY NUMBER, + USG_CONSUMED_UNITS VARCHAR2(100), + USG_CONSUMED_MEASURE VARCHAR2(100), + IS_CORRECTION VARCHAR2(10), + TAGS_DATA VARCHAR2(4000) +) COMPRESS; + +CREATE INDEX OCI_USAGE_1IX ON OCI_USAGE(TENANT_NAME,USAGE_INTERVAL_START); + +------------------------------- +-- OCI_USAGE_TAG_KEYS +------------------------------- +CREATE TABLE OCI_USAGE_TAG_KEYS ( + TENANT_NAME VARCHAR2(100), + TAG_KEY VARCHAR2(100), + CONSTRAINT OCI_USAGE_TAG_KEYS_PK PRIMARY KEY(TENANT_NAME,TAG_KEY) +); + +------------------------------- +-- OCI_USAGE_TAG_KEYS +------------------------------- +CREATE TABLE OCI_USAGE_STATS ( + TENANT_NAME VARCHAR2(100), + FILE_ID VARCHAR2(30), + USAGE_INTERVAL_START DATE, + NUM_ROWS NUMBER, + UPDATE_DATE DATE, + AGENT_VERSION VARCHAR2(30), + CONSTRAINT OCI_USAGE_STATS_PK PRIMARY KEY (TENANT_NAME,FILE_ID,USAGE_INTERVAL_START) +); + +------------------------------- +-- OCI_COST +------------------------------- +create table OCI_COST ( + TENANT_NAME VARCHAR2(100), + TENANT_ID VARCHAR2(100), + FILE_ID VARCHAR2(30), + USAGE_INTERVAL_START DATE, + USAGE_INTERVAL_END DATE, + PRD_SERVICE VARCHAR2(100), + PRD_RESOURCE VARCHAR2(100), + PRD_COMPARTMENT_ID VARCHAR2(100), + PRD_COMPARTMENT_NAME VARCHAR2(100), + PRD_COMPARTMENT_PATH VARCHAR2(1000), + PRD_REGION VARCHAR2(100), + PRD_AVAILABILITY_DOMAIN VARCHAR2(100), + USG_RESOURCE_ID VARCHAR2(1000), + USG_BILLED_QUANTITY NUMBER, + USG_BILLED_QUANTITY_OVERAGE NUMBER, + COST_SUBSCRIPTION_ID NUMBER, + COST_PRODUCT_SKU VARCHAR2(10), + PRD_DESCRIPTION VARCHAR2(1000), + COST_UNIT_PRICE NUMBER, + COST_UNIT_PRICE_OVERAGE NUMBER, + COST_MY_COST NUMBER, + COST_MY_COST_OVERAGE NUMBER, + COST_CURRENCY_CODE VARCHAR2(10), + COST_BILLING_UNIT VARCHAR2(1000), + COST_OVERAGE_FLAG VARCHAR2(10), + IS_CORRECTION VARCHAR2(10), + TAGS_DATA VARCHAR2(4000) +) COMPRESS; + +CREATE INDEX OCI_COST_1IX ON OCI_COST(TENANT_NAME,USAGE_INTERVAL_START); + +------------------------------- +-- OCI_COST_TAG_KEYS +------------------------------- +CREATE TABLE OCI_COST_TAG_KEYS (TENANT_NAME VARCHAR2(100), TAG_KEY VARCHAR2(100), + CONSTRAINT OCI_COST_TAG_KEYS_PK PRIMARY KEY(TENANT_NAME,TAG_KEY) +); + +------------------------------- +-- OCI_COST_STATS +------------------------------- +CREATE TABLE OCI_COST_STATS ( + TENANT_NAME VARCHAR2(100), + FILE_ID VARCHAR2(30), + USAGE_INTERVAL_START DATE, + NUM_ROWS NUMBER, + COST_MY_COST NUMBER, + COST_MY_COST_OVERAGE NUMBER, + COST_CURRENCY_CODE VARCHAR2(30), + UPDATE_DATE DATE, + AGENT_VERSION VARCHAR2(30), + CONSTRAINT OCI_COST_STATS_PK PRIMARY KEY (TENANT_NAME,FILE_ID,USAGE_INTERVAL_START) +); + +------------------------------- +-- OCI_COST_REFERENCE +------------------------------- +CREATE TABLE OCI_COST_REFERENCE ( + TENANT_NAME VARCHAR2(100), + REF_TYPE VARCHAR2(100), + REF_NAME VARCHAR2(1000), + CONSTRAINT OCI_REFERENCE_PK PRIMARY KEY (TENANT_NAME,REF_TYPE,REF_NAME) +) ; + +------------------------------- +-- OCI_PRICE_LIST +------------------------------- +create table OCI_PRICE_LIST ( + TENANT_NAME VARCHAR2(100), + TENANT_ID VARCHAR2(100), + COST_PRODUCT_SKU VARCHAR2(10), + PRD_DESCRIPTION VARCHAR2(1000), + COST_CURRENCY_CODE VARCHAR2(10), + COST_UNIT_PRICE NUMBER, + COST_LAST_UPDATE DATE, + RATE_DESCRIPTION VARCHAR2(1000), + RATE_PAYGO_PRICE NUMBER, + RATE_MONTHLY_FLEX_PRICE NUMBER, + RATE_UPDATE_DATE DATE, + CONSTRAINT OCI_PRICE_LIST_PK PRIMARY KEY (TENANT_NAME,TENANT_ID,COST_PRODUCT_SKU) +); diff --git a/examples/usage_reports_to_adw/setup/enable_apex.sql b/examples/usage_reports_to_adw/setup/enable_apex.sql new file mode 100755 index 0000000000..6c9eaa04dd --- /dev/null +++ b/examples/usage_reports_to_adw/setup/enable_apex.sql @@ -0,0 +1,48 @@ + +--------------------------------------------------- +-- APEX Create user and import app +--------------------------------------------------- + +begin + apex_util.set_workspace(p_workspace => 'USAGE'); + apex_util.create_user( + p_user_name => 'USAGE', + p_web_password => '&pass.', + p_developer_privs => 'ADMIN:CREATE:DATA_LOADER:EDIT:HELP:MONITOR:SQL', + p_email_address => 'usage@example.com', + p_default_schema => 'USAGE', + p_change_password_on_first_use => 'N' ); +end; +/ +prompt Remove Application 100 +begin + apex_util.set_workspace(p_workspace => 'USAGE'); + wwv_flow_api.remove_flow(100); +end; +/ + +prompt Install Application 100 +declare + c_workspace constant apex_workspaces.workspace%type := 'USAGE'; + c_app_id constant apex_applications.application_id%type := 100; + c_app_alias constant apex_applications.alias%type := 'USAGE2ADW'; + + l_workspace_id apex_workspaces.workspace_id%type; +begin + apex_application_install.clear_all; + + select workspace_id into l_workspace_id from apex_workspaces where workspace = 'USAGE'; + + apex_application_install.set_workspace_id(l_workspace_id); + apex_application_install.set_application_id(c_app_id); + apex_application_install.set_application_alias(c_app_alias); + apex_application_install.generate_offset; +end; +/ + +----------------------------- +-- setup the application +----------------------------- +@/home/opc/usage_reports_to_adw/apex_demo_app/usage.demo.apex.sql + + diff --git a/examples/usage_reports_to_adw/setup/setup.crontab.txt b/examples/usage_reports_to_adw/setup/setup.crontab.txt new file mode 100755 index 0000000000..bf09d9af57 --- /dev/null +++ b/examples/usage_reports_to_adw/setup/setup.crontab.txt @@ -0,0 +1,5 @@ +############################################################################### +# Crontab to run every 6 hours +############################################################################### +0 */6 * * * timeout 6h /home/opc/usage_reports_to_adw/shell_scripts/run_single_daily_usage2adw.sh > /home/opc/usage_reports_to_adw/run_single_daily_usage2adw_crontab_run.txt 2>&1 + diff --git a/examples/usage_reports_to_adw/setup/setup_credentials.sh b/examples/usage_reports_to_adw/setup/setup_credentials.sh new file mode 100755 index 0000000000..0ef0a1fedc --- /dev/null +++ b/examples/usage_reports_to_adw/setup/setup_credentials.sh @@ -0,0 +1,48 @@ +#!/bin/bash +############################################################################################################################# +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. +# +# Initial Setup credentials +# Written by Adi Zohar, October 2020 +# Git Location = https://github.com/oracle/oci-python-sdk/tree/master/examples/usage_reports_to_adw +# +# Version 2020-10-22 +# +######################################################################################################################### + +export APPDIR=/home/opc/usage_reports_to_adw +export CREDFILE=$APPDIR/config.user +export LOG=/home/opc/setup_credentials.log +rm -f $LOG +echo "##################################################" | tee -a $LOG +echo "# Start process at `date`" | tee -a $LOG +echo "##################################################" | tee -a $LOG + +########################################### +# Request Application Credential +########################################### +echo "" | tee -a $LOG +echo "########################################################################" | tee -a $LOG +echo "# 5. Application Credentials, stored at $CREDFILE" | tee -a $LOG +echo "########################################################################" | tee -a $LOG +printf "Please Enter Database Name : "; read DATABASE_NAME +printf "Please Enter ADB Admin Password: "; read DATABASE_ADMIN +printf "Please Enter ADB Application Password (Min 12 Chars, One Upper, One Lower, One Digits): "; read DATABASE_PASS +printf "Please Enter Extract Start Date (Format YYYY-MM i.e. 2020-10): "; read EXTRACT_DATE + +echo "DATABASE_USER=USAGE" > $CREDFILE +echo "DATABASE_NAME=${DATABASE_NAME}_low" >> $CREDFILE +echo "DATABASE_PASS=${DATABASE_PASS}" >> $CREDFILE +echo "DATABASE_ADMIN=${DATABASE_ADMIN}" >> $CREDFILE +echo "EXTRACT_DATE=${EXTRACT_DATE}" >> $CREDFILE +echo "" | tee -a $LOG +echo "Below Data written to $CREDFILE:" | tee -a $LOG +cat $CREDFILE | tee -a $LOG +echo "" | tee -a $LOG +echo "Setup Packages Completed." | tee -a $LOG +echo "" | tee -a $LOG +echo "########################################################################" | tee -a $LOG +echo "# Please download the database wallet to /home/opc/wallet.zip " | tee -a $LOG +echo "# Then execute $APPDIR/setup/setup_usage2adw.sh" | tee -a $LOG +echo "########################################################################" | tee -a $LOG diff --git a/examples/usage_reports_to_adw/setup/setup_packages.sh b/examples/usage_reports_to_adw/setup/setup_packages.sh new file mode 100755 index 0000000000..60613cd25a --- /dev/null +++ b/examples/usage_reports_to_adw/setup/setup_packages.sh @@ -0,0 +1,73 @@ +#!/bin/bash +############################################################################################################################# +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. +# +# Initial Setup unix Packages +# Written by Adi Zohar, October 2020 +# Git Location = https://github.com/oracle/oci-python-sdk/tree/master/examples/usage_reports_to_adw +# +# Version 2020-10-22 +# +######################################################################################################################### + +export APPDIR=/home/opc/usage_reports_to_adw +export CREDFILE=$APPDIR/config.user +export LOG=/home/opc/setup_packages.log +rm -f $LOG +echo "##################################################" | tee -a $LOG +echo "# Start process at `date`" | tee -a $LOG +echo "##################################################" | tee -a $LOG + +########################################### +# Install Python3, git and python packages +########################################### +echo "" | tee -a $LOG +echo "########################################################################" | tee -a $LOG +echo "# 1. Install Python3, Git and Python OCI Packages, Can take a moment." | tee -a $LOG +echo "########################################################################" | tee -a $LOG +sudo yum install -y python3 git | tee -a $LOG +sudo pip3 install oci oci-cli cx_Oracle requests | tee -a $LOG +echo "Completed." | tee -a $LOG + +########################################### +# Install Oracle Instant Client +########################################### +echo "" | tee -a $LOG +echo "########################################################################" | tee -a $LOG +echo "# 2. Install Oracle Instant Client." | tee -a $LOG +echo "########################################################################" | tee -a $LOG +sudo yum install -y oracle-release-el7 | tee -a $LOG +sudo yum install -y oracle-instantclient19.8-basic.x86_64 oracle-instantclient19.8-sqlplus.x86_64 | tee -a $LOG +echo "Completed." | tee -a $LOG + +########################################### +# Setup .bashrc profile +########################################### +echo "" | tee -a $LOG +echo "########################################################################" | tee -a $LOG +echo "# 3. Setup .bashrc env variables." | tee -a $LOG +echo "########################################################################" | tee -a $LOG +echo "export CLIENT_HOME=/usr/lib/oracle/19.8/client64" >>$HOME/.bashrc +echo "export LD_LIBRARY_PATH=$CLIENT_HOME/lib" >>$HOME/.bashrc +echo "export PATH=$PATH:$CLIENT_HOME/bin" >>$HOME/.bashrc +echo "export TNS_ADMIN=$HOME/ADWCUSG" >>$HOME/.bashrc +echo "export PYTHONUNBUFFERED=TRUE" >>$HOME/.bashrc +echo "Completed." | tee -a $LOG + +########################################### +# Clone OCI Python SDK repo +########################################### +echo "" | tee -a $LOG +echo "########################################################################" | tee -a $LOG +echo "# 4. Clone OCI Python SDK Git." | tee -a $LOG +echo "########################################################################" | tee -a $LOG +git clone https://github.com/oracle/oci-python-sdk | tee -a $LOG +ln -s /home/opc/oci-python-sdk/examples/usage_reports_to_adw . +chmod +x /home/opc/usage_reports_to_adw/setup/*.sh +chmod +x /home/opc/usage_reports_to_adw/shell_scripts/*.sh +echo "Completed." | tee -a $LOG + +echo "##################################################" | tee -a $LOG +echo "# End process at `date`" | tee -a $LOG +echo "##################################################" | tee -a $LOG diff --git a/examples/usage_reports_to_adw/setup/setup_upgrade_usage2adw.sh b/examples/usage_reports_to_adw/setup/setup_upgrade_usage2adw.sh new file mode 100755 index 0000000000..761116de04 --- /dev/null +++ b/examples/usage_reports_to_adw/setup/setup_upgrade_usage2adw.sh @@ -0,0 +1,169 @@ +#!/bin/bash +############################################################################################################################# +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. +# +# Setup Upgrade for usage2adw +# Written by Adi Zohar, October 2020 +# Git Location = https://github.com/oracle/oci-python-sdk/tree/master/examples/usage_reports_to_adw +# +# If script fail, please add the policies and re-run +# +# Version 2020-10-22 +# +######################################################################################################################### + +################################################### +# Check file usage2adw.py location +################################################### +echo "##################################################" | tee -a $LOG +echo "# Upgrade usage2adw" | tee -a $LOG +echo "##################################################" | tee -a $LOG +cd /home/opc +echo "Chekcing file usage2adw.py location before upgrade" +if [ -f "/home/opc/usage_reports_to_adw/usage2adw.py" ]; then + echo " File usage2adw.py exist in app - /home/opc/usage_reports_to_adw/usage2adw.py " +elif [ -f "/home/opc/oci-python-sdk/examples/usage_reports_to_adw/usage2adw.py" ]; then + echo " File usage2adw.py exist in oci-python-sdk location, /home/opc/oci-python-sdk/examples/usage_reports_to_adw/usage2adw.py" + echo " Creating Symbolic Link: ln -s /home/opc/oci-python-sdk/examples/usage_reports_to_adw ." + ln -s /home/opc/oci-python-sdk/examples/usage_reports_to_adw . +else + echo " File usage2adw.py could not find, cannot upgrade, abort " + exit 1 +fi + +################################################### +# Check if to upgrade +################################################### +echo "" +echo "Upgrade usage2adw will upgrade the below:" +echo "1. usage2adw.py" +echo "2. APEX Application - All additional users will be removed" +printf "Do you want to continue (y/n) ? "; read ANSWER + +if [ "$ANSWER" = 'y' ] +then + echo "" +else + exit 0 +fi + +################################################### +# Start process +################################################### +source ~/.bashrc >/dev/null + +export APPDIR=/home/opc/usage_reports_to_adw +export CREDFILE=$APPDIR/config.user +export LOG=/home/opc/upgrade.log +export LOGDIR=$APPDIR/setup/log +export GIT=https://raw.githubusercontent.com/oracle/oci-python-sdk/master/examples/usage_reports_to_adw + +cd $APPDIR +mkdir -p $LOGDIR +rm -f $LOG + +echo "##################################################" | tee -a $LOG +echo "# Start process at `date`" | tee -a $LOG +echo "##################################################" | tee -a $LOG +echo "# Log = $LOG " +echo "" +echo "" | tee -a $LOG +echo "1. Check if Credential File Exist - $CREDFILE" | tee -a $LOG + +if [ -f "$CREDFILE" ]; then + echo " File exists." | tee -a $LOG +else + echo " File does not exist, Please provide information below:" tee -a $LOG + printf " Please Enter Database Name : "; read DATABASE_NAME + printf " Please Enter ADB Admin Password: "; read DATABASE_ADMIN + printf " Please Enter ADB App Password : "; read DATABASE_PASS + + echo "DATABASE_USER=USAGE" > $CREDFILE + echo "DATABASE_NAME=${DATABASE_NAME}_low" >> $CREDFILE + echo "DATABASE_PASS=${DATABASE_PASS}" >> $CREDFILE + echo "DATABASE_ADMIN=${DATABASE_ADMIN}" >> $CREDFILE + echo "EXTRACT_DATE=2020-08" >> $CREDFILE + echo "File Created." | tee -a $LOG +fi + +########################################### +# Read App info from file +########################################### +echo "2. Read App info from file" | tee -a $LOG +db_app_password=`grep "^DATABASE_PASS" $CREDFILE | awk -F= '{ print $2 }'` +db_db_name=`grep "^DATABASE_NAME" $CREDFILE | awk -F= '{ print $2 }'` + +########################################### +# Download files from github +########################################### +echo "" | tee -a $LOG +echo "3. Download Files from github - $GIT " | tee -a $LOG +echo " Download usage2adw.py" | tee -a $LOG +wget ${GIT}/usage2adw.py -O ${APPDIR}/usage2adw.py -o $LOGDIR/usage2adw.py.download.log| tee -a $LOG +if [ $? -eq 0 ]; then + echo " usage2adw.py downloaded successfully" | tee -a $LOG +else + echo " Error Downloading usage2adw.py, Abort, log=$LOGDIR/usage2adw.py.download.log" | tee -a $LOG + exit 1 +fi + +echo " Download usage.demo.apex.sql" | tee -a $LOG +wget ${GIT}/apex_demo_app/usage.demo.apex.sql -O ${APPDIR}/apex_demo_app/usage.demo.apex.sql -o $LOGDIR/usage.demo.apex.sql.download.log| tee -a $LOG +if [ $? -eq 0 ]; then + echo " usage.demo.apex.sql downloaded successfully" | tee -a $LOG +else + echo " Error Downloading usage.demo.apex.sql, Abort, log=$LOGDIR/usage.demo.apex.sql.download.log" | tee -a $LOG + exit 1 +fi + +echo " Download enable_apex.sql" | tee -a $LOG +wget ${GIT}/setup/enable_apex.sql -O ${APPDIR}/setup/enable_apex.sql -o $LOGDIR/enable_apex.sql.download.log| tee -a $LOG +if [ $? -eq 0 ]; then + echo " enable_apex.sql downloaded successfully" | tee -a $LOG +else + echo " Error Downloading enable_apex.sql, Abort, log=$LOGDIR/enable_apex.sql.download.log" | tee -a $LOG + exit 1 +fi + +########################################### +# Download files from github +########################################### +echo "" | tee -a $LOG +echo "4. List files." | tee -a $LOG +ls -lrt ${APPDIR}/usage2adw.py ${APPDIR}/apex_demo_app/usage.demo.apex.sql ${APPDIR}/setup/enable_apex.sql | tee -a $LOG + +########################################### +# Delete APEX App and import New App +########################################### +echo "" | tee -a $LOG +slog=$LOGDIR/upgrade_apex_application.log +echo "5. Upgrade APEX application" | tee -a $LOG +echo " sqlplus USAGE/${db_app_password}@${db_db_name} @$APPDIR/setup/enable_apex.sql" | tee -a $LOG +echo "set echo on serveroutput on time on lines 199 trimsp on pages 1000 verify off +spool $slog +define pass=$db_app_password +@${APPDIR}/setup/enable_apex.sql +spool off +" | sqlplus -s USAGE/${db_app_password}@${db_db_name} >> $LOG + +if (( `egrep 'ORA-|SP2-' $slog | egrep -v 'ORA-00955|ORA-00001|ORA-06512' | wc -l` > 0 )); then + egrep 'ORA-|SP2-' $slog | egrep -v 'ORA-00955|ORA-00001|ORA-06512' + echo " Error upgrading APEX APP, please check log $slog, aborting." + exit 1 +else + echo " Okay." | tee -a $LOG +fi + +########################################### +# Completed +########################################### +echo "" | tee -a $LOG +echo "##################################################" | tee -a $LOG +echo "# Upgrade Completed at `date`" | tee -a $LOG +echo "##################################################" | tee -a $LOG +echo "Please run the application to upgrade schema:" | tee -a $LOG +echo "cd $APPDIR" | tee -a $LOG +echo "python3 usage2adw.py -ip -du USAGE -dp ${db_app_password} -dn ${db_db_name}" | tee -a $LOG +echo "" + diff --git a/examples/usage_reports_to_adw/setup/setup_usage2adw.sh b/examples/usage_reports_to_adw/setup/setup_usage2adw.sh new file mode 100755 index 0000000000..82804ccf36 --- /dev/null +++ b/examples/usage_reports_to_adw/setup/setup_usage2adw.sh @@ -0,0 +1,176 @@ +#!/bin/bash +############################################################################################################################# +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. +# +# Setup for usage2adw +# Written by Adi Zohar, October 2020 +# Git Location = https://github.com/oracle/oci-python-sdk/tree/master/examples/usage_reports_to_adw +# +# If script fail, please add the policies and re-run +# +# Version 2020-10-22 +# +######################################################################################################################### +# Required Instant Principle Policy which includes the below: +# +# 1. Create new Dynamic Group : UsageDownloadGroup +# Obtain Compute OCID and add rule - ALL {instance.id = 'ocid1.instance.oc1.xxxxxxxxxx'} +# or by compartment +# Obtain Compartment OCID and add rule - ALL {instance.compartment.id = 'ocid1.compartment.oc1.xxxxxxxxxx'} +# +# 2. Create new Policy: UsageDownloadPolicy with Statements: +# define tenancy usage-report as ocid1.tenancy.oc1..aaaaaaaaned4fkpkisbwjlr56u7cj63lf3wffbilvqknstgtvzub7vhqkggq +# endorse dynamic-group UsageDownloadGroup to read objects in tenancy usage-report +# Allow dynamic-group UsageDownloadGroup to inspect compartments in tenancy +# Allow dynamic-group UsageDownloadGroup to inspect tenancies in tenancy +######################################################################################################################### + +source ~/.bashrc >/dev/null + +export APPDIR=/home/opc/usage_reports_to_adw +export CREDFILE=$APPDIR/config.user +export LOG=/home/opc/setup.log +export LOGDIR=$APPDIR/setup/log +export SCRIPT=$APPDIR/setup/setup_usage2adw.sh +export PYTHONUNBUFFERED=TRUE +cd $APPDIR/setup +mkdir -p $LOGDIR +rm -f $LOG +echo "##################################################" | tee -a $LOG +echo "# Start process at `date`" | tee -a $LOG +echo "##################################################" | tee -a $LOG + +########################################### +# Create the adw properties file +########################################### +echo "" | tee -a $LOG +echo "1. Read Variables from config.user file." | tee -a $LOG + +db_db_name=`grep "^DATABASE_NAME" $CREDFILE | awk -F= '{ print $2 }'` +db_app_password=`grep "^DATABASE_PASS" $CREDFILE | awk -F= '{ print $2 }'` +db_admin_password=`grep "^DATABASE_ADMIN" $CREDFILE| awk -F= '{ print $2 }'` +extract_from_date=`grep "^EXTRACT_DATE" $CREDFILE | awk -F= '{ print $2 }'` + +########################################### +# Extract Wallet from wallet.zip +########################################### +mkdir -p /home/opc/ADWCUSG +echo "" | tee -a $LOG +echo "2. Extract database wallet." | tee -a $LOG +unzip -o $HOME/wallet.zip -d /home/opc/ADWCUSG +if [ $? -eq 0 ]; then + echo " Database Wallet extracted successfully" | tee -a $LOG +else + echo " Error Extracting, Abort" | tee -a $LOG + exit 1 +fi +rm -f wallet.zip wallet_file + +########################################### +# Fixed sqlnet.ora parameter +########################################### +echo "" | tee -a $LOG +echo "3. Fixing sqlnet.ora directory parameter" | tee -a $LOG +sed -i "s#?/network/admin#$HOME/ADWCUSG#" ~/ADWCUSG/sqlnet.ora +if [ $? -eq 0 ]; then + echo " Done." | tee -a $LOG +else + echo " Error fixing sqlnet.ora, Abort" | tee -a $LOG + exit 1 +fi + +########################################### +# Check Oci Connectivity +########################################### +echo "" | tee -a $LOG +echo "4. Checking OCI Connectivity using instance principles..." | tee -a $LOG +echo " Executed: python3 check_connectivity.sh" | tee -a $LOG +slog=$LOGDIR/check_connectivity.log +rm -f $slog +python3 $APPDIR/setup/check_connectivity.py | tee -a $slog | tee -a $LOG +if (( `grep Error $slog | wc -l` > 0 )); then + echo " Error querying OCI, please check the log $slog" | tee -a $LOG + echo " Please check the documentation to have the dynamic group and policy correctted" | tee -a $LOG + echo " Once fixed you can rerun the script $SCRIPT" | tee -a $LOG + echo " Abort" | tee -a $LOG + exit 1 +else + echo " Okay." | tee -a $LOG +fi + +########################################### +# create application schema and enable APEX +########################################### +echo "" | tee -a $LOG +slog=$LOGDIR/db_creation_user.log +echo "5. Creating USAGE user on ADWC instance and enable APEX Workspace" | tee -a $LOG +echo " commands executed:" | tee -a $LOG +echo " sqlplus ADMIN/${db_admin_password}@${db_db_name}" | tee -a $LOG +echo " create user usage identified by ${db_app_password};" | tee -a $LOG +echo " grant create dimension, connect, resource, dwrole, unlimited tablespace to usage;" | tee -a $LOG +echo " exec apex_instance_admin.add_workspace(p_workspace => 'USAGE', p_primary_schema => 'USAGE');" | tee -a $LOG +echo "set lines 199 trimsp on pages 0 feed on +spool $slog +create user usage identified by ${db_app_password}; +grant create dimension, connect, resource, dwrole, unlimited tablespace to usage; +exec apex_instance_admin.add_workspace(p_workspace => 'USAGE', p_primary_schema => 'USAGE'); +" | sqlplus -s ADMIN/${db_admin_password}@${db_db_name} >> $LOG + +if (( `grep ORA- $slog | egrep -v 'ORA-01920|ORA-20987|06512'| wc -l` > 0 )); then + echo " Error creating USAGE user, please check log $slog, aborting." + exit 1 +else + echo " Okay." | tee -a $LOG +fi + +########################################### +# create tables and import APEX App +########################################### +echo "" | tee -a $LOG +slog=$LOGDIR/create_table_enable_apex.log +echo "6. Create USAGE Tables and Import APEX application" | tee -a $LOG +echo " sqlplus USAGE/${db_app_password}@${db_db_name} @$APPDIR/setup/create_tables.sql" | tee -a $LOG +echo " sqlplus USAGE/${db_app_password}@${db_db_name} @$APPDIR/setup/enable_apex.sql" | tee -a $LOG +echo "set echo on serveroutput on time on lines 199 trimsp on pages 1000 verify off +spool $slog +define pass=${db_app_password} +@$APPDIR/setup/create_tables +@$APPDIR/setup/enable_apex +spool off +" | sqlplus -s USAGE/${db_app_password}@${db_db_name} >> $LOG + +if (( `egrep 'ORA-|SP2-' $slog | egrep -v 'ORA-00955|ORA-00001|ORA-06512' | wc -l` > 0 )); then + egrep 'ORA-|SP2-' $slog | egrep -v 'ORA-00955|ORA-00001|ORA-06512' + echo " Error creating USAGE tables, please check log $slog, aborting." + exit 1 +else + echo " Okay." | tee -a $LOG +fi + +########################################### +# Setup Crontab +########################################### +echo "" | tee -a $LOG +echo "7. Setup Crontab to run every 6 hours" | tee -a $LOG +echo "Executed: crontab $APPDIR/setup/setup.crontab.txt" | tee -a $LOG +crontab $APPDIR/setup/setup.crontab.txt + +########################################### +# run initial usage2adw +########################################### +echo "" | tee -a $LOG +echo "###############################################################" | tee -a $LOG +echo "# Running Initial usage2adw.py extract" | tee -a $LOG +echo "###############################################################" | tee -a $LOG +echo " Command line: " | tee -a $LOG +echo " python3 usage2adw.py -ip -du USAGE -dp ${db_app_password} -dn ${db_db_name} -d ${extract_from_date}" | tee -a $LOG +echo "" | tee -a $LOG | tee -a $LOG +cd $APPDIR +python3 usage2adw.py -ip -du USAGE -dp ${db_app_password} -dn ${db_db_name} -d ${extract_from_date} | tee -a $LOG +echo "" | tee -a $LOG + +echo "############################################################################################" | tee -a $LOG +echo "# If process complete successfuly, please continue and login to APEX" | tee -a $LOG +echo "############################################################################################" | tee -a $LOG + diff --git a/examples/usage_reports_to_adw/shell_scripts/run_daily_report.sh b/examples/usage_reports_to_adw/shell_scripts/run_daily_report.sh old mode 100644 new mode 100755 index bf64cb3e96..e0fc0373ff --- a/examples/usage_reports_to_adw/shell_scripts/run_daily_report.sh +++ b/examples/usage_reports_to_adw/shell_scripts/run_daily_report.sh @@ -7,7 +7,7 @@ # Amend variables below and database connectivity # # Crontab set: -# 0 7 * * * timeout 6h /home/opc/oci-python-sdk/examples/usage_reports_to_adw/shell_scripts > /home/opc/oci-python-sdk/examples/usage_reports_to_adw/shell_scripts/run_daily_report_crontab_run.txt 2>&1 +# 0 7 * * * timeout 6h /home/opc/usage_reports_to_adw/shell_scripts/run_daily_report.sh > /home/opc/usage_reports_to_adw/run_daily_report_crontab_run.txt 2>&1 ############################################################################################################################# # Env Variables based on yum instant client export CLIENT_HOME=/usr/lib/oracle/19.6/client64 @@ -17,6 +17,8 @@ export PATH=$PATH:$CLIENT_HOME/bin # App dir export TNS_ADMIN=$HOME/ADWCUSG export APPDIR=$HOME/oci-python-sdk/examples/usage_reports_to_adw +export CREDFILE=$APPDIR/config.user +cd $APPDIR # Mail Info export DATE_PRINT="`date '+%d-%b-%Y'`" @@ -26,9 +28,9 @@ export MAIL_TO="oci.user@oracle.com" export MAIL_SUBJECT="Cost Usage Report $DATE_PRINT" # database info -export DATABASE_USER=usage -export DATABASE_PASS= -export DATABASE_NAME=adwcusg_low +export DATABASE_USER=`grep "^DATABASE_USER" $CREDFILE | awk -F= '{ print $2 }'` +export DATABASE_PASS=`grep "^DATABASE_PASS" $CREDFILE | awk -F= '{ print $2 }'` +export DATABASE_NAME=`grep "^DATABASE_NAME" $CREDFILE | awk -F= '{ print $2 }'` # Fixed variables export DATE=`date '+%Y%m%d_%H%M'` @@ -37,10 +39,10 @@ export OUTPUT_FILE=${REPORT_DIR}/daily_${DATE}.txt mkdir -p ${REPORT_DIR} ################################## -# run report +# run report ################################## echo " -set pages 0 head off feed off lines 799 trimsp on echo off verify off +set pages 0 head off feed off lines 799 trimsp on echo off verify off set define @ col line for a1000 @@ -113,7 +115,7 @@ from case when trunc(greatest(day1,day2,day3,day4,day5,day6,day7,day8,day9,day10)) = trunc(day10) then 'dcbold' else 'dcr' END as day10_class from ( - select + select tenant_name, sum(case when trunc(USAGE_INTERVAL_START) = trunc(sysdate-10) then COST_MY_COST else 0 end) DAY10, sum(case when trunc(USAGE_INTERVAL_START) = trunc(sysdate-9 ) then COST_MY_COST else 0 end) DAY9, @@ -128,7 +130,7 @@ from max(UPDATE_DATE) LAST_LOAD, max(agent_version) AGENT from oci_cost_stats - where + where tenant_name like '%' and USAGE_INTERVAL_START >= trunc(sysdate-11) group by tenant_name @@ -194,7 +196,7 @@ from case when trunc(greatest(m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12)) = trunc(m12) then 'dcbold' else 'dcr' END as m12_class from ( - select + select tenant_name, sum(case when trunc(USAGE_INTERVAL_START,'MM') = add_months(trunc(sysdate,'MM'),-11) then COST_MY_COST else 0 end) M12, sum(case when trunc(USAGE_INTERVAL_START,'MM') = add_months(trunc(sysdate,'MM'),-10) then COST_MY_COST else 0 end) M11, @@ -209,7 +211,7 @@ from sum(case when trunc(USAGE_INTERVAL_START,'MM') = add_months(trunc(sysdate,'MM'), -1) then COST_MY_COST else 0 end) M2, sum(case when trunc(USAGE_INTERVAL_START,'MM') = trunc(sysdate,'MM') then COST_MY_COST else 0 end) M1 from oci_cost_stats - where + where tenant_name like '%' group by tenant_name order by 1 @@ -217,6 +219,50 @@ from ); prompt +prompt

+ +prompt +prompt + +select + ''|| + ''|| + ''|| + '' + as line +from dual +union all +select + ''|| + ' '|| + ' '|| + '' as line +from +( + select + 'Cost Tables and Indexes' object_name, + to_char(sum(bytes/1024/1024/1024),'999,999.99') GB + from + user_segments + where segment_name like '%OCI_COST%' + union all + select + 'Usage Tables and Indexes' object_name, + to_char(sum(bytes/1024/1024/1024),'999,999.99') GB + from + user_segments + where segment_name like '%OCI_USAGE%' + union all + select + 'Total All Objects' object_name, + to_char(sum(bytes/1024/1024/1024),'999,999.99') GB + from + user_segments + where segment_name not like 'BIN%' +); + +prompt
Storage Statistics
AreaGigabyte
'||object_name||' '||gb||'
+ " | sqlplus -s ${DATABASE_USER}/${DATABASE_PASS}@${DATABASE_NAME} > $OUTPUT_FILE # Check for errors @@ -241,3 +287,4 @@ Subject: $MAIL_SUBJECT Content-Type: text/html `cat $OUTPUT_FILE` eomail + diff --git a/examples/usage_reports_to_adw/shell_scripts/run_multi_daily_usage2adw.sh b/examples/usage_reports_to_adw/shell_scripts/run_multi_daily_usage2adw.sh old mode 100644 new mode 100755 index a956fdae79..740e8ab0c7 --- a/examples/usage_reports_to_adw/shell_scripts/run_multi_daily_usage2adw.sh +++ b/examples/usage_reports_to_adw/shell_scripts/run_multi_daily_usage2adw.sh @@ -8,25 +8,28 @@ # Run Multi daily usage load for crontab use # # Amend variables below and database connectivity +# Use .oci/config profiles with user authentications # # Crontab set: -# 0 0 * * * timeout 6h /home/opc/oci-python-sdk/examples/usage_reports_to_adw/shell_scripts/run_multi_daily_usage2adw.sh > /home/opc/oci-python-sdk/examples/usage_reports_to_adw/shell_scripts/run_multi_daily_usage2adw_crontab_run.txt 2>&1 +# 0 0 * * * timeout 6h /home/opc/usage_reports_to_adw/shell_scripts/run_multi_tenants.sh > /home/opc/usage_reports_to_adw/run_multi_tenants_crontab_run.txt 2>&1 ############################################################################################################################# # Env Variables based on yum instant client -export CLIENT_HOME=/usr/lib/oracle/18.3/client64 +export CLIENT_HOME=/usr/lib/oracle/19.8/client64 export LD_LIBRARY_PATH=$CLIENT_HOME/lib export PATH=$PATH:$CLIENT_HOME/bin # App dir export TNS_ADMIN=$HOME/ADWCUSG -export APPDIR=$HOME/oci-python-sdk/examples/usage_reports_to_adw +export APPDIR=$HOME/usage_reports_to_adw +export CREDFILE=$APPDIR/config.user +cd $APPDIR # database info -export DATABASE_USER=usage -export DATABASE_PASS=PaSsw0rd2#_# -export DATABASE_NAME=adwcusg_low -export MIN_DATE=2020-01-01 +export DATABASE_USER=`grep "^DATABASE_USER" $CREDFILE | awk -F= '{ print $2 }'` +export DATABASE_PASS=`grep "^DATABASE_PASS" $CREDFILE | awk -F= '{ print $2 }'` +export DATABASE_NAME=`grep "^DATABASE_NAME" $CREDFILE | awk -F= '{ print $2 }'` +export MIN_DATE=`grep "^EXTRACT_DATE" $CREDFILE | awk -F= '{ print $2 }'` # Fixed variables export DATE=`date '+%Y%m%d_%H%M'` diff --git a/examples/usage_reports_to_adw/shell_scripts/run_single_daily_usage2adw.sh b/examples/usage_reports_to_adw/shell_scripts/run_single_daily_usage2adw.sh old mode 100644 new mode 100755 index b3595245b2..0c390d5fdd --- a/examples/usage_reports_to_adw/shell_scripts/run_single_daily_usage2adw.sh +++ b/examples/usage_reports_to_adw/shell_scripts/run_single_daily_usage2adw.sh @@ -5,28 +5,28 @@ # # Author - Adi Zohar, Feb 28th 2020 # -# Run Single daily usage load for crontab use +# Run Single daily usage load for crontab use or manual execution # -# Amend variables below and database connectivity -# -# Crontab set: -# 0 0 * * * timeout 6h /home/opc/oci-python-sdk/examples/usage_reports_to_adw/shell_scripts/run_single_daily_usage2adw.sh > /home/opc/oci-python-sdk/examples/usage_reports_to_adw/shell_scripts/run_single_daily_usage2adw_crontab_run.txt 2>&1 +# Crontab set to run every 6 hours +# 0 */6 * * * timeout 6h /home/opc/usage_reports_to_adw/shell_scripts/run_single_daily_usage2adw.sh > /home/opc/usage_reports_to_adw/run_single_daily_usage2adw_crontab_run.txt 2>&1 ############################################################################################################################# # Env Variables based on yum instant client -export CLIENT_HOME=/usr/lib/oracle/18.3/client64 +export CLIENT_HOME=/usr/lib/oracle/19.8/client64 export LD_LIBRARY_PATH=$CLIENT_HOME/lib export PATH=$PATH:$CLIENT_HOME/bin # App dir export TNS_ADMIN=$HOME/ADWCUSG -export APPDIR=$HOME/oci-python-sdk/examples/usage_reports_to_adw +export APPDIR=$HOME/usage_reports_to_adw +export CREDFILE=$APPDIR/config.user +cd $APPDIR # database info -export DATABASE_USER=usage -export DATABASE_PASS=PaSsw0rd2#_# -export DATABASE_NAME=adwcusg_low -export MIN_DATE=2020-01-01 +export DATABASE_USER=`grep "^DATABASE_USER" $CREDFILE | awk -F= '{ print $2 }'` +export DATABASE_PASS=`grep "^DATABASE_PASS" $CREDFILE | awk -F= '{ print $2 }'` +export DATABASE_NAME=`grep "^DATABASE_NAME" $CREDFILE | awk -F= '{ print $2 }'` +export MIN_DATE=`grep "^EXTRACT_DATE" $CREDFILE | awk -F= '{ print $2 }'` # Fixed variables export DATE=`date '+%Y%m%d_%H%M'` @@ -35,9 +35,9 @@ mkdir -p ${REPORT_DIR} export OUTPUT_FILE=${REPORT_DIR}/${DATE}.txt # execute using instance principles -echo "Running ... to $OUTPUT_FILE " +echo "Running ... to $OUTPUT_FILE and screen" -python3 $APPDIR/usage2adw.py -ip -du $DATABASE_USER -dp $DATABASE_PASS -dn $DATABASE_NAME -d $MIN_DATE > $OUTPUT_FILE +python3 $APPDIR/usage2adw.py -ip -du $DATABASE_USER -dp $DATABASE_PASS -dn $DATABASE_NAME -d $MIN_DATE | tee -a $OUTPUT_FILE grep -i "Error" $OUTPUT_FILE echo "Finished at `date` " diff --git a/examples/usage_reports_to_adw/step_by_step_daily_report.md b/examples/usage_reports_to_adw/step_by_step_daily_report.md old mode 100644 new mode 100755 diff --git a/examples/usage_reports_to_adw/step_by_step_installation.md b/examples/usage_reports_to_adw/step_by_step_installation.md old mode 100644 new mode 100755 index 540e7dde98..2e4042c8a7 --- a/examples/usage_reports_to_adw/step_by_step_installation.md +++ b/examples/usage_reports_to_adw/step_by_step_installation.md @@ -1,6 +1,6 @@ # Usage2ADW - Oracle Cloud Infrastructure Usage and Cost Reports to Autonomous Database with APEX Reporting -## Step by Step installation Guide on OCI VM and Autonomous Data Warehouse Database +## Step by Step Manual installation Guide on OCI VM and Autonomous Data Warehouse Database usage2adw is a tool which uses the Python SDK to extract the usage reports from your tenant and load it to Oracle Autonomous Database. Oracle Application Express (APEX) will be used for reporting. @@ -51,10 +51,11 @@ Oracle Application Express (APEX) will be used for reporting. Create Policy --> Name = UsageDownloadPolicy --> Desc = Allow Dynamic Group UsageDownloadGroup to Extract Usage report script - --> Statement 1 = define tenancy usage-report as ocid1.tenancy.oc1..aaaaaaaaned4fkpkisbwjlr56u7cj63lf3wffbilvqknstgtvzub7vhqkggq - --> Statement 2 = endorse dynamic-group UsageDownloadGroup to read objects in tenancy usage-report - --> Statement 3 = Allow dynamic-group UsageDownloadGroup to inspect compartments in tenancy - --> Statement 4 = Allow dynamic-group UsageDownloadGroup to inspect tenancies in tenancy + Statements: + define tenancy usage-report as ocid1.tenancy.oc1..aaaaaaaaned4fkpkisbwjlr56u7cj63lf3wffbilvqknstgtvzub7vhqkggq + endorse dynamic-group UsageDownloadGroup to read objects in tenancy usage-report + Allow dynamic-group UsageDownloadGroup to inspect compartments in tenancy + Allow dynamic-group UsageDownloadGroup to inspect tenancies in tenancy *** Please don't change the usage report tenant OCID, it is fixed. ``` @@ -94,44 +95,21 @@ Oracle Application Express (APEX) will be used for reporting. ssh opc@UsageVM ``` -## 6. Install Python 3 and OCI packages +## 6. Run Install Packages Script from Github +The script will install Python3, Git and python packages - oci, oci-cli, cx_Oracle and requests +Install Oracle Database Instance Client, Update bashrc and Clone the Python SDK ``` - sudo yum install -y python3 - sudo pip3 install oci oci-cli cx_Oracle requests - - # test instance principle is working using oci-cli - oci os ns get --auth instance_principal - - [opc@usagevm ~]$ oci os ns get --auth instance_principal - { - "data": "orasenatdplxxxx" - } -``` - -## 7. Install Oracle instant client - + # on oci github: + bash -c "$(curl -L https://raw.githubusercontent.com/oci-python-sdk/examples/usage_reports_to_adw/master/setup/setup_packages.sh)" ``` - # Please refer to the download site for Manual installation = https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html - - # update Oracle Linux el7 repository - sudo yum install oracle-release-el7 - # List instant client packages - sudo yum list oracle-instantclient* +## 7. Setup Credentials - # please choose basic and sqlplus package, below example on 19.6 - sudo yum install -y oracle-instantclient19.6-basic.x86_64 oracle-instantclient19.6-sqlplus.x86_64 +This script will ask for Database Name, Admin Password, Application Password and Extract Start Date - # setup oracle home variables - # Add the below to $HOME/.bashrc: - export CLIENT_HOME=/usr/lib/oracle/19.6/client64 - export LD_LIBRARY_PATH=$CLIENT_HOME/lib - export PATH=$PATH:$CLIENT_HOME/bin - export TNS_ADMIN=$HOME/ADWCUSG - - # set the variables - source $HOME/.bashrc +``` + /home/opc/usage_reports_to_adw/setup/setup_credentials.sh ``` ## 8. Download Autonomous database Wallet @@ -145,103 +123,53 @@ Oracle Application Express (APEX) will be used for reporting. --> Administration --> Download Client Credential --> Specify the Admin Password - --> Copy the Wallet wallet_ADWCUSG.zip to the Linux folder $HOME/ADWCUSG + --> Copy the Wallet wallet_ADWCUSG.zip to the Linux folder /home/opc with the name wallet.zip ``` ![](img/Image_10.png) -``` - # on Linux -> Unzip Wallet - cd $HOME/ADWCUSG - unzip wallet_ADWCUSG.zip - - # Change directory of sqlnet.ora to $HOME/ADWCUSG - sed -i "s#?/network/admin#$HOME/ADWCUSG#" sqlnet.ora -``` - -## 9. Create Database User for the Usage repository +## 9. Check OCI Connectivity and setup database users and apex ``` - sqlplus admin/password@adwcusg_low + # Execute: + /home/opc/usage_reports_to_adw/setup/setup_usage2adw.sh - # Choose your own password - SQL> create user usage identified by PaSsw0rd2#_#; - SQL> grant connect, resource, dwrole, unlimited tablespace to usage; - SQL> exit -``` - -## 10. Clone the OCI SDK Repo from Git Hub - -``` - cd $HOME - sudo yum install -y git - git clone https://github.com/oracle/oci-python-sdk - cd oci-python-sdk/examples/usage_reports_to_adw ``` -## 11. Execute the python script - usage2adw.py - -``` - # Please amend the password for the USAGE schema - python3 usage2adw.py -ip -du USAGE -dp PaSsw0rd2#_# -dn adwcusg_low -``` - - -## 12. Open Autonomous Database APEX Application +## 10. Open Autonomous Database APEX Workspace Admin ``` OCI Console -> Autonomous Databases -> ADWCUSG -> Service Console Development Menu -> Oracle APEX -``` + Choose Workspace Login. -![](img/Image_11.png) + Workspace = Usage + User = Usage + Password = Password you defined for the application -``` - Enter Admin Password - for first time setup -``` - -![](img/Image_12.png) - - -## 13. Create APEX workspace - -![](img/Image_13.png) ``` - Database User = USAGE - Workspace Name = USAGE -``` +![](img/Image_16.png) -![](img/Image_14.png) +## 11. Login to Apex Application ``` - Sign Out - Top Right Menu -> Sign Out -``` + Press on App Builder on the Left side + Press on the application "Usage and Cost Report" + Execute the application + Bookmark this page for future use -![](img/Image_15.png) + User = Usage + Password = Password you defined for the application -## 14. Setup APEX Administrator User Application - -``` - Login under USAGE Workspace - --> Workspace = USAGE - --> Username = USAGE - --> Password = "USAGE Schema Password" - --> Press Continue - - Specify your e-mail and name. - --> Apply Changes ``` +![](img/Image_30.png) -![](img/Image_16.png) - -![](img/Image_17.png) - -![](img/Image_18.png) -## 15. Create End User Account +## 12. How to create additional End User Accounts ``` + Login to Workspace Managament Top 3rd Right Menu -> Manage Users and Groups --> Create User @@ -262,81 +190,13 @@ Oracle Application Express (APEX) will be used for reporting. ![](img/Image_22.png) -## 16. Import APEX application - -Right Click and Download [usage.demo.apex.sql](https://raw.githubusercontent.com/oracle/oci-python-sdk/master/examples/usage_reports_to_adw/apex_demo_app/usage.demo.apex.sql) from github "apex_demo_app" folder (raw) - -``` - APEX Top Menu -> App Builder -> Import - --> Choose File = usage.demo.apex.sql (Download from github apex folder) - --> Press Next - --> Press Next - --> Press Install Application - --> Press Next - --> Press Install -``` - -![](img/Image_23.png) - -![](img/Image_24.png) - -![](img/Image_25.png) - -![](img/Image_26.png) - -![](img/Image_27.png) - -![](img/Image_28.png) - -## 17. Execute Application +## 20. How to upgrade the usage2adw application and APEX ``` - Press Run application - Bookmark the page for future use. - Login = your end user username and password + # on oci github: + bash -c "$(curl -L https://raw.githubusercontent.com/oci-python-sdk/examples/usage_reports_to_adw/master/setup/setup_upgrade_usage2adw.sh)" ``` -![](img/Image.png) - -![](img/Image_30.png) - -![](img/Image_31.png) - -![](img/Image_32.png) - -![](img/screen_1.png) -![](img/screen_2.png) -![](img/screen_3.png) - - -## 18. Bonus - Schedule a crontab job to execute the load daily -``` - # Amend the database variables of the file run_daily_usage2adw.sh according to your environment: - $HOME/oci-python-sdk/examples/usage_reports_to_adw/shell_scripts/run_single_daily_usage2adw.sh - - # change execution permission - chmod +x $HOME/oci-python-sdk/examples/usage_reports_to_adw/shell_scripts/run_single_daily_usage2adw.sh - - # add crontab that execute every night - 0 0 * * * timeout 6h /home/opc/oci-python-sdk/examples/usage_reports_to_adw/shell_scripts/run_single_daily_usage2adw.sh > /home/opc/oci-python-sdk/examples/usage_reports_to_adw/shell_scripts/run_single_daily_usage2adw_crontab_run.txt 2>&1 -``` - -## 19. How to upgrade the usage2adw software and "OCI Usage and Cost Report" APEX application -``` - # clone the software from github: - cd $HOME - git clone https://github.com/oracle/oci-python-sdk - - # Execute the python script in order to upgrade the metadata - cd oci-python-sdk/examples/usage_reports_to_adw - python3 usage2adw.py -ip -du USAGE -dp PaSsw0rd2#_# -dn adwcusg_low - - # Login to APEX workspace and choose "OCI Usage and Cost Report" Application - On the right menu -> Delete this application - - # Import the new APEX Application - Follow section 16 - Import APEX application -``` ## License diff --git a/src/oci/__init__.py b/src/oci/__init__.py index d73941effd..d28ac0765d 100644 --- a/src/oci/__init__.py +++ b/src/oci/__init__.py @@ -2,7 +2,7 @@ # Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. # 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. -from . import analytics, announcements_service, apigateway, application_migration, audit, autoscaling, bds, blockchain, budget, cims, cloud_guard, compute_instance_agent, container_engine, core, data_catalog, data_flow, data_integration, data_safe, data_science, database, dns, dts, email, events, file_storage, functions, healthchecks, identity, integration, key_management, limits, load_balancer, log_analytics, logging, loggingingestion, loggingsearch, management_agent, management_dashboard, marketplace, monitoring, mysql, nosql, object_storage, oce, ocvp, oda, ons, opsi, os_management, resource_manager, resource_search, sch, secrets, streaming, usage_api, vault, waas, work_requests +from . import analytics, announcements_service, apigateway, application_migration, audit, autoscaling, bds, blockchain, budget, cims, cloud_guard, compute_instance_agent, container_engine, core, data_catalog, data_flow, data_integration, data_safe, data_science, database, dns, dts, email, events, file_storage, functions, healthchecks, identity, integration, key_management, limits, load_balancer, log_analytics, logging, loggingingestion, loggingsearch, management_agent, management_dashboard, marketplace, monitoring, mysql, nosql, object_storage, oce, ocvp, oda, ons, opsi, optimizer, os_management, resource_manager, resource_search, sch, secrets, streaming, tenant_manager_control_plane, usage_api, vault, waas, work_requests from . import auth, config, constants, decorators, exceptions, regions, pagination, retry, fips from .base_client import BaseClient from .request import Request @@ -15,5 +15,5 @@ __all__ = [ "BaseClient", "Error", "Request", "Response", "Signer", "config", "constants", "decorators", "exceptions", "regions", "wait_until", "pagination", "auth", "retry", "fips", - "analytics", "announcements_service", "apigateway", "application_migration", "audit", "autoscaling", "bds", "blockchain", "budget", "cims", "cloud_guard", "compute_instance_agent", "container_engine", "core", "data_catalog", "data_flow", "data_integration", "data_safe", "data_science", "database", "dns", "dts", "email", "events", "file_storage", "functions", "healthchecks", "identity", "integration", "key_management", "limits", "load_balancer", "log_analytics", "logging", "loggingingestion", "loggingsearch", "management_agent", "management_dashboard", "marketplace", "monitoring", "mysql", "nosql", "object_storage", "oce", "ocvp", "oda", "ons", "opsi", "os_management", "resource_manager", "resource_search", "sch", "secrets", "streaming", "usage_api", "vault", "waas", "work_requests" + "analytics", "announcements_service", "apigateway", "application_migration", "audit", "autoscaling", "bds", "blockchain", "budget", "cims", "cloud_guard", "compute_instance_agent", "container_engine", "core", "data_catalog", "data_flow", "data_integration", "data_safe", "data_science", "database", "dns", "dts", "email", "events", "file_storage", "functions", "healthchecks", "identity", "integration", "key_management", "limits", "load_balancer", "log_analytics", "logging", "loggingingestion", "loggingsearch", "management_agent", "management_dashboard", "marketplace", "monitoring", "mysql", "nosql", "object_storage", "oce", "ocvp", "oda", "ons", "opsi", "optimizer", "os_management", "resource_manager", "resource_search", "sch", "secrets", "streaming", "tenant_manager_control_plane", "usage_api", "vault", "waas", "work_requests" ] diff --git a/src/oci/functions/functions_management_client.py b/src/oci/functions/functions_management_client.py index 14af1f250f..286752e24e 100644 --- a/src/oci/functions/functions_management_client.py +++ b/src/oci/functions/functions_management_client.py @@ -641,7 +641,7 @@ def list_applications(self, compartment_id, **kwargs): A filter to return only applications with display names that match the display name string. Matching is exact. :param str id: (optional) - A filter to return only applications with the specfied OCID. + A filter to return only applications with the specified OCID. :param str sort_order: (optional) Specifies sort order. diff --git a/src/oci/functions/models/application.py b/src/oci/functions/models/application.py index 21acaa0511..59c6f55bd2 100644 --- a/src/oci/functions/models/application.py +++ b/src/oci/functions/models/application.py @@ -72,6 +72,10 @@ def __init__(self, **kwargs): The value to assign to the subnet_ids property of this Application. :type subnet_ids: list[str] + :param syslog_url: + The value to assign to the syslog_url property of this Application. + :type syslog_url: str + :param freeform_tags: The value to assign to the freeform_tags property of this Application. :type freeform_tags: dict(str, str) @@ -96,6 +100,7 @@ def __init__(self, **kwargs): 'lifecycle_state': 'str', 'config': 'dict(str, str)', 'subnet_ids': 'list[str]', + 'syslog_url': 'str', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))', 'time_created': 'datetime', @@ -109,6 +114,7 @@ def __init__(self, **kwargs): 'lifecycle_state': 'lifecycleState', 'config': 'config', 'subnet_ids': 'subnetIds', + 'syslog_url': 'syslogUrl', 'freeform_tags': 'freeformTags', 'defined_tags': 'definedTags', 'time_created': 'timeCreated', @@ -121,6 +127,7 @@ def __init__(self, **kwargs): self._lifecycle_state = None self._config = None self._subnet_ids = None + self._syslog_url = None self._freeform_tags = None self._defined_tags = None self._time_created = None @@ -129,7 +136,7 @@ def __init__(self, **kwargs): @property def id(self): """ - Gets the id of this Application. + **[Required]** Gets the id of this Application. The `OCID`__ of the application. __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm @@ -294,6 +301,38 @@ def subnet_ids(self, subnet_ids): """ self._subnet_ids = subnet_ids + @property + def syslog_url(self): + """ + Gets the syslog_url of this Application. + A syslog URL to which to send all function logs. Supports tcp, udp, and tcp+tls. + The syslog URL must be reachable from all of the subnets configured for the application. + Note: If you enable the OCI Logging service for this application, the syslogUrl value is ignored. Function logs are sent to the OCI Logging service, and not to the syslog URL. + + Example: `tcp://logserver.myserver:1234` + + + :return: The syslog_url of this Application. + :rtype: str + """ + return self._syslog_url + + @syslog_url.setter + def syslog_url(self, syslog_url): + """ + Sets the syslog_url of this Application. + A syslog URL to which to send all function logs. Supports tcp, udp, and tcp+tls. + The syslog URL must be reachable from all of the subnets configured for the application. + Note: If you enable the OCI Logging service for this application, the syslogUrl value is ignored. Function logs are sent to the OCI Logging service, and not to the syslog URL. + + Example: `tcp://logserver.myserver:1234` + + + :param syslog_url: The syslog_url of this Application. + :type: str + """ + self._syslog_url = syslog_url + @property def freeform_tags(self): """ diff --git a/src/oci/functions/models/application_summary.py b/src/oci/functions/models/application_summary.py index 551bfb6d6e..c39137702c 100644 --- a/src/oci/functions/models/application_summary.py +++ b/src/oci/functions/models/application_summary.py @@ -92,7 +92,7 @@ def __init__(self, **kwargs): @property def id(self): """ - Gets the id of this ApplicationSummary. + **[Required]** Gets the id of this ApplicationSummary. The `OCID`__ of the application. __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm diff --git a/src/oci/functions/models/create_application_details.py b/src/oci/functions/models/create_application_details.py index f9a6728a8b..1d6ec997fc 100644 --- a/src/oci/functions/models/create_application_details.py +++ b/src/oci/functions/models/create_application_details.py @@ -34,6 +34,10 @@ def __init__(self, **kwargs): The value to assign to the subnet_ids property of this CreateApplicationDetails. :type subnet_ids: list[str] + :param syslog_url: + The value to assign to the syslog_url property of this CreateApplicationDetails. + :type syslog_url: str + :param freeform_tags: The value to assign to the freeform_tags property of this CreateApplicationDetails. :type freeform_tags: dict(str, str) @@ -48,6 +52,7 @@ def __init__(self, **kwargs): 'display_name': 'str', 'config': 'dict(str, str)', 'subnet_ids': 'list[str]', + 'syslog_url': 'str', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))' } @@ -57,6 +62,7 @@ def __init__(self, **kwargs): 'display_name': 'displayName', 'config': 'config', 'subnet_ids': 'subnetIds', + 'syslog_url': 'syslogUrl', 'freeform_tags': 'freeformTags', 'defined_tags': 'definedTags' } @@ -65,6 +71,7 @@ def __init__(self, **kwargs): self._display_name = None self._config = None self._subnet_ids = None + self._syslog_url = None self._freeform_tags = None self._defined_tags = None @@ -178,6 +185,38 @@ def subnet_ids(self, subnet_ids): """ self._subnet_ids = subnet_ids + @property + def syslog_url(self): + """ + Gets the syslog_url of this CreateApplicationDetails. + A syslog URL to which to send all function logs. Supports tcp, udp, and tcp+tls. + The syslog URL must be reachable from all of the subnets configured for the application. + Note: If you enable the OCI Logging service for this application, the syslogUrl value is ignored. Function logs are sent to the OCI Logging service, and not to the syslog URL. + + Example: `tcp://logserver.myserver:1234` + + + :return: The syslog_url of this CreateApplicationDetails. + :rtype: str + """ + return self._syslog_url + + @syslog_url.setter + def syslog_url(self, syslog_url): + """ + Sets the syslog_url of this CreateApplicationDetails. + A syslog URL to which to send all function logs. Supports tcp, udp, and tcp+tls. + The syslog URL must be reachable from all of the subnets configured for the application. + Note: If you enable the OCI Logging service for this application, the syslogUrl value is ignored. Function logs are sent to the OCI Logging service, and not to the syslog URL. + + Example: `tcp://logserver.myserver:1234` + + + :param syslog_url: The syslog_url of this CreateApplicationDetails. + :type: str + """ + self._syslog_url = syslog_url + @property def freeform_tags(self): """ diff --git a/src/oci/functions/models/function.py b/src/oci/functions/models/function.py index d1d0ab44a6..4e07fde089 100644 --- a/src/oci/functions/models/function.py +++ b/src/oci/functions/models/function.py @@ -164,7 +164,7 @@ def __init__(self, **kwargs): @property def id(self): """ - Gets the id of this Function. + **[Required]** Gets the id of this Function. The `OCID`__ of the function. __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm diff --git a/src/oci/functions/models/function_summary.py b/src/oci/functions/models/function_summary.py index 3c13f4b0c4..d414853fc7 100644 --- a/src/oci/functions/models/function_summary.py +++ b/src/oci/functions/models/function_summary.py @@ -157,7 +157,7 @@ def __init__(self, **kwargs): @property def id(self): """ - Gets the id of this FunctionSummary. + **[Required]** Gets the id of this FunctionSummary. The `OCID`__ of the function. __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm diff --git a/src/oci/functions/models/update_application_details.py b/src/oci/functions/models/update_application_details.py index c464c3809c..9b3a4f8f0f 100644 --- a/src/oci/functions/models/update_application_details.py +++ b/src/oci/functions/models/update_application_details.py @@ -22,6 +22,10 @@ def __init__(self, **kwargs): The value to assign to the config property of this UpdateApplicationDetails. :type config: dict(str, str) + :param syslog_url: + The value to assign to the syslog_url property of this UpdateApplicationDetails. + :type syslog_url: str + :param freeform_tags: The value to assign to the freeform_tags property of this UpdateApplicationDetails. :type freeform_tags: dict(str, str) @@ -33,17 +37,20 @@ def __init__(self, **kwargs): """ self.swagger_types = { 'config': 'dict(str, str)', + 'syslog_url': 'str', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))' } self.attribute_map = { 'config': 'config', + 'syslog_url': 'syslogUrl', 'freeform_tags': 'freeformTags', 'defined_tags': 'definedTags' } self._config = None + self._syslog_url = None self._freeform_tags = None self._defined_tags = None @@ -81,6 +88,38 @@ def config(self, config): """ self._config = config + @property + def syslog_url(self): + """ + Gets the syslog_url of this UpdateApplicationDetails. + A syslog URL to which to send all function logs. Supports tcp, udp, and tcp+tls. + The syslog URL must be reachable from all of the subnets configured for the application. + Note: If you enable the OCI Logging service for this application, the syslogUrl value is ignored. Function logs are sent to the OCI Logging service, and not to the syslog URL. + + Example: `tcp://logserver.myserver:1234` + + + :return: The syslog_url of this UpdateApplicationDetails. + :rtype: str + """ + return self._syslog_url + + @syslog_url.setter + def syslog_url(self, syslog_url): + """ + Sets the syslog_url of this UpdateApplicationDetails. + A syslog URL to which to send all function logs. Supports tcp, udp, and tcp+tls. + The syslog URL must be reachable from all of the subnets configured for the application. + Note: If you enable the OCI Logging service for this application, the syslogUrl value is ignored. Function logs are sent to the OCI Logging service, and not to the syslog URL. + + Example: `tcp://logserver.myserver:1234` + + + :param syslog_url: The syslog_url of this UpdateApplicationDetails. + :type: str + """ + self._syslog_url = syslog_url + @property def freeform_tags(self): """ diff --git a/src/oci/nosql/models/create_table_details.py b/src/oci/nosql/models/create_table_details.py index 48bb8fc744..ef006b1d77 100644 --- a/src/oci/nosql/models/create_table_details.py +++ b/src/oci/nosql/models/create_table_details.py @@ -34,6 +34,10 @@ def __init__(self, **kwargs): The value to assign to the table_limits property of this CreateTableDetails. :type table_limits: TableLimits + :param is_auto_reclaimable: + The value to assign to the is_auto_reclaimable property of this CreateTableDetails. + :type is_auto_reclaimable: bool + :param freeform_tags: The value to assign to the freeform_tags property of this CreateTableDetails. :type freeform_tags: dict(str, str) @@ -48,6 +52,7 @@ def __init__(self, **kwargs): 'compartment_id': 'str', 'ddl_statement': 'str', 'table_limits': 'TableLimits', + 'is_auto_reclaimable': 'bool', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))' } @@ -57,6 +62,7 @@ def __init__(self, **kwargs): 'compartment_id': 'compartmentId', 'ddl_statement': 'ddlStatement', 'table_limits': 'tableLimits', + 'is_auto_reclaimable': 'isAutoReclaimable', 'freeform_tags': 'freeformTags', 'defined_tags': 'definedTags' } @@ -65,6 +71,7 @@ def __init__(self, **kwargs): self._compartment_id = None self._ddl_statement = None self._table_limits = None + self._is_auto_reclaimable = None self._freeform_tags = None self._defined_tags = None @@ -160,6 +167,30 @@ def table_limits(self, table_limits): """ self._table_limits = table_limits + @property + def is_auto_reclaimable(self): + """ + Gets the is_auto_reclaimable of this CreateTableDetails. + True if table can be reclaimed after an idle period. + + + :return: The is_auto_reclaimable of this CreateTableDetails. + :rtype: bool + """ + return self._is_auto_reclaimable + + @is_auto_reclaimable.setter + def is_auto_reclaimable(self, is_auto_reclaimable): + """ + Sets the is_auto_reclaimable of this CreateTableDetails. + True if table can be reclaimed after an idle period. + + + :param is_auto_reclaimable: The is_auto_reclaimable of this CreateTableDetails. + :type: bool + """ + self._is_auto_reclaimable = is_auto_reclaimable + @property def freeform_tags(self): """ diff --git a/src/oci/nosql/models/table.py b/src/oci/nosql/models/table.py index bed62bf60c..8c9a572b3b 100644 --- a/src/oci/nosql/models/table.py +++ b/src/oci/nosql/models/table.py @@ -37,6 +37,10 @@ class Table(object): #: This constant has a value of "FAILED" LIFECYCLE_STATE_FAILED = "FAILED" + #: A constant which can be used with the lifecycle_state property of a Table. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + def __init__(self, **kwargs): """ Initializes a new Table object with values from keyword arguments. @@ -68,10 +72,18 @@ def __init__(self, **kwargs): :param lifecycle_state: The value to assign to the lifecycle_state property of this Table. - Allowed values for this property are: "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Allowed values for this property are: "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "INACTIVE", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :type lifecycle_state: str + :param is_auto_reclaimable: + The value to assign to the is_auto_reclaimable property of this Table. + :type is_auto_reclaimable: bool + + :param time_of_expiration: + The value to assign to the time_of_expiration property of this Table. + :type time_of_expiration: datetime + :param lifecycle_details: The value to assign to the lifecycle_details property of this Table. :type lifecycle_details: str @@ -92,6 +104,10 @@ def __init__(self, **kwargs): The value to assign to the defined_tags property of this Table. :type defined_tags: dict(str, dict(str, object)) + :param system_tags: + The value to assign to the system_tags property of this Table. + :type system_tags: dict(str, dict(str, object)) + """ self.swagger_types = { 'id': 'str', @@ -101,11 +117,14 @@ def __init__(self, **kwargs): 'time_updated': 'datetime', 'table_limits': 'TableLimits', 'lifecycle_state': 'str', + 'is_auto_reclaimable': 'bool', + 'time_of_expiration': 'datetime', 'lifecycle_details': 'str', 'schema': 'Schema', 'ddl_statement': 'str', 'freeform_tags': 'dict(str, str)', - 'defined_tags': 'dict(str, dict(str, object))' + 'defined_tags': 'dict(str, dict(str, object))', + 'system_tags': 'dict(str, dict(str, object))' } self.attribute_map = { @@ -116,11 +135,14 @@ def __init__(self, **kwargs): 'time_updated': 'timeUpdated', 'table_limits': 'tableLimits', 'lifecycle_state': 'lifecycleState', + 'is_auto_reclaimable': 'isAutoReclaimable', + 'time_of_expiration': 'timeOfExpiration', 'lifecycle_details': 'lifecycleDetails', 'schema': 'schema', 'ddl_statement': 'ddlStatement', 'freeform_tags': 'freeformTags', - 'defined_tags': 'definedTags' + 'defined_tags': 'definedTags', + 'system_tags': 'systemTags' } self._id = None @@ -130,11 +152,14 @@ def __init__(self, **kwargs): self._time_updated = None self._table_limits = None self._lifecycle_state = None + self._is_auto_reclaimable = None + self._time_of_expiration = None self._lifecycle_details = None self._schema = None self._ddl_statement = None self._freeform_tags = None self._defined_tags = None + self._system_tags = None @property def id(self): @@ -286,7 +311,7 @@ def lifecycle_state(self): Gets the lifecycle_state of this Table. The state of a table. - Allowed values for this property are: "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Allowed values for this property are: "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "INACTIVE", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. @@ -305,11 +330,63 @@ def lifecycle_state(self, lifecycle_state): :param lifecycle_state: The lifecycle_state of this Table. :type: str """ - allowed_values = ["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"] + allowed_values = ["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "INACTIVE"] if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state + @property + def is_auto_reclaimable(self): + """ + Gets the is_auto_reclaimable of this Table. + True if this table can be reclaimed after an idle period. + + + :return: The is_auto_reclaimable of this Table. + :rtype: bool + """ + return self._is_auto_reclaimable + + @is_auto_reclaimable.setter + def is_auto_reclaimable(self, is_auto_reclaimable): + """ + Sets the is_auto_reclaimable of this Table. + True if this table can be reclaimed after an idle period. + + + :param is_auto_reclaimable: The is_auto_reclaimable of this Table. + :type: bool + """ + self._is_auto_reclaimable = is_auto_reclaimable + + @property + def time_of_expiration(self): + """ + Gets the time_of_expiration of this Table. + If lifecycleState is INACTIVE, indicates when + this table will be automatically removed. + An RFC3339 formatted datetime string. + + + :return: The time_of_expiration of this Table. + :rtype: datetime + """ + return self._time_of_expiration + + @time_of_expiration.setter + def time_of_expiration(self, time_of_expiration): + """ + Sets the time_of_expiration of this Table. + If lifecycleState is INACTIVE, indicates when + this table will be automatically removed. + An RFC3339 formatted datetime string. + + + :param time_of_expiration: The time_of_expiration of this Table. + :type: datetime + """ + self._time_of_expiration = time_of_expiration + @property def lifecycle_details(self): """ @@ -434,6 +511,38 @@ def defined_tags(self, defined_tags): """ self._defined_tags = defined_tags + @property + def system_tags(self): + """ + Gets the system_tags of this Table. + Read-only system tag. These predefined keys are scoped to + namespaces. At present the only supported namespace is + `\"orcl-cloud\"`; and the only key in that namespace is + `\"free-tier-retained\"`. + Example: `{\"orcl-cloud\"\": {\"free-tier-retained\": \"true\"}}` + + + :return: The system_tags of this Table. + :rtype: dict(str, dict(str, object)) + """ + return self._system_tags + + @system_tags.setter + def system_tags(self, system_tags): + """ + Sets the system_tags of this Table. + Read-only system tag. These predefined keys are scoped to + namespaces. At present the only supported namespace is + `\"orcl-cloud\"`; and the only key in that namespace is + `\"free-tier-retained\"`. + Example: `{\"orcl-cloud\"\": {\"free-tier-retained\": \"true\"}}` + + + :param system_tags: The system_tags of this Table. + :type: dict(str, dict(str, object)) + """ + self._system_tags = system_tags + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/nosql/models/table_collection.py b/src/oci/nosql/models/table_collection.py index f4837359d5..b359c77c62 100644 --- a/src/oci/nosql/models/table_collection.py +++ b/src/oci/nosql/models/table_collection.py @@ -22,16 +22,30 @@ def __init__(self, **kwargs): The value to assign to the items property of this TableCollection. :type items: list[TableSummary] + :param max_auto_reclaimable_tables: + The value to assign to the max_auto_reclaimable_tables property of this TableCollection. + :type max_auto_reclaimable_tables: int + + :param auto_reclaimable_tables: + The value to assign to the auto_reclaimable_tables property of this TableCollection. + :type auto_reclaimable_tables: int + """ self.swagger_types = { - 'items': 'list[TableSummary]' + 'items': 'list[TableSummary]', + 'max_auto_reclaimable_tables': 'int', + 'auto_reclaimable_tables': 'int' } self.attribute_map = { - 'items': 'items' + 'items': 'items', + 'max_auto_reclaimable_tables': 'maxAutoReclaimableTables', + 'auto_reclaimable_tables': 'autoReclaimableTables' } self._items = None + self._max_auto_reclaimable_tables = None + self._auto_reclaimable_tables = None @property def items(self): @@ -57,6 +71,54 @@ def items(self, items): """ self._items = items + @property + def max_auto_reclaimable_tables(self): + """ + Gets the max_auto_reclaimable_tables of this TableCollection. + The maximum number of reclaimable tables allowed in the tenancy. + + + :return: The max_auto_reclaimable_tables of this TableCollection. + :rtype: int + """ + return self._max_auto_reclaimable_tables + + @max_auto_reclaimable_tables.setter + def max_auto_reclaimable_tables(self, max_auto_reclaimable_tables): + """ + Sets the max_auto_reclaimable_tables of this TableCollection. + The maximum number of reclaimable tables allowed in the tenancy. + + + :param max_auto_reclaimable_tables: The max_auto_reclaimable_tables of this TableCollection. + :type: int + """ + self._max_auto_reclaimable_tables = max_auto_reclaimable_tables + + @property + def auto_reclaimable_tables(self): + """ + Gets the auto_reclaimable_tables of this TableCollection. + The current number of reclaimable tables in the tenancy. + + + :return: The auto_reclaimable_tables of this TableCollection. + :rtype: int + """ + return self._auto_reclaimable_tables + + @auto_reclaimable_tables.setter + def auto_reclaimable_tables(self, auto_reclaimable_tables): + """ + Sets the auto_reclaimable_tables of this TableCollection. + The current number of reclaimable tables in the tenancy. + + + :param auto_reclaimable_tables: The auto_reclaimable_tables of this TableCollection. + :type: int + """ + self._auto_reclaimable_tables = auto_reclaimable_tables + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/nosql/models/table_summary.py b/src/oci/nosql/models/table_summary.py index ea8d308cc0..7898ab5816 100644 --- a/src/oci/nosql/models/table_summary.py +++ b/src/oci/nosql/models/table_summary.py @@ -50,6 +50,14 @@ def __init__(self, **kwargs): The value to assign to the lifecycle_details property of this TableSummary. :type lifecycle_details: str + :param is_auto_reclaimable: + The value to assign to the is_auto_reclaimable property of this TableSummary. + :type is_auto_reclaimable: bool + + :param time_of_expiration: + The value to assign to the time_of_expiration property of this TableSummary. + :type time_of_expiration: datetime + :param freeform_tags: The value to assign to the freeform_tags property of this TableSummary. :type freeform_tags: dict(str, str) @@ -58,6 +66,10 @@ def __init__(self, **kwargs): The value to assign to the defined_tags property of this TableSummary. :type defined_tags: dict(str, dict(str, object)) + :param system_tags: + The value to assign to the system_tags property of this TableSummary. + :type system_tags: dict(str, dict(str, object)) + """ self.swagger_types = { 'id': 'str', @@ -68,8 +80,11 @@ def __init__(self, **kwargs): 'table_limits': 'TableLimits', 'lifecycle_state': 'str', 'lifecycle_details': 'str', + 'is_auto_reclaimable': 'bool', + 'time_of_expiration': 'datetime', 'freeform_tags': 'dict(str, str)', - 'defined_tags': 'dict(str, dict(str, object))' + 'defined_tags': 'dict(str, dict(str, object))', + 'system_tags': 'dict(str, dict(str, object))' } self.attribute_map = { @@ -81,8 +96,11 @@ def __init__(self, **kwargs): 'table_limits': 'tableLimits', 'lifecycle_state': 'lifecycleState', 'lifecycle_details': 'lifecycleDetails', + 'is_auto_reclaimable': 'isAutoReclaimable', + 'time_of_expiration': 'timeOfExpiration', 'freeform_tags': 'freeformTags', - 'defined_tags': 'definedTags' + 'defined_tags': 'definedTags', + 'system_tags': 'systemTags' } self._id = None @@ -93,8 +111,11 @@ def __init__(self, **kwargs): self._table_limits = None self._lifecycle_state = None self._lifecycle_details = None + self._is_auto_reclaimable = None + self._time_of_expiration = None self._freeform_tags = None self._defined_tags = None + self._system_tags = None @property def id(self): @@ -288,6 +309,58 @@ def lifecycle_details(self, lifecycle_details): """ self._lifecycle_details = lifecycle_details + @property + def is_auto_reclaimable(self): + """ + Gets the is_auto_reclaimable of this TableSummary. + True if this table can be reclaimed after an idle period. + + + :return: The is_auto_reclaimable of this TableSummary. + :rtype: bool + """ + return self._is_auto_reclaimable + + @is_auto_reclaimable.setter + def is_auto_reclaimable(self, is_auto_reclaimable): + """ + Sets the is_auto_reclaimable of this TableSummary. + True if this table can be reclaimed after an idle period. + + + :param is_auto_reclaimable: The is_auto_reclaimable of this TableSummary. + :type: bool + """ + self._is_auto_reclaimable = is_auto_reclaimable + + @property + def time_of_expiration(self): + """ + Gets the time_of_expiration of this TableSummary. + If lifecycleState is INACTIVE, indicates when + this table will be automatically removed. + An RFC3339 formatted datetime string. + + + :return: The time_of_expiration of this TableSummary. + :rtype: datetime + """ + return self._time_of_expiration + + @time_of_expiration.setter + def time_of_expiration(self, time_of_expiration): + """ + Sets the time_of_expiration of this TableSummary. + If lifecycleState is INACTIVE, indicates when + this table will be automatically removed. + An RFC3339 formatted datetime string. + + + :param time_of_expiration: The time_of_expiration of this TableSummary. + :type: datetime + """ + self._time_of_expiration = time_of_expiration + @property def freeform_tags(self): """ @@ -344,6 +417,38 @@ def defined_tags(self, defined_tags): """ self._defined_tags = defined_tags + @property + def system_tags(self): + """ + Gets the system_tags of this TableSummary. + Read-only system tag. These predefined keys are scoped to + namespaces. At present the only supported namespace is + `\"orcl-cloud\"`; and the only key in that namespace is + `\"free-tier-retained\"`. + Example: `{\"orcl-cloud\"\": {\"free-tier-retained\": \"true\"}}` + + + :return: The system_tags of this TableSummary. + :rtype: dict(str, dict(str, object)) + """ + return self._system_tags + + @system_tags.setter + def system_tags(self, system_tags): + """ + Sets the system_tags of this TableSummary. + Read-only system tag. These predefined keys are scoped to + namespaces. At present the only supported namespace is + `\"orcl-cloud\"`; and the only key in that namespace is + `\"free-tier-retained\"`. + Example: `{\"orcl-cloud\"\": {\"free-tier-retained\": \"true\"}}` + + + :param system_tags: The system_tags of this TableSummary. + :type: dict(str, dict(str, object)) + """ + self._system_tags = system_tags + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/nosql/nosql_client.py b/src/oci/nosql/nosql_client.py index fe7f55d205..b452e76ce7 100644 --- a/src/oci/nosql/nosql_client.py +++ b/src/oci/nosql/nosql_client.py @@ -1107,7 +1107,7 @@ def list_indexes(self, table_name_or_id, **kwargs): :param str lifecycle_state: (optional) Filter list by the lifecycle state of the item. - Allowed values are: "ALL", "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED" + Allowed values are: "ALL", "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "INACTIVE" :param int limit: (optional) The maximum number of items to return. @@ -1175,7 +1175,7 @@ def list_indexes(self, table_name_or_id, **kwargs): raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) if 'lifecycle_state' in kwargs: - lifecycle_state_allowed_values = ["ALL", "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"] + lifecycle_state_allowed_values = ["ALL", "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "INACTIVE"] if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: raise ValueError( "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) @@ -1382,7 +1382,7 @@ def list_tables(self, compartment_id, **kwargs): :param str lifecycle_state: (optional) Filter list by the lifecycle state of the item. - Allowed values are: "ALL", "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED" + Allowed values are: "ALL", "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "INACTIVE" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. @@ -1429,7 +1429,7 @@ def list_tables(self, compartment_id, **kwargs): ) if 'lifecycle_state' in kwargs: - lifecycle_state_allowed_values = ["ALL", "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"] + lifecycle_state_allowed_values = ["ALL", "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "INACTIVE"] if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: raise ValueError( "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) diff --git a/src/oci/object_storage/models/object_lifecycle_rule.py b/src/oci/object_storage/models/object_lifecycle_rule.py index 10359cb951..a3cf283931 100644 --- a/src/oci/object_storage/models/object_lifecycle_rule.py +++ b/src/oci/object_storage/models/object_lifecycle_rule.py @@ -117,7 +117,11 @@ def name(self, name): def target(self): """ Gets the target of this ObjectLifecycleRule. - + The target of the object lifecycle policy rule. The values of target can be either \"objects\", + \"multipart-uploads\" or \"previous-object-versions\". This field when declared as \"objects\" is used to specify + archive or delete rule for objects. This field when declared as \"multipart-uploads\" is used to specify + the abort (only) rule for uncommitted multipart-uploads. This field when declared as \"previous-object-versions\" + is used to specify archive or delete rule for previous versions of existing objects. :return: The target of this ObjectLifecycleRule. @@ -129,7 +133,11 @@ def target(self): def target(self, target): """ Sets the target of this ObjectLifecycleRule. - + The target of the object lifecycle policy rule. The values of target can be either \"objects\", + \"multipart-uploads\" or \"previous-object-versions\". This field when declared as \"objects\" is used to specify + archive or delete rule for objects. This field when declared as \"multipart-uploads\" is used to specify + the abort (only) rule for uncommitted multipart-uploads. This field when declared as \"previous-object-versions\" + is used to specify archive or delete rule for previous versions of existing objects. :param target: The target of this ObjectLifecycleRule. diff --git a/src/oci/optimizer/__init__.py b/src/oci/optimizer/__init__.py new file mode 100644 index 0000000000..edd8829e7f --- /dev/null +++ b/src/oci/optimizer/__init__.py @@ -0,0 +1,12 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + +from __future__ import absolute_import + + +from .optimizer_client import OptimizerClient +from .optimizer_client_composite_operations import OptimizerClientCompositeOperations +from . import models + +__all__ = ["OptimizerClient", "OptimizerClientCompositeOperations", "models"] diff --git a/src/oci/optimizer/models/__init__.py b/src/oci/optimizer/models/__init__.py new file mode 100644 index 0000000000..6c395ab148 --- /dev/null +++ b/src/oci/optimizer/models/__init__.py @@ -0,0 +1,84 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + +from __future__ import absolute_import + +from .action import Action +from .bulk_apply_recommendations_details import BulkApplyRecommendationsDetails +from .category import Category +from .category_collection import CategoryCollection +from .category_summary import CategorySummary +from .create_profile_details import CreateProfileDetails +from .enrollment_status import EnrollmentStatus +from .enrollment_status_collection import EnrollmentStatusCollection +from .enrollment_status_summary import EnrollmentStatusSummary +from .history_collection import HistoryCollection +from .history_summary import HistorySummary +from .level_configuration import LevelConfiguration +from .levels_configuration import LevelsConfiguration +from .profile import Profile +from .profile_collection import ProfileCollection +from .profile_summary import ProfileSummary +from .recommendation import Recommendation +from .recommendation_collection import RecommendationCollection +from .recommendation_count import RecommendationCount +from .recommendation_summary import RecommendationSummary +from .resource_action import ResourceAction +from .resource_action_collection import ResourceActionCollection +from .resource_action_summary import ResourceActionSummary +from .resource_count import ResourceCount +from .supported_level import SupportedLevel +from .supported_levels import SupportedLevels +from .update_enrollment_status_details import UpdateEnrollmentStatusDetails +from .update_profile_details import UpdateProfileDetails +from .update_recommendation_details import UpdateRecommendationDetails +from .update_resource_action_details import UpdateResourceActionDetails +from .work_request import WorkRequest +from .work_request_collection import WorkRequestCollection +from .work_request_error import WorkRequestError +from .work_request_error_collection import WorkRequestErrorCollection +from .work_request_log_entry import WorkRequestLogEntry +from .work_request_log_entry_collection import WorkRequestLogEntryCollection +from .work_request_resource import WorkRequestResource + +# Maps type names to classes for optimizer services. +optimizer_type_mapping = { + "Action": Action, + "BulkApplyRecommendationsDetails": BulkApplyRecommendationsDetails, + "Category": Category, + "CategoryCollection": CategoryCollection, + "CategorySummary": CategorySummary, + "CreateProfileDetails": CreateProfileDetails, + "EnrollmentStatus": EnrollmentStatus, + "EnrollmentStatusCollection": EnrollmentStatusCollection, + "EnrollmentStatusSummary": EnrollmentStatusSummary, + "HistoryCollection": HistoryCollection, + "HistorySummary": HistorySummary, + "LevelConfiguration": LevelConfiguration, + "LevelsConfiguration": LevelsConfiguration, + "Profile": Profile, + "ProfileCollection": ProfileCollection, + "ProfileSummary": ProfileSummary, + "Recommendation": Recommendation, + "RecommendationCollection": RecommendationCollection, + "RecommendationCount": RecommendationCount, + "RecommendationSummary": RecommendationSummary, + "ResourceAction": ResourceAction, + "ResourceActionCollection": ResourceActionCollection, + "ResourceActionSummary": ResourceActionSummary, + "ResourceCount": ResourceCount, + "SupportedLevel": SupportedLevel, + "SupportedLevels": SupportedLevels, + "UpdateEnrollmentStatusDetails": UpdateEnrollmentStatusDetails, + "UpdateProfileDetails": UpdateProfileDetails, + "UpdateRecommendationDetails": UpdateRecommendationDetails, + "UpdateResourceActionDetails": UpdateResourceActionDetails, + "WorkRequest": WorkRequest, + "WorkRequestCollection": WorkRequestCollection, + "WorkRequestError": WorkRequestError, + "WorkRequestErrorCollection": WorkRequestErrorCollection, + "WorkRequestLogEntry": WorkRequestLogEntry, + "WorkRequestLogEntryCollection": WorkRequestLogEntryCollection, + "WorkRequestResource": WorkRequestResource +} diff --git a/src/oci/optimizer/models/action.py b/src/oci/optimizer/models/action.py new file mode 100644 index 0000000000..0eb8528f6a --- /dev/null +++ b/src/oci/optimizer/models/action.py @@ -0,0 +1,146 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class Action(object): + """ + Details about the recommended action. + + **Caution:** Avoid using any confidential information when you use the API to supply string values. + """ + + #: A constant which can be used with the type property of a Action. + #: This constant has a value of "KB_ARTICLE" + TYPE_KB_ARTICLE = "KB_ARTICLE" + + def __init__(self, **kwargs): + """ + Initializes a new Action object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param type: + The value to assign to the type property of this Action. + Allowed values for this property are: "KB_ARTICLE", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type type: str + + :param description: + The value to assign to the description property of this Action. + :type description: str + + :param url: + The value to assign to the url property of this Action. + :type url: str + + """ + self.swagger_types = { + 'type': 'str', + 'description': 'str', + 'url': 'str' + } + + self.attribute_map = { + 'type': 'type', + 'description': 'description', + 'url': 'url' + } + + self._type = None + self._description = None + self._url = None + + @property + def type(self): + """ + **[Required]** Gets the type of this Action. + The status of the resource action. + + Allowed values for this property are: "KB_ARTICLE", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The type of this Action. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """ + Sets the type of this Action. + The status of the resource action. + + + :param type: The type of this Action. + :type: str + """ + allowed_values = ["KB_ARTICLE"] + if not value_allowed_none_or_none_sentinel(type, allowed_values): + type = 'UNKNOWN_ENUM_VALUE' + self._type = type + + @property + def description(self): + """ + **[Required]** Gets the description of this Action. + Text describing the recommended action. + + + :return: The description of this Action. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """ + Sets the description of this Action. + Text describing the recommended action. + + + :param description: The description of this Action. + :type: str + """ + self._description = description + + @property + def url(self): + """ + **[Required]** Gets the url of this Action. + The URL path to documentation that explains how to perform the action. + + + :return: The url of this Action. + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """ + Sets the url of this Action. + The URL path to documentation that explains how to perform the action. + + + :param url: The url of this Action. + :type: str + """ + self._url = url + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/bulk_apply_recommendations_details.py b/src/oci/optimizer/models/bulk_apply_recommendations_details.py new file mode 100644 index 0000000000..9c2115f6c5 --- /dev/null +++ b/src/oci/optimizer/models/bulk_apply_recommendations_details.py @@ -0,0 +1,163 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class BulkApplyRecommendationsDetails(object): + """ + Details about bulk recommendation actions. + """ + + #: A constant which can be used with the status property of a BulkApplyRecommendationsDetails. + #: This constant has a value of "PENDING" + STATUS_PENDING = "PENDING" + + #: A constant which can be used with the status property of a BulkApplyRecommendationsDetails. + #: This constant has a value of "DISMISSED" + STATUS_DISMISSED = "DISMISSED" + + #: A constant which can be used with the status property of a BulkApplyRecommendationsDetails. + #: This constant has a value of "POSTPONED" + STATUS_POSTPONED = "POSTPONED" + + #: A constant which can be used with the status property of a BulkApplyRecommendationsDetails. + #: This constant has a value of "IMPLEMENTED" + STATUS_IMPLEMENTED = "IMPLEMENTED" + + def __init__(self, **kwargs): + """ + Initializes a new BulkApplyRecommendationsDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param resource_action_ids: + The value to assign to the resource_action_ids property of this BulkApplyRecommendationsDetails. + :type resource_action_ids: list[str] + + :param status: + The value to assign to the status property of this BulkApplyRecommendationsDetails. + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED" + :type status: str + + :param time_status_end: + The value to assign to the time_status_end property of this BulkApplyRecommendationsDetails. + :type time_status_end: datetime + + """ + self.swagger_types = { + 'resource_action_ids': 'list[str]', + 'status': 'str', + 'time_status_end': 'datetime' + } + + self.attribute_map = { + 'resource_action_ids': 'resourceActionIds', + 'status': 'status', + 'time_status_end': 'timeStatusEnd' + } + + self._resource_action_ids = None + self._status = None + self._time_status_end = None + + @property + def resource_action_ids(self): + """ + **[Required]** Gets the resource_action_ids of this BulkApplyRecommendationsDetails. + The unique OCIDs of the resource actions that recommendations are applied to. + + + :return: The resource_action_ids of this BulkApplyRecommendationsDetails. + :rtype: list[str] + """ + return self._resource_action_ids + + @resource_action_ids.setter + def resource_action_ids(self, resource_action_ids): + """ + Sets the resource_action_ids of this BulkApplyRecommendationsDetails. + The unique OCIDs of the resource actions that recommendations are applied to. + + + :param resource_action_ids: The resource_action_ids of this BulkApplyRecommendationsDetails. + :type: list[str] + """ + self._resource_action_ids = resource_action_ids + + @property + def status(self): + """ + **[Required]** Gets the status of this BulkApplyRecommendationsDetails. + The current status of the recommendation. + + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED" + + + :return: The status of this BulkApplyRecommendationsDetails. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this BulkApplyRecommendationsDetails. + The current status of the recommendation. + + + :param status: The status of this BulkApplyRecommendationsDetails. + :type: str + """ + allowed_values = ["PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + raise ValueError( + "Invalid value for `status`, must be None or one of {0}" + .format(allowed_values) + ) + self._status = status + + @property + def time_status_end(self): + """ + Gets the time_status_end of this BulkApplyRecommendationsDetails. + The date and time the current status will change. The format is defined by RFC3339. + + For example, \"The current `postponed` status of the resource action will end and change to `pending` on this + date and time.\" + + + :return: The time_status_end of this BulkApplyRecommendationsDetails. + :rtype: datetime + """ + return self._time_status_end + + @time_status_end.setter + def time_status_end(self, time_status_end): + """ + Sets the time_status_end of this BulkApplyRecommendationsDetails. + The date and time the current status will change. The format is defined by RFC3339. + + For example, \"The current `postponed` status of the resource action will end and change to `pending` on this + date and time.\" + + + :param time_status_end: The time_status_end of this BulkApplyRecommendationsDetails. + :type: datetime + """ + self._time_status_end = time_status_end + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/category.py b/src/oci/optimizer/models/category.py new file mode 100644 index 0000000000..c2a4fc151e --- /dev/null +++ b/src/oci/optimizer/models/category.py @@ -0,0 +1,395 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class Category(object): + """ + The metadata associated with the category. + + **Caution:** Avoid using any confidential information when you supply string values using the API. + """ + + #: A constant which can be used with the lifecycle_state property of a Category. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a Category. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a Category. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a Category. + #: This constant has a value of "ATTACHING" + LIFECYCLE_STATE_ATTACHING = "ATTACHING" + + #: A constant which can be used with the lifecycle_state property of a Category. + #: This constant has a value of "DETACHING" + LIFECYCLE_STATE_DETACHING = "DETACHING" + + #: A constant which can be used with the lifecycle_state property of a Category. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a Category. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a Category. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a Category. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + def __init__(self, **kwargs): + """ + Initializes a new Category object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this Category. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this Category. + :type compartment_id: str + + :param name: + The value to assign to the name property of this Category. + :type name: str + + :param description: + The value to assign to the description property of this Category. + :type description: str + + :param recommendation_counts: + The value to assign to the recommendation_counts property of this Category. + :type recommendation_counts: list[RecommendationCount] + + :param resource_counts: + The value to assign to the resource_counts property of this Category. + :type resource_counts: list[ResourceCount] + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this Category. + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param estimated_cost_saving: + The value to assign to the estimated_cost_saving property of this Category. + :type estimated_cost_saving: float + + :param time_created: + The value to assign to the time_created property of this Category. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this Category. + :type time_updated: datetime + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'name': 'str', + 'description': 'str', + 'recommendation_counts': 'list[RecommendationCount]', + 'resource_counts': 'list[ResourceCount]', + 'lifecycle_state': 'str', + 'estimated_cost_saving': 'float', + 'time_created': 'datetime', + 'time_updated': 'datetime' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'name': 'name', + 'description': 'description', + 'recommendation_counts': 'recommendationCounts', + 'resource_counts': 'resourceCounts', + 'lifecycle_state': 'lifecycleState', + 'estimated_cost_saving': 'estimatedCostSaving', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated' + } + + self._id = None + self._compartment_id = None + self._name = None + self._description = None + self._recommendation_counts = None + self._resource_counts = None + self._lifecycle_state = None + self._estimated_cost_saving = None + self._time_created = None + self._time_updated = None + + @property + def id(self): + """ + **[Required]** Gets the id of this Category. + The unique OCID of the category. + + + :return: The id of this Category. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this Category. + The unique OCID of the category. + + + :param id: The id of this Category. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this Category. + The OCID of the tenancy. The tenancy is the root compartment. + + + :return: The compartment_id of this Category. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this Category. + The OCID of the tenancy. The tenancy is the root compartment. + + + :param compartment_id: The compartment_id of this Category. + :type: str + """ + self._compartment_id = compartment_id + + @property + def name(self): + """ + **[Required]** Gets the name of this Category. + The name assigned to the category. + + + :return: The name of this Category. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this Category. + The name assigned to the category. + + + :param name: The name of this Category. + :type: str + """ + self._name = name + + @property + def description(self): + """ + **[Required]** Gets the description of this Category. + Text describing the category. + + + :return: The description of this Category. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """ + Sets the description of this Category. + Text describing the category. + + + :param description: The description of this Category. + :type: str + """ + self._description = description + + @property + def recommendation_counts(self): + """ + **[Required]** Gets the recommendation_counts of this Category. + An array of `RecommendationCount` objects grouped by the level of importance assigned to the recommendation. + + + :return: The recommendation_counts of this Category. + :rtype: list[RecommendationCount] + """ + return self._recommendation_counts + + @recommendation_counts.setter + def recommendation_counts(self, recommendation_counts): + """ + Sets the recommendation_counts of this Category. + An array of `RecommendationCount` objects grouped by the level of importance assigned to the recommendation. + + + :param recommendation_counts: The recommendation_counts of this Category. + :type: list[RecommendationCount] + """ + self._recommendation_counts = recommendation_counts + + @property + def resource_counts(self): + """ + **[Required]** Gets the resource_counts of this Category. + An array of `ResourceCount` objects grouped by the status of the recommendation. + + + :return: The resource_counts of this Category. + :rtype: list[ResourceCount] + """ + return self._resource_counts + + @resource_counts.setter + def resource_counts(self, resource_counts): + """ + Sets the resource_counts of this Category. + An array of `ResourceCount` objects grouped by the status of the recommendation. + + + :param resource_counts: The resource_counts of this Category. + :type: list[ResourceCount] + """ + self._resource_counts = resource_counts + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this Category. + The category's current state. + + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this Category. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this Category. + The category's current state. + + + :param lifecycle_state: The lifecycle_state of this Category. + :type: str + """ + allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def estimated_cost_saving(self): + """ + **[Required]** Gets the estimated_cost_saving of this Category. + The estimated cost savings, in dollars, for the category. + + + :return: The estimated_cost_saving of this Category. + :rtype: float + """ + return self._estimated_cost_saving + + @estimated_cost_saving.setter + def estimated_cost_saving(self, estimated_cost_saving): + """ + Sets the estimated_cost_saving of this Category. + The estimated cost savings, in dollars, for the category. + + + :param estimated_cost_saving: The estimated_cost_saving of this Category. + :type: float + """ + self._estimated_cost_saving = estimated_cost_saving + + @property + def time_created(self): + """ + **[Required]** Gets the time_created of this Category. + The date and time the category details were created, in the format defined by RFC3339. + + + :return: The time_created of this Category. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this Category. + The date and time the category details were created, in the format defined by RFC3339. + + + :param time_created: The time_created of this Category. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + **[Required]** Gets the time_updated of this Category. + The date and time the category details were last updated, in the format defined by RFC3339. + + + :return: The time_updated of this Category. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this Category. + The date and time the category details were last updated, in the format defined by RFC3339. + + + :param time_updated: The time_updated of this Category. + :type: datetime + """ + self._time_updated = time_updated + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/category_collection.py b/src/oci/optimizer/models/category_collection.py new file mode 100644 index 0000000000..aaba7e5796 --- /dev/null +++ b/src/oci/optimizer/models/category_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class CategoryCollection(object): + """ + A list of categories that match filter criteria, if any. Results contain `CategorySummary` objects. + """ + + def __init__(self, **kwargs): + """ + Initializes a new CategoryCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this CategoryCollection. + :type items: list[CategorySummary] + + """ + self.swagger_types = { + 'items': 'list[CategorySummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this CategoryCollection. + A collection of category summaries. + + + :return: The items of this CategoryCollection. + :rtype: list[CategorySummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this CategoryCollection. + A collection of category summaries. + + + :param items: The items of this CategoryCollection. + :type: list[CategorySummary] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/category_summary.py b/src/oci/optimizer/models/category_summary.py new file mode 100644 index 0000000000..f3c17028ca --- /dev/null +++ b/src/oci/optimizer/models/category_summary.py @@ -0,0 +1,395 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class CategorySummary(object): + """ + The metadata associated with the category summary. + + **Caution:** Avoid using any confidential information when you supply string values using the API. + """ + + #: A constant which can be used with the lifecycle_state property of a CategorySummary. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a CategorySummary. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a CategorySummary. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a CategorySummary. + #: This constant has a value of "ATTACHING" + LIFECYCLE_STATE_ATTACHING = "ATTACHING" + + #: A constant which can be used with the lifecycle_state property of a CategorySummary. + #: This constant has a value of "DETACHING" + LIFECYCLE_STATE_DETACHING = "DETACHING" + + #: A constant which can be used with the lifecycle_state property of a CategorySummary. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a CategorySummary. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a CategorySummary. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a CategorySummary. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + def __init__(self, **kwargs): + """ + Initializes a new CategorySummary object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this CategorySummary. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this CategorySummary. + :type compartment_id: str + + :param name: + The value to assign to the name property of this CategorySummary. + :type name: str + + :param description: + The value to assign to the description property of this CategorySummary. + :type description: str + + :param recommendation_counts: + The value to assign to the recommendation_counts property of this CategorySummary. + :type recommendation_counts: list[RecommendationCount] + + :param resource_counts: + The value to assign to the resource_counts property of this CategorySummary. + :type resource_counts: list[ResourceCount] + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this CategorySummary. + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param estimated_cost_saving: + The value to assign to the estimated_cost_saving property of this CategorySummary. + :type estimated_cost_saving: float + + :param time_created: + The value to assign to the time_created property of this CategorySummary. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this CategorySummary. + :type time_updated: datetime + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'name': 'str', + 'description': 'str', + 'recommendation_counts': 'list[RecommendationCount]', + 'resource_counts': 'list[ResourceCount]', + 'lifecycle_state': 'str', + 'estimated_cost_saving': 'float', + 'time_created': 'datetime', + 'time_updated': 'datetime' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'name': 'name', + 'description': 'description', + 'recommendation_counts': 'recommendationCounts', + 'resource_counts': 'resourceCounts', + 'lifecycle_state': 'lifecycleState', + 'estimated_cost_saving': 'estimatedCostSaving', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated' + } + + self._id = None + self._compartment_id = None + self._name = None + self._description = None + self._recommendation_counts = None + self._resource_counts = None + self._lifecycle_state = None + self._estimated_cost_saving = None + self._time_created = None + self._time_updated = None + + @property + def id(self): + """ + **[Required]** Gets the id of this CategorySummary. + The unique OCID of the category. + + + :return: The id of this CategorySummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this CategorySummary. + The unique OCID of the category. + + + :param id: The id of this CategorySummary. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this CategorySummary. + The OCID of the tenancy. The tenancy is the root compartment. + + + :return: The compartment_id of this CategorySummary. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this CategorySummary. + The OCID of the tenancy. The tenancy is the root compartment. + + + :param compartment_id: The compartment_id of this CategorySummary. + :type: str + """ + self._compartment_id = compartment_id + + @property + def name(self): + """ + **[Required]** Gets the name of this CategorySummary. + The name assigned to the category. + + + :return: The name of this CategorySummary. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this CategorySummary. + The name assigned to the category. + + + :param name: The name of this CategorySummary. + :type: str + """ + self._name = name + + @property + def description(self): + """ + **[Required]** Gets the description of this CategorySummary. + Text describing the category. + + + :return: The description of this CategorySummary. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """ + Sets the description of this CategorySummary. + Text describing the category. + + + :param description: The description of this CategorySummary. + :type: str + """ + self._description = description + + @property + def recommendation_counts(self): + """ + **[Required]** Gets the recommendation_counts of this CategorySummary. + An array of `RecommendationCount` objects grouped by the level of importance assigned to each recommendation. + + + :return: The recommendation_counts of this CategorySummary. + :rtype: list[RecommendationCount] + """ + return self._recommendation_counts + + @recommendation_counts.setter + def recommendation_counts(self, recommendation_counts): + """ + Sets the recommendation_counts of this CategorySummary. + An array of `RecommendationCount` objects grouped by the level of importance assigned to each recommendation. + + + :param recommendation_counts: The recommendation_counts of this CategorySummary. + :type: list[RecommendationCount] + """ + self._recommendation_counts = recommendation_counts + + @property + def resource_counts(self): + """ + **[Required]** Gets the resource_counts of this CategorySummary. + An array of `ResourceCount` objects grouped by the status of each recommendation. + + + :return: The resource_counts of this CategorySummary. + :rtype: list[ResourceCount] + """ + return self._resource_counts + + @resource_counts.setter + def resource_counts(self, resource_counts): + """ + Sets the resource_counts of this CategorySummary. + An array of `ResourceCount` objects grouped by the status of each recommendation. + + + :param resource_counts: The resource_counts of this CategorySummary. + :type: list[ResourceCount] + """ + self._resource_counts = resource_counts + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this CategorySummary. + The category's current state. + + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this CategorySummary. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this CategorySummary. + The category's current state. + + + :param lifecycle_state: The lifecycle_state of this CategorySummary. + :type: str + """ + allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def estimated_cost_saving(self): + """ + **[Required]** Gets the estimated_cost_saving of this CategorySummary. + The estimated cost savings, in dollars, for the category. + + + :return: The estimated_cost_saving of this CategorySummary. + :rtype: float + """ + return self._estimated_cost_saving + + @estimated_cost_saving.setter + def estimated_cost_saving(self, estimated_cost_saving): + """ + Sets the estimated_cost_saving of this CategorySummary. + The estimated cost savings, in dollars, for the category. + + + :param estimated_cost_saving: The estimated_cost_saving of this CategorySummary. + :type: float + """ + self._estimated_cost_saving = estimated_cost_saving + + @property + def time_created(self): + """ + **[Required]** Gets the time_created of this CategorySummary. + The date and time the category details were created, in the format defined by RFC3339. + + + :return: The time_created of this CategorySummary. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this CategorySummary. + The date and time the category details were created, in the format defined by RFC3339. + + + :param time_created: The time_created of this CategorySummary. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + **[Required]** Gets the time_updated of this CategorySummary. + The date and time the category details were last updated, in the format defined by RFC3339. + + + :return: The time_updated of this CategorySummary. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this CategorySummary. + The date and time the category details were last updated, in the format defined by RFC3339. + + + :param time_updated: The time_updated of this CategorySummary. + :type: datetime + """ + self._time_updated = time_updated + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/create_profile_details.py b/src/oci/optimizer/models/create_profile_details.py new file mode 100644 index 0000000000..a9b20f7405 --- /dev/null +++ b/src/oci/optimizer/models/create_profile_details.py @@ -0,0 +1,243 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class CreateProfileDetails(object): + """ + Details for creating a profile. + + **Caution:** Avoid using any confidential information when you use the API to supply string values. + """ + + def __init__(self, **kwargs): + """ + Initializes a new CreateProfileDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param compartment_id: + The value to assign to the compartment_id property of this CreateProfileDetails. + :type compartment_id: str + + :param name: + The value to assign to the name property of this CreateProfileDetails. + :type name: str + + :param description: + The value to assign to the description property of this CreateProfileDetails. + :type description: str + + :param defined_tags: + The value to assign to the defined_tags property of this CreateProfileDetails. + :type defined_tags: dict(str, dict(str, object)) + + :param freeform_tags: + The value to assign to the freeform_tags property of this CreateProfileDetails. + :type freeform_tags: dict(str, str) + + :param levels_configuration: + The value to assign to the levels_configuration property of this CreateProfileDetails. + :type levels_configuration: LevelsConfiguration + + """ + self.swagger_types = { + 'compartment_id': 'str', + 'name': 'str', + 'description': 'str', + 'defined_tags': 'dict(str, dict(str, object))', + 'freeform_tags': 'dict(str, str)', + 'levels_configuration': 'LevelsConfiguration' + } + + self.attribute_map = { + 'compartment_id': 'compartmentId', + 'name': 'name', + 'description': 'description', + 'defined_tags': 'definedTags', + 'freeform_tags': 'freeformTags', + 'levels_configuration': 'levelsConfiguration' + } + + self._compartment_id = None + self._name = None + self._description = None + self._defined_tags = None + self._freeform_tags = None + self._levels_configuration = None + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this CreateProfileDetails. + The OCID of the tenancy. The tenancy is the root compartment. + + + :return: The compartment_id of this CreateProfileDetails. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this CreateProfileDetails. + The OCID of the tenancy. The tenancy is the root compartment. + + + :param compartment_id: The compartment_id of this CreateProfileDetails. + :type: str + """ + self._compartment_id = compartment_id + + @property + def name(self): + """ + **[Required]** Gets the name of this CreateProfileDetails. + The name assigned to the profile. + + + :return: The name of this CreateProfileDetails. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this CreateProfileDetails. + The name assigned to the profile. + + + :param name: The name of this CreateProfileDetails. + :type: str + """ + self._name = name + + @property + def description(self): + """ + **[Required]** Gets the description of this CreateProfileDetails. + Text describing the profile. + + + :return: The description of this CreateProfileDetails. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """ + Sets the description of this CreateProfileDetails. + Text describing the profile. + + + :param description: The description of this CreateProfileDetails. + :type: str + """ + self._description = description + + @property + def defined_tags(self): + """ + Gets the defined_tags of this CreateProfileDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this CreateProfileDetails. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this CreateProfileDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this CreateProfileDetails. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this CreateProfileDetails. + Simple key-value pair applied without any predefined name, type, or namespace. + For more information, see `Resource Tags`__. Exists for cross-compatibility only. + + Example: `{\"bar-key\": \"value\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this CreateProfileDetails. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this CreateProfileDetails. + Simple key-value pair applied without any predefined name, type, or namespace. + For more information, see `Resource Tags`__. Exists for cross-compatibility only. + + Example: `{\"bar-key\": \"value\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this CreateProfileDetails. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def levels_configuration(self): + """ + **[Required]** Gets the levels_configuration of this CreateProfileDetails. + + :return: The levels_configuration of this CreateProfileDetails. + :rtype: LevelsConfiguration + """ + return self._levels_configuration + + @levels_configuration.setter + def levels_configuration(self, levels_configuration): + """ + Sets the levels_configuration of this CreateProfileDetails. + + :param levels_configuration: The levels_configuration of this CreateProfileDetails. + :type: LevelsConfiguration + """ + self._levels_configuration = levels_configuration + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/enrollment_status.py b/src/oci/optimizer/models/enrollment_status.py new file mode 100644 index 0000000000..91ab6c1cfc --- /dev/null +++ b/src/oci/optimizer/models/enrollment_status.py @@ -0,0 +1,318 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class EnrollmentStatus(object): + """ + The metadata associated with the enrollment status. + + **Caution:** Avoid using any confidential information when you use the API to supply string values. + """ + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatus. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatus. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatus. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatus. + #: This constant has a value of "ATTACHING" + LIFECYCLE_STATE_ATTACHING = "ATTACHING" + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatus. + #: This constant has a value of "DETACHING" + LIFECYCLE_STATE_DETACHING = "DETACHING" + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatus. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatus. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatus. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatus. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the status property of a EnrollmentStatus. + #: This constant has a value of "ACTIVE" + STATUS_ACTIVE = "ACTIVE" + + #: A constant which can be used with the status property of a EnrollmentStatus. + #: This constant has a value of "INACTIVE" + STATUS_INACTIVE = "INACTIVE" + + def __init__(self, **kwargs): + """ + Initializes a new EnrollmentStatus object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this EnrollmentStatus. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this EnrollmentStatus. + :type compartment_id: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this EnrollmentStatus. + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param status: + The value to assign to the status property of this EnrollmentStatus. + Allowed values for this property are: "ACTIVE", "INACTIVE", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param status_reason: + The value to assign to the status_reason property of this EnrollmentStatus. + :type status_reason: str + + :param time_created: + The value to assign to the time_created property of this EnrollmentStatus. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this EnrollmentStatus. + :type time_updated: datetime + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'lifecycle_state': 'str', + 'status': 'str', + 'status_reason': 'str', + 'time_created': 'datetime', + 'time_updated': 'datetime' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'lifecycle_state': 'lifecycleState', + 'status': 'status', + 'status_reason': 'statusReason', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated' + } + + self._id = None + self._compartment_id = None + self._lifecycle_state = None + self._status = None + self._status_reason = None + self._time_created = None + self._time_updated = None + + @property + def id(self): + """ + **[Required]** Gets the id of this EnrollmentStatus. + The OCID of the enrollment status. + + + :return: The id of this EnrollmentStatus. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this EnrollmentStatus. + The OCID of the enrollment status. + + + :param id: The id of this EnrollmentStatus. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this EnrollmentStatus. + The OCID of the compartment. + + + :return: The compartment_id of this EnrollmentStatus. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this EnrollmentStatus. + The OCID of the compartment. + + + :param compartment_id: The compartment_id of this EnrollmentStatus. + :type: str + """ + self._compartment_id = compartment_id + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this EnrollmentStatus. + The enrollment status' current state. + + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this EnrollmentStatus. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this EnrollmentStatus. + The enrollment status' current state. + + + :param lifecycle_state: The lifecycle_state of this EnrollmentStatus. + :type: str + """ + allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def status(self): + """ + **[Required]** Gets the status of this EnrollmentStatus. + The current Cloud Advisor enrollment status. + + Allowed values for this property are: "ACTIVE", "INACTIVE", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this EnrollmentStatus. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this EnrollmentStatus. + The current Cloud Advisor enrollment status. + + + :param status: The status of this EnrollmentStatus. + :type: str + """ + allowed_values = ["ACTIVE", "INACTIVE"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def status_reason(self): + """ + Gets the status_reason of this EnrollmentStatus. + The reason for the enrollment status of the tenancy. + + + :return: The status_reason of this EnrollmentStatus. + :rtype: str + """ + return self._status_reason + + @status_reason.setter + def status_reason(self, status_reason): + """ + Sets the status_reason of this EnrollmentStatus. + The reason for the enrollment status of the tenancy. + + + :param status_reason: The status_reason of this EnrollmentStatus. + :type: str + """ + self._status_reason = status_reason + + @property + def time_created(self): + """ + Gets the time_created of this EnrollmentStatus. + The date and time the enrollment status was created, in the format defined by RFC3339. + + + :return: The time_created of this EnrollmentStatus. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this EnrollmentStatus. + The date and time the enrollment status was created, in the format defined by RFC3339. + + + :param time_created: The time_created of this EnrollmentStatus. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + Gets the time_updated of this EnrollmentStatus. + The date and time the enrollment status was last updated, in the format defined by RFC3339. + + + :return: The time_updated of this EnrollmentStatus. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this EnrollmentStatus. + The date and time the enrollment status was last updated, in the format defined by RFC3339. + + + :param time_updated: The time_updated of this EnrollmentStatus. + :type: datetime + """ + self._time_updated = time_updated + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/enrollment_status_collection.py b/src/oci/optimizer/models/enrollment_status_collection.py new file mode 100644 index 0000000000..c7e77b9186 --- /dev/null +++ b/src/oci/optimizer/models/enrollment_status_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class EnrollmentStatusCollection(object): + """ + A list of enrollment statuses that match filter criteria, if any. Results contain `EnrollmentStatusSummary` objects. + """ + + def __init__(self, **kwargs): + """ + Initializes a new EnrollmentStatusCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this EnrollmentStatusCollection. + :type items: list[EnrollmentStatusSummary] + + """ + self.swagger_types = { + 'items': 'list[EnrollmentStatusSummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this EnrollmentStatusCollection. + A collection of enrollment status summaries. + + + :return: The items of this EnrollmentStatusCollection. + :rtype: list[EnrollmentStatusSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this EnrollmentStatusCollection. + A collection of enrollment status summaries. + + + :param items: The items of this EnrollmentStatusCollection. + :type: list[EnrollmentStatusSummary] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/enrollment_status_summary.py b/src/oci/optimizer/models/enrollment_status_summary.py new file mode 100644 index 0000000000..b4e8eeac81 --- /dev/null +++ b/src/oci/optimizer/models/enrollment_status_summary.py @@ -0,0 +1,318 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class EnrollmentStatusSummary(object): + """ + The metadata associated with the enrollment status summary. + + **Caution:** Avoid using any confidential information when you use the API to supply string values. + """ + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatusSummary. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatusSummary. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatusSummary. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatusSummary. + #: This constant has a value of "ATTACHING" + LIFECYCLE_STATE_ATTACHING = "ATTACHING" + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatusSummary. + #: This constant has a value of "DETACHING" + LIFECYCLE_STATE_DETACHING = "DETACHING" + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatusSummary. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatusSummary. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatusSummary. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a EnrollmentStatusSummary. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the status property of a EnrollmentStatusSummary. + #: This constant has a value of "ACTIVE" + STATUS_ACTIVE = "ACTIVE" + + #: A constant which can be used with the status property of a EnrollmentStatusSummary. + #: This constant has a value of "INACTIVE" + STATUS_INACTIVE = "INACTIVE" + + def __init__(self, **kwargs): + """ + Initializes a new EnrollmentStatusSummary object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this EnrollmentStatusSummary. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this EnrollmentStatusSummary. + :type compartment_id: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this EnrollmentStatusSummary. + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param status: + The value to assign to the status property of this EnrollmentStatusSummary. + Allowed values for this property are: "ACTIVE", "INACTIVE", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param status_reason: + The value to assign to the status_reason property of this EnrollmentStatusSummary. + :type status_reason: str + + :param time_created: + The value to assign to the time_created property of this EnrollmentStatusSummary. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this EnrollmentStatusSummary. + :type time_updated: datetime + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'lifecycle_state': 'str', + 'status': 'str', + 'status_reason': 'str', + 'time_created': 'datetime', + 'time_updated': 'datetime' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'lifecycle_state': 'lifecycleState', + 'status': 'status', + 'status_reason': 'statusReason', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated' + } + + self._id = None + self._compartment_id = None + self._lifecycle_state = None + self._status = None + self._status_reason = None + self._time_created = None + self._time_updated = None + + @property + def id(self): + """ + **[Required]** Gets the id of this EnrollmentStatusSummary. + The OCID of the enrollment status. + + + :return: The id of this EnrollmentStatusSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this EnrollmentStatusSummary. + The OCID of the enrollment status. + + + :param id: The id of this EnrollmentStatusSummary. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this EnrollmentStatusSummary. + The OCID of the compartment. + + + :return: The compartment_id of this EnrollmentStatusSummary. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this EnrollmentStatusSummary. + The OCID of the compartment. + + + :param compartment_id: The compartment_id of this EnrollmentStatusSummary. + :type: str + """ + self._compartment_id = compartment_id + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this EnrollmentStatusSummary. + The enrollment status' current state. + + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this EnrollmentStatusSummary. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this EnrollmentStatusSummary. + The enrollment status' current state. + + + :param lifecycle_state: The lifecycle_state of this EnrollmentStatusSummary. + :type: str + """ + allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def status(self): + """ + **[Required]** Gets the status of this EnrollmentStatusSummary. + The current Cloud Advisor enrollment status. + + Allowed values for this property are: "ACTIVE", "INACTIVE", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this EnrollmentStatusSummary. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this EnrollmentStatusSummary. + The current Cloud Advisor enrollment status. + + + :param status: The status of this EnrollmentStatusSummary. + :type: str + """ + allowed_values = ["ACTIVE", "INACTIVE"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def status_reason(self): + """ + Gets the status_reason of this EnrollmentStatusSummary. + The reason for the enrollment status of the tenancy. + + + :return: The status_reason of this EnrollmentStatusSummary. + :rtype: str + """ + return self._status_reason + + @status_reason.setter + def status_reason(self, status_reason): + """ + Sets the status_reason of this EnrollmentStatusSummary. + The reason for the enrollment status of the tenancy. + + + :param status_reason: The status_reason of this EnrollmentStatusSummary. + :type: str + """ + self._status_reason = status_reason + + @property + def time_created(self): + """ + Gets the time_created of this EnrollmentStatusSummary. + The date and time the enrollment status was created, in the format defined by RFC3339. + + + :return: The time_created of this EnrollmentStatusSummary. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this EnrollmentStatusSummary. + The date and time the enrollment status was created, in the format defined by RFC3339. + + + :param time_created: The time_created of this EnrollmentStatusSummary. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + Gets the time_updated of this EnrollmentStatusSummary. + The date and time the enrollment status was last updated, in the format defined by RFC3339. + + + :return: The time_updated of this EnrollmentStatusSummary. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this EnrollmentStatusSummary. + The date and time the enrollment status was last updated, in the format defined by RFC3339. + + + :param time_updated: The time_updated of this EnrollmentStatusSummary. + :type: datetime + """ + self._time_updated = time_updated + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/history_collection.py b/src/oci/optimizer/models/history_collection.py new file mode 100644 index 0000000000..dd6b7c99c2 --- /dev/null +++ b/src/oci/optimizer/models/history_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class HistoryCollection(object): + """ + A list containing the recommendation history items that match filter criteria, if any. Results contain `HistorySummary` objects. + """ + + def __init__(self, **kwargs): + """ + Initializes a new HistoryCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this HistoryCollection. + :type items: list[HistorySummary] + + """ + self.swagger_types = { + 'items': 'list[HistorySummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this HistoryCollection. + A collection of history summaries. + + + :return: The items of this HistoryCollection. + :rtype: list[HistorySummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this HistoryCollection. + A collection of history summaries. + + + :param items: The items of this HistoryCollection. + :type: list[HistorySummary] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/history_summary.py b/src/oci/optimizer/models/history_summary.py new file mode 100644 index 0000000000..3eeb51833f --- /dev/null +++ b/src/oci/optimizer/models/history_summary.py @@ -0,0 +1,668 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class HistorySummary(object): + """ + The metadata associated with the recommendation history and its related resources. + + **Caution:** Avoid using any confidential information when you use the API to supply string values. + """ + + #: A constant which can be used with the lifecycle_state property of a HistorySummary. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a HistorySummary. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a HistorySummary. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a HistorySummary. + #: This constant has a value of "ATTACHING" + LIFECYCLE_STATE_ATTACHING = "ATTACHING" + + #: A constant which can be used with the lifecycle_state property of a HistorySummary. + #: This constant has a value of "DETACHING" + LIFECYCLE_STATE_DETACHING = "DETACHING" + + #: A constant which can be used with the lifecycle_state property of a HistorySummary. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a HistorySummary. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a HistorySummary. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a HistorySummary. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the status property of a HistorySummary. + #: This constant has a value of "PENDING" + STATUS_PENDING = "PENDING" + + #: A constant which can be used with the status property of a HistorySummary. + #: This constant has a value of "DISMISSED" + STATUS_DISMISSED = "DISMISSED" + + #: A constant which can be used with the status property of a HistorySummary. + #: This constant has a value of "POSTPONED" + STATUS_POSTPONED = "POSTPONED" + + #: A constant which can be used with the status property of a HistorySummary. + #: This constant has a value of "IMPLEMENTED" + STATUS_IMPLEMENTED = "IMPLEMENTED" + + def __init__(self, **kwargs): + """ + Initializes a new HistorySummary object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this HistorySummary. + :type id: str + + :param name: + The value to assign to the name property of this HistorySummary. + :type name: str + + :param resource_type: + The value to assign to the resource_type property of this HistorySummary. + :type resource_type: str + + :param category_id: + The value to assign to the category_id property of this HistorySummary. + :type category_id: str + + :param recommendation_id: + The value to assign to the recommendation_id property of this HistorySummary. + :type recommendation_id: str + + :param recommendation_name: + The value to assign to the recommendation_name property of this HistorySummary. + :type recommendation_name: str + + :param resource_id: + The value to assign to the resource_id property of this HistorySummary. + :type resource_id: str + + :param resource_action_id: + The value to assign to the resource_action_id property of this HistorySummary. + :type resource_action_id: str + + :param action: + The value to assign to the action property of this HistorySummary. + :type action: Action + + :param compartment_id: + The value to assign to the compartment_id property of this HistorySummary. + :type compartment_id: str + + :param compartment_name: + The value to assign to the compartment_name property of this HistorySummary. + :type compartment_name: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this HistorySummary. + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param estimated_cost_saving: + The value to assign to the estimated_cost_saving property of this HistorySummary. + :type estimated_cost_saving: float + + :param status: + The value to assign to the status property of this HistorySummary. + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param metadata: + The value to assign to the metadata property of this HistorySummary. + :type metadata: dict(str, str) + + :param extended_metadata: + The value to assign to the extended_metadata property of this HistorySummary. + :type extended_metadata: dict(str, object) + + :param time_created: + The value to assign to the time_created property of this HistorySummary. + :type time_created: datetime + + """ + self.swagger_types = { + 'id': 'str', + 'name': 'str', + 'resource_type': 'str', + 'category_id': 'str', + 'recommendation_id': 'str', + 'recommendation_name': 'str', + 'resource_id': 'str', + 'resource_action_id': 'str', + 'action': 'Action', + 'compartment_id': 'str', + 'compartment_name': 'str', + 'lifecycle_state': 'str', + 'estimated_cost_saving': 'float', + 'status': 'str', + 'metadata': 'dict(str, str)', + 'extended_metadata': 'dict(str, object)', + 'time_created': 'datetime' + } + + self.attribute_map = { + 'id': 'id', + 'name': 'name', + 'resource_type': 'resourceType', + 'category_id': 'categoryId', + 'recommendation_id': 'recommendationId', + 'recommendation_name': 'recommendationName', + 'resource_id': 'resourceId', + 'resource_action_id': 'resourceActionId', + 'action': 'action', + 'compartment_id': 'compartmentId', + 'compartment_name': 'compartmentName', + 'lifecycle_state': 'lifecycleState', + 'estimated_cost_saving': 'estimatedCostSaving', + 'status': 'status', + 'metadata': 'metadata', + 'extended_metadata': 'extendedMetadata', + 'time_created': 'timeCreated' + } + + self._id = None + self._name = None + self._resource_type = None + self._category_id = None + self._recommendation_id = None + self._recommendation_name = None + self._resource_id = None + self._resource_action_id = None + self._action = None + self._compartment_id = None + self._compartment_name = None + self._lifecycle_state = None + self._estimated_cost_saving = None + self._status = None + self._metadata = None + self._extended_metadata = None + self._time_created = None + + @property + def id(self): + """ + **[Required]** Gets the id of this HistorySummary. + The unique OCID associated with the recommendation history. + + + :return: The id of this HistorySummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this HistorySummary. + The unique OCID associated with the recommendation history. + + + :param id: The id of this HistorySummary. + :type: str + """ + self._id = id + + @property + def name(self): + """ + **[Required]** Gets the name of this HistorySummary. + The name assigned to the resource. + + + :return: The name of this HistorySummary. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this HistorySummary. + The name assigned to the resource. + + + :param name: The name of this HistorySummary. + :type: str + """ + self._name = name + + @property + def resource_type(self): + """ + **[Required]** Gets the resource_type of this HistorySummary. + The kind of resource. + + + :return: The resource_type of this HistorySummary. + :rtype: str + """ + return self._resource_type + + @resource_type.setter + def resource_type(self, resource_type): + """ + Sets the resource_type of this HistorySummary. + The kind of resource. + + + :param resource_type: The resource_type of this HistorySummary. + :type: str + """ + self._resource_type = resource_type + + @property + def category_id(self): + """ + **[Required]** Gets the category_id of this HistorySummary. + The unique OCID associated with the category. + + + :return: The category_id of this HistorySummary. + :rtype: str + """ + return self._category_id + + @category_id.setter + def category_id(self, category_id): + """ + Sets the category_id of this HistorySummary. + The unique OCID associated with the category. + + + :param category_id: The category_id of this HistorySummary. + :type: str + """ + self._category_id = category_id + + @property + def recommendation_id(self): + """ + **[Required]** Gets the recommendation_id of this HistorySummary. + The unique OCID associated with the recommendation. + + + :return: The recommendation_id of this HistorySummary. + :rtype: str + """ + return self._recommendation_id + + @recommendation_id.setter + def recommendation_id(self, recommendation_id): + """ + Sets the recommendation_id of this HistorySummary. + The unique OCID associated with the recommendation. + + + :param recommendation_id: The recommendation_id of this HistorySummary. + :type: str + """ + self._recommendation_id = recommendation_id + + @property + def recommendation_name(self): + """ + **[Required]** Gets the recommendation_name of this HistorySummary. + The name assigned to the recommendation. + + + :return: The recommendation_name of this HistorySummary. + :rtype: str + """ + return self._recommendation_name + + @recommendation_name.setter + def recommendation_name(self, recommendation_name): + """ + Sets the recommendation_name of this HistorySummary. + The name assigned to the recommendation. + + + :param recommendation_name: The recommendation_name of this HistorySummary. + :type: str + """ + self._recommendation_name = recommendation_name + + @property + def resource_id(self): + """ + **[Required]** Gets the resource_id of this HistorySummary. + The unique OCID associated with the resource. + + + :return: The resource_id of this HistorySummary. + :rtype: str + """ + return self._resource_id + + @resource_id.setter + def resource_id(self, resource_id): + """ + Sets the resource_id of this HistorySummary. + The unique OCID associated with the resource. + + + :param resource_id: The resource_id of this HistorySummary. + :type: str + """ + self._resource_id = resource_id + + @property + def resource_action_id(self): + """ + **[Required]** Gets the resource_action_id of this HistorySummary. + The unique OCID associated with the resource action. + + + :return: The resource_action_id of this HistorySummary. + :rtype: str + """ + return self._resource_action_id + + @resource_action_id.setter + def resource_action_id(self, resource_action_id): + """ + Sets the resource_action_id of this HistorySummary. + The unique OCID associated with the resource action. + + + :param resource_action_id: The resource_action_id of this HistorySummary. + :type: str + """ + self._resource_action_id = resource_action_id + + @property + def action(self): + """ + **[Required]** Gets the action of this HistorySummary. + + :return: The action of this HistorySummary. + :rtype: Action + """ + return self._action + + @action.setter + def action(self, action): + """ + Sets the action of this HistorySummary. + + :param action: The action of this HistorySummary. + :type: Action + """ + self._action = action + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this HistorySummary. + The OCID of the compartment. + + + :return: The compartment_id of this HistorySummary. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this HistorySummary. + The OCID of the compartment. + + + :param compartment_id: The compartment_id of this HistorySummary. + :type: str + """ + self._compartment_id = compartment_id + + @property + def compartment_name(self): + """ + **[Required]** Gets the compartment_name of this HistorySummary. + The name assigned to the compartment. + + + :return: The compartment_name of this HistorySummary. + :rtype: str + """ + return self._compartment_name + + @compartment_name.setter + def compartment_name(self, compartment_name): + """ + Sets the compartment_name of this HistorySummary. + The name assigned to the compartment. + + + :param compartment_name: The compartment_name of this HistorySummary. + :type: str + """ + self._compartment_name = compartment_name + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this HistorySummary. + The recommendation history's current state. + + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this HistorySummary. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this HistorySummary. + The recommendation history's current state. + + + :param lifecycle_state: The lifecycle_state of this HistorySummary. + :type: str + """ + allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def estimated_cost_saving(self): + """ + **[Required]** Gets the estimated_cost_saving of this HistorySummary. + The estimated cost savings, in dollars, for the resource action. + + + :return: The estimated_cost_saving of this HistorySummary. + :rtype: float + """ + return self._estimated_cost_saving + + @estimated_cost_saving.setter + def estimated_cost_saving(self, estimated_cost_saving): + """ + Sets the estimated_cost_saving of this HistorySummary. + The estimated cost savings, in dollars, for the resource action. + + + :param estimated_cost_saving: The estimated_cost_saving of this HistorySummary. + :type: float + """ + self._estimated_cost_saving = estimated_cost_saving + + @property + def status(self): + """ + **[Required]** Gets the status of this HistorySummary. + The current status of the resource action. + + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this HistorySummary. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this HistorySummary. + The current status of the resource action. + + + :param status: The status of this HistorySummary. + :type: str + """ + allowed_values = ["PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def metadata(self): + """ + Gets the metadata of this HistorySummary. + Custom metadata key/value pairs for the resource action. + + **Metadata Example** + + \"metadata\" : { + \"cpuRecommendedShape\": \"VM.Standard1.1\", + \"computeMemoryUtilization\": \"26.05734124418388\", + \"currentShape\": \"VM.Standard1.2\", + \"instanceRecommendedShape\": \"VM.Standard1.1\", + \"computeCpuUtilization\": \"7.930035319720132\", + \"memoryRecommendedShape\": \"None\" + } + + + :return: The metadata of this HistorySummary. + :rtype: dict(str, str) + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """ + Sets the metadata of this HistorySummary. + Custom metadata key/value pairs for the resource action. + + **Metadata Example** + + \"metadata\" : { + \"cpuRecommendedShape\": \"VM.Standard1.1\", + \"computeMemoryUtilization\": \"26.05734124418388\", + \"currentShape\": \"VM.Standard1.2\", + \"instanceRecommendedShape\": \"VM.Standard1.1\", + \"computeCpuUtilization\": \"7.930035319720132\", + \"memoryRecommendedShape\": \"None\" + } + + + :param metadata: The metadata of this HistorySummary. + :type: dict(str, str) + """ + self._metadata = metadata + + @property + def extended_metadata(self): + """ + Gets the extended_metadata of this HistorySummary. + Additional metadata key/value pairs that you provide. + They serve the same purpose and functionality as fields in the `metadata` object. + + They are distinguished from `metadata` fields in that these can be nested JSON objects (whereas `metadata` fields are string/string maps only). + + For example: + + `{\"CurrentShape\": {\"name\":\"VM.Standard2.16\"}, \"RecommendedShape\": {\"name\":\"VM.Standard2.8\"}}` + + + :return: The extended_metadata of this HistorySummary. + :rtype: dict(str, object) + """ + return self._extended_metadata + + @extended_metadata.setter + def extended_metadata(self, extended_metadata): + """ + Sets the extended_metadata of this HistorySummary. + Additional metadata key/value pairs that you provide. + They serve the same purpose and functionality as fields in the `metadata` object. + + They are distinguished from `metadata` fields in that these can be nested JSON objects (whereas `metadata` fields are string/string maps only). + + For example: + + `{\"CurrentShape\": {\"name\":\"VM.Standard2.16\"}, \"RecommendedShape\": {\"name\":\"VM.Standard2.8\"}}` + + + :param extended_metadata: The extended_metadata of this HistorySummary. + :type: dict(str, object) + """ + self._extended_metadata = extended_metadata + + @property + def time_created(self): + """ + Gets the time_created of this HistorySummary. + The date and time the recommendation history was created, in the format defined by RFC3339. + + + :return: The time_created of this HistorySummary. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this HistorySummary. + The date and time the recommendation history was created, in the format defined by RFC3339. + + + :param time_created: The time_created of this HistorySummary. + :type: datetime + """ + self._time_created = time_created + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/level_configuration.py b/src/oci/optimizer/models/level_configuration.py new file mode 100644 index 0000000000..e8f513abae --- /dev/null +++ b/src/oci/optimizer/models/level_configuration.py @@ -0,0 +1,101 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class LevelConfiguration(object): + """ + Details about the configuration level for the recommendation. + """ + + def __init__(self, **kwargs): + """ + Initializes a new LevelConfiguration object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param recommendation_id: + The value to assign to the recommendation_id property of this LevelConfiguration. + :type recommendation_id: str + + :param level: + The value to assign to the level property of this LevelConfiguration. + :type level: str + + """ + self.swagger_types = { + 'recommendation_id': 'str', + 'level': 'str' + } + + self.attribute_map = { + 'recommendation_id': 'recommendationId', + 'level': 'level' + } + + self._recommendation_id = None + self._level = None + + @property + def recommendation_id(self): + """ + Gets the recommendation_id of this LevelConfiguration. + The unique OCID of the recommendation. + + + :return: The recommendation_id of this LevelConfiguration. + :rtype: str + """ + return self._recommendation_id + + @recommendation_id.setter + def recommendation_id(self, recommendation_id): + """ + Sets the recommendation_id of this LevelConfiguration. + The unique OCID of the recommendation. + + + :param recommendation_id: The recommendation_id of this LevelConfiguration. + :type: str + """ + self._recommendation_id = recommendation_id + + @property + def level(self): + """ + Gets the level of this LevelConfiguration. + The pre-defined profile level. + + + :return: The level of this LevelConfiguration. + :rtype: str + """ + return self._level + + @level.setter + def level(self, level): + """ + Sets the level of this LevelConfiguration. + The pre-defined profile level. + + + :param level: The level of this LevelConfiguration. + :type: str + """ + self._level = level + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/levels_configuration.py b/src/oci/optimizer/models/levels_configuration.py new file mode 100644 index 0000000000..722af61410 --- /dev/null +++ b/src/oci/optimizer/models/levels_configuration.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class LevelsConfiguration(object): + """ + A list of configuration levels for each recommendation. + """ + + def __init__(self, **kwargs): + """ + Initializes a new LevelsConfiguration object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this LevelsConfiguration. + :type items: list[LevelConfiguration] + + """ + self.swagger_types = { + 'items': 'list[LevelConfiguration]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + Gets the items of this LevelsConfiguration. + The array of configuration levels. + + + :return: The items of this LevelsConfiguration. + :rtype: list[LevelConfiguration] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this LevelsConfiguration. + The array of configuration levels. + + + :param items: The items of this LevelsConfiguration. + :type: list[LevelConfiguration] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/profile.py b/src/oci/optimizer/models/profile.py new file mode 100644 index 0000000000..0ed475302e --- /dev/null +++ b/src/oci/optimizer/models/profile.py @@ -0,0 +1,411 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class Profile(object): + """ + The metadata associated with the profile. + + **Caution:** Avoid using any confidential information when you use the API to supply string values. + """ + + #: A constant which can be used with the lifecycle_state property of a Profile. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a Profile. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a Profile. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a Profile. + #: This constant has a value of "ATTACHING" + LIFECYCLE_STATE_ATTACHING = "ATTACHING" + + #: A constant which can be used with the lifecycle_state property of a Profile. + #: This constant has a value of "DETACHING" + LIFECYCLE_STATE_DETACHING = "DETACHING" + + #: A constant which can be used with the lifecycle_state property of a Profile. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a Profile. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a Profile. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a Profile. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + def __init__(self, **kwargs): + """ + Initializes a new Profile object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this Profile. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this Profile. + :type compartment_id: str + + :param name: + The value to assign to the name property of this Profile. + :type name: str + + :param description: + The value to assign to the description property of this Profile. + :type description: str + + :param defined_tags: + The value to assign to the defined_tags property of this Profile. + :type defined_tags: dict(str, dict(str, object)) + + :param freeform_tags: + The value to assign to the freeform_tags property of this Profile. + :type freeform_tags: dict(str, str) + + :param levels_configuration: + The value to assign to the levels_configuration property of this Profile. + :type levels_configuration: LevelsConfiguration + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this Profile. + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param time_created: + The value to assign to the time_created property of this Profile. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this Profile. + :type time_updated: datetime + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'name': 'str', + 'description': 'str', + 'defined_tags': 'dict(str, dict(str, object))', + 'freeform_tags': 'dict(str, str)', + 'levels_configuration': 'LevelsConfiguration', + 'lifecycle_state': 'str', + 'time_created': 'datetime', + 'time_updated': 'datetime' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'name': 'name', + 'description': 'description', + 'defined_tags': 'definedTags', + 'freeform_tags': 'freeformTags', + 'levels_configuration': 'levelsConfiguration', + 'lifecycle_state': 'lifecycleState', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated' + } + + self._id = None + self._compartment_id = None + self._name = None + self._description = None + self._defined_tags = None + self._freeform_tags = None + self._levels_configuration = None + self._lifecycle_state = None + self._time_created = None + self._time_updated = None + + @property + def id(self): + """ + **[Required]** Gets the id of this Profile. + The unique OCID of the profile. + + + :return: The id of this Profile. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this Profile. + The unique OCID of the profile. + + + :param id: The id of this Profile. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this Profile. + The OCID of the tenancy. The tenancy is the root compartment. + + + :return: The compartment_id of this Profile. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this Profile. + The OCID of the tenancy. The tenancy is the root compartment. + + + :param compartment_id: The compartment_id of this Profile. + :type: str + """ + self._compartment_id = compartment_id + + @property + def name(self): + """ + **[Required]** Gets the name of this Profile. + The name assigned to the profile. + + + :return: The name of this Profile. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this Profile. + The name assigned to the profile. + + + :param name: The name of this Profile. + :type: str + """ + self._name = name + + @property + def description(self): + """ + **[Required]** Gets the description of this Profile. + Text describing the profile. + + + :return: The description of this Profile. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """ + Sets the description of this Profile. + Text describing the profile. + + + :param description: The description of this Profile. + :type: str + """ + self._description = description + + @property + def defined_tags(self): + """ + Gets the defined_tags of this Profile. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this Profile. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this Profile. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this Profile. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this Profile. + Simple key-value pair applied without any predefined name, type, or namespace. + For more information, see `Resource Tags`__. Exists for cross-compatibility only. + + Example: `{\"bar-key\": \"value\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this Profile. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this Profile. + Simple key-value pair applied without any predefined name, type, or namespace. + For more information, see `Resource Tags`__. Exists for cross-compatibility only. + + Example: `{\"bar-key\": \"value\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this Profile. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def levels_configuration(self): + """ + Gets the levels_configuration of this Profile. + + :return: The levels_configuration of this Profile. + :rtype: LevelsConfiguration + """ + return self._levels_configuration + + @levels_configuration.setter + def levels_configuration(self, levels_configuration): + """ + Sets the levels_configuration of this Profile. + + :param levels_configuration: The levels_configuration of this Profile. + :type: LevelsConfiguration + """ + self._levels_configuration = levels_configuration + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this Profile. + The profile's current state. + + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this Profile. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this Profile. + The profile's current state. + + + :param lifecycle_state: The lifecycle_state of this Profile. + :type: str + """ + allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def time_created(self): + """ + **[Required]** Gets the time_created of this Profile. + The date and time the profile was created, in the format defined by RFC3339. + + + :return: The time_created of this Profile. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this Profile. + The date and time the profile was created, in the format defined by RFC3339. + + + :param time_created: The time_created of this Profile. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + **[Required]** Gets the time_updated of this Profile. + The date and time the profile was last updated, in the format defined by RFC3339. + + + :return: The time_updated of this Profile. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this Profile. + The date and time the profile was last updated, in the format defined by RFC3339. + + + :param time_updated: The time_updated of this Profile. + :type: datetime + """ + self._time_updated = time_updated + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/profile_collection.py b/src/oci/optimizer/models/profile_collection.py new file mode 100644 index 0000000000..4e33b94148 --- /dev/null +++ b/src/oci/optimizer/models/profile_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class ProfileCollection(object): + """ + A list of profiles that match filter criteria, if any. Results contain `ProfileSummary` objects. + """ + + def __init__(self, **kwargs): + """ + Initializes a new ProfileCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this ProfileCollection. + :type items: list[ProfileSummary] + + """ + self.swagger_types = { + 'items': 'list[ProfileSummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this ProfileCollection. + A collection of profile summaries. + + + :return: The items of this ProfileCollection. + :rtype: list[ProfileSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this ProfileCollection. + A collection of profile summaries. + + + :param items: The items of this ProfileCollection. + :type: list[ProfileSummary] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/profile_summary.py b/src/oci/optimizer/models/profile_summary.py new file mode 100644 index 0000000000..0aa94b5e65 --- /dev/null +++ b/src/oci/optimizer/models/profile_summary.py @@ -0,0 +1,409 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class ProfileSummary(object): + """ + The metadata associated with the profile summary. + """ + + #: A constant which can be used with the lifecycle_state property of a ProfileSummary. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a ProfileSummary. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a ProfileSummary. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a ProfileSummary. + #: This constant has a value of "ATTACHING" + LIFECYCLE_STATE_ATTACHING = "ATTACHING" + + #: A constant which can be used with the lifecycle_state property of a ProfileSummary. + #: This constant has a value of "DETACHING" + LIFECYCLE_STATE_DETACHING = "DETACHING" + + #: A constant which can be used with the lifecycle_state property of a ProfileSummary. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a ProfileSummary. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a ProfileSummary. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a ProfileSummary. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + def __init__(self, **kwargs): + """ + Initializes a new ProfileSummary object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this ProfileSummary. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this ProfileSummary. + :type compartment_id: str + + :param name: + The value to assign to the name property of this ProfileSummary. + :type name: str + + :param description: + The value to assign to the description property of this ProfileSummary. + :type description: str + + :param defined_tags: + The value to assign to the defined_tags property of this ProfileSummary. + :type defined_tags: dict(str, dict(str, object)) + + :param freeform_tags: + The value to assign to the freeform_tags property of this ProfileSummary. + :type freeform_tags: dict(str, str) + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this ProfileSummary. + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param levels_configuration: + The value to assign to the levels_configuration property of this ProfileSummary. + :type levels_configuration: LevelsConfiguration + + :param time_created: + The value to assign to the time_created property of this ProfileSummary. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this ProfileSummary. + :type time_updated: datetime + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'name': 'str', + 'description': 'str', + 'defined_tags': 'dict(str, dict(str, object))', + 'freeform_tags': 'dict(str, str)', + 'lifecycle_state': 'str', + 'levels_configuration': 'LevelsConfiguration', + 'time_created': 'datetime', + 'time_updated': 'datetime' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'name': 'name', + 'description': 'description', + 'defined_tags': 'definedTags', + 'freeform_tags': 'freeformTags', + 'lifecycle_state': 'lifecycleState', + 'levels_configuration': 'levelsConfiguration', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated' + } + + self._id = None + self._compartment_id = None + self._name = None + self._description = None + self._defined_tags = None + self._freeform_tags = None + self._lifecycle_state = None + self._levels_configuration = None + self._time_created = None + self._time_updated = None + + @property + def id(self): + """ + **[Required]** Gets the id of this ProfileSummary. + The unique OCID of the profile. + + + :return: The id of this ProfileSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this ProfileSummary. + The unique OCID of the profile. + + + :param id: The id of this ProfileSummary. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this ProfileSummary. + The OCID of the tenancy. The tenancy is the root compartment. + + + :return: The compartment_id of this ProfileSummary. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this ProfileSummary. + The OCID of the tenancy. The tenancy is the root compartment. + + + :param compartment_id: The compartment_id of this ProfileSummary. + :type: str + """ + self._compartment_id = compartment_id + + @property + def name(self): + """ + **[Required]** Gets the name of this ProfileSummary. + The name assigned to the profile. + + + :return: The name of this ProfileSummary. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this ProfileSummary. + The name assigned to the profile. + + + :param name: The name of this ProfileSummary. + :type: str + """ + self._name = name + + @property + def description(self): + """ + **[Required]** Gets the description of this ProfileSummary. + Text describing the profile. + + + :return: The description of this ProfileSummary. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """ + Sets the description of this ProfileSummary. + Text describing the profile. + + + :param description: The description of this ProfileSummary. + :type: str + """ + self._description = description + + @property + def defined_tags(self): + """ + Gets the defined_tags of this ProfileSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this ProfileSummary. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this ProfileSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this ProfileSummary. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this ProfileSummary. + Simple key-value pair applied without any predefined name, type, or namespace. + For more information, see `Resource Tags`__. Exists for cross-compatibility only. + + Example: `{\"bar-key\": \"value\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this ProfileSummary. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this ProfileSummary. + Simple key-value pair applied without any predefined name, type, or namespace. + For more information, see `Resource Tags`__. Exists for cross-compatibility only. + + Example: `{\"bar-key\": \"value\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this ProfileSummary. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this ProfileSummary. + The profile's current state. + + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this ProfileSummary. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this ProfileSummary. + The profile's current state. + + + :param lifecycle_state: The lifecycle_state of this ProfileSummary. + :type: str + """ + allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def levels_configuration(self): + """ + Gets the levels_configuration of this ProfileSummary. + + :return: The levels_configuration of this ProfileSummary. + :rtype: LevelsConfiguration + """ + return self._levels_configuration + + @levels_configuration.setter + def levels_configuration(self, levels_configuration): + """ + Sets the levels_configuration of this ProfileSummary. + + :param levels_configuration: The levels_configuration of this ProfileSummary. + :type: LevelsConfiguration + """ + self._levels_configuration = levels_configuration + + @property + def time_created(self): + """ + **[Required]** Gets the time_created of this ProfileSummary. + The date and time the profile was created, in the format defined by RFC3339. + + + :return: The time_created of this ProfileSummary. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this ProfileSummary. + The date and time the profile was created, in the format defined by RFC3339. + + + :param time_created: The time_created of this ProfileSummary. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + **[Required]** Gets the time_updated of this ProfileSummary. + The date and time the profile was last updated, in the format defined by RFC3339. + + + :return: The time_updated of this ProfileSummary. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this ProfileSummary. + The date and time the profile was last updated, in the format defined by RFC3339. + + + :param time_updated: The time_updated of this ProfileSummary. + :type: datetime + """ + self._time_updated = time_updated + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/recommendation.py b/src/oci/optimizer/models/recommendation.py new file mode 100644 index 0000000000..428a6c1b0b --- /dev/null +++ b/src/oci/optimizer/models/recommendation.py @@ -0,0 +1,608 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class Recommendation(object): + """ + The metadata associated with the recommendation. + + **Caution:** Avoid using any confidential information when you supply string values using the API. + """ + + #: A constant which can be used with the importance property of a Recommendation. + #: This constant has a value of "CRITICAL" + IMPORTANCE_CRITICAL = "CRITICAL" + + #: A constant which can be used with the importance property of a Recommendation. + #: This constant has a value of "HIGH" + IMPORTANCE_HIGH = "HIGH" + + #: A constant which can be used with the importance property of a Recommendation. + #: This constant has a value of "MODERATE" + IMPORTANCE_MODERATE = "MODERATE" + + #: A constant which can be used with the importance property of a Recommendation. + #: This constant has a value of "LOW" + IMPORTANCE_LOW = "LOW" + + #: A constant which can be used with the importance property of a Recommendation. + #: This constant has a value of "MINOR" + IMPORTANCE_MINOR = "MINOR" + + #: A constant which can be used with the lifecycle_state property of a Recommendation. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a Recommendation. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a Recommendation. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a Recommendation. + #: This constant has a value of "ATTACHING" + LIFECYCLE_STATE_ATTACHING = "ATTACHING" + + #: A constant which can be used with the lifecycle_state property of a Recommendation. + #: This constant has a value of "DETACHING" + LIFECYCLE_STATE_DETACHING = "DETACHING" + + #: A constant which can be used with the lifecycle_state property of a Recommendation. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a Recommendation. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a Recommendation. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a Recommendation. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the status property of a Recommendation. + #: This constant has a value of "PENDING" + STATUS_PENDING = "PENDING" + + #: A constant which can be used with the status property of a Recommendation. + #: This constant has a value of "DISMISSED" + STATUS_DISMISSED = "DISMISSED" + + #: A constant which can be used with the status property of a Recommendation. + #: This constant has a value of "POSTPONED" + STATUS_POSTPONED = "POSTPONED" + + #: A constant which can be used with the status property of a Recommendation. + #: This constant has a value of "IMPLEMENTED" + STATUS_IMPLEMENTED = "IMPLEMENTED" + + def __init__(self, **kwargs): + """ + Initializes a new Recommendation object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this Recommendation. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this Recommendation. + :type compartment_id: str + + :param category_id: + The value to assign to the category_id property of this Recommendation. + :type category_id: str + + :param name: + The value to assign to the name property of this Recommendation. + :type name: str + + :param description: + The value to assign to the description property of this Recommendation. + :type description: str + + :param importance: + The value to assign to the importance property of this Recommendation. + Allowed values for this property are: "CRITICAL", "HIGH", "MODERATE", "LOW", "MINOR", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type importance: str + + :param resource_counts: + The value to assign to the resource_counts property of this Recommendation. + :type resource_counts: list[ResourceCount] + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this Recommendation. + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param estimated_cost_saving: + The value to assign to the estimated_cost_saving property of this Recommendation. + :type estimated_cost_saving: float + + :param status: + The value to assign to the status property of this Recommendation. + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param time_status_begin: + The value to assign to the time_status_begin property of this Recommendation. + :type time_status_begin: datetime + + :param time_status_end: + The value to assign to the time_status_end property of this Recommendation. + :type time_status_end: datetime + + :param time_created: + The value to assign to the time_created property of this Recommendation. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this Recommendation. + :type time_updated: datetime + + :param supported_levels: + The value to assign to the supported_levels property of this Recommendation. + :type supported_levels: SupportedLevels + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'category_id': 'str', + 'name': 'str', + 'description': 'str', + 'importance': 'str', + 'resource_counts': 'list[ResourceCount]', + 'lifecycle_state': 'str', + 'estimated_cost_saving': 'float', + 'status': 'str', + 'time_status_begin': 'datetime', + 'time_status_end': 'datetime', + 'time_created': 'datetime', + 'time_updated': 'datetime', + 'supported_levels': 'SupportedLevels' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'category_id': 'categoryId', + 'name': 'name', + 'description': 'description', + 'importance': 'importance', + 'resource_counts': 'resourceCounts', + 'lifecycle_state': 'lifecycleState', + 'estimated_cost_saving': 'estimatedCostSaving', + 'status': 'status', + 'time_status_begin': 'timeStatusBegin', + 'time_status_end': 'timeStatusEnd', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated', + 'supported_levels': 'supportedLevels' + } + + self._id = None + self._compartment_id = None + self._category_id = None + self._name = None + self._description = None + self._importance = None + self._resource_counts = None + self._lifecycle_state = None + self._estimated_cost_saving = None + self._status = None + self._time_status_begin = None + self._time_status_end = None + self._time_created = None + self._time_updated = None + self._supported_levels = None + + @property + def id(self): + """ + **[Required]** Gets the id of this Recommendation. + The unique OCID associated with the recommendation. + + + :return: The id of this Recommendation. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this Recommendation. + The unique OCID associated with the recommendation. + + + :param id: The id of this Recommendation. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this Recommendation. + The OCID of the tenancy. The tenancy is the root compartment. + + + :return: The compartment_id of this Recommendation. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this Recommendation. + The OCID of the tenancy. The tenancy is the root compartment. + + + :param compartment_id: The compartment_id of this Recommendation. + :type: str + """ + self._compartment_id = compartment_id + + @property + def category_id(self): + """ + **[Required]** Gets the category_id of this Recommendation. + The unique OCID associated with the category. + + + :return: The category_id of this Recommendation. + :rtype: str + """ + return self._category_id + + @category_id.setter + def category_id(self, category_id): + """ + Sets the category_id of this Recommendation. + The unique OCID associated with the category. + + + :param category_id: The category_id of this Recommendation. + :type: str + """ + self._category_id = category_id + + @property + def name(self): + """ + **[Required]** Gets the name of this Recommendation. + The name assigned to the recommendation. + + + :return: The name of this Recommendation. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this Recommendation. + The name assigned to the recommendation. + + + :param name: The name of this Recommendation. + :type: str + """ + self._name = name + + @property + def description(self): + """ + **[Required]** Gets the description of this Recommendation. + Text describing the recommendation. + + + :return: The description of this Recommendation. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """ + Sets the description of this Recommendation. + Text describing the recommendation. + + + :param description: The description of this Recommendation. + :type: str + """ + self._description = description + + @property + def importance(self): + """ + **[Required]** Gets the importance of this Recommendation. + The level of importance assigned to the recommendation. + + Allowed values for this property are: "CRITICAL", "HIGH", "MODERATE", "LOW", "MINOR", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The importance of this Recommendation. + :rtype: str + """ + return self._importance + + @importance.setter + def importance(self, importance): + """ + Sets the importance of this Recommendation. + The level of importance assigned to the recommendation. + + + :param importance: The importance of this Recommendation. + :type: str + """ + allowed_values = ["CRITICAL", "HIGH", "MODERATE", "LOW", "MINOR"] + if not value_allowed_none_or_none_sentinel(importance, allowed_values): + importance = 'UNKNOWN_ENUM_VALUE' + self._importance = importance + + @property + def resource_counts(self): + """ + **[Required]** Gets the resource_counts of this Recommendation. + An array of `ResourceCount` objects grouped by the status of the resource actions. + + + :return: The resource_counts of this Recommendation. + :rtype: list[ResourceCount] + """ + return self._resource_counts + + @resource_counts.setter + def resource_counts(self, resource_counts): + """ + Sets the resource_counts of this Recommendation. + An array of `ResourceCount` objects grouped by the status of the resource actions. + + + :param resource_counts: The resource_counts of this Recommendation. + :type: list[ResourceCount] + """ + self._resource_counts = resource_counts + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this Recommendation. + The recommendation's current state. + + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this Recommendation. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this Recommendation. + The recommendation's current state. + + + :param lifecycle_state: The lifecycle_state of this Recommendation. + :type: str + """ + allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def estimated_cost_saving(self): + """ + **[Required]** Gets the estimated_cost_saving of this Recommendation. + The estimated cost savings, in dollars, for the recommendation. + + + :return: The estimated_cost_saving of this Recommendation. + :rtype: float + """ + return self._estimated_cost_saving + + @estimated_cost_saving.setter + def estimated_cost_saving(self, estimated_cost_saving): + """ + Sets the estimated_cost_saving of this Recommendation. + The estimated cost savings, in dollars, for the recommendation. + + + :param estimated_cost_saving: The estimated_cost_saving of this Recommendation. + :type: float + """ + self._estimated_cost_saving = estimated_cost_saving + + @property + def status(self): + """ + **[Required]** Gets the status of this Recommendation. + The current status of the recommendation. + + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this Recommendation. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this Recommendation. + The current status of the recommendation. + + + :param status: The status of this Recommendation. + :type: str + """ + allowed_values = ["PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def time_status_begin(self): + """ + **[Required]** Gets the time_status_begin of this Recommendation. + The date and time that the recommendation entered its current status. The format is defined by RFC3339. + + For example, \"The status of the recommendation changed from `pending` to `current(ignored)` on this date and time.\" + + + :return: The time_status_begin of this Recommendation. + :rtype: datetime + """ + return self._time_status_begin + + @time_status_begin.setter + def time_status_begin(self, time_status_begin): + """ + Sets the time_status_begin of this Recommendation. + The date and time that the recommendation entered its current status. The format is defined by RFC3339. + + For example, \"The status of the recommendation changed from `pending` to `current(ignored)` on this date and time.\" + + + :param time_status_begin: The time_status_begin of this Recommendation. + :type: datetime + """ + self._time_status_begin = time_status_begin + + @property + def time_status_end(self): + """ + Gets the time_status_end of this Recommendation. + The date and time the current status will change. The format is defined by RFC3339. + + For example, \"The current `postponed` status of the recommendation will end and change to `pending` on this + date and time.\" + + + :return: The time_status_end of this Recommendation. + :rtype: datetime + """ + return self._time_status_end + + @time_status_end.setter + def time_status_end(self, time_status_end): + """ + Sets the time_status_end of this Recommendation. + The date and time the current status will change. The format is defined by RFC3339. + + For example, \"The current `postponed` status of the recommendation will end and change to `pending` on this + date and time.\" + + + :param time_status_end: The time_status_end of this Recommendation. + :type: datetime + """ + self._time_status_end = time_status_end + + @property + def time_created(self): + """ + Gets the time_created of this Recommendation. + The date and time the recommendation details were created, in the format defined by RFC3339. + + + :return: The time_created of this Recommendation. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this Recommendation. + The date and time the recommendation details were created, in the format defined by RFC3339. + + + :param time_created: The time_created of this Recommendation. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + Gets the time_updated of this Recommendation. + The date and time the recommendation details were last updated, in the format defined by RFC3339. + + + :return: The time_updated of this Recommendation. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this Recommendation. + The date and time the recommendation details were last updated, in the format defined by RFC3339. + + + :param time_updated: The time_updated of this Recommendation. + :type: datetime + """ + self._time_updated = time_updated + + @property + def supported_levels(self): + """ + Gets the supported_levels of this Recommendation. + + :return: The supported_levels of this Recommendation. + :rtype: SupportedLevels + """ + return self._supported_levels + + @supported_levels.setter + def supported_levels(self, supported_levels): + """ + Sets the supported_levels of this Recommendation. + + :param supported_levels: The supported_levels of this Recommendation. + :type: SupportedLevels + """ + self._supported_levels = supported_levels + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/recommendation_collection.py b/src/oci/optimizer/models/recommendation_collection.py new file mode 100644 index 0000000000..603b96c724 --- /dev/null +++ b/src/oci/optimizer/models/recommendation_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class RecommendationCollection(object): + """ + A list of recommendations that match filter criteria, if any. Results contain `RecommendationSummary` objects. + """ + + def __init__(self, **kwargs): + """ + Initializes a new RecommendationCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this RecommendationCollection. + :type items: list[RecommendationSummary] + + """ + self.swagger_types = { + 'items': 'list[RecommendationSummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this RecommendationCollection. + A collection of recommendations. + + + :return: The items of this RecommendationCollection. + :rtype: list[RecommendationSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this RecommendationCollection. + A collection of recommendations. + + + :param items: The items of this RecommendationCollection. + :type: list[RecommendationSummary] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/recommendation_count.py b/src/oci/optimizer/models/recommendation_count.py new file mode 100644 index 0000000000..b24ae6ea86 --- /dev/null +++ b/src/oci/optimizer/models/recommendation_count.py @@ -0,0 +1,129 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class RecommendationCount(object): + """ + The count of recommendations in a category, grouped by importance. + """ + + #: A constant which can be used with the importance property of a RecommendationCount. + #: This constant has a value of "CRITICAL" + IMPORTANCE_CRITICAL = "CRITICAL" + + #: A constant which can be used with the importance property of a RecommendationCount. + #: This constant has a value of "HIGH" + IMPORTANCE_HIGH = "HIGH" + + #: A constant which can be used with the importance property of a RecommendationCount. + #: This constant has a value of "MODERATE" + IMPORTANCE_MODERATE = "MODERATE" + + #: A constant which can be used with the importance property of a RecommendationCount. + #: This constant has a value of "LOW" + IMPORTANCE_LOW = "LOW" + + #: A constant which can be used with the importance property of a RecommendationCount. + #: This constant has a value of "MINOR" + IMPORTANCE_MINOR = "MINOR" + + def __init__(self, **kwargs): + """ + Initializes a new RecommendationCount object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param importance: + The value to assign to the importance property of this RecommendationCount. + Allowed values for this property are: "CRITICAL", "HIGH", "MODERATE", "LOW", "MINOR", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type importance: str + + :param count: + The value to assign to the count property of this RecommendationCount. + :type count: int + + """ + self.swagger_types = { + 'importance': 'str', + 'count': 'int' + } + + self.attribute_map = { + 'importance': 'importance', + 'count': 'count' + } + + self._importance = None + self._count = None + + @property + def importance(self): + """ + **[Required]** Gets the importance of this RecommendationCount. + The level of importance assigned to the recommendation. + + Allowed values for this property are: "CRITICAL", "HIGH", "MODERATE", "LOW", "MINOR", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The importance of this RecommendationCount. + :rtype: str + """ + return self._importance + + @importance.setter + def importance(self, importance): + """ + Sets the importance of this RecommendationCount. + The level of importance assigned to the recommendation. + + + :param importance: The importance of this RecommendationCount. + :type: str + """ + allowed_values = ["CRITICAL", "HIGH", "MODERATE", "LOW", "MINOR"] + if not value_allowed_none_or_none_sentinel(importance, allowed_values): + importance = 'UNKNOWN_ENUM_VALUE' + self._importance = importance + + @property + def count(self): + """ + **[Required]** Gets the count of this RecommendationCount. + The count of recommendations. + + + :return: The count of this RecommendationCount. + :rtype: int + """ + return self._count + + @count.setter + def count(self, count): + """ + Sets the count of this RecommendationCount. + The count of recommendations. + + + :param count: The count of this RecommendationCount. + :type: int + """ + self._count = count + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/recommendation_summary.py b/src/oci/optimizer/models/recommendation_summary.py new file mode 100644 index 0000000000..6295b733e4 --- /dev/null +++ b/src/oci/optimizer/models/recommendation_summary.py @@ -0,0 +1,608 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class RecommendationSummary(object): + """ + The metadata associated with the recommendation summary. + + **Caution:** Avoid using any confidential information when you supply string values using the API. + """ + + #: A constant which can be used with the importance property of a RecommendationSummary. + #: This constant has a value of "CRITICAL" + IMPORTANCE_CRITICAL = "CRITICAL" + + #: A constant which can be used with the importance property of a RecommendationSummary. + #: This constant has a value of "HIGH" + IMPORTANCE_HIGH = "HIGH" + + #: A constant which can be used with the importance property of a RecommendationSummary. + #: This constant has a value of "MODERATE" + IMPORTANCE_MODERATE = "MODERATE" + + #: A constant which can be used with the importance property of a RecommendationSummary. + #: This constant has a value of "LOW" + IMPORTANCE_LOW = "LOW" + + #: A constant which can be used with the importance property of a RecommendationSummary. + #: This constant has a value of "MINOR" + IMPORTANCE_MINOR = "MINOR" + + #: A constant which can be used with the lifecycle_state property of a RecommendationSummary. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a RecommendationSummary. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a RecommendationSummary. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a RecommendationSummary. + #: This constant has a value of "ATTACHING" + LIFECYCLE_STATE_ATTACHING = "ATTACHING" + + #: A constant which can be used with the lifecycle_state property of a RecommendationSummary. + #: This constant has a value of "DETACHING" + LIFECYCLE_STATE_DETACHING = "DETACHING" + + #: A constant which can be used with the lifecycle_state property of a RecommendationSummary. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a RecommendationSummary. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a RecommendationSummary. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a RecommendationSummary. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the status property of a RecommendationSummary. + #: This constant has a value of "PENDING" + STATUS_PENDING = "PENDING" + + #: A constant which can be used with the status property of a RecommendationSummary. + #: This constant has a value of "DISMISSED" + STATUS_DISMISSED = "DISMISSED" + + #: A constant which can be used with the status property of a RecommendationSummary. + #: This constant has a value of "POSTPONED" + STATUS_POSTPONED = "POSTPONED" + + #: A constant which can be used with the status property of a RecommendationSummary. + #: This constant has a value of "IMPLEMENTED" + STATUS_IMPLEMENTED = "IMPLEMENTED" + + def __init__(self, **kwargs): + """ + Initializes a new RecommendationSummary object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this RecommendationSummary. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this RecommendationSummary. + :type compartment_id: str + + :param category_id: + The value to assign to the category_id property of this RecommendationSummary. + :type category_id: str + + :param name: + The value to assign to the name property of this RecommendationSummary. + :type name: str + + :param description: + The value to assign to the description property of this RecommendationSummary. + :type description: str + + :param importance: + The value to assign to the importance property of this RecommendationSummary. + Allowed values for this property are: "CRITICAL", "HIGH", "MODERATE", "LOW", "MINOR", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type importance: str + + :param resource_counts: + The value to assign to the resource_counts property of this RecommendationSummary. + :type resource_counts: list[ResourceCount] + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this RecommendationSummary. + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param estimated_cost_saving: + The value to assign to the estimated_cost_saving property of this RecommendationSummary. + :type estimated_cost_saving: float + + :param status: + The value to assign to the status property of this RecommendationSummary. + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param time_status_begin: + The value to assign to the time_status_begin property of this RecommendationSummary. + :type time_status_begin: datetime + + :param time_status_end: + The value to assign to the time_status_end property of this RecommendationSummary. + :type time_status_end: datetime + + :param time_created: + The value to assign to the time_created property of this RecommendationSummary. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this RecommendationSummary. + :type time_updated: datetime + + :param supported_levels: + The value to assign to the supported_levels property of this RecommendationSummary. + :type supported_levels: SupportedLevels + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'category_id': 'str', + 'name': 'str', + 'description': 'str', + 'importance': 'str', + 'resource_counts': 'list[ResourceCount]', + 'lifecycle_state': 'str', + 'estimated_cost_saving': 'float', + 'status': 'str', + 'time_status_begin': 'datetime', + 'time_status_end': 'datetime', + 'time_created': 'datetime', + 'time_updated': 'datetime', + 'supported_levels': 'SupportedLevels' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'category_id': 'categoryId', + 'name': 'name', + 'description': 'description', + 'importance': 'importance', + 'resource_counts': 'resourceCounts', + 'lifecycle_state': 'lifecycleState', + 'estimated_cost_saving': 'estimatedCostSaving', + 'status': 'status', + 'time_status_begin': 'timeStatusBegin', + 'time_status_end': 'timeStatusEnd', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated', + 'supported_levels': 'supportedLevels' + } + + self._id = None + self._compartment_id = None + self._category_id = None + self._name = None + self._description = None + self._importance = None + self._resource_counts = None + self._lifecycle_state = None + self._estimated_cost_saving = None + self._status = None + self._time_status_begin = None + self._time_status_end = None + self._time_created = None + self._time_updated = None + self._supported_levels = None + + @property + def id(self): + """ + **[Required]** Gets the id of this RecommendationSummary. + The unique OCID associated with the recommendation. + + + :return: The id of this RecommendationSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this RecommendationSummary. + The unique OCID associated with the recommendation. + + + :param id: The id of this RecommendationSummary. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this RecommendationSummary. + The OCID of the tenancy. The tenancy is the root compartment. + + + :return: The compartment_id of this RecommendationSummary. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this RecommendationSummary. + The OCID of the tenancy. The tenancy is the root compartment. + + + :param compartment_id: The compartment_id of this RecommendationSummary. + :type: str + """ + self._compartment_id = compartment_id + + @property + def category_id(self): + """ + **[Required]** Gets the category_id of this RecommendationSummary. + The unique OCID associated with the category. + + + :return: The category_id of this RecommendationSummary. + :rtype: str + """ + return self._category_id + + @category_id.setter + def category_id(self, category_id): + """ + Sets the category_id of this RecommendationSummary. + The unique OCID associated with the category. + + + :param category_id: The category_id of this RecommendationSummary. + :type: str + """ + self._category_id = category_id + + @property + def name(self): + """ + **[Required]** Gets the name of this RecommendationSummary. + The name assigned to the recommendation. + + + :return: The name of this RecommendationSummary. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this RecommendationSummary. + The name assigned to the recommendation. + + + :param name: The name of this RecommendationSummary. + :type: str + """ + self._name = name + + @property + def description(self): + """ + **[Required]** Gets the description of this RecommendationSummary. + Text describing the recommendation. + + + :return: The description of this RecommendationSummary. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """ + Sets the description of this RecommendationSummary. + Text describing the recommendation. + + + :param description: The description of this RecommendationSummary. + :type: str + """ + self._description = description + + @property + def importance(self): + """ + **[Required]** Gets the importance of this RecommendationSummary. + The level of importance assigned to the recommendation. + + Allowed values for this property are: "CRITICAL", "HIGH", "MODERATE", "LOW", "MINOR", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The importance of this RecommendationSummary. + :rtype: str + """ + return self._importance + + @importance.setter + def importance(self, importance): + """ + Sets the importance of this RecommendationSummary. + The level of importance assigned to the recommendation. + + + :param importance: The importance of this RecommendationSummary. + :type: str + """ + allowed_values = ["CRITICAL", "HIGH", "MODERATE", "LOW", "MINOR"] + if not value_allowed_none_or_none_sentinel(importance, allowed_values): + importance = 'UNKNOWN_ENUM_VALUE' + self._importance = importance + + @property + def resource_counts(self): + """ + **[Required]** Gets the resource_counts of this RecommendationSummary. + An array of `ResourceCount` objects grouped by the status of the resource actions. + + + :return: The resource_counts of this RecommendationSummary. + :rtype: list[ResourceCount] + """ + return self._resource_counts + + @resource_counts.setter + def resource_counts(self, resource_counts): + """ + Sets the resource_counts of this RecommendationSummary. + An array of `ResourceCount` objects grouped by the status of the resource actions. + + + :param resource_counts: The resource_counts of this RecommendationSummary. + :type: list[ResourceCount] + """ + self._resource_counts = resource_counts + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this RecommendationSummary. + The recommendation's current state. + + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this RecommendationSummary. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this RecommendationSummary. + The recommendation's current state. + + + :param lifecycle_state: The lifecycle_state of this RecommendationSummary. + :type: str + """ + allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def estimated_cost_saving(self): + """ + **[Required]** Gets the estimated_cost_saving of this RecommendationSummary. + The estimated cost savings, in dollars, for the recommendation. + + + :return: The estimated_cost_saving of this RecommendationSummary. + :rtype: float + """ + return self._estimated_cost_saving + + @estimated_cost_saving.setter + def estimated_cost_saving(self, estimated_cost_saving): + """ + Sets the estimated_cost_saving of this RecommendationSummary. + The estimated cost savings, in dollars, for the recommendation. + + + :param estimated_cost_saving: The estimated_cost_saving of this RecommendationSummary. + :type: float + """ + self._estimated_cost_saving = estimated_cost_saving + + @property + def status(self): + """ + **[Required]** Gets the status of this RecommendationSummary. + The current status of the recommendation. + + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this RecommendationSummary. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this RecommendationSummary. + The current status of the recommendation. + + + :param status: The status of this RecommendationSummary. + :type: str + """ + allowed_values = ["PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def time_status_begin(self): + """ + **[Required]** Gets the time_status_begin of this RecommendationSummary. + The date and time that the recommendation entered its current status. The format is defined by RFC3339. + + For example, \"The status of the recommendation changed from `pending` to `current(ignored)` on this date and time.\" + + + :return: The time_status_begin of this RecommendationSummary. + :rtype: datetime + """ + return self._time_status_begin + + @time_status_begin.setter + def time_status_begin(self, time_status_begin): + """ + Sets the time_status_begin of this RecommendationSummary. + The date and time that the recommendation entered its current status. The format is defined by RFC3339. + + For example, \"The status of the recommendation changed from `pending` to `current(ignored)` on this date and time.\" + + + :param time_status_begin: The time_status_begin of this RecommendationSummary. + :type: datetime + """ + self._time_status_begin = time_status_begin + + @property + def time_status_end(self): + """ + Gets the time_status_end of this RecommendationSummary. + The date and time the current status will change. The format is defined by RFC3339. + + For example, \"The current `postponed` status of the recommendation will end and change to `pending` on this + date and time.\" + + + :return: The time_status_end of this RecommendationSummary. + :rtype: datetime + """ + return self._time_status_end + + @time_status_end.setter + def time_status_end(self, time_status_end): + """ + Sets the time_status_end of this RecommendationSummary. + The date and time the current status will change. The format is defined by RFC3339. + + For example, \"The current `postponed` status of the recommendation will end and change to `pending` on this + date and time.\" + + + :param time_status_end: The time_status_end of this RecommendationSummary. + :type: datetime + """ + self._time_status_end = time_status_end + + @property + def time_created(self): + """ + Gets the time_created of this RecommendationSummary. + The date and time the recommendation details were created, in the format defined by RFC3339. + + + :return: The time_created of this RecommendationSummary. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this RecommendationSummary. + The date and time the recommendation details were created, in the format defined by RFC3339. + + + :param time_created: The time_created of this RecommendationSummary. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + Gets the time_updated of this RecommendationSummary. + The date and time the recommendation details were last updated, in the format defined by RFC3339. + + + :return: The time_updated of this RecommendationSummary. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this RecommendationSummary. + The date and time the recommendation details were last updated, in the format defined by RFC3339. + + + :param time_updated: The time_updated of this RecommendationSummary. + :type: datetime + """ + self._time_updated = time_updated + + @property + def supported_levels(self): + """ + Gets the supported_levels of this RecommendationSummary. + + :return: The supported_levels of this RecommendationSummary. + :rtype: SupportedLevels + """ + return self._supported_levels + + @supported_levels.setter + def supported_levels(self, supported_levels): + """ + Sets the supported_levels of this RecommendationSummary. + + :param supported_levels: The supported_levels of this RecommendationSummary. + :type: SupportedLevels + """ + self._supported_levels = supported_levels + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/resource_action.py b/src/oci/optimizer/models/resource_action.py new file mode 100644 index 0000000000..bbf58a8980 --- /dev/null +++ b/src/oci/optimizer/models/resource_action.py @@ -0,0 +1,709 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class ResourceAction(object): + """ + The metadata associated with the resource action. + + **Caution:** Avoid using any confidential information when you use the API to supply string values. + """ + + #: A constant which can be used with the lifecycle_state property of a ResourceAction. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a ResourceAction. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a ResourceAction. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a ResourceAction. + #: This constant has a value of "ATTACHING" + LIFECYCLE_STATE_ATTACHING = "ATTACHING" + + #: A constant which can be used with the lifecycle_state property of a ResourceAction. + #: This constant has a value of "DETACHING" + LIFECYCLE_STATE_DETACHING = "DETACHING" + + #: A constant which can be used with the lifecycle_state property of a ResourceAction. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a ResourceAction. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a ResourceAction. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a ResourceAction. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the status property of a ResourceAction. + #: This constant has a value of "PENDING" + STATUS_PENDING = "PENDING" + + #: A constant which can be used with the status property of a ResourceAction. + #: This constant has a value of "DISMISSED" + STATUS_DISMISSED = "DISMISSED" + + #: A constant which can be used with the status property of a ResourceAction. + #: This constant has a value of "POSTPONED" + STATUS_POSTPONED = "POSTPONED" + + #: A constant which can be used with the status property of a ResourceAction. + #: This constant has a value of "IMPLEMENTED" + STATUS_IMPLEMENTED = "IMPLEMENTED" + + def __init__(self, **kwargs): + """ + Initializes a new ResourceAction object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this ResourceAction. + :type id: str + + :param category_id: + The value to assign to the category_id property of this ResourceAction. + :type category_id: str + + :param recommendation_id: + The value to assign to the recommendation_id property of this ResourceAction. + :type recommendation_id: str + + :param resource_id: + The value to assign to the resource_id property of this ResourceAction. + :type resource_id: str + + :param name: + The value to assign to the name property of this ResourceAction. + :type name: str + + :param resource_type: + The value to assign to the resource_type property of this ResourceAction. + :type resource_type: str + + :param compartment_id: + The value to assign to the compartment_id property of this ResourceAction. + :type compartment_id: str + + :param compartment_name: + The value to assign to the compartment_name property of this ResourceAction. + :type compartment_name: str + + :param action: + The value to assign to the action property of this ResourceAction. + :type action: Action + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this ResourceAction. + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param estimated_cost_saving: + The value to assign to the estimated_cost_saving property of this ResourceAction. + :type estimated_cost_saving: float + + :param status: + The value to assign to the status property of this ResourceAction. + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param time_status_begin: + The value to assign to the time_status_begin property of this ResourceAction. + :type time_status_begin: datetime + + :param time_status_end: + The value to assign to the time_status_end property of this ResourceAction. + :type time_status_end: datetime + + :param metadata: + The value to assign to the metadata property of this ResourceAction. + :type metadata: dict(str, str) + + :param extended_metadata: + The value to assign to the extended_metadata property of this ResourceAction. + :type extended_metadata: dict(str, object) + + :param time_created: + The value to assign to the time_created property of this ResourceAction. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this ResourceAction. + :type time_updated: datetime + + """ + self.swagger_types = { + 'id': 'str', + 'category_id': 'str', + 'recommendation_id': 'str', + 'resource_id': 'str', + 'name': 'str', + 'resource_type': 'str', + 'compartment_id': 'str', + 'compartment_name': 'str', + 'action': 'Action', + 'lifecycle_state': 'str', + 'estimated_cost_saving': 'float', + 'status': 'str', + 'time_status_begin': 'datetime', + 'time_status_end': 'datetime', + 'metadata': 'dict(str, str)', + 'extended_metadata': 'dict(str, object)', + 'time_created': 'datetime', + 'time_updated': 'datetime' + } + + self.attribute_map = { + 'id': 'id', + 'category_id': 'categoryId', + 'recommendation_id': 'recommendationId', + 'resource_id': 'resourceId', + 'name': 'name', + 'resource_type': 'resourceType', + 'compartment_id': 'compartmentId', + 'compartment_name': 'compartmentName', + 'action': 'action', + 'lifecycle_state': 'lifecycleState', + 'estimated_cost_saving': 'estimatedCostSaving', + 'status': 'status', + 'time_status_begin': 'timeStatusBegin', + 'time_status_end': 'timeStatusEnd', + 'metadata': 'metadata', + 'extended_metadata': 'extendedMetadata', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated' + } + + self._id = None + self._category_id = None + self._recommendation_id = None + self._resource_id = None + self._name = None + self._resource_type = None + self._compartment_id = None + self._compartment_name = None + self._action = None + self._lifecycle_state = None + self._estimated_cost_saving = None + self._status = None + self._time_status_begin = None + self._time_status_end = None + self._metadata = None + self._extended_metadata = None + self._time_created = None + self._time_updated = None + + @property + def id(self): + """ + **[Required]** Gets the id of this ResourceAction. + The unique OCID associated with the resource action. + + + :return: The id of this ResourceAction. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this ResourceAction. + The unique OCID associated with the resource action. + + + :param id: The id of this ResourceAction. + :type: str + """ + self._id = id + + @property + def category_id(self): + """ + **[Required]** Gets the category_id of this ResourceAction. + The unique OCID associated with the category. + + + :return: The category_id of this ResourceAction. + :rtype: str + """ + return self._category_id + + @category_id.setter + def category_id(self, category_id): + """ + Sets the category_id of this ResourceAction. + The unique OCID associated with the category. + + + :param category_id: The category_id of this ResourceAction. + :type: str + """ + self._category_id = category_id + + @property + def recommendation_id(self): + """ + **[Required]** Gets the recommendation_id of this ResourceAction. + The unique OCID associated with the recommendation. + + + :return: The recommendation_id of this ResourceAction. + :rtype: str + """ + return self._recommendation_id + + @recommendation_id.setter + def recommendation_id(self, recommendation_id): + """ + Sets the recommendation_id of this ResourceAction. + The unique OCID associated with the recommendation. + + + :param recommendation_id: The recommendation_id of this ResourceAction. + :type: str + """ + self._recommendation_id = recommendation_id + + @property + def resource_id(self): + """ + **[Required]** Gets the resource_id of this ResourceAction. + The unique OCID associated with the resource. + + + :return: The resource_id of this ResourceAction. + :rtype: str + """ + return self._resource_id + + @resource_id.setter + def resource_id(self, resource_id): + """ + Sets the resource_id of this ResourceAction. + The unique OCID associated with the resource. + + + :param resource_id: The resource_id of this ResourceAction. + :type: str + """ + self._resource_id = resource_id + + @property + def name(self): + """ + **[Required]** Gets the name of this ResourceAction. + The name assigned to the resource. + + + :return: The name of this ResourceAction. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this ResourceAction. + The name assigned to the resource. + + + :param name: The name of this ResourceAction. + :type: str + """ + self._name = name + + @property + def resource_type(self): + """ + **[Required]** Gets the resource_type of this ResourceAction. + The kind of resource. + + + :return: The resource_type of this ResourceAction. + :rtype: str + """ + return self._resource_type + + @resource_type.setter + def resource_type(self, resource_type): + """ + Sets the resource_type of this ResourceAction. + The kind of resource. + + + :param resource_type: The resource_type of this ResourceAction. + :type: str + """ + self._resource_type = resource_type + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this ResourceAction. + The OCID of the compartment. + + + :return: The compartment_id of this ResourceAction. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this ResourceAction. + The OCID of the compartment. + + + :param compartment_id: The compartment_id of this ResourceAction. + :type: str + """ + self._compartment_id = compartment_id + + @property + def compartment_name(self): + """ + **[Required]** Gets the compartment_name of this ResourceAction. + The name associated with the compartment. + + + :return: The compartment_name of this ResourceAction. + :rtype: str + """ + return self._compartment_name + + @compartment_name.setter + def compartment_name(self, compartment_name): + """ + Sets the compartment_name of this ResourceAction. + The name associated with the compartment. + + + :param compartment_name: The compartment_name of this ResourceAction. + :type: str + """ + self._compartment_name = compartment_name + + @property + def action(self): + """ + **[Required]** Gets the action of this ResourceAction. + + :return: The action of this ResourceAction. + :rtype: Action + """ + return self._action + + @action.setter + def action(self, action): + """ + Sets the action of this ResourceAction. + + :param action: The action of this ResourceAction. + :type: Action + """ + self._action = action + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this ResourceAction. + The resource action's current state. + + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this ResourceAction. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this ResourceAction. + The resource action's current state. + + + :param lifecycle_state: The lifecycle_state of this ResourceAction. + :type: str + """ + allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def estimated_cost_saving(self): + """ + **[Required]** Gets the estimated_cost_saving of this ResourceAction. + The estimated cost savings, in dollars, for the resource action. + + + :return: The estimated_cost_saving of this ResourceAction. + :rtype: float + """ + return self._estimated_cost_saving + + @estimated_cost_saving.setter + def estimated_cost_saving(self, estimated_cost_saving): + """ + Sets the estimated_cost_saving of this ResourceAction. + The estimated cost savings, in dollars, for the resource action. + + + :param estimated_cost_saving: The estimated_cost_saving of this ResourceAction. + :type: float + """ + self._estimated_cost_saving = estimated_cost_saving + + @property + def status(self): + """ + **[Required]** Gets the status of this ResourceAction. + The current status of the resource action. + + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this ResourceAction. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this ResourceAction. + The current status of the resource action. + + + :param status: The status of this ResourceAction. + :type: str + """ + allowed_values = ["PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def time_status_begin(self): + """ + **[Required]** Gets the time_status_begin of this ResourceAction. + The date and time that the resource action entered its current status. The format is defined by RFC3339. + + For example, \"The status of the resource action changed from `pending` to `current(ignored)` on this date and time.\" + + + :return: The time_status_begin of this ResourceAction. + :rtype: datetime + """ + return self._time_status_begin + + @time_status_begin.setter + def time_status_begin(self, time_status_begin): + """ + Sets the time_status_begin of this ResourceAction. + The date and time that the resource action entered its current status. The format is defined by RFC3339. + + For example, \"The status of the resource action changed from `pending` to `current(ignored)` on this date and time.\" + + + :param time_status_begin: The time_status_begin of this ResourceAction. + :type: datetime + """ + self._time_status_begin = time_status_begin + + @property + def time_status_end(self): + """ + Gets the time_status_end of this ResourceAction. + The date and time the current status will change. The format is defined by RFC3339. + + For example, \"The current `postponed` status of the resource action will end and change to `pending` on this + date and time.\" + + + :return: The time_status_end of this ResourceAction. + :rtype: datetime + """ + return self._time_status_end + + @time_status_end.setter + def time_status_end(self, time_status_end): + """ + Sets the time_status_end of this ResourceAction. + The date and time the current status will change. The format is defined by RFC3339. + + For example, \"The current `postponed` status of the resource action will end and change to `pending` on this + date and time.\" + + + :param time_status_end: The time_status_end of this ResourceAction. + :type: datetime + """ + self._time_status_end = time_status_end + + @property + def metadata(self): + """ + Gets the metadata of this ResourceAction. + Custom metadata key/value pairs for the resource action. + + **Metadata Example** + + \"metadata\" : { + \"cpuRecommendedShape\": \"VM.Standard1.1\", + \"computeMemoryUtilization\": \"26.05734124418388\", + \"currentShape\": \"VM.Standard1.2\", + \"instanceRecommendedShape\": \"VM.Standard1.1\", + \"computeCpuUtilization\": \"7.930035319720132\", + \"memoryRecommendedShape\": \"None\" + } + + + :return: The metadata of this ResourceAction. + :rtype: dict(str, str) + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """ + Sets the metadata of this ResourceAction. + Custom metadata key/value pairs for the resource action. + + **Metadata Example** + + \"metadata\" : { + \"cpuRecommendedShape\": \"VM.Standard1.1\", + \"computeMemoryUtilization\": \"26.05734124418388\", + \"currentShape\": \"VM.Standard1.2\", + \"instanceRecommendedShape\": \"VM.Standard1.1\", + \"computeCpuUtilization\": \"7.930035319720132\", + \"memoryRecommendedShape\": \"None\" + } + + + :param metadata: The metadata of this ResourceAction. + :type: dict(str, str) + """ + self._metadata = metadata + + @property + def extended_metadata(self): + """ + Gets the extended_metadata of this ResourceAction. + Additional metadata key/value pairs that you provide. + They serve the same purpose and functionality as fields in the `metadata` object. + + They are distinguished from `metadata` fields in that these can be nested JSON objects (whereas `metadata` fields are string/string maps only). + + For example: + + `{\"CurrentShape\": {\"name\":\"VM.Standard2.16\"}, \"RecommendedShape\": {\"name\":\"VM.Standard2.8\"}}` + + + :return: The extended_metadata of this ResourceAction. + :rtype: dict(str, object) + """ + return self._extended_metadata + + @extended_metadata.setter + def extended_metadata(self, extended_metadata): + """ + Sets the extended_metadata of this ResourceAction. + Additional metadata key/value pairs that you provide. + They serve the same purpose and functionality as fields in the `metadata` object. + + They are distinguished from `metadata` fields in that these can be nested JSON objects (whereas `metadata` fields are string/string maps only). + + For example: + + `{\"CurrentShape\": {\"name\":\"VM.Standard2.16\"}, \"RecommendedShape\": {\"name\":\"VM.Standard2.8\"}}` + + + :param extended_metadata: The extended_metadata of this ResourceAction. + :type: dict(str, object) + """ + self._extended_metadata = extended_metadata + + @property + def time_created(self): + """ + Gets the time_created of this ResourceAction. + The date and time the resource action details were created, in the format defined by RFC3339. + + + :return: The time_created of this ResourceAction. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this ResourceAction. + The date and time the resource action details were created, in the format defined by RFC3339. + + + :param time_created: The time_created of this ResourceAction. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + Gets the time_updated of this ResourceAction. + The date and time the resource action details were last updated, in the format defined by RFC3339. + + + :return: The time_updated of this ResourceAction. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this ResourceAction. + The date and time the resource action details were last updated, in the format defined by RFC3339. + + + :param time_updated: The time_updated of this ResourceAction. + :type: datetime + """ + self._time_updated = time_updated + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/resource_action_collection.py b/src/oci/optimizer/models/resource_action_collection.py new file mode 100644 index 0000000000..be98e932e3 --- /dev/null +++ b/src/oci/optimizer/models/resource_action_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class ResourceActionCollection(object): + """ + A list of resource actions that match filter criteria, if any. Results contain `ResourceActionSummary` objects. + """ + + def __init__(self, **kwargs): + """ + Initializes a new ResourceActionCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this ResourceActionCollection. + :type items: list[ResourceActionSummary] + + """ + self.swagger_types = { + 'items': 'list[ResourceActionSummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this ResourceActionCollection. + A collection of resource actions. + + + :return: The items of this ResourceActionCollection. + :rtype: list[ResourceActionSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this ResourceActionCollection. + A collection of resource actions. + + + :param items: The items of this ResourceActionCollection. + :type: list[ResourceActionSummary] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/resource_action_summary.py b/src/oci/optimizer/models/resource_action_summary.py new file mode 100644 index 0000000000..f72f03c554 --- /dev/null +++ b/src/oci/optimizer/models/resource_action_summary.py @@ -0,0 +1,709 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class ResourceActionSummary(object): + """ + The metadata associated with the resource action summary. + + **Caution:** Avoid using any confidential information when you use the API to supply string values. + """ + + #: A constant which can be used with the lifecycle_state property of a ResourceActionSummary. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a ResourceActionSummary. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a ResourceActionSummary. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a ResourceActionSummary. + #: This constant has a value of "ATTACHING" + LIFECYCLE_STATE_ATTACHING = "ATTACHING" + + #: A constant which can be used with the lifecycle_state property of a ResourceActionSummary. + #: This constant has a value of "DETACHING" + LIFECYCLE_STATE_DETACHING = "DETACHING" + + #: A constant which can be used with the lifecycle_state property of a ResourceActionSummary. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a ResourceActionSummary. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a ResourceActionSummary. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a ResourceActionSummary. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the status property of a ResourceActionSummary. + #: This constant has a value of "PENDING" + STATUS_PENDING = "PENDING" + + #: A constant which can be used with the status property of a ResourceActionSummary. + #: This constant has a value of "DISMISSED" + STATUS_DISMISSED = "DISMISSED" + + #: A constant which can be used with the status property of a ResourceActionSummary. + #: This constant has a value of "POSTPONED" + STATUS_POSTPONED = "POSTPONED" + + #: A constant which can be used with the status property of a ResourceActionSummary. + #: This constant has a value of "IMPLEMENTED" + STATUS_IMPLEMENTED = "IMPLEMENTED" + + def __init__(self, **kwargs): + """ + Initializes a new ResourceActionSummary object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this ResourceActionSummary. + :type id: str + + :param category_id: + The value to assign to the category_id property of this ResourceActionSummary. + :type category_id: str + + :param recommendation_id: + The value to assign to the recommendation_id property of this ResourceActionSummary. + :type recommendation_id: str + + :param resource_id: + The value to assign to the resource_id property of this ResourceActionSummary. + :type resource_id: str + + :param name: + The value to assign to the name property of this ResourceActionSummary. + :type name: str + + :param resource_type: + The value to assign to the resource_type property of this ResourceActionSummary. + :type resource_type: str + + :param compartment_id: + The value to assign to the compartment_id property of this ResourceActionSummary. + :type compartment_id: str + + :param compartment_name: + The value to assign to the compartment_name property of this ResourceActionSummary. + :type compartment_name: str + + :param action: + The value to assign to the action property of this ResourceActionSummary. + :type action: Action + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this ResourceActionSummary. + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param estimated_cost_saving: + The value to assign to the estimated_cost_saving property of this ResourceActionSummary. + :type estimated_cost_saving: float + + :param status: + The value to assign to the status property of this ResourceActionSummary. + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param time_status_begin: + The value to assign to the time_status_begin property of this ResourceActionSummary. + :type time_status_begin: datetime + + :param time_status_end: + The value to assign to the time_status_end property of this ResourceActionSummary. + :type time_status_end: datetime + + :param metadata: + The value to assign to the metadata property of this ResourceActionSummary. + :type metadata: dict(str, str) + + :param extended_metadata: + The value to assign to the extended_metadata property of this ResourceActionSummary. + :type extended_metadata: dict(str, object) + + :param time_created: + The value to assign to the time_created property of this ResourceActionSummary. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this ResourceActionSummary. + :type time_updated: datetime + + """ + self.swagger_types = { + 'id': 'str', + 'category_id': 'str', + 'recommendation_id': 'str', + 'resource_id': 'str', + 'name': 'str', + 'resource_type': 'str', + 'compartment_id': 'str', + 'compartment_name': 'str', + 'action': 'Action', + 'lifecycle_state': 'str', + 'estimated_cost_saving': 'float', + 'status': 'str', + 'time_status_begin': 'datetime', + 'time_status_end': 'datetime', + 'metadata': 'dict(str, str)', + 'extended_metadata': 'dict(str, object)', + 'time_created': 'datetime', + 'time_updated': 'datetime' + } + + self.attribute_map = { + 'id': 'id', + 'category_id': 'categoryId', + 'recommendation_id': 'recommendationId', + 'resource_id': 'resourceId', + 'name': 'name', + 'resource_type': 'resourceType', + 'compartment_id': 'compartmentId', + 'compartment_name': 'compartmentName', + 'action': 'action', + 'lifecycle_state': 'lifecycleState', + 'estimated_cost_saving': 'estimatedCostSaving', + 'status': 'status', + 'time_status_begin': 'timeStatusBegin', + 'time_status_end': 'timeStatusEnd', + 'metadata': 'metadata', + 'extended_metadata': 'extendedMetadata', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated' + } + + self._id = None + self._category_id = None + self._recommendation_id = None + self._resource_id = None + self._name = None + self._resource_type = None + self._compartment_id = None + self._compartment_name = None + self._action = None + self._lifecycle_state = None + self._estimated_cost_saving = None + self._status = None + self._time_status_begin = None + self._time_status_end = None + self._metadata = None + self._extended_metadata = None + self._time_created = None + self._time_updated = None + + @property + def id(self): + """ + **[Required]** Gets the id of this ResourceActionSummary. + The unique OCID associated with the resource action. + + + :return: The id of this ResourceActionSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this ResourceActionSummary. + The unique OCID associated with the resource action. + + + :param id: The id of this ResourceActionSummary. + :type: str + """ + self._id = id + + @property + def category_id(self): + """ + **[Required]** Gets the category_id of this ResourceActionSummary. + The unique OCID associated with the category. + + + :return: The category_id of this ResourceActionSummary. + :rtype: str + """ + return self._category_id + + @category_id.setter + def category_id(self, category_id): + """ + Sets the category_id of this ResourceActionSummary. + The unique OCID associated with the category. + + + :param category_id: The category_id of this ResourceActionSummary. + :type: str + """ + self._category_id = category_id + + @property + def recommendation_id(self): + """ + **[Required]** Gets the recommendation_id of this ResourceActionSummary. + The unique OCID associated with the recommendation. + + + :return: The recommendation_id of this ResourceActionSummary. + :rtype: str + """ + return self._recommendation_id + + @recommendation_id.setter + def recommendation_id(self, recommendation_id): + """ + Sets the recommendation_id of this ResourceActionSummary. + The unique OCID associated with the recommendation. + + + :param recommendation_id: The recommendation_id of this ResourceActionSummary. + :type: str + """ + self._recommendation_id = recommendation_id + + @property + def resource_id(self): + """ + **[Required]** Gets the resource_id of this ResourceActionSummary. + The unique OCID associated with the resource. + + + :return: The resource_id of this ResourceActionSummary. + :rtype: str + """ + return self._resource_id + + @resource_id.setter + def resource_id(self, resource_id): + """ + Sets the resource_id of this ResourceActionSummary. + The unique OCID associated with the resource. + + + :param resource_id: The resource_id of this ResourceActionSummary. + :type: str + """ + self._resource_id = resource_id + + @property + def name(self): + """ + **[Required]** Gets the name of this ResourceActionSummary. + The name assigned to the resource. + + + :return: The name of this ResourceActionSummary. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this ResourceActionSummary. + The name assigned to the resource. + + + :param name: The name of this ResourceActionSummary. + :type: str + """ + self._name = name + + @property + def resource_type(self): + """ + **[Required]** Gets the resource_type of this ResourceActionSummary. + The kind of resource. + + + :return: The resource_type of this ResourceActionSummary. + :rtype: str + """ + return self._resource_type + + @resource_type.setter + def resource_type(self, resource_type): + """ + Sets the resource_type of this ResourceActionSummary. + The kind of resource. + + + :param resource_type: The resource_type of this ResourceActionSummary. + :type: str + """ + self._resource_type = resource_type + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this ResourceActionSummary. + The OCID of the compartment. + + + :return: The compartment_id of this ResourceActionSummary. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this ResourceActionSummary. + The OCID of the compartment. + + + :param compartment_id: The compartment_id of this ResourceActionSummary. + :type: str + """ + self._compartment_id = compartment_id + + @property + def compartment_name(self): + """ + **[Required]** Gets the compartment_name of this ResourceActionSummary. + The name associated with the compartment. + + + :return: The compartment_name of this ResourceActionSummary. + :rtype: str + """ + return self._compartment_name + + @compartment_name.setter + def compartment_name(self, compartment_name): + """ + Sets the compartment_name of this ResourceActionSummary. + The name associated with the compartment. + + + :param compartment_name: The compartment_name of this ResourceActionSummary. + :type: str + """ + self._compartment_name = compartment_name + + @property + def action(self): + """ + **[Required]** Gets the action of this ResourceActionSummary. + + :return: The action of this ResourceActionSummary. + :rtype: Action + """ + return self._action + + @action.setter + def action(self, action): + """ + Sets the action of this ResourceActionSummary. + + :param action: The action of this ResourceActionSummary. + :type: Action + """ + self._action = action + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this ResourceActionSummary. + The resource action's current state. + + Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this ResourceActionSummary. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this ResourceActionSummary. + The resource action's current state. + + + :param lifecycle_state: The lifecycle_state of this ResourceActionSummary. + :type: str + """ + allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def estimated_cost_saving(self): + """ + **[Required]** Gets the estimated_cost_saving of this ResourceActionSummary. + The estimated cost savings, in dollars, for the resource action. + + + :return: The estimated_cost_saving of this ResourceActionSummary. + :rtype: float + """ + return self._estimated_cost_saving + + @estimated_cost_saving.setter + def estimated_cost_saving(self, estimated_cost_saving): + """ + Sets the estimated_cost_saving of this ResourceActionSummary. + The estimated cost savings, in dollars, for the resource action. + + + :param estimated_cost_saving: The estimated_cost_saving of this ResourceActionSummary. + :type: float + """ + self._estimated_cost_saving = estimated_cost_saving + + @property + def status(self): + """ + **[Required]** Gets the status of this ResourceActionSummary. + The current status of the resource action. + + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this ResourceActionSummary. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this ResourceActionSummary. + The current status of the resource action. + + + :param status: The status of this ResourceActionSummary. + :type: str + """ + allowed_values = ["PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def time_status_begin(self): + """ + **[Required]** Gets the time_status_begin of this ResourceActionSummary. + The date and time that the resource action entered its current status. The format is defined by RFC3339. + + For example, \"The status of the resource action changed from `pending` to `current(ignored)` on this date and time.\" + + + :return: The time_status_begin of this ResourceActionSummary. + :rtype: datetime + """ + return self._time_status_begin + + @time_status_begin.setter + def time_status_begin(self, time_status_begin): + """ + Sets the time_status_begin of this ResourceActionSummary. + The date and time that the resource action entered its current status. The format is defined by RFC3339. + + For example, \"The status of the resource action changed from `pending` to `current(ignored)` on this date and time.\" + + + :param time_status_begin: The time_status_begin of this ResourceActionSummary. + :type: datetime + """ + self._time_status_begin = time_status_begin + + @property + def time_status_end(self): + """ + Gets the time_status_end of this ResourceActionSummary. + The date and time the current status will change. The format is defined by RFC3339. + + For example, \"The current `postponed` status of the resource action will end and change to `pending` on this + date and time.\" + + + :return: The time_status_end of this ResourceActionSummary. + :rtype: datetime + """ + return self._time_status_end + + @time_status_end.setter + def time_status_end(self, time_status_end): + """ + Sets the time_status_end of this ResourceActionSummary. + The date and time the current status will change. The format is defined by RFC3339. + + For example, \"The current `postponed` status of the resource action will end and change to `pending` on this + date and time.\" + + + :param time_status_end: The time_status_end of this ResourceActionSummary. + :type: datetime + """ + self._time_status_end = time_status_end + + @property + def metadata(self): + """ + Gets the metadata of this ResourceActionSummary. + Custom metadata key/value pairs for the resource action. + + **Metadata Example** + + \"metadata\" : { + \"cpuRecommendedShape\": \"VM.Standard1.1\", + \"computeMemoryUtilization\": \"26.05734124418388\", + \"currentShape\": \"VM.Standard1.2\", + \"instanceRecommendedShape\": \"VM.Standard1.1\", + \"computeCpuUtilization\": \"7.930035319720132\", + \"memoryRecommendedShape\": \"None\" + } + + + :return: The metadata of this ResourceActionSummary. + :rtype: dict(str, str) + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """ + Sets the metadata of this ResourceActionSummary. + Custom metadata key/value pairs for the resource action. + + **Metadata Example** + + \"metadata\" : { + \"cpuRecommendedShape\": \"VM.Standard1.1\", + \"computeMemoryUtilization\": \"26.05734124418388\", + \"currentShape\": \"VM.Standard1.2\", + \"instanceRecommendedShape\": \"VM.Standard1.1\", + \"computeCpuUtilization\": \"7.930035319720132\", + \"memoryRecommendedShape\": \"None\" + } + + + :param metadata: The metadata of this ResourceActionSummary. + :type: dict(str, str) + """ + self._metadata = metadata + + @property + def extended_metadata(self): + """ + Gets the extended_metadata of this ResourceActionSummary. + Additional metadata key/value pairs that you provide. + They serve the same purpose and functionality as fields in the `metadata` object. + + They are distinguished from `metadata` fields in that these can be nested JSON objects (whereas `metadata` fields are string/string maps only). + + For example: + + `{\"CurrentShape\": {\"name\":\"VM.Standard2.16\"}, \"RecommendedShape\": {\"name\":\"VM.Standard2.8\"}}` + + + :return: The extended_metadata of this ResourceActionSummary. + :rtype: dict(str, object) + """ + return self._extended_metadata + + @extended_metadata.setter + def extended_metadata(self, extended_metadata): + """ + Sets the extended_metadata of this ResourceActionSummary. + Additional metadata key/value pairs that you provide. + They serve the same purpose and functionality as fields in the `metadata` object. + + They are distinguished from `metadata` fields in that these can be nested JSON objects (whereas `metadata` fields are string/string maps only). + + For example: + + `{\"CurrentShape\": {\"name\":\"VM.Standard2.16\"}, \"RecommendedShape\": {\"name\":\"VM.Standard2.8\"}}` + + + :param extended_metadata: The extended_metadata of this ResourceActionSummary. + :type: dict(str, object) + """ + self._extended_metadata = extended_metadata + + @property + def time_created(self): + """ + Gets the time_created of this ResourceActionSummary. + The date and time the resource action details were created, in the format defined by RFC3339. + + + :return: The time_created of this ResourceActionSummary. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this ResourceActionSummary. + The date and time the resource action details were created, in the format defined by RFC3339. + + + :param time_created: The time_created of this ResourceActionSummary. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + Gets the time_updated of this ResourceActionSummary. + The date and time the resource action details were last updated, in the format defined by RFC3339. + + + :return: The time_updated of this ResourceActionSummary. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this ResourceActionSummary. + The date and time the resource action details were last updated, in the format defined by RFC3339. + + + :param time_updated: The time_updated of this ResourceActionSummary. + :type: datetime + """ + self._time_updated = time_updated + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/resource_count.py b/src/oci/optimizer/models/resource_count.py new file mode 100644 index 0000000000..86049b8750 --- /dev/null +++ b/src/oci/optimizer/models/resource_count.py @@ -0,0 +1,125 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class ResourceCount(object): + """ + The count of resources in a category, grouped by status. + """ + + #: A constant which can be used with the status property of a ResourceCount. + #: This constant has a value of "PENDING" + STATUS_PENDING = "PENDING" + + #: A constant which can be used with the status property of a ResourceCount. + #: This constant has a value of "DISMISSED" + STATUS_DISMISSED = "DISMISSED" + + #: A constant which can be used with the status property of a ResourceCount. + #: This constant has a value of "POSTPONED" + STATUS_POSTPONED = "POSTPONED" + + #: A constant which can be used with the status property of a ResourceCount. + #: This constant has a value of "IMPLEMENTED" + STATUS_IMPLEMENTED = "IMPLEMENTED" + + def __init__(self, **kwargs): + """ + Initializes a new ResourceCount object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param status: + The value to assign to the status property of this ResourceCount. + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param count: + The value to assign to the count property of this ResourceCount. + :type count: int + + """ + self.swagger_types = { + 'status': 'str', + 'count': 'int' + } + + self.attribute_map = { + 'status': 'status', + 'count': 'count' + } + + self._status = None + self._count = None + + @property + def status(self): + """ + **[Required]** Gets the status of this ResourceCount. + The recommendation status of the resource. + + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this ResourceCount. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this ResourceCount. + The recommendation status of the resource. + + + :param status: The status of this ResourceCount. + :type: str + """ + allowed_values = ["PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def count(self): + """ + **[Required]** Gets the count of this ResourceCount. + The count of resources. + + + :return: The count of this ResourceCount. + :rtype: int + """ + return self._count + + @count.setter + def count(self, count): + """ + Sets the count of this ResourceCount. + The count of resources. + + + :param count: The count of this ResourceCount. + :type: int + """ + self._count = count + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/supported_level.py b/src/oci/optimizer/models/supported_level.py new file mode 100644 index 0000000000..7576a89ef5 --- /dev/null +++ b/src/oci/optimizer/models/supported_level.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class SupportedLevel(object): + """ + A system defined profile level supported by the recommendation. + """ + + def __init__(self, **kwargs): + """ + Initializes a new SupportedLevel object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param name: + The value to assign to the name property of this SupportedLevel. + :type name: str + + """ + self.swagger_types = { + 'name': 'str' + } + + self.attribute_map = { + 'name': 'name' + } + + self._name = None + + @property + def name(self): + """ + Gets the name of this SupportedLevel. + The name of the profile level. + + + :return: The name of this SupportedLevel. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this SupportedLevel. + The name of the profile level. + + + :param name: The name of this SupportedLevel. + :type: str + """ + self._name = name + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/supported_levels.py b/src/oci/optimizer/models/supported_levels.py new file mode 100644 index 0000000000..5876df9ae7 --- /dev/null +++ b/src/oci/optimizer/models/supported_levels.py @@ -0,0 +1,72 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class SupportedLevels(object): + """ + Optional. The profile levels supported by a recommendation. + For example, profile level values could be `Low`, `Medium`, and `High`. + Not all recommendations support this field. + """ + + def __init__(self, **kwargs): + """ + Initializes a new SupportedLevels object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this SupportedLevels. + :type items: list[SupportedLevel] + + """ + self.swagger_types = { + 'items': 'list[SupportedLevel]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + Gets the items of this SupportedLevels. + The list of supported levels. + + + :return: The items of this SupportedLevels. + :rtype: list[SupportedLevel] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this SupportedLevels. + The list of supported levels. + + + :param items: The items of this SupportedLevels. + :type: list[SupportedLevel] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/update_enrollment_status_details.py b/src/oci/optimizer/models/update_enrollment_status_details.py new file mode 100644 index 0000000000..dcbb6bc1ec --- /dev/null +++ b/src/oci/optimizer/models/update_enrollment_status_details.py @@ -0,0 +1,89 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class UpdateEnrollmentStatusDetails(object): + """ + The request object for updating the enrollment status details. + + **Caution:** Avoid using any confidential information when you use the API to supply string values. + """ + + #: A constant which can be used with the status property of a UpdateEnrollmentStatusDetails. + #: This constant has a value of "ACTIVE" + STATUS_ACTIVE = "ACTIVE" + + #: A constant which can be used with the status property of a UpdateEnrollmentStatusDetails. + #: This constant has a value of "INACTIVE" + STATUS_INACTIVE = "INACTIVE" + + def __init__(self, **kwargs): + """ + Initializes a new UpdateEnrollmentStatusDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param status: + The value to assign to the status property of this UpdateEnrollmentStatusDetails. + Allowed values for this property are: "ACTIVE", "INACTIVE" + :type status: str + + """ + self.swagger_types = { + 'status': 'str' + } + + self.attribute_map = { + 'status': 'status' + } + + self._status = None + + @property + def status(self): + """ + **[Required]** Gets the status of this UpdateEnrollmentStatusDetails. + The Cloud Advisor enrollment status. + + Allowed values for this property are: "ACTIVE", "INACTIVE" + + + :return: The status of this UpdateEnrollmentStatusDetails. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this UpdateEnrollmentStatusDetails. + The Cloud Advisor enrollment status. + + + :param status: The status of this UpdateEnrollmentStatusDetails. + :type: str + """ + allowed_values = ["ACTIVE", "INACTIVE"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + raise ValueError( + "Invalid value for `status`, must be None or one of {0}" + .format(allowed_values) + ) + self._status = status + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/update_profile_details.py b/src/oci/optimizer/models/update_profile_details.py new file mode 100644 index 0000000000..ab6087e4ee --- /dev/null +++ b/src/oci/optimizer/models/update_profile_details.py @@ -0,0 +1,181 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class UpdateProfileDetails(object): + """ + Details for updating a profile. + + **Caution:** Avoid using any confidential information when you use the API to supply string values. + """ + + def __init__(self, **kwargs): + """ + Initializes a new UpdateProfileDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param description: + The value to assign to the description property of this UpdateProfileDetails. + :type description: str + + :param defined_tags: + The value to assign to the defined_tags property of this UpdateProfileDetails. + :type defined_tags: dict(str, dict(str, object)) + + :param freeform_tags: + The value to assign to the freeform_tags property of this UpdateProfileDetails. + :type freeform_tags: dict(str, str) + + :param levels_configuration: + The value to assign to the levels_configuration property of this UpdateProfileDetails. + :type levels_configuration: LevelsConfiguration + + """ + self.swagger_types = { + 'description': 'str', + 'defined_tags': 'dict(str, dict(str, object))', + 'freeform_tags': 'dict(str, str)', + 'levels_configuration': 'LevelsConfiguration' + } + + self.attribute_map = { + 'description': 'description', + 'defined_tags': 'definedTags', + 'freeform_tags': 'freeformTags', + 'levels_configuration': 'levelsConfiguration' + } + + self._description = None + self._defined_tags = None + self._freeform_tags = None + self._levels_configuration = None + + @property + def description(self): + """ + Gets the description of this UpdateProfileDetails. + Text describing the profile. + + + :return: The description of this UpdateProfileDetails. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """ + Sets the description of this UpdateProfileDetails. + Text describing the profile. + + + :param description: The description of this UpdateProfileDetails. + :type: str + """ + self._description = description + + @property + def defined_tags(self): + """ + Gets the defined_tags of this UpdateProfileDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this UpdateProfileDetails. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this UpdateProfileDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this UpdateProfileDetails. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this UpdateProfileDetails. + Simple key-value pair applied without any predefined name, type, or namespace. + For more information, see `Resource Tags`__. Exists for cross-compatibility only. + + Example: `{\"bar-key\": \"value\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this UpdateProfileDetails. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this UpdateProfileDetails. + Simple key-value pair applied without any predefined name, type, or namespace. + For more information, see `Resource Tags`__. Exists for cross-compatibility only. + + Example: `{\"bar-key\": \"value\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this UpdateProfileDetails. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def levels_configuration(self): + """ + Gets the levels_configuration of this UpdateProfileDetails. + + :return: The levels_configuration of this UpdateProfileDetails. + :rtype: LevelsConfiguration + """ + return self._levels_configuration + + @levels_configuration.setter + def levels_configuration(self, levels_configuration): + """ + Sets the levels_configuration of this UpdateProfileDetails. + + :param levels_configuration: The levels_configuration of this UpdateProfileDetails. + :type: LevelsConfiguration + """ + self._levels_configuration = levels_configuration + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/update_recommendation_details.py b/src/oci/optimizer/models/update_recommendation_details.py new file mode 100644 index 0000000000..c5b206ce2e --- /dev/null +++ b/src/oci/optimizer/models/update_recommendation_details.py @@ -0,0 +1,132 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class UpdateRecommendationDetails(object): + """ + The request object for updating the recommendation details. + """ + + #: A constant which can be used with the status property of a UpdateRecommendationDetails. + #: This constant has a value of "PENDING" + STATUS_PENDING = "PENDING" + + #: A constant which can be used with the status property of a UpdateRecommendationDetails. + #: This constant has a value of "DISMISSED" + STATUS_DISMISSED = "DISMISSED" + + #: A constant which can be used with the status property of a UpdateRecommendationDetails. + #: This constant has a value of "POSTPONED" + STATUS_POSTPONED = "POSTPONED" + + #: A constant which can be used with the status property of a UpdateRecommendationDetails. + #: This constant has a value of "IMPLEMENTED" + STATUS_IMPLEMENTED = "IMPLEMENTED" + + def __init__(self, **kwargs): + """ + Initializes a new UpdateRecommendationDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param status: + The value to assign to the status property of this UpdateRecommendationDetails. + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED" + :type status: str + + :param time_status_end: + The value to assign to the time_status_end property of this UpdateRecommendationDetails. + :type time_status_end: datetime + + """ + self.swagger_types = { + 'status': 'str', + 'time_status_end': 'datetime' + } + + self.attribute_map = { + 'status': 'status', + 'time_status_end': 'timeStatusEnd' + } + + self._status = None + self._time_status_end = None + + @property + def status(self): + """ + **[Required]** Gets the status of this UpdateRecommendationDetails. + The status of the recommendation. + + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED" + + + :return: The status of this UpdateRecommendationDetails. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this UpdateRecommendationDetails. + The status of the recommendation. + + + :param status: The status of this UpdateRecommendationDetails. + :type: str + """ + allowed_values = ["PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + raise ValueError( + "Invalid value for `status`, must be None or one of {0}" + .format(allowed_values) + ) + self._status = status + + @property + def time_status_end(self): + """ + Gets the time_status_end of this UpdateRecommendationDetails. + The date and time the current status will change. The format is defined by RFC3339. + + For example, \"The current `postponed` status of the recommendation will end and change to `pending` on this + date and time.\" + + + :return: The time_status_end of this UpdateRecommendationDetails. + :rtype: datetime + """ + return self._time_status_end + + @time_status_end.setter + def time_status_end(self, time_status_end): + """ + Sets the time_status_end of this UpdateRecommendationDetails. + The date and time the current status will change. The format is defined by RFC3339. + + For example, \"The current `postponed` status of the recommendation will end and change to `pending` on this + date and time.\" + + + :param time_status_end: The time_status_end of this UpdateRecommendationDetails. + :type: datetime + """ + self._time_status_end = time_status_end + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/update_resource_action_details.py b/src/oci/optimizer/models/update_resource_action_details.py new file mode 100644 index 0000000000..cf684ecbe3 --- /dev/null +++ b/src/oci/optimizer/models/update_resource_action_details.py @@ -0,0 +1,132 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class UpdateResourceActionDetails(object): + """ + The request object for updating the resource action details. + """ + + #: A constant which can be used with the status property of a UpdateResourceActionDetails. + #: This constant has a value of "PENDING" + STATUS_PENDING = "PENDING" + + #: A constant which can be used with the status property of a UpdateResourceActionDetails. + #: This constant has a value of "DISMISSED" + STATUS_DISMISSED = "DISMISSED" + + #: A constant which can be used with the status property of a UpdateResourceActionDetails. + #: This constant has a value of "POSTPONED" + STATUS_POSTPONED = "POSTPONED" + + #: A constant which can be used with the status property of a UpdateResourceActionDetails. + #: This constant has a value of "IMPLEMENTED" + STATUS_IMPLEMENTED = "IMPLEMENTED" + + def __init__(self, **kwargs): + """ + Initializes a new UpdateResourceActionDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param status: + The value to assign to the status property of this UpdateResourceActionDetails. + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED" + :type status: str + + :param time_status_end: + The value to assign to the time_status_end property of this UpdateResourceActionDetails. + :type time_status_end: datetime + + """ + self.swagger_types = { + 'status': 'str', + 'time_status_end': 'datetime' + } + + self.attribute_map = { + 'status': 'status', + 'time_status_end': 'timeStatusEnd' + } + + self._status = None + self._time_status_end = None + + @property + def status(self): + """ + **[Required]** Gets the status of this UpdateResourceActionDetails. + The status of the resource action. + + Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED" + + + :return: The status of this UpdateResourceActionDetails. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this UpdateResourceActionDetails. + The status of the resource action. + + + :param status: The status of this UpdateResourceActionDetails. + :type: str + """ + allowed_values = ["PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + raise ValueError( + "Invalid value for `status`, must be None or one of {0}" + .format(allowed_values) + ) + self._status = status + + @property + def time_status_end(self): + """ + Gets the time_status_end of this UpdateResourceActionDetails. + The date and time the current status will change. The format is defined by RFC3339. + + For example, \"The current `postponed` status of the resource action will end and change to `pending` on this + date and time.\" + + + :return: The time_status_end of this UpdateResourceActionDetails. + :rtype: datetime + """ + return self._time_status_end + + @time_status_end.setter + def time_status_end(self, time_status_end): + """ + Sets the time_status_end of this UpdateResourceActionDetails. + The date and time the current status will change. The format is defined by RFC3339. + + For example, \"The current `postponed` status of the resource action will end and change to `pending` on this + date and time.\" + + + :param time_status_end: The time_status_end of this UpdateResourceActionDetails. + :type: datetime + """ + self._time_status_end = time_status_end + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/work_request.py b/src/oci/optimizer/models/work_request.py new file mode 100644 index 0000000000..8dd9b49557 --- /dev/null +++ b/src/oci/optimizer/models/work_request.py @@ -0,0 +1,362 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class WorkRequest(object): + """ + The asynchronous API request does not take effect immediately. This request spawns an asynchronous workflow to fulfill the request. WorkRequest objects provide visibility for in-progress workflows. + """ + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "BULK_APPLY_RECOMMENDATIONS" + OPERATION_TYPE_BULK_APPLY_RECOMMENDATIONS = "BULK_APPLY_RECOMMENDATIONS" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "ACCEPTED" + STATUS_ACCEPTED = "ACCEPTED" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "IN_PROGRESS" + STATUS_IN_PROGRESS = "IN_PROGRESS" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "FAILED" + STATUS_FAILED = "FAILED" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "SUCCEEDED" + STATUS_SUCCEEDED = "SUCCEEDED" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "CANCELING" + STATUS_CANCELING = "CANCELING" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "CANCELED" + STATUS_CANCELED = "CANCELED" + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequest object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param operation_type: + The value to assign to the operation_type property of this WorkRequest. + Allowed values for this property are: "BULK_APPLY_RECOMMENDATIONS", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type operation_type: str + + :param status: + The value to assign to the status property of this WorkRequest. + Allowed values for this property are: "ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param id: + The value to assign to the id property of this WorkRequest. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this WorkRequest. + :type compartment_id: str + + :param resources: + The value to assign to the resources property of this WorkRequest. + :type resources: list[WorkRequestResource] + + :param percent_complete: + The value to assign to the percent_complete property of this WorkRequest. + :type percent_complete: float + + :param time_accepted: + The value to assign to the time_accepted property of this WorkRequest. + :type time_accepted: datetime + + :param time_started: + The value to assign to the time_started property of this WorkRequest. + :type time_started: datetime + + :param time_finished: + The value to assign to the time_finished property of this WorkRequest. + :type time_finished: datetime + + """ + self.swagger_types = { + 'operation_type': 'str', + 'status': 'str', + 'id': 'str', + 'compartment_id': 'str', + 'resources': 'list[WorkRequestResource]', + 'percent_complete': 'float', + 'time_accepted': 'datetime', + 'time_started': 'datetime', + 'time_finished': 'datetime' + } + + self.attribute_map = { + 'operation_type': 'operationType', + 'status': 'status', + 'id': 'id', + 'compartment_id': 'compartmentId', + 'resources': 'resources', + 'percent_complete': 'percentComplete', + 'time_accepted': 'timeAccepted', + 'time_started': 'timeStarted', + 'time_finished': 'timeFinished' + } + + self._operation_type = None + self._status = None + self._id = None + self._compartment_id = None + self._resources = None + self._percent_complete = None + self._time_accepted = None + self._time_started = None + self._time_finished = None + + @property + def operation_type(self): + """ + **[Required]** Gets the operation_type of this WorkRequest. + An enum-like description of the type of work the work request is doing. + + Allowed values for this property are: "BULK_APPLY_RECOMMENDATIONS", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The operation_type of this WorkRequest. + :rtype: str + """ + return self._operation_type + + @operation_type.setter + def operation_type(self, operation_type): + """ + Sets the operation_type of this WorkRequest. + An enum-like description of the type of work the work request is doing. + + + :param operation_type: The operation_type of this WorkRequest. + :type: str + """ + allowed_values = ["BULK_APPLY_RECOMMENDATIONS"] + if not value_allowed_none_or_none_sentinel(operation_type, allowed_values): + operation_type = 'UNKNOWN_ENUM_VALUE' + self._operation_type = operation_type + + @property + def status(self): + """ + **[Required]** Gets the status of this WorkRequest. + The current status of the work request. + + Allowed values for this property are: "ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this WorkRequest. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this WorkRequest. + The current status of the work request. + + + :param status: The status of this WorkRequest. + :type: str + """ + allowed_values = ["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def id(self): + """ + **[Required]** Gets the id of this WorkRequest. + The OCID of the work request. + + + :return: The id of this WorkRequest. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this WorkRequest. + The OCID of the work request. + + + :param id: The id of this WorkRequest. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this WorkRequest. + The OCID of the compartment that contains the work request. + + + :return: The compartment_id of this WorkRequest. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this WorkRequest. + The OCID of the compartment that contains the work request. + + + :param compartment_id: The compartment_id of this WorkRequest. + :type: str + """ + self._compartment_id = compartment_id + + @property + def resources(self): + """ + **[Required]** Gets the resources of this WorkRequest. + The resources this work request affects. + + + :return: The resources of this WorkRequest. + :rtype: list[WorkRequestResource] + """ + return self._resources + + @resources.setter + def resources(self, resources): + """ + Sets the resources of this WorkRequest. + The resources this work request affects. + + + :param resources: The resources of this WorkRequest. + :type: list[WorkRequestResource] + """ + self._resources = resources + + @property + def percent_complete(self): + """ + **[Required]** Gets the percent_complete of this WorkRequest. + How much progress the operation has made. + + + :return: The percent_complete of this WorkRequest. + :rtype: float + """ + return self._percent_complete + + @percent_complete.setter + def percent_complete(self, percent_complete): + """ + Sets the percent_complete of this WorkRequest. + How much progress the operation has made. + + + :param percent_complete: The percent_complete of this WorkRequest. + :type: float + """ + self._percent_complete = percent_complete + + @property + def time_accepted(self): + """ + **[Required]** Gets the time_accepted of this WorkRequest. + Date and time the work was accepted, in the format defined by RFC3339. Example: `2016-08-25T21:10:29.600Z` + + + :return: The time_accepted of this WorkRequest. + :rtype: datetime + """ + return self._time_accepted + + @time_accepted.setter + def time_accepted(self, time_accepted): + """ + Sets the time_accepted of this WorkRequest. + Date and time the work was accepted, in the format defined by RFC3339. Example: `2016-08-25T21:10:29.600Z` + + + :param time_accepted: The time_accepted of this WorkRequest. + :type: datetime + """ + self._time_accepted = time_accepted + + @property + def time_started(self): + """ + Gets the time_started of this WorkRequest. + Date and time the work started, in the format defined by RFC3339. Example: `2016-08-25T21:10:29.600Z` + + + :return: The time_started of this WorkRequest. + :rtype: datetime + """ + return self._time_started + + @time_started.setter + def time_started(self, time_started): + """ + Sets the time_started of this WorkRequest. + Date and time the work started, in the format defined by RFC3339. Example: `2016-08-25T21:10:29.600Z` + + + :param time_started: The time_started of this WorkRequest. + :type: datetime + """ + self._time_started = time_started + + @property + def time_finished(self): + """ + Gets the time_finished of this WorkRequest. + Date and time the work completed, in the format defined by RFC3339. Example: `2016-08-25T21:10:29.600Z` + + + :return: The time_finished of this WorkRequest. + :rtype: datetime + """ + return self._time_finished + + @time_finished.setter + def time_finished(self, time_finished): + """ + Sets the time_finished of this WorkRequest. + Date and time the work completed, in the format defined by RFC3339. Example: `2016-08-25T21:10:29.600Z` + + + :param time_finished: The time_finished of this WorkRequest. + :type: datetime + """ + self._time_finished = time_finished + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/work_request_collection.py b/src/oci/optimizer/models/work_request_collection.py new file mode 100644 index 0000000000..ca648e31d6 --- /dev/null +++ b/src/oci/optimizer/models/work_request_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class WorkRequestCollection(object): + """ + A list of work requests that match filter criteria, if any. Results contain `WorkRequest` objects. + """ + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequestCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this WorkRequestCollection. + :type items: list[WorkRequest] + + """ + self.swagger_types = { + 'items': 'list[WorkRequest]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this WorkRequestCollection. + A collection of work requests. + + + :return: The items of this WorkRequestCollection. + :rtype: list[WorkRequest] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this WorkRequestCollection. + A collection of work requests. + + + :param items: The items of this WorkRequestCollection. + :type: list[WorkRequest] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/work_request_error.py b/src/oci/optimizer/models/work_request_error.py new file mode 100644 index 0000000000..3d55f463f9 --- /dev/null +++ b/src/oci/optimizer/models/work_request_error.py @@ -0,0 +1,132 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class WorkRequestError(object): + """ + Details about errors encountered while executing a work request. + """ + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequestError object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param code: + The value to assign to the code property of this WorkRequestError. + :type code: str + + :param message: + The value to assign to the message property of this WorkRequestError. + :type message: str + + :param timestamp: + The value to assign to the timestamp property of this WorkRequestError. + :type timestamp: datetime + + """ + self.swagger_types = { + 'code': 'str', + 'message': 'str', + 'timestamp': 'datetime' + } + + self.attribute_map = { + 'code': 'code', + 'message': 'message', + 'timestamp': 'timestamp' + } + + self._code = None + self._message = None + self._timestamp = None + + @property + def code(self): + """ + **[Required]** Gets the code of this WorkRequestError. + A machine-usable code for the error that occured. + + + :return: The code of this WorkRequestError. + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """ + Sets the code of this WorkRequestError. + A machine-usable code for the error that occured. + + + :param code: The code of this WorkRequestError. + :type: str + """ + self._code = code + + @property + def message(self): + """ + **[Required]** Gets the message of this WorkRequestError. + A human-readable error string. + + + :return: The message of this WorkRequestError. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """ + Sets the message of this WorkRequestError. + A human-readable error string. + + + :param message: The message of this WorkRequestError. + :type: str + """ + self._message = message + + @property + def timestamp(self): + """ + **[Required]** Gets the timestamp of this WorkRequestError. + Date and time the error happened, in the format defined by RFC3339. Example: `2016-08-25T21:10:29.600Z` + + + :return: The timestamp of this WorkRequestError. + :rtype: datetime + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """ + Sets the timestamp of this WorkRequestError. + Date and time the error happened, in the format defined by RFC3339. Example: `2016-08-25T21:10:29.600Z` + + + :param timestamp: The timestamp of this WorkRequestError. + :type: datetime + """ + self._timestamp = timestamp + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/work_request_error_collection.py b/src/oci/optimizer/models/work_request_error_collection.py new file mode 100644 index 0000000000..34c89e2194 --- /dev/null +++ b/src/oci/optimizer/models/work_request_error_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class WorkRequestErrorCollection(object): + """ + A list of work request errors that match filter criteria, if any. Results contain `WorkRequestError` objects. + """ + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequestErrorCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this WorkRequestErrorCollection. + :type items: list[WorkRequestError] + + """ + self.swagger_types = { + 'items': 'list[WorkRequestError]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this WorkRequestErrorCollection. + A collection of work request errors. + + + :return: The items of this WorkRequestErrorCollection. + :rtype: list[WorkRequestError] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this WorkRequestErrorCollection. + A collection of work request errors. + + + :param items: The items of this WorkRequestErrorCollection. + :type: list[WorkRequestError] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/work_request_log_entry.py b/src/oci/optimizer/models/work_request_log_entry.py new file mode 100644 index 0000000000..3917a4fcf5 --- /dev/null +++ b/src/oci/optimizer/models/work_request_log_entry.py @@ -0,0 +1,101 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class WorkRequestLogEntry(object): + """ + Details about the log entity. + """ + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequestLogEntry object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param message: + The value to assign to the message property of this WorkRequestLogEntry. + :type message: str + + :param timestamp: + The value to assign to the timestamp property of this WorkRequestLogEntry. + :type timestamp: datetime + + """ + self.swagger_types = { + 'message': 'str', + 'timestamp': 'datetime' + } + + self.attribute_map = { + 'message': 'message', + 'timestamp': 'timestamp' + } + + self._message = None + self._timestamp = None + + @property + def message(self): + """ + **[Required]** Gets the message of this WorkRequestLogEntry. + A human-readable error string. + + + :return: The message of this WorkRequestLogEntry. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """ + Sets the message of this WorkRequestLogEntry. + A human-readable error string. + + + :param message: The message of this WorkRequestLogEntry. + :type: str + """ + self._message = message + + @property + def timestamp(self): + """ + **[Required]** Gets the timestamp of this WorkRequestLogEntry. + Date and time the log was written, in the format defined by RFC3339. Example: `2016-08-25T21:10:29.600Z` + + + :return: The timestamp of this WorkRequestLogEntry. + :rtype: datetime + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """ + Sets the timestamp of this WorkRequestLogEntry. + Date and time the log was written, in the format defined by RFC3339. Example: `2016-08-25T21:10:29.600Z` + + + :param timestamp: The timestamp of this WorkRequestLogEntry. + :type: datetime + """ + self._timestamp = timestamp + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/work_request_log_entry_collection.py b/src/oci/optimizer/models/work_request_log_entry_collection.py new file mode 100644 index 0000000000..a5eead683e --- /dev/null +++ b/src/oci/optimizer/models/work_request_log_entry_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class WorkRequestLogEntryCollection(object): + """ + A list of work request logs that match filter criteria, if any. Results contain `WorkRequestLogEntry` objects. + """ + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequestLogEntryCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this WorkRequestLogEntryCollection. + :type items: list[WorkRequestLogEntry] + + """ + self.swagger_types = { + 'items': 'list[WorkRequestLogEntry]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this WorkRequestLogEntryCollection. + A collection of work request log entries. + + + :return: The items of this WorkRequestLogEntryCollection. + :rtype: list[WorkRequestLogEntry] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this WorkRequestLogEntryCollection. + A collection of work request log entries. + + + :param items: The items of this WorkRequestLogEntryCollection. + :type: list[WorkRequestLogEntry] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/models/work_request_resource.py b/src/oci/optimizer/models/work_request_resource.py new file mode 100644 index 0000000000..01216ded1c --- /dev/null +++ b/src/oci/optimizer/models/work_request_resource.py @@ -0,0 +1,199 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class WorkRequestResource(object): + """ + Details about the resource entity. + """ + + #: A constant which can be used with the action_type property of a WorkRequestResource. + #: This constant has a value of "CREATED" + ACTION_TYPE_CREATED = "CREATED" + + #: A constant which can be used with the action_type property of a WorkRequestResource. + #: This constant has a value of "UPDATED" + ACTION_TYPE_UPDATED = "UPDATED" + + #: A constant which can be used with the action_type property of a WorkRequestResource. + #: This constant has a value of "DELETED" + ACTION_TYPE_DELETED = "DELETED" + + #: A constant which can be used with the action_type property of a WorkRequestResource. + #: This constant has a value of "IN_PROGRESS" + ACTION_TYPE_IN_PROGRESS = "IN_PROGRESS" + + #: A constant which can be used with the action_type property of a WorkRequestResource. + #: This constant has a value of "RELATED" + ACTION_TYPE_RELATED = "RELATED" + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequestResource object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param entity_type: + The value to assign to the entity_type property of this WorkRequestResource. + :type entity_type: str + + :param action_type: + The value to assign to the action_type property of this WorkRequestResource. + Allowed values for this property are: "CREATED", "UPDATED", "DELETED", "IN_PROGRESS", "RELATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type action_type: str + + :param identifier: + The value to assign to the identifier property of this WorkRequestResource. + :type identifier: str + + :param entity_uri: + The value to assign to the entity_uri property of this WorkRequestResource. + :type entity_uri: str + + """ + self.swagger_types = { + 'entity_type': 'str', + 'action_type': 'str', + 'identifier': 'str', + 'entity_uri': 'str' + } + + self.attribute_map = { + 'entity_type': 'entityType', + 'action_type': 'actionType', + 'identifier': 'identifier', + 'entity_uri': 'entityUri' + } + + self._entity_type = None + self._action_type = None + self._identifier = None + self._entity_uri = None + + @property + def entity_type(self): + """ + **[Required]** Gets the entity_type of this WorkRequestResource. + The resource type the work request affects. + + + :return: The entity_type of this WorkRequestResource. + :rtype: str + """ + return self._entity_type + + @entity_type.setter + def entity_type(self, entity_type): + """ + Sets the entity_type of this WorkRequestResource. + The resource type the work request affects. + + + :param entity_type: The entity_type of this WorkRequestResource. + :type: str + """ + self._entity_type = entity_type + + @property + def action_type(self): + """ + **[Required]** Gets the action_type of this WorkRequestResource. + The way in which this resource was affected by the work tracked by the work request. + + A resource being created, updated, or deleted remains in the `IN_PROGRESS` state until + work is complete for that resource. At that point, the resource transitions to the `CREATED`, `UPDATED`, + or `DELETED` state. + + Allowed values for this property are: "CREATED", "UPDATED", "DELETED", "IN_PROGRESS", "RELATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The action_type of this WorkRequestResource. + :rtype: str + """ + return self._action_type + + @action_type.setter + def action_type(self, action_type): + """ + Sets the action_type of this WorkRequestResource. + The way in which this resource was affected by the work tracked by the work request. + + A resource being created, updated, or deleted remains in the `IN_PROGRESS` state until + work is complete for that resource. At that point, the resource transitions to the `CREATED`, `UPDATED`, + or `DELETED` state. + + + :param action_type: The action_type of this WorkRequestResource. + :type: str + """ + allowed_values = ["CREATED", "UPDATED", "DELETED", "IN_PROGRESS", "RELATED"] + if not value_allowed_none_or_none_sentinel(action_type, allowed_values): + action_type = 'UNKNOWN_ENUM_VALUE' + self._action_type = action_type + + @property + def identifier(self): + """ + **[Required]** Gets the identifier of this WorkRequestResource. + The resource identifier the work request affects. + + + :return: The identifier of this WorkRequestResource. + :rtype: str + """ + return self._identifier + + @identifier.setter + def identifier(self, identifier): + """ + Sets the identifier of this WorkRequestResource. + The resource identifier the work request affects. + + + :param identifier: The identifier of this WorkRequestResource. + :type: str + """ + self._identifier = identifier + + @property + def entity_uri(self): + """ + Gets the entity_uri of this WorkRequestResource. + The URI path that the user can do a GET on to access the resource metadata + + + :return: The entity_uri of this WorkRequestResource. + :rtype: str + """ + return self._entity_uri + + @entity_uri.setter + def entity_uri(self, entity_uri): + """ + Sets the entity_uri of this WorkRequestResource. + The URI path that the user can do a GET on to access the resource metadata + + + :param entity_uri: The entity_uri of this WorkRequestResource. + :type: str + """ + self._entity_uri = entity_uri + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/optimizer/optimizer_client.py b/src/oci/optimizer/optimizer_client.py new file mode 100644 index 0000000000..1b8cce09f9 --- /dev/null +++ b/src/oci/optimizer/optimizer_client.py @@ -0,0 +1,2233 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + +from __future__ import absolute_import + +from oci._vendor import requests # noqa: F401 +from oci._vendor import six + +from oci import retry # noqa: F401 +from oci.base_client import BaseClient +from oci.config import get_config_value_or_default, validate_config +from oci.signer import Signer +from oci.util import Sentinel, get_signer_from_authentication_type, AUTHENTICATION_TYPE_FIELD_NAME +from .models import optimizer_type_mapping +missing = Sentinel("Missing") + + +class OptimizerClient(object): + """ + APIs for managing Cloud Advisor. Cloud Advisor provides recommendations that help you maximize cost savings and improve the security posture of your tenancy. + """ + + def __init__(self, config, **kwargs): + """ + Creates a new service client + + :param dict config: + Configuration keys and values as per `SDK and Tool Configuration `__. + The :py:meth:`~oci.config.from_file` method can be used to load configuration from a file. Alternatively, a ``dict`` can be passed. You can validate_config + the dict using :py:meth:`~oci.config.validate_config` + + :param str service_endpoint: (optional) + The endpoint of the service to call using this client. For example ``https://iaas.us-ashburn-1.oraclecloud.com``. If this keyword argument is + not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit + need to specify a service endpoint. + + :param timeout: (optional) + The connection and read timeouts for the client. The default values are connection timeout 10 seconds and read timeout 60 seconds. This keyword argument can be provided + as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If + a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout. + :type timeout: float or tuple(float, float) + + :param signer: (optional) + The signer to use when signing requests made by the service client. The default is to use a :py:class:`~oci.signer.Signer` based on the values + provided in the config parameter. + + One use case for this parameter is for `Instance Principals authentication `__ + by passing an instance of :py:class:`~oci.auth.signers.InstancePrincipalsSecurityTokenSigner` as the value for this keyword argument + :type signer: :py:class:`~oci.signer.AbstractBaseSigner` + + :param obj retry_strategy: (optional) + A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. + Retry strategies can also be applied at the operation level by passing a ``retry_strategy`` keyword argument as part of calling the operation. + Any value provided at the operation level will override whatever is specified at the client level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + """ + validate_config(config, signer=kwargs.get('signer')) + if 'signer' in kwargs: + signer = kwargs['signer'] + + elif AUTHENTICATION_TYPE_FIELD_NAME in config: + signer = get_signer_from_authentication_type(config) + + else: + signer = Signer( + tenancy=config["tenancy"], + user=config["user"], + fingerprint=config["fingerprint"], + private_key_file_location=config.get("key_file"), + pass_phrase=get_config_value_or_default(config, "pass_phrase"), + private_key_content=config.get("key_content") + ) + + base_client_init_kwargs = { + 'regional_client': True, + 'service_endpoint': kwargs.get('service_endpoint'), + 'timeout': kwargs.get('timeout'), + 'base_path': '/20200606', + 'service_endpoint_template': 'https://optimizer.{region}.oci.{secondLevelDomain}', + 'skip_deserialization': kwargs.get('skip_deserialization', False) + } + self.base_client = BaseClient("optimizer", config, signer, optimizer_type_mapping, **base_client_init_kwargs) + self.retry_strategy = kwargs.get('retry_strategy') + + def bulk_apply_recommendations(self, recommendation_id, bulk_apply_recommendations_details, **kwargs): + """ + Applies the specified recommendations to the resources. + + + :param str recommendation_id: (required) + The unique OCID associated with the recommendation. + + :param BulkApplyRecommendationsDetails bulk_apply_recommendations_details: (required) + Details about bulk recommendation actions. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations (for example, if a resource + has been deleted and purged from the system, then a retry of the original creation request + may be rejected). + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/recommendations/{recommendationId}/actions/bulkApplyRecommendations" + method = "POST" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id", + "opc_retry_token" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "bulk_apply_recommendations got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "recommendationId": recommendation_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=bulk_apply_recommendations_details) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=bulk_apply_recommendations_details) + + def create_profile(self, create_profile_details, **kwargs): + """ + Creates a new profile. + + + :param CreateProfileDetails create_profile_details: (required) + Details for creating the profile. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations (for example, if a resource + has been deleted and purged from the system, then a retry of the original creation request + may be rejected). + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.Profile` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/profiles" + method = "POST" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id", + "opc_retry_token" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "create_profile got unknown kwargs: {!r}".format(extra_kwargs)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + header_params=header_params, + body=create_profile_details, + response_type="Profile") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + header_params=header_params, + body=create_profile_details, + response_type="Profile") + + def delete_profile(self, profile_id, **kwargs): + """ + Deletes the specified profile. Uses the profile's OCID to determine which profile to delete. + + + :param str profile_id: (required) + The unique OCID of the profile. + + :param str if_match: (optional) + 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. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/profiles/{profileId}" + method = "DELETE" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "if_match", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "delete_profile got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "profileId": profile_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + + def get_category(self, category_id, **kwargs): + """ + Gets the category that corresponds to the specified OCID. + + + :param str category_id: (required) + The unique OCID associated with the category. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.Category` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/categories/{categoryId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_category got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "categoryId": category_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="Category") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="Category") + + def get_enrollment_status(self, enrollment_status_id, **kwargs): + """ + Gets the Cloud Advisor enrollment status. + + + :param str enrollment_status_id: (required) + The unique OCID associated with the enrollment status. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.EnrollmentStatus` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/enrollmentStatus/{enrollmentStatusId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_enrollment_status got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "enrollmentStatusId": enrollment_status_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="EnrollmentStatus") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="EnrollmentStatus") + + def get_profile(self, profile_id, **kwargs): + """ + Gets the specified profile's information. Uses the profile's OCID to determine which profile to retrieve. + + + :param str profile_id: (required) + The unique OCID of the profile. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.Profile` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/profiles/{profileId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_profile got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "profileId": profile_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="Profile") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="Profile") + + def get_recommendation(self, recommendation_id, **kwargs): + """ + Gets the recommendation for the specified OCID. + + + :param str recommendation_id: (required) + The unique OCID associated with the recommendation. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.Recommendation` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/recommendations/{recommendationId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_recommendation got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "recommendationId": recommendation_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="Recommendation") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="Recommendation") + + def get_resource_action(self, resource_action_id, **kwargs): + """ + Gets the resource action that corresponds to the specified OCID. + + + :param str resource_action_id: (required) + The unique OCID associated with the resource action. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.ResourceAction` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/resourceActions/{resourceActionId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_resource_action got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "resourceActionId": resource_action_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="ResourceAction") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="ResourceAction") + + def get_work_request(self, work_request_id, **kwargs): + """ + Gets the status of the work request associated with the specified ID. + + + :param str work_request_id: (required) + The OCID of the work request. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.WorkRequest` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/workRequests/{workRequestId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_work_request got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "workRequestId": work_request_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="WorkRequest") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="WorkRequest") + + def list_categories(self, compartment_id, compartment_id_in_subtree, **kwargs): + """ + Lists the supported Cloud Advisor categories. + + + :param str compartment_id: (required) + The OCID of the compartment. + + :param bool compartment_id_in_subtree: (required) + When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of `accessLevel`. + + Can only be set to true when performing ListCompartments on the tenancy (root compartment). + + :param str name: (optional) + Optional. A filter that returns results that match the name specified. + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + :param str sort_order: (optional) + The sort order to use, either ascending (`ASC`) or descending (`DESC`). + + Allowed values are: "ASC", "DESC" + + :param str sort_by: (optional) + The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive. + + Allowed values are: "NAME", "TIMECREATED" + + :param str lifecycle_state: (optional) + A filter that returns results that match the lifecycle state specified. + + Allowed values are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING" + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.CategoryCollection` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/categories" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "name", + "limit", + "page", + "sort_order", + "sort_by", + "lifecycle_state", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_categories got unknown kwargs: {!r}".format(extra_kwargs)) + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) + ) + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["NAME", "TIMECREATED"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) + ) + + if 'lifecycle_state' in kwargs: + lifecycle_state_allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: + raise ValueError( + "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) + ) + + query_params = { + "compartmentId": compartment_id, + "compartmentIdInSubtree": compartment_id_in_subtree, + "name": kwargs.get("name", missing), + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing), + "sortOrder": kwargs.get("sort_order", missing), + "sortBy": kwargs.get("sort_by", missing), + "lifecycleState": kwargs.get("lifecycle_state", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="CategoryCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="CategoryCollection") + + def list_enrollment_statuses(self, compartment_id, **kwargs): + """ + Lists the Cloud Advisor enrollment statuses. + + + :param str compartment_id: (required) + The OCID of the compartment. + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + :param str sort_order: (optional) + The sort order to use, either ascending (`ASC`) or descending (`DESC`). + + Allowed values are: "ASC", "DESC" + + :param str sort_by: (optional) + The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive. + + Allowed values are: "NAME", "TIMECREATED" + + :param str lifecycle_state: (optional) + A filter that returns results that match the lifecycle state specified. + + Allowed values are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING" + + :param str status: (optional) + A filter that returns results that match the Cloud Advisor enrollment status specified. + + Allowed values are: "ACTIVE", "INACTIVE" + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.EnrollmentStatusCollection` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/enrollmentStatus" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "limit", + "page", + "sort_order", + "sort_by", + "lifecycle_state", + "status", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_enrollment_statuses got unknown kwargs: {!r}".format(extra_kwargs)) + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) + ) + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["NAME", "TIMECREATED"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) + ) + + if 'lifecycle_state' in kwargs: + lifecycle_state_allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: + raise ValueError( + "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) + ) + + if 'status' in kwargs: + status_allowed_values = ["ACTIVE", "INACTIVE"] + if kwargs['status'] not in status_allowed_values: + raise ValueError( + "Invalid value for `status`, must be one of {0}".format(status_allowed_values) + ) + + query_params = { + "compartmentId": compartment_id, + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing), + "sortOrder": kwargs.get("sort_order", missing), + "sortBy": kwargs.get("sort_by", missing), + "lifecycleState": kwargs.get("lifecycle_state", missing), + "status": kwargs.get("status", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="EnrollmentStatusCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="EnrollmentStatusCollection") + + def list_histories(self, compartment_id, compartment_id_in_subtree, **kwargs): + """ + Lists changes to the recommendations based on user activity. + For example, lists when recommendations have been implemented, dismissed, postponed, or reactivated. + + + :param str compartment_id: (required) + The OCID of the compartment. + + :param bool compartment_id_in_subtree: (required) + When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of `accessLevel`. + + Can only be set to true when performing ListCompartments on the tenancy (root compartment). + + :param str name: (optional) + Optional. A filter that returns results that match the name specified. + + :param str recommendation_name: (optional) + Optional. A filter that returns results that match the recommendation name specified. + + :param str recommendation_id: (optional) + The unique OCID associated with the recommendation. + + :param str resource_type: (optional) + Optional. A filter that returns results that match the resource type specified. + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + :param str sort_order: (optional) + The sort order to use, either ascending (`ASC`) or descending (`DESC`). + + Allowed values are: "ASC", "DESC" + + :param str sort_by: (optional) + The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive. + + Allowed values are: "NAME", "TIMECREATED" + + :param str lifecycle_state: (optional) + A filter that returns results that match the lifecycle state specified. + + Allowed values are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING" + + :param str status: (optional) + A filter that returns recommendations that match the status specified. + + Allowed values are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED" + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.HistoryCollection` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/histories" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "name", + "recommendation_name", + "recommendation_id", + "resource_type", + "limit", + "page", + "sort_order", + "sort_by", + "lifecycle_state", + "status", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_histories got unknown kwargs: {!r}".format(extra_kwargs)) + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) + ) + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["NAME", "TIMECREATED"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) + ) + + if 'lifecycle_state' in kwargs: + lifecycle_state_allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: + raise ValueError( + "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) + ) + + if 'status' in kwargs: + status_allowed_values = ["PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED"] + if kwargs['status'] not in status_allowed_values: + raise ValueError( + "Invalid value for `status`, must be one of {0}".format(status_allowed_values) + ) + + query_params = { + "compartmentId": compartment_id, + "compartmentIdInSubtree": compartment_id_in_subtree, + "name": kwargs.get("name", missing), + "recommendationName": kwargs.get("recommendation_name", missing), + "recommendationId": kwargs.get("recommendation_id", missing), + "resourceType": kwargs.get("resource_type", missing), + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing), + "sortOrder": kwargs.get("sort_order", missing), + "sortBy": kwargs.get("sort_by", missing), + "lifecycleState": kwargs.get("lifecycle_state", missing), + "status": kwargs.get("status", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="HistoryCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="HistoryCollection") + + def list_profiles(self, compartment_id, **kwargs): + """ + Lists the existing profiles. + + + :param str compartment_id: (required) + The OCID of the compartment. + + :param str name: (optional) + Optional. A filter that returns results that match the name specified. + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + :param str sort_order: (optional) + The sort order to use, either ascending (`ASC`) or descending (`DESC`). + + Allowed values are: "ASC", "DESC" + + :param str sort_by: (optional) + The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive. + + Allowed values are: "NAME", "TIMECREATED" + + :param str lifecycle_state: (optional) + A filter that returns results that match the lifecycle state specified. + + Allowed values are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING" + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.ProfileCollection` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/profiles" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "name", + "limit", + "page", + "sort_order", + "sort_by", + "lifecycle_state", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_profiles got unknown kwargs: {!r}".format(extra_kwargs)) + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) + ) + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["NAME", "TIMECREATED"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) + ) + + if 'lifecycle_state' in kwargs: + lifecycle_state_allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: + raise ValueError( + "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) + ) + + query_params = { + "compartmentId": compartment_id, + "name": kwargs.get("name", missing), + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing), + "sortOrder": kwargs.get("sort_order", missing), + "sortBy": kwargs.get("sort_by", missing), + "lifecycleState": kwargs.get("lifecycle_state", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="ProfileCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="ProfileCollection") + + def list_recommendations(self, compartment_id, compartment_id_in_subtree, category_id, **kwargs): + """ + Lists the Cloud Advisor recommendations that are currently supported in the specified category. + + + :param str compartment_id: (required) + The OCID of the compartment. + + :param bool compartment_id_in_subtree: (required) + When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of `accessLevel`. + + Can only be set to true when performing ListCompartments on the tenancy (root compartment). + + :param str category_id: (required) + The unique OCID associated with the category. + + :param str name: (optional) + Optional. A filter that returns results that match the name specified. + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + :param str sort_order: (optional) + The sort order to use, either ascending (`ASC`) or descending (`DESC`). + + Allowed values are: "ASC", "DESC" + + :param str sort_by: (optional) + The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive. + + Allowed values are: "NAME", "TIMECREATED" + + :param str lifecycle_state: (optional) + A filter that returns results that match the lifecycle state specified. + + Allowed values are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING" + + :param str status: (optional) + A filter that returns recommendations that match the status specified. + + Allowed values are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED" + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.RecommendationCollection` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/recommendations" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "name", + "limit", + "page", + "sort_order", + "sort_by", + "lifecycle_state", + "status", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_recommendations got unknown kwargs: {!r}".format(extra_kwargs)) + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) + ) + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["NAME", "TIMECREATED"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) + ) + + if 'lifecycle_state' in kwargs: + lifecycle_state_allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: + raise ValueError( + "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) + ) + + if 'status' in kwargs: + status_allowed_values = ["PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED"] + if kwargs['status'] not in status_allowed_values: + raise ValueError( + "Invalid value for `status`, must be one of {0}".format(status_allowed_values) + ) + + query_params = { + "compartmentId": compartment_id, + "compartmentIdInSubtree": compartment_id_in_subtree, + "categoryId": category_id, + "name": kwargs.get("name", missing), + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing), + "sortOrder": kwargs.get("sort_order", missing), + "sortBy": kwargs.get("sort_by", missing), + "lifecycleState": kwargs.get("lifecycle_state", missing), + "status": kwargs.get("status", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="RecommendationCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="RecommendationCollection") + + def list_resource_actions(self, compartment_id, compartment_id_in_subtree, recommendation_id, **kwargs): + """ + Lists the Cloud Advisor resource actions that are supported by the specified recommendation. + + + :param str compartment_id: (required) + The OCID of the compartment. + + :param bool compartment_id_in_subtree: (required) + When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of `accessLevel`. + + Can only be set to true when performing ListCompartments on the tenancy (root compartment). + + :param str recommendation_id: (required) + The unique OCID associated with the recommendation. + + :param str name: (optional) + Optional. A filter that returns results that match the name specified. + + :param str resource_type: (optional) + Optional. A filter that returns results that match the resource type specified. + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + :param str sort_order: (optional) + The sort order to use, either ascending (`ASC`) or descending (`DESC`). + + Allowed values are: "ASC", "DESC" + + :param str sort_by: (optional) + The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive. + + Allowed values are: "NAME", "TIMECREATED" + + :param str lifecycle_state: (optional) + A filter that returns results that match the lifecycle state specified. + + Allowed values are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING" + + :param str status: (optional) + A filter that returns recommendations that match the status specified. + + Allowed values are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED" + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.ResourceActionCollection` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/resourceActions" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "name", + "resource_type", + "limit", + "page", + "sort_order", + "sort_by", + "lifecycle_state", + "status", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_resource_actions got unknown kwargs: {!r}".format(extra_kwargs)) + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) + ) + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["NAME", "TIMECREATED"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) + ) + + if 'lifecycle_state' in kwargs: + lifecycle_state_allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"] + if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: + raise ValueError( + "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) + ) + + if 'status' in kwargs: + status_allowed_values = ["PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED"] + if kwargs['status'] not in status_allowed_values: + raise ValueError( + "Invalid value for `status`, must be one of {0}".format(status_allowed_values) + ) + + query_params = { + "compartmentId": compartment_id, + "compartmentIdInSubtree": compartment_id_in_subtree, + "recommendationId": recommendation_id, + "name": kwargs.get("name", missing), + "resourceType": kwargs.get("resource_type", missing), + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing), + "sortOrder": kwargs.get("sort_order", missing), + "sortBy": kwargs.get("sort_by", missing), + "lifecycleState": kwargs.get("lifecycle_state", missing), + "status": kwargs.get("status", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="ResourceActionCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="ResourceActionCollection") + + def list_work_request_errors(self, work_request_id, **kwargs): + """ + Lists errors associated with the specified work request. + + + :param str work_request_id: (required) + The OCID of the work request. + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.WorkRequestErrorCollection` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/workRequests/{workRequestId}/errors" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "page", + "limit", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_work_request_errors got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "workRequestId": work_request_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + query_params = { + "page": kwargs.get("page", missing), + "limit": kwargs.get("limit", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="WorkRequestErrorCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="WorkRequestErrorCollection") + + def list_work_request_logs(self, work_request_id, **kwargs): + """ + Lists the logs associated with the specified work request. + + + :param str work_request_id: (required) + The OCID of the work request. + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.WorkRequestLogEntryCollection` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/workRequests/{workRequestId}/logs" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "page", + "limit", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_work_request_logs got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "workRequestId": work_request_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + query_params = { + "page": kwargs.get("page", missing), + "limit": kwargs.get("limit", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="WorkRequestLogEntryCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="WorkRequestLogEntryCollection") + + def list_work_requests(self, compartment_id, **kwargs): + """ + Lists the work requests in the tenancy. The tenancy is the root compartment. + + + :param str compartment_id: (required) + The OCID of the compartment. + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.WorkRequestCollection` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/workRequests" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "page", + "limit", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_work_requests got unknown kwargs: {!r}".format(extra_kwargs)) + + query_params = { + "compartmentId": compartment_id, + "page": kwargs.get("page", missing), + "limit": kwargs.get("limit", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="WorkRequestCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="WorkRequestCollection") + + def update_enrollment_status(self, enrollment_status_id, update_enrollment_status_details, **kwargs): + """ + Updates the enrollment status of the tenancy. + + + :param str enrollment_status_id: (required) + The unique OCID associated with the enrollment status. + + :param UpdateEnrollmentStatusDetails update_enrollment_status_details: (required) + The request object for updating the enrollment status. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param str if_match: (optional) + 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. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.EnrollmentStatus` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/enrollmentStatus/{enrollmentStatusId}" + method = "PUT" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id", + "if_match" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "update_enrollment_status got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "enrollmentStatusId": enrollment_status_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "if-match": kwargs.get("if_match", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_enrollment_status_details, + response_type="EnrollmentStatus") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_enrollment_status_details, + response_type="EnrollmentStatus") + + def update_profile(self, profile_id, update_profile_details, **kwargs): + """ + Updates the specified profile. Uses the profile's OCID to determine which profile to update. + + + :param str profile_id: (required) + The unique OCID of the profile. + + :param UpdateProfileDetails update_profile_details: (required) + The profile information to use for the update. + + :param str if_match: (optional) + 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. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.Profile` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/profiles/{profileId}" + method = "PUT" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "if_match", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "update_profile got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "profileId": profile_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_profile_details, + response_type="Profile") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_profile_details, + response_type="Profile") + + def update_recommendation(self, recommendation_id, update_recommendation_details, **kwargs): + """ + Updates the recommendation that corresponds to the specified OCID. + Use this operation to implement the following actions: + + * Postpone recommendation + * Dismiss recommendation + * Reactivate recommendation + + + :param str recommendation_id: (required) + The unique OCID associated with the recommendation. + + :param UpdateRecommendationDetails update_recommendation_details: (required) + The request object for udpating the recommendation details. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param str if_match: (optional) + 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. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.Recommendation` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/recommendations/{recommendationId}" + method = "PUT" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id", + "if_match" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "update_recommendation got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "recommendationId": recommendation_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "if-match": kwargs.get("if_match", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_recommendation_details, + response_type="Recommendation") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_recommendation_details, + response_type="Recommendation") + + def update_resource_action(self, resource_action_id, update_resource_action_details, **kwargs): + """ + Updates the resource action that corresponds to the specified OCID. + Use this operation to implement the following actions: + + * Postpone resource action + * Ignore resource action + * Reactivate resource action + + + :param str resource_action_id: (required) + The unique OCID associated with the resource action. + + :param UpdateResourceActionDetails update_resource_action_details: (required) + The resource action information to be updated. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. + If you need to contact Oracle about a particular request, please provide the request ID. + + :param str if_match: (optional) + 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. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.optimizer.models.ResourceAction` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/resourceActions/{resourceActionId}" + method = "PUT" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id", + "if_match" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "update_resource_action got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "resourceActionId": resource_action_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "if-match": kwargs.get("if_match", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_resource_action_details, + response_type="ResourceAction") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_resource_action_details, + response_type="ResourceAction") diff --git a/src/oci/optimizer/optimizer_client_composite_operations.py b/src/oci/optimizer/optimizer_client_composite_operations.py new file mode 100644 index 0000000000..8dc70d9cbd --- /dev/null +++ b/src/oci/optimizer/optimizer_client_composite_operations.py @@ -0,0 +1,314 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + +import oci # noqa: F401 +from oci.util import WAIT_RESOURCE_NOT_FOUND # noqa: F401 + + +class OptimizerClientCompositeOperations(object): + """ + This class provides a wrapper around :py:class:`~oci.optimizer.OptimizerClient` and offers convenience methods + for operations that would otherwise need to be chained together. For example, instead of performing an action + on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource + to enter a given state, you can call a single method in this class to accomplish the same functionality + """ + + def __init__(self, client, **kwargs): + """ + Creates a new OptimizerClientCompositeOperations object + + :param OptimizerClient client: + The service client which will be wrapped by this object + """ + self.client = client + + def bulk_apply_recommendations_and_wait_for_state(self, recommendation_id, bulk_apply_recommendations_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.optimizer.OptimizerClient.bulk_apply_recommendations` and waits for the :py:class:`~oci.optimizer.models.WorkRequest` + to enter the given state(s). + + :param str recommendation_id: (required) + The unique OCID associated with the recommendation. + + :param BulkApplyRecommendationsDetails bulk_apply_recommendations_details: (required) + Details about bulk recommendation actions. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.optimizer.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.optimizer.OptimizerClient.bulk_apply_recommendations` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.bulk_apply_recommendations(recommendation_id, bulk_apply_recommendations_details, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.headers['opc-work-request-id'] + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_work_request(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def create_profile_and_wait_for_state(self, create_profile_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.optimizer.OptimizerClient.create_profile` and waits for the :py:class:`~oci.optimizer.models.Profile` acted upon + to enter the given state(s). + + :param CreateProfileDetails create_profile_details: (required) + Details for creating the profile. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.optimizer.models.Profile.lifecycle_state` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.optimizer.OptimizerClient.create_profile` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.create_profile(create_profile_details, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.data.id + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_profile(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def delete_profile_and_wait_for_state(self, profile_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.optimizer.OptimizerClient.delete_profile` and waits for the :py:class:`~oci.optimizer.models.Profile` acted upon + to enter the given state(s). + + :param str profile_id: (required) + The unique OCID of the profile. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.optimizer.models.Profile.lifecycle_state` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.optimizer.OptimizerClient.delete_profile` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + initial_get_result = self.client.get_profile(profile_id) + operation_result = None + try: + operation_result = self.client.delete_profile(profile_id, **operation_kwargs) + except oci.exceptions.ServiceError as e: + if e.status == 404: + return WAIT_RESOURCE_NOT_FOUND + else: + raise e + + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + + try: + waiter_result = oci.wait_until( + self.client, + initial_get_result, + evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states, + succeed_on_not_found=True, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def update_enrollment_status_and_wait_for_state(self, enrollment_status_id, update_enrollment_status_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.optimizer.OptimizerClient.update_enrollment_status` and waits for the :py:class:`~oci.optimizer.models.EnrollmentStatus` acted upon + to enter the given state(s). + + :param str enrollment_status_id: (required) + The unique OCID associated with the enrollment status. + + :param UpdateEnrollmentStatusDetails update_enrollment_status_details: (required) + The request object for updating the enrollment status. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.optimizer.models.EnrollmentStatus.lifecycle_state` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.optimizer.OptimizerClient.update_enrollment_status` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.update_enrollment_status(enrollment_status_id, update_enrollment_status_details, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.data.id + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_enrollment_status(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def update_profile_and_wait_for_state(self, profile_id, update_profile_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.optimizer.OptimizerClient.update_profile` and waits for the :py:class:`~oci.optimizer.models.Profile` acted upon + to enter the given state(s). + + :param str profile_id: (required) + The unique OCID of the profile. + + :param UpdateProfileDetails update_profile_details: (required) + The profile information to use for the update. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.optimizer.models.Profile.lifecycle_state` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.optimizer.OptimizerClient.update_profile` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.update_profile(profile_id, update_profile_details, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.data.id + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_profile(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def update_recommendation_and_wait_for_state(self, recommendation_id, update_recommendation_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.optimizer.OptimizerClient.update_recommendation` and waits for the :py:class:`~oci.optimizer.models.Recommendation` acted upon + to enter the given state(s). + + :param str recommendation_id: (required) + The unique OCID associated with the recommendation. + + :param UpdateRecommendationDetails update_recommendation_details: (required) + The request object for udpating the recommendation details. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.optimizer.models.Recommendation.lifecycle_state` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.optimizer.OptimizerClient.update_recommendation` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.update_recommendation(recommendation_id, update_recommendation_details, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.data.id + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_recommendation(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def update_resource_action_and_wait_for_state(self, resource_action_id, update_resource_action_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.optimizer.OptimizerClient.update_resource_action` and waits for the :py:class:`~oci.optimizer.models.ResourceAction` acted upon + to enter the given state(s). + + :param str resource_action_id: (required) + The unique OCID associated with the resource action. + + :param UpdateResourceActionDetails update_resource_action_details: (required) + The resource action information to be updated. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.optimizer.models.ResourceAction.lifecycle_state` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.optimizer.OptimizerClient.update_resource_action` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.update_resource_action(resource_action_id, update_resource_action_details, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.data.id + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_resource_action(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) diff --git a/src/oci/tenant_manager_control_plane/__init__.py b/src/oci/tenant_manager_control_plane/__init__.py new file mode 100644 index 0000000000..83047a9fc0 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/__init__.py @@ -0,0 +1,18 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + +from __future__ import absolute_import + + +from .link_client import LinkClient +from .link_client_composite_operations import LinkClientCompositeOperations +from .recipient_invitation_client import RecipientInvitationClient +from .recipient_invitation_client_composite_operations import RecipientInvitationClientCompositeOperations +from .sender_invitation_client import SenderInvitationClient +from .sender_invitation_client_composite_operations import SenderInvitationClientCompositeOperations +from .work_request_client import WorkRequestClient +from .work_request_client_composite_operations import WorkRequestClientCompositeOperations +from . import models + +__all__ = ["LinkClient", "LinkClientCompositeOperations", "RecipientInvitationClient", "RecipientInvitationClientCompositeOperations", "SenderInvitationClient", "SenderInvitationClientCompositeOperations", "WorkRequestClient", "WorkRequestClientCompositeOperations", "models"] diff --git a/src/oci/tenant_manager_control_plane/link_client.py b/src/oci/tenant_manager_control_plane/link_client.py new file mode 100644 index 0000000000..2a617c6bd6 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/link_client.py @@ -0,0 +1,348 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + +from __future__ import absolute_import + +from oci._vendor import requests # noqa: F401 +from oci._vendor import six + +from oci import retry # noqa: F401 +from oci.base_client import BaseClient +from oci.config import get_config_value_or_default, validate_config +from oci.signer import Signer +from oci.util import Sentinel, get_signer_from_authentication_type, AUTHENTICATION_TYPE_FIELD_NAME +from .models import tenant_manager_control_plane_type_mapping +missing = Sentinel("Missing") + + +class LinkClient(object): + """ + A description of the TenantManager API + """ + + def __init__(self, config, **kwargs): + """ + Creates a new service client + + :param dict config: + Configuration keys and values as per `SDK and Tool Configuration `__. + The :py:meth:`~oci.config.from_file` method can be used to load configuration from a file. Alternatively, a ``dict`` can be passed. You can validate_config + the dict using :py:meth:`~oci.config.validate_config` + + :param str service_endpoint: (optional) + The endpoint of the service to call using this client. For example ``https://iaas.us-ashburn-1.oraclecloud.com``. If this keyword argument is + not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit + need to specify a service endpoint. + + :param timeout: (optional) + The connection and read timeouts for the client. The default values are connection timeout 10 seconds and read timeout 60 seconds. This keyword argument can be provided + as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If + a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout. + :type timeout: float or tuple(float, float) + + :param signer: (optional) + The signer to use when signing requests made by the service client. The default is to use a :py:class:`~oci.signer.Signer` based on the values + provided in the config parameter. + + One use case for this parameter is for `Instance Principals authentication `__ + by passing an instance of :py:class:`~oci.auth.signers.InstancePrincipalsSecurityTokenSigner` as the value for this keyword argument + :type signer: :py:class:`~oci.signer.AbstractBaseSigner` + + :param obj retry_strategy: (optional) + A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. + Retry strategies can also be applied at the operation level by passing a ``retry_strategy`` keyword argument as part of calling the operation. + Any value provided at the operation level will override whatever is specified at the client level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + """ + validate_config(config, signer=kwargs.get('signer')) + if 'signer' in kwargs: + signer = kwargs['signer'] + + elif AUTHENTICATION_TYPE_FIELD_NAME in config: + signer = get_signer_from_authentication_type(config) + + else: + signer = Signer( + tenancy=config["tenancy"], + user=config["user"], + fingerprint=config["fingerprint"], + private_key_file_location=config.get("key_file"), + pass_phrase=get_config_value_or_default(config, "pass_phrase"), + private_key_content=config.get("key_content") + ) + + base_client_init_kwargs = { + 'regional_client': True, + 'service_endpoint': kwargs.get('service_endpoint'), + 'timeout': kwargs.get('timeout'), + 'base_path': '/20200801', + 'service_endpoint_template': 'https://organizations.{region}.oci.{secondLevelDomain}', + 'skip_deserialization': kwargs.get('skip_deserialization', False) + } + self.base_client = BaseClient("link", config, signer, tenant_manager_control_plane_type_mapping, **base_client_init_kwargs) + self.retry_strategy = kwargs.get('retry_strategy') + + def delete_link(self, link_id, **kwargs): + """ + Terminate the link. + + + :param str link_id: (required) + OCID of the link to terminate. + + :param str if_match: (optional) + 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. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/links/{linkId}" + method = "DELETE" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "if_match", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "delete_link got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "linkId": link_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + + def get_link(self, link_id, **kwargs): + """ + Gets information about the link. + + + :param str link_id: (required) + OCID of the link to retrieve. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.tenant_manager_control_plane.models.Link` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/links/{linkId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_link got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "linkId": link_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="Link") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="Link") + + def list_links(self, **kwargs): + """ + Return a (paginated) list of links. + + + :param str parent_tenancy_id: (optional) + The ID of the parent tenancy this link is associated with. + + :param str child_tenancy_id: (optional) + The ID of the child tenancy this link is associated with. + + :param str lifecycle_state: (optional) + The lifecycle state of the resource. + + Allowed values are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED" + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param str page: (optional) + The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + + :param int limit: (optional) + The maximum number of items to return. + + :param str sort_order: (optional) + The sort order to use, either 'asc' or 'desc'. + + Allowed values are: "ASC", "DESC" + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.tenant_manager_control_plane.models.LinkCollection` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/links" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "parent_tenancy_id", + "child_tenancy_id", + "lifecycle_state", + "opc_request_id", + "page", + "limit", + "sort_order" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_links got unknown kwargs: {!r}".format(extra_kwargs)) + + if 'lifecycle_state' in kwargs: + lifecycle_state_allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED"] + if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: + raise ValueError( + "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) + ) + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) + ) + + query_params = { + "parentTenancyId": kwargs.get("parent_tenancy_id", missing), + "childTenancyId": kwargs.get("child_tenancy_id", missing), + "lifecycleState": kwargs.get("lifecycle_state", missing), + "page": kwargs.get("page", missing), + "limit": kwargs.get("limit", missing), + "sortOrder": kwargs.get("sort_order", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="LinkCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="LinkCollection") diff --git a/src/oci/tenant_manager_control_plane/link_client_composite_operations.py b/src/oci/tenant_manager_control_plane/link_client_composite_operations.py new file mode 100644 index 0000000000..48eadd1281 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/link_client_composite_operations.py @@ -0,0 +1,71 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + +import oci # noqa: F401 +from oci.util import WAIT_RESOURCE_NOT_FOUND # noqa: F401 + + +class LinkClientCompositeOperations(object): + """ + This class provides a wrapper around :py:class:`~oci.tenant_manager_control_plane.LinkClient` and offers convenience methods + for operations that would otherwise need to be chained together. For example, instead of performing an action + on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource + to enter a given state, you can call a single method in this class to accomplish the same functionality + """ + + def __init__(self, client, **kwargs): + """ + Creates a new LinkClientCompositeOperations object + + :param LinkClient client: + The service client which will be wrapped by this object + """ + self.client = client + + def delete_link_and_wait_for_state(self, link_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.tenant_manager_control_plane.LinkClient.delete_link` and waits for the :py:class:`~oci.tenant_manager_control_plane.models.Link` acted upon + to enter the given state(s). + + :param str link_id: (required) + OCID of the link to terminate. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.tenant_manager_control_plane.models.Link.lifecycle_state` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.tenant_manager_control_plane.LinkClient.delete_link` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + initial_get_result = self.client.get_link(link_id) + operation_result = None + try: + operation_result = self.client.delete_link(link_id, **operation_kwargs) + except oci.exceptions.ServiceError as e: + if e.status == 404: + return WAIT_RESOURCE_NOT_FOUND + else: + raise e + + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + + try: + waiter_result = oci.wait_until( + self.client, + initial_get_result, + evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states, + succeed_on_not_found=True, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) diff --git a/src/oci/tenant_manager_control_plane/models/__init__.py b/src/oci/tenant_manager_control_plane/models/__init__.py new file mode 100644 index 0000000000..427780b6d9 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/__init__.py @@ -0,0 +1,50 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + +from __future__ import absolute_import + +from .create_sender_invitation_details import CreateSenderInvitationDetails +from .link import Link +from .link_collection import LinkCollection +from .link_summary import LinkSummary +from .recipient_invitation import RecipientInvitation +from .recipient_invitation_collection import RecipientInvitationCollection +from .recipient_invitation_summary import RecipientInvitationSummary +from .sender_invitation import SenderInvitation +from .sender_invitation_collection import SenderInvitationCollection +from .sender_invitation_summary import SenderInvitationSummary +from .update_recipient_invitation_details import UpdateRecipientInvitationDetails +from .update_sender_invitation_details import UpdateSenderInvitationDetails +from .work_request import WorkRequest +from .work_request_collection import WorkRequestCollection +from .work_request_error import WorkRequestError +from .work_request_error_collection import WorkRequestErrorCollection +from .work_request_log_entry import WorkRequestLogEntry +from .work_request_log_entry_collection import WorkRequestLogEntryCollection +from .work_request_resource import WorkRequestResource +from .work_request_summary import WorkRequestSummary + +# Maps type names to classes for tenant_manager_control_plane services. +tenant_manager_control_plane_type_mapping = { + "CreateSenderInvitationDetails": CreateSenderInvitationDetails, + "Link": Link, + "LinkCollection": LinkCollection, + "LinkSummary": LinkSummary, + "RecipientInvitation": RecipientInvitation, + "RecipientInvitationCollection": RecipientInvitationCollection, + "RecipientInvitationSummary": RecipientInvitationSummary, + "SenderInvitation": SenderInvitation, + "SenderInvitationCollection": SenderInvitationCollection, + "SenderInvitationSummary": SenderInvitationSummary, + "UpdateRecipientInvitationDetails": UpdateRecipientInvitationDetails, + "UpdateSenderInvitationDetails": UpdateSenderInvitationDetails, + "WorkRequest": WorkRequest, + "WorkRequestCollection": WorkRequestCollection, + "WorkRequestError": WorkRequestError, + "WorkRequestErrorCollection": WorkRequestErrorCollection, + "WorkRequestLogEntry": WorkRequestLogEntry, + "WorkRequestLogEntryCollection": WorkRequestLogEntryCollection, + "WorkRequestResource": WorkRequestResource, + "WorkRequestSummary": WorkRequestSummary +} diff --git a/src/oci/tenant_manager_control_plane/models/create_sender_invitation_details.py b/src/oci/tenant_manager_control_plane/models/create_sender_invitation_details.py new file mode 100644 index 0000000000..a68dadb665 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/create_sender_invitation_details.py @@ -0,0 +1,229 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class CreateSenderInvitationDetails(object): + """ + The parameters for creating a sender invitation. + """ + + def __init__(self, **kwargs): + """ + Initializes a new CreateSenderInvitationDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param compartment_id: + The value to assign to the compartment_id property of this CreateSenderInvitationDetails. + :type compartment_id: str + + :param recipient_tenancy_id: + The value to assign to the recipient_tenancy_id property of this CreateSenderInvitationDetails. + :type recipient_tenancy_id: str + + :param recipient_email_address: + The value to assign to the recipient_email_address property of this CreateSenderInvitationDetails. + :type recipient_email_address: str + + :param display_name: + The value to assign to the display_name property of this CreateSenderInvitationDetails. + :type display_name: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this CreateSenderInvitationDetails. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this CreateSenderInvitationDetails. + :type defined_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'compartment_id': 'str', + 'recipient_tenancy_id': 'str', + 'recipient_email_address': 'str', + 'display_name': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'compartment_id': 'compartmentId', + 'recipient_tenancy_id': 'recipientTenancyId', + 'recipient_email_address': 'recipientEmailAddress', + 'display_name': 'displayName', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags' + } + + self._compartment_id = None + self._recipient_tenancy_id = None + self._recipient_email_address = None + self._display_name = None + self._freeform_tags = None + self._defined_tags = None + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this CreateSenderInvitationDetails. + OCID of the sender tenancy. + + + :return: The compartment_id of this CreateSenderInvitationDetails. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this CreateSenderInvitationDetails. + OCID of the sender tenancy. + + + :param compartment_id: The compartment_id of this CreateSenderInvitationDetails. + :type: str + """ + self._compartment_id = compartment_id + + @property + def recipient_tenancy_id(self): + """ + **[Required]** Gets the recipient_tenancy_id of this CreateSenderInvitationDetails. + OCID of the recipient tenancy. + + + :return: The recipient_tenancy_id of this CreateSenderInvitationDetails. + :rtype: str + """ + return self._recipient_tenancy_id + + @recipient_tenancy_id.setter + def recipient_tenancy_id(self, recipient_tenancy_id): + """ + Sets the recipient_tenancy_id of this CreateSenderInvitationDetails. + OCID of the recipient tenancy. + + + :param recipient_tenancy_id: The recipient_tenancy_id of this CreateSenderInvitationDetails. + :type: str + """ + self._recipient_tenancy_id = recipient_tenancy_id + + @property + def recipient_email_address(self): + """ + Gets the recipient_email_address of this CreateSenderInvitationDetails. + Email address of the recipient. + + + :return: The recipient_email_address of this CreateSenderInvitationDetails. + :rtype: str + """ + return self._recipient_email_address + + @recipient_email_address.setter + def recipient_email_address(self, recipient_email_address): + """ + Sets the recipient_email_address of this CreateSenderInvitationDetails. + Email address of the recipient. + + + :param recipient_email_address: The recipient_email_address of this CreateSenderInvitationDetails. + :type: str + """ + self._recipient_email_address = recipient_email_address + + @property + def display_name(self): + """ + Gets the display_name of this CreateSenderInvitationDetails. + A user-created name to describe the invitation. + + + :return: The display_name of this CreateSenderInvitationDetails. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this CreateSenderInvitationDetails. + A user-created name to describe the invitation. + + + :param display_name: The display_name of this CreateSenderInvitationDetails. + :type: str + """ + self._display_name = display_name + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this CreateSenderInvitationDetails. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :return: The freeform_tags of this CreateSenderInvitationDetails. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this CreateSenderInvitationDetails. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :param freeform_tags: The freeform_tags of this CreateSenderInvitationDetails. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this CreateSenderInvitationDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :return: The defined_tags of this CreateSenderInvitationDetails. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this CreateSenderInvitationDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :param defined_tags: The defined_tags of this CreateSenderInvitationDetails. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/link.py b/src/oci/tenant_manager_control_plane/models/link.py new file mode 100644 index 0000000000..5e67f257fd --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/link.py @@ -0,0 +1,288 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class Link(object): + """ + A link between a parent tenancy and a child tenancy. + """ + + #: A constant which can be used with the lifecycle_state property of a Link. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the lifecycle_state property of a Link. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a Link. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a Link. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a Link. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a Link. + #: This constant has a value of "TERMINATED" + LIFECYCLE_STATE_TERMINATED = "TERMINATED" + + def __init__(self, **kwargs): + """ + Initializes a new Link object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this Link. + :type id: str + + :param parent_tenancy_id: + The value to assign to the parent_tenancy_id property of this Link. + :type parent_tenancy_id: str + + :param child_tenancy_id: + The value to assign to the child_tenancy_id property of this Link. + :type child_tenancy_id: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this Link. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param time_created: + The value to assign to the time_created property of this Link. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this Link. + :type time_updated: datetime + + :param time_terminated: + The value to assign to the time_terminated property of this Link. + :type time_terminated: datetime + + """ + self.swagger_types = { + 'id': 'str', + 'parent_tenancy_id': 'str', + 'child_tenancy_id': 'str', + 'lifecycle_state': 'str', + 'time_created': 'datetime', + 'time_updated': 'datetime', + 'time_terminated': 'datetime' + } + + self.attribute_map = { + 'id': 'id', + 'parent_tenancy_id': 'parentTenancyId', + 'child_tenancy_id': 'childTenancyId', + 'lifecycle_state': 'lifecycleState', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated', + 'time_terminated': 'timeTerminated' + } + + self._id = None + self._parent_tenancy_id = None + self._child_tenancy_id = None + self._lifecycle_state = None + self._time_created = None + self._time_updated = None + self._time_terminated = None + + @property + def id(self): + """ + **[Required]** Gets the id of this Link. + OCID of the link. + + + :return: The id of this Link. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this Link. + OCID of the link. + + + :param id: The id of this Link. + :type: str + """ + self._id = id + + @property + def parent_tenancy_id(self): + """ + **[Required]** Gets the parent_tenancy_id of this Link. + OCID of the parent tenancy. + + + :return: The parent_tenancy_id of this Link. + :rtype: str + """ + return self._parent_tenancy_id + + @parent_tenancy_id.setter + def parent_tenancy_id(self, parent_tenancy_id): + """ + Sets the parent_tenancy_id of this Link. + OCID of the parent tenancy. + + + :param parent_tenancy_id: The parent_tenancy_id of this Link. + :type: str + """ + self._parent_tenancy_id = parent_tenancy_id + + @property + def child_tenancy_id(self): + """ + **[Required]** Gets the child_tenancy_id of this Link. + OCID of the child tenancy + + + :return: The child_tenancy_id of this Link. + :rtype: str + """ + return self._child_tenancy_id + + @child_tenancy_id.setter + def child_tenancy_id(self, child_tenancy_id): + """ + Sets the child_tenancy_id of this Link. + OCID of the child tenancy + + + :param child_tenancy_id: The child_tenancy_id of this Link. + :type: str + """ + self._child_tenancy_id = child_tenancy_id + + @property + def lifecycle_state(self): + """ + Gets the lifecycle_state of this Link. + Lifecycle state of the link. + + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this Link. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this Link. + Lifecycle state of the link. + + + :param lifecycle_state: The lifecycle_state of this Link. + :type: str + """ + allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def time_created(self): + """ + **[Required]** Gets the time_created of this Link. + Date-time when this link was created. + + + :return: The time_created of this Link. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this Link. + Date-time when this link was created. + + + :param time_created: The time_created of this Link. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + Gets the time_updated of this Link. + Date-time when this link was last updated. + + + :return: The time_updated of this Link. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this Link. + Date-time when this link was last updated. + + + :param time_updated: The time_updated of this Link. + :type: datetime + """ + self._time_updated = time_updated + + @property + def time_terminated(self): + """ + Gets the time_terminated of this Link. + Date-time when this link was terminated. + + + :return: The time_terminated of this Link. + :rtype: datetime + """ + return self._time_terminated + + @time_terminated.setter + def time_terminated(self, time_terminated): + """ + Sets the time_terminated of this Link. + Date-time when this link was terminated. + + + :param time_terminated: The time_terminated of this Link. + :type: datetime + """ + self._time_terminated = time_terminated + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/link_collection.py b/src/oci/tenant_manager_control_plane/models/link_collection.py new file mode 100644 index 0000000000..1604a49400 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/link_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class LinkCollection(object): + """ + Result of a query request for a list of links. Contains Link items. + """ + + def __init__(self, **kwargs): + """ + Initializes a new LinkCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this LinkCollection. + :type items: list[LinkSummary] + + """ + self.swagger_types = { + 'items': 'list[LinkSummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this LinkCollection. + Array containing LinkSummary items. + + + :return: The items of this LinkCollection. + :rtype: list[LinkSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this LinkCollection. + Array containing LinkSummary items. + + + :param items: The items of this LinkCollection. + :type: list[LinkSummary] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/link_summary.py b/src/oci/tenant_manager_control_plane/models/link_summary.py new file mode 100644 index 0000000000..d1dea2d627 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/link_summary.py @@ -0,0 +1,288 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class LinkSummary(object): + """ + The summary of a link between a parent tenancy and a child tenancy. + """ + + #: A constant which can be used with the lifecycle_state property of a LinkSummary. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the lifecycle_state property of a LinkSummary. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a LinkSummary. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a LinkSummary. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a LinkSummary. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a LinkSummary. + #: This constant has a value of "TERMINATED" + LIFECYCLE_STATE_TERMINATED = "TERMINATED" + + def __init__(self, **kwargs): + """ + Initializes a new LinkSummary object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this LinkSummary. + :type id: str + + :param parent_tenancy_id: + The value to assign to the parent_tenancy_id property of this LinkSummary. + :type parent_tenancy_id: str + + :param child_tenancy_id: + The value to assign to the child_tenancy_id property of this LinkSummary. + :type child_tenancy_id: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this LinkSummary. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param time_created: + The value to assign to the time_created property of this LinkSummary. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this LinkSummary. + :type time_updated: datetime + + :param time_terminated: + The value to assign to the time_terminated property of this LinkSummary. + :type time_terminated: datetime + + """ + self.swagger_types = { + 'id': 'str', + 'parent_tenancy_id': 'str', + 'child_tenancy_id': 'str', + 'lifecycle_state': 'str', + 'time_created': 'datetime', + 'time_updated': 'datetime', + 'time_terminated': 'datetime' + } + + self.attribute_map = { + 'id': 'id', + 'parent_tenancy_id': 'parentTenancyId', + 'child_tenancy_id': 'childTenancyId', + 'lifecycle_state': 'lifecycleState', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated', + 'time_terminated': 'timeTerminated' + } + + self._id = None + self._parent_tenancy_id = None + self._child_tenancy_id = None + self._lifecycle_state = None + self._time_created = None + self._time_updated = None + self._time_terminated = None + + @property + def id(self): + """ + **[Required]** Gets the id of this LinkSummary. + OCID of the link. + + + :return: The id of this LinkSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this LinkSummary. + OCID of the link. + + + :param id: The id of this LinkSummary. + :type: str + """ + self._id = id + + @property + def parent_tenancy_id(self): + """ + **[Required]** Gets the parent_tenancy_id of this LinkSummary. + OCID of the parent tenancy. + + + :return: The parent_tenancy_id of this LinkSummary. + :rtype: str + """ + return self._parent_tenancy_id + + @parent_tenancy_id.setter + def parent_tenancy_id(self, parent_tenancy_id): + """ + Sets the parent_tenancy_id of this LinkSummary. + OCID of the parent tenancy. + + + :param parent_tenancy_id: The parent_tenancy_id of this LinkSummary. + :type: str + """ + self._parent_tenancy_id = parent_tenancy_id + + @property + def child_tenancy_id(self): + """ + **[Required]** Gets the child_tenancy_id of this LinkSummary. + OCID of the child tenancy. + + + :return: The child_tenancy_id of this LinkSummary. + :rtype: str + """ + return self._child_tenancy_id + + @child_tenancy_id.setter + def child_tenancy_id(self, child_tenancy_id): + """ + Sets the child_tenancy_id of this LinkSummary. + OCID of the child tenancy. + + + :param child_tenancy_id: The child_tenancy_id of this LinkSummary. + :type: str + """ + self._child_tenancy_id = child_tenancy_id + + @property + def lifecycle_state(self): + """ + Gets the lifecycle_state of this LinkSummary. + Lifecycle state of the link. + + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this LinkSummary. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this LinkSummary. + Lifecycle state of the link. + + + :param lifecycle_state: The lifecycle_state of this LinkSummary. + :type: str + """ + allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def time_created(self): + """ + **[Required]** Gets the time_created of this LinkSummary. + Date-time when this link was created + + + :return: The time_created of this LinkSummary. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this LinkSummary. + Date-time when this link was created + + + :param time_created: The time_created of this LinkSummary. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + Gets the time_updated of this LinkSummary. + Date-time when this link was last updated. + + + :return: The time_updated of this LinkSummary. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this LinkSummary. + Date-time when this link was last updated. + + + :param time_updated: The time_updated of this LinkSummary. + :type: datetime + """ + self._time_updated = time_updated + + @property + def time_terminated(self): + """ + Gets the time_terminated of this LinkSummary. + Date-time when this link was terminated. + + + :return: The time_terminated of this LinkSummary. + :rtype: datetime + """ + return self._time_terminated + + @time_terminated.setter + def time_terminated(self, time_terminated): + """ + Sets the time_terminated of this LinkSummary. + Date-time when this link was terminated. + + + :param time_terminated: The time_terminated of this LinkSummary. + :type: datetime + """ + self._time_terminated = time_terminated + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/recipient_invitation.py b/src/oci/tenant_manager_control_plane/models/recipient_invitation.py new file mode 100644 index 0000000000..95c03d0027 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/recipient_invitation.py @@ -0,0 +1,512 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class RecipientInvitation(object): + """ + The invitation model that the recipient owns. + """ + + #: A constant which can be used with the lifecycle_state property of a RecipientInvitation. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the lifecycle_state property of a RecipientInvitation. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a RecipientInvitation. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a RecipientInvitation. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a RecipientInvitation. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a RecipientInvitation. + #: This constant has a value of "TERMINATED" + LIFECYCLE_STATE_TERMINATED = "TERMINATED" + + #: A constant which can be used with the status property of a RecipientInvitation. + #: This constant has a value of "PENDING" + STATUS_PENDING = "PENDING" + + #: A constant which can be used with the status property of a RecipientInvitation. + #: This constant has a value of "CANCELED" + STATUS_CANCELED = "CANCELED" + + #: A constant which can be used with the status property of a RecipientInvitation. + #: This constant has a value of "ACCEPTED" + STATUS_ACCEPTED = "ACCEPTED" + + #: A constant which can be used with the status property of a RecipientInvitation. + #: This constant has a value of "IGNORED" + STATUS_IGNORED = "IGNORED" + + #: A constant which can be used with the status property of a RecipientInvitation. + #: This constant has a value of "EXPIRED" + STATUS_EXPIRED = "EXPIRED" + + #: A constant which can be used with the status property of a RecipientInvitation. + #: This constant has a value of "FAILED" + STATUS_FAILED = "FAILED" + + def __init__(self, **kwargs): + """ + Initializes a new RecipientInvitation object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this RecipientInvitation. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this RecipientInvitation. + :type compartment_id: str + + :param sender_invitation_id: + The value to assign to the sender_invitation_id property of this RecipientInvitation. + :type sender_invitation_id: str + + :param sender_tenancy_id: + The value to assign to the sender_tenancy_id property of this RecipientInvitation. + :type sender_tenancy_id: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this RecipientInvitation. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param status: + The value to assign to the status property of this RecipientInvitation. + Allowed values for this property are: "PENDING", "CANCELED", "ACCEPTED", "IGNORED", "EXPIRED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param display_name: + The value to assign to the display_name property of this RecipientInvitation. + :type display_name: str + + :param time_created: + The value to assign to the time_created property of this RecipientInvitation. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this RecipientInvitation. + :type time_updated: datetime + + :param recipient_email_address: + The value to assign to the recipient_email_address property of this RecipientInvitation. + :type recipient_email_address: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this RecipientInvitation. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this RecipientInvitation. + :type defined_tags: dict(str, dict(str, object)) + + :param system_tags: + The value to assign to the system_tags property of this RecipientInvitation. + :type system_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'sender_invitation_id': 'str', + 'sender_tenancy_id': 'str', + 'lifecycle_state': 'str', + 'status': 'str', + 'display_name': 'str', + 'time_created': 'datetime', + 'time_updated': 'datetime', + 'recipient_email_address': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))', + 'system_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'sender_invitation_id': 'senderInvitationId', + 'sender_tenancy_id': 'senderTenancyId', + 'lifecycle_state': 'lifecycleState', + 'status': 'status', + 'display_name': 'displayName', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated', + 'recipient_email_address': 'recipientEmailAddress', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags', + 'system_tags': 'systemTags' + } + + self._id = None + self._compartment_id = None + self._sender_invitation_id = None + self._sender_tenancy_id = None + self._lifecycle_state = None + self._status = None + self._display_name = None + self._time_created = None + self._time_updated = None + self._recipient_email_address = None + self._freeform_tags = None + self._defined_tags = None + self._system_tags = None + + @property + def id(self): + """ + **[Required]** Gets the id of this RecipientInvitation. + OCID of the recipient invitation. + + + :return: The id of this RecipientInvitation. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this RecipientInvitation. + OCID of the recipient invitation. + + + :param id: The id of this RecipientInvitation. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this RecipientInvitation. + OCID of the recipient tenancy. + + + :return: The compartment_id of this RecipientInvitation. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this RecipientInvitation. + OCID of the recipient tenancy. + + + :param compartment_id: The compartment_id of this RecipientInvitation. + :type: str + """ + self._compartment_id = compartment_id + + @property + def sender_invitation_id(self): + """ + **[Required]** Gets the sender_invitation_id of this RecipientInvitation. + OCID of the corresponding sender invitation. + + + :return: The sender_invitation_id of this RecipientInvitation. + :rtype: str + """ + return self._sender_invitation_id + + @sender_invitation_id.setter + def sender_invitation_id(self, sender_invitation_id): + """ + Sets the sender_invitation_id of this RecipientInvitation. + OCID of the corresponding sender invitation. + + + :param sender_invitation_id: The sender_invitation_id of this RecipientInvitation. + :type: str + """ + self._sender_invitation_id = sender_invitation_id + + @property + def sender_tenancy_id(self): + """ + **[Required]** Gets the sender_tenancy_id of this RecipientInvitation. + OCID of the sender tenancy. + + + :return: The sender_tenancy_id of this RecipientInvitation. + :rtype: str + """ + return self._sender_tenancy_id + + @sender_tenancy_id.setter + def sender_tenancy_id(self, sender_tenancy_id): + """ + Sets the sender_tenancy_id of this RecipientInvitation. + OCID of the sender tenancy. + + + :param sender_tenancy_id: The sender_tenancy_id of this RecipientInvitation. + :type: str + """ + self._sender_tenancy_id = sender_tenancy_id + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this RecipientInvitation. + Lifecycle state of the recipient invitation. + + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this RecipientInvitation. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this RecipientInvitation. + Lifecycle state of the recipient invitation. + + + :param lifecycle_state: The lifecycle_state of this RecipientInvitation. + :type: str + """ + allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def status(self): + """ + **[Required]** Gets the status of this RecipientInvitation. + Status of the recipient invitation. + + Allowed values for this property are: "PENDING", "CANCELED", "ACCEPTED", "IGNORED", "EXPIRED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this RecipientInvitation. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this RecipientInvitation. + Status of the recipient invitation. + + + :param status: The status of this RecipientInvitation. + :type: str + """ + allowed_values = ["PENDING", "CANCELED", "ACCEPTED", "IGNORED", "EXPIRED", "FAILED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def display_name(self): + """ + Gets the display_name of this RecipientInvitation. + A user-created name to describe the invitation. + + + :return: The display_name of this RecipientInvitation. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this RecipientInvitation. + A user-created name to describe the invitation. + + + :param display_name: The display_name of this RecipientInvitation. + :type: str + """ + self._display_name = display_name + + @property + def time_created(self): + """ + **[Required]** Gets the time_created of this RecipientInvitation. + Date-time when this recipient invitation was created. + + + :return: The time_created of this RecipientInvitation. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this RecipientInvitation. + Date-time when this recipient invitation was created. + + + :param time_created: The time_created of this RecipientInvitation. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + Gets the time_updated of this RecipientInvitation. + Date-time when this recipient invitation was last updated. + + + :return: The time_updated of this RecipientInvitation. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this RecipientInvitation. + Date-time when this recipient invitation was last updated. + + + :param time_updated: The time_updated of this RecipientInvitation. + :type: datetime + """ + self._time_updated = time_updated + + @property + def recipient_email_address(self): + """ + Gets the recipient_email_address of this RecipientInvitation. + Email address of the recipient. + + + :return: The recipient_email_address of this RecipientInvitation. + :rtype: str + """ + return self._recipient_email_address + + @recipient_email_address.setter + def recipient_email_address(self, recipient_email_address): + """ + Sets the recipient_email_address of this RecipientInvitation. + Email address of the recipient. + + + :param recipient_email_address: The recipient_email_address of this RecipientInvitation. + :type: str + """ + self._recipient_email_address = recipient_email_address + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this RecipientInvitation. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :return: The freeform_tags of this RecipientInvitation. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this RecipientInvitation. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :param freeform_tags: The freeform_tags of this RecipientInvitation. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this RecipientInvitation. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :return: The defined_tags of this RecipientInvitation. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this RecipientInvitation. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :param defined_tags: The defined_tags of this RecipientInvitation. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def system_tags(self): + """ + Gets the system_tags of this RecipientInvitation. + Usage of system tag keys. These predefined keys are scoped to namespaces. + Example: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}` + + + :return: The system_tags of this RecipientInvitation. + :rtype: dict(str, dict(str, object)) + """ + return self._system_tags + + @system_tags.setter + def system_tags(self, system_tags): + """ + Sets the system_tags of this RecipientInvitation. + Usage of system tag keys. These predefined keys are scoped to namespaces. + Example: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}` + + + :param system_tags: The system_tags of this RecipientInvitation. + :type: dict(str, dict(str, object)) + """ + self._system_tags = system_tags + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/recipient_invitation_collection.py b/src/oci/tenant_manager_control_plane/models/recipient_invitation_collection.py new file mode 100644 index 0000000000..df1995e15e --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/recipient_invitation_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class RecipientInvitationCollection(object): + """ + Result of a query request for a list of recipient invitations. Contains RecipientInvitationSummary items. + """ + + def __init__(self, **kwargs): + """ + Initializes a new RecipientInvitationCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this RecipientInvitationCollection. + :type items: list[RecipientInvitationSummary] + + """ + self.swagger_types = { + 'items': 'list[RecipientInvitationSummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this RecipientInvitationCollection. + Array containing RecipientInvitationSummary items. + + + :return: The items of this RecipientInvitationCollection. + :rtype: list[RecipientInvitationSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this RecipientInvitationCollection. + Array containing RecipientInvitationSummary items. + + + :param items: The items of this RecipientInvitationCollection. + :type: list[RecipientInvitationSummary] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/recipient_invitation_summary.py b/src/oci/tenant_manager_control_plane/models/recipient_invitation_summary.py new file mode 100644 index 0000000000..05d16a1d6e --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/recipient_invitation_summary.py @@ -0,0 +1,512 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class RecipientInvitationSummary(object): + """ + The summary of the invitation model that the recipient owns. + """ + + #: A constant which can be used with the lifecycle_state property of a RecipientInvitationSummary. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the lifecycle_state property of a RecipientInvitationSummary. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a RecipientInvitationSummary. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a RecipientInvitationSummary. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a RecipientInvitationSummary. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a RecipientInvitationSummary. + #: This constant has a value of "TERMINATED" + LIFECYCLE_STATE_TERMINATED = "TERMINATED" + + #: A constant which can be used with the status property of a RecipientInvitationSummary. + #: This constant has a value of "PENDING" + STATUS_PENDING = "PENDING" + + #: A constant which can be used with the status property of a RecipientInvitationSummary. + #: This constant has a value of "CANCELED" + STATUS_CANCELED = "CANCELED" + + #: A constant which can be used with the status property of a RecipientInvitationSummary. + #: This constant has a value of "ACCEPTED" + STATUS_ACCEPTED = "ACCEPTED" + + #: A constant which can be used with the status property of a RecipientInvitationSummary. + #: This constant has a value of "IGNORED" + STATUS_IGNORED = "IGNORED" + + #: A constant which can be used with the status property of a RecipientInvitationSummary. + #: This constant has a value of "EXPIRED" + STATUS_EXPIRED = "EXPIRED" + + #: A constant which can be used with the status property of a RecipientInvitationSummary. + #: This constant has a value of "FAILED" + STATUS_FAILED = "FAILED" + + def __init__(self, **kwargs): + """ + Initializes a new RecipientInvitationSummary object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this RecipientInvitationSummary. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this RecipientInvitationSummary. + :type compartment_id: str + + :param display_name: + The value to assign to the display_name property of this RecipientInvitationSummary. + :type display_name: str + + :param sender_invitation_id: + The value to assign to the sender_invitation_id property of this RecipientInvitationSummary. + :type sender_invitation_id: str + + :param sender_tenancy_id: + The value to assign to the sender_tenancy_id property of this RecipientInvitationSummary. + :type sender_tenancy_id: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this RecipientInvitationSummary. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param status: + The value to assign to the status property of this RecipientInvitationSummary. + Allowed values for this property are: "PENDING", "CANCELED", "ACCEPTED", "IGNORED", "EXPIRED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param time_created: + The value to assign to the time_created property of this RecipientInvitationSummary. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this RecipientInvitationSummary. + :type time_updated: datetime + + :param recipient_email_address: + The value to assign to the recipient_email_address property of this RecipientInvitationSummary. + :type recipient_email_address: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this RecipientInvitationSummary. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this RecipientInvitationSummary. + :type defined_tags: dict(str, dict(str, object)) + + :param system_tags: + The value to assign to the system_tags property of this RecipientInvitationSummary. + :type system_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'display_name': 'str', + 'sender_invitation_id': 'str', + 'sender_tenancy_id': 'str', + 'lifecycle_state': 'str', + 'status': 'str', + 'time_created': 'datetime', + 'time_updated': 'datetime', + 'recipient_email_address': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))', + 'system_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'display_name': 'displayName', + 'sender_invitation_id': 'senderInvitationId', + 'sender_tenancy_id': 'senderTenancyId', + 'lifecycle_state': 'lifecycleState', + 'status': 'status', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated', + 'recipient_email_address': 'recipientEmailAddress', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags', + 'system_tags': 'systemTags' + } + + self._id = None + self._compartment_id = None + self._display_name = None + self._sender_invitation_id = None + self._sender_tenancy_id = None + self._lifecycle_state = None + self._status = None + self._time_created = None + self._time_updated = None + self._recipient_email_address = None + self._freeform_tags = None + self._defined_tags = None + self._system_tags = None + + @property + def id(self): + """ + **[Required]** Gets the id of this RecipientInvitationSummary. + OCID of the recipient invitation. + + + :return: The id of this RecipientInvitationSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this RecipientInvitationSummary. + OCID of the recipient invitation. + + + :param id: The id of this RecipientInvitationSummary. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this RecipientInvitationSummary. + OCID of the recipient tenancy. + + + :return: The compartment_id of this RecipientInvitationSummary. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this RecipientInvitationSummary. + OCID of the recipient tenancy. + + + :param compartment_id: The compartment_id of this RecipientInvitationSummary. + :type: str + """ + self._compartment_id = compartment_id + + @property + def display_name(self): + """ + **[Required]** Gets the display_name of this RecipientInvitationSummary. + A user-created name to describe the invitation. + + + :return: The display_name of this RecipientInvitationSummary. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this RecipientInvitationSummary. + A user-created name to describe the invitation. + + + :param display_name: The display_name of this RecipientInvitationSummary. + :type: str + """ + self._display_name = display_name + + @property + def sender_invitation_id(self): + """ + **[Required]** Gets the sender_invitation_id of this RecipientInvitationSummary. + OCID of the corresponding sender invitation. + + + :return: The sender_invitation_id of this RecipientInvitationSummary. + :rtype: str + """ + return self._sender_invitation_id + + @sender_invitation_id.setter + def sender_invitation_id(self, sender_invitation_id): + """ + Sets the sender_invitation_id of this RecipientInvitationSummary. + OCID of the corresponding sender invitation. + + + :param sender_invitation_id: The sender_invitation_id of this RecipientInvitationSummary. + :type: str + """ + self._sender_invitation_id = sender_invitation_id + + @property + def sender_tenancy_id(self): + """ + **[Required]** Gets the sender_tenancy_id of this RecipientInvitationSummary. + OCID of the sender tenancy. + + + :return: The sender_tenancy_id of this RecipientInvitationSummary. + :rtype: str + """ + return self._sender_tenancy_id + + @sender_tenancy_id.setter + def sender_tenancy_id(self, sender_tenancy_id): + """ + Sets the sender_tenancy_id of this RecipientInvitationSummary. + OCID of the sender tenancy. + + + :param sender_tenancy_id: The sender_tenancy_id of this RecipientInvitationSummary. + :type: str + """ + self._sender_tenancy_id = sender_tenancy_id + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this RecipientInvitationSummary. + Lifecycle state of the recipient invitation. + + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this RecipientInvitationSummary. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this RecipientInvitationSummary. + Lifecycle state of the recipient invitation. + + + :param lifecycle_state: The lifecycle_state of this RecipientInvitationSummary. + :type: str + """ + allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def status(self): + """ + **[Required]** Gets the status of this RecipientInvitationSummary. + Status of the recipient invitation. + + Allowed values for this property are: "PENDING", "CANCELED", "ACCEPTED", "IGNORED", "EXPIRED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this RecipientInvitationSummary. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this RecipientInvitationSummary. + Status of the recipient invitation. + + + :param status: The status of this RecipientInvitationSummary. + :type: str + """ + allowed_values = ["PENDING", "CANCELED", "ACCEPTED", "IGNORED", "EXPIRED", "FAILED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def time_created(self): + """ + **[Required]** Gets the time_created of this RecipientInvitationSummary. + Date-time when this recipient invitation was created. + + + :return: The time_created of this RecipientInvitationSummary. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this RecipientInvitationSummary. + Date-time when this recipient invitation was created. + + + :param time_created: The time_created of this RecipientInvitationSummary. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + Gets the time_updated of this RecipientInvitationSummary. + Date-time when this recipient invitation was last updated. + + + :return: The time_updated of this RecipientInvitationSummary. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this RecipientInvitationSummary. + Date-time when this recipient invitation was last updated. + + + :param time_updated: The time_updated of this RecipientInvitationSummary. + :type: datetime + """ + self._time_updated = time_updated + + @property + def recipient_email_address(self): + """ + Gets the recipient_email_address of this RecipientInvitationSummary. + Email address of the recipient. + + + :return: The recipient_email_address of this RecipientInvitationSummary. + :rtype: str + """ + return self._recipient_email_address + + @recipient_email_address.setter + def recipient_email_address(self, recipient_email_address): + """ + Sets the recipient_email_address of this RecipientInvitationSummary. + Email address of the recipient. + + + :param recipient_email_address: The recipient_email_address of this RecipientInvitationSummary. + :type: str + """ + self._recipient_email_address = recipient_email_address + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this RecipientInvitationSummary. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :return: The freeform_tags of this RecipientInvitationSummary. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this RecipientInvitationSummary. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :param freeform_tags: The freeform_tags of this RecipientInvitationSummary. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this RecipientInvitationSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :return: The defined_tags of this RecipientInvitationSummary. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this RecipientInvitationSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :param defined_tags: The defined_tags of this RecipientInvitationSummary. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def system_tags(self): + """ + Gets the system_tags of this RecipientInvitationSummary. + Usage of system tag keys. These predefined keys are scoped to namespaces. + Example: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}` + + + :return: The system_tags of this RecipientInvitationSummary. + :rtype: dict(str, dict(str, object)) + """ + return self._system_tags + + @system_tags.setter + def system_tags(self, system_tags): + """ + Sets the system_tags of this RecipientInvitationSummary. + Usage of system tag keys. These predefined keys are scoped to namespaces. + Example: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}` + + + :param system_tags: The system_tags of this RecipientInvitationSummary. + :type: dict(str, dict(str, object)) + """ + self._system_tags = system_tags + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/sender_invitation.py b/src/oci/tenant_manager_control_plane/models/sender_invitation.py new file mode 100644 index 0000000000..6a13e1c433 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/sender_invitation.py @@ -0,0 +1,508 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class SenderInvitation(object): + """ + The invitation model that the sender owns. + """ + + #: A constant which can be used with the lifecycle_state property of a SenderInvitation. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the lifecycle_state property of a SenderInvitation. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a SenderInvitation. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a SenderInvitation. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a SenderInvitation. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a SenderInvitation. + #: This constant has a value of "TERMINATED" + LIFECYCLE_STATE_TERMINATED = "TERMINATED" + + #: A constant which can be used with the status property of a SenderInvitation. + #: This constant has a value of "PENDING" + STATUS_PENDING = "PENDING" + + #: A constant which can be used with the status property of a SenderInvitation. + #: This constant has a value of "CANCELED" + STATUS_CANCELED = "CANCELED" + + #: A constant which can be used with the status property of a SenderInvitation. + #: This constant has a value of "ACCEPTED" + STATUS_ACCEPTED = "ACCEPTED" + + #: A constant which can be used with the status property of a SenderInvitation. + #: This constant has a value of "EXPIRED" + STATUS_EXPIRED = "EXPIRED" + + #: A constant which can be used with the status property of a SenderInvitation. + #: This constant has a value of "FAILED" + STATUS_FAILED = "FAILED" + + def __init__(self, **kwargs): + """ + Initializes a new SenderInvitation object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this SenderInvitation. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this SenderInvitation. + :type compartment_id: str + + :param recipient_invitation_id: + The value to assign to the recipient_invitation_id property of this SenderInvitation. + :type recipient_invitation_id: str + + :param recipient_tenancy_id: + The value to assign to the recipient_tenancy_id property of this SenderInvitation. + :type recipient_tenancy_id: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this SenderInvitation. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param status: + The value to assign to the status property of this SenderInvitation. + Allowed values for this property are: "PENDING", "CANCELED", "ACCEPTED", "EXPIRED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param display_name: + The value to assign to the display_name property of this SenderInvitation. + :type display_name: str + + :param time_created: + The value to assign to the time_created property of this SenderInvitation. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this SenderInvitation. + :type time_updated: datetime + + :param recipient_email_address: + The value to assign to the recipient_email_address property of this SenderInvitation. + :type recipient_email_address: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this SenderInvitation. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this SenderInvitation. + :type defined_tags: dict(str, dict(str, object)) + + :param system_tags: + The value to assign to the system_tags property of this SenderInvitation. + :type system_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'recipient_invitation_id': 'str', + 'recipient_tenancy_id': 'str', + 'lifecycle_state': 'str', + 'status': 'str', + 'display_name': 'str', + 'time_created': 'datetime', + 'time_updated': 'datetime', + 'recipient_email_address': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))', + 'system_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'recipient_invitation_id': 'recipientInvitationId', + 'recipient_tenancy_id': 'recipientTenancyId', + 'lifecycle_state': 'lifecycleState', + 'status': 'status', + 'display_name': 'displayName', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated', + 'recipient_email_address': 'recipientEmailAddress', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags', + 'system_tags': 'systemTags' + } + + self._id = None + self._compartment_id = None + self._recipient_invitation_id = None + self._recipient_tenancy_id = None + self._lifecycle_state = None + self._status = None + self._display_name = None + self._time_created = None + self._time_updated = None + self._recipient_email_address = None + self._freeform_tags = None + self._defined_tags = None + self._system_tags = None + + @property + def id(self): + """ + **[Required]** Gets the id of this SenderInvitation. + OCID of the sender invitation. + + + :return: The id of this SenderInvitation. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this SenderInvitation. + OCID of the sender invitation. + + + :param id: The id of this SenderInvitation. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this SenderInvitation. + OCID of the sender tenancy. + + + :return: The compartment_id of this SenderInvitation. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this SenderInvitation. + OCID of the sender tenancy. + + + :param compartment_id: The compartment_id of this SenderInvitation. + :type: str + """ + self._compartment_id = compartment_id + + @property + def recipient_invitation_id(self): + """ + Gets the recipient_invitation_id of this SenderInvitation. + OCID of the corresponding recipient invitation. + + + :return: The recipient_invitation_id of this SenderInvitation. + :rtype: str + """ + return self._recipient_invitation_id + + @recipient_invitation_id.setter + def recipient_invitation_id(self, recipient_invitation_id): + """ + Sets the recipient_invitation_id of this SenderInvitation. + OCID of the corresponding recipient invitation. + + + :param recipient_invitation_id: The recipient_invitation_id of this SenderInvitation. + :type: str + """ + self._recipient_invitation_id = recipient_invitation_id + + @property + def recipient_tenancy_id(self): + """ + **[Required]** Gets the recipient_tenancy_id of this SenderInvitation. + OCID of the recipient tenancy. + + + :return: The recipient_tenancy_id of this SenderInvitation. + :rtype: str + """ + return self._recipient_tenancy_id + + @recipient_tenancy_id.setter + def recipient_tenancy_id(self, recipient_tenancy_id): + """ + Sets the recipient_tenancy_id of this SenderInvitation. + OCID of the recipient tenancy. + + + :param recipient_tenancy_id: The recipient_tenancy_id of this SenderInvitation. + :type: str + """ + self._recipient_tenancy_id = recipient_tenancy_id + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this SenderInvitation. + Lifecycle state of the sender invitation. + + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this SenderInvitation. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this SenderInvitation. + Lifecycle state of the sender invitation. + + + :param lifecycle_state: The lifecycle_state of this SenderInvitation. + :type: str + """ + allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def status(self): + """ + **[Required]** Gets the status of this SenderInvitation. + Status of the sender invitation. + + Allowed values for this property are: "PENDING", "CANCELED", "ACCEPTED", "EXPIRED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this SenderInvitation. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this SenderInvitation. + Status of the sender invitation. + + + :param status: The status of this SenderInvitation. + :type: str + """ + allowed_values = ["PENDING", "CANCELED", "ACCEPTED", "EXPIRED", "FAILED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def display_name(self): + """ + Gets the display_name of this SenderInvitation. + A user-created name to describe the invitation. + + + :return: The display_name of this SenderInvitation. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this SenderInvitation. + A user-created name to describe the invitation. + + + :param display_name: The display_name of this SenderInvitation. + :type: str + """ + self._display_name = display_name + + @property + def time_created(self): + """ + **[Required]** Gets the time_created of this SenderInvitation. + Date-time when this sender invitation was created. + + + :return: The time_created of this SenderInvitation. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this SenderInvitation. + Date-time when this sender invitation was created. + + + :param time_created: The time_created of this SenderInvitation. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + Gets the time_updated of this SenderInvitation. + Date-time when this sender invitation was last updated. + + + :return: The time_updated of this SenderInvitation. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this SenderInvitation. + Date-time when this sender invitation was last updated. + + + :param time_updated: The time_updated of this SenderInvitation. + :type: datetime + """ + self._time_updated = time_updated + + @property + def recipient_email_address(self): + """ + Gets the recipient_email_address of this SenderInvitation. + Email address of the recipient. + + + :return: The recipient_email_address of this SenderInvitation. + :rtype: str + """ + return self._recipient_email_address + + @recipient_email_address.setter + def recipient_email_address(self, recipient_email_address): + """ + Sets the recipient_email_address of this SenderInvitation. + Email address of the recipient. + + + :param recipient_email_address: The recipient_email_address of this SenderInvitation. + :type: str + """ + self._recipient_email_address = recipient_email_address + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this SenderInvitation. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :return: The freeform_tags of this SenderInvitation. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this SenderInvitation. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :param freeform_tags: The freeform_tags of this SenderInvitation. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this SenderInvitation. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :return: The defined_tags of this SenderInvitation. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this SenderInvitation. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :param defined_tags: The defined_tags of this SenderInvitation. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def system_tags(self): + """ + Gets the system_tags of this SenderInvitation. + Usage of system tag keys. These predefined keys are scoped to namespaces. + Example: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}` + + + :return: The system_tags of this SenderInvitation. + :rtype: dict(str, dict(str, object)) + """ + return self._system_tags + + @system_tags.setter + def system_tags(self, system_tags): + """ + Sets the system_tags of this SenderInvitation. + Usage of system tag keys. These predefined keys are scoped to namespaces. + Example: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}` + + + :param system_tags: The system_tags of this SenderInvitation. + :type: dict(str, dict(str, object)) + """ + self._system_tags = system_tags + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/sender_invitation_collection.py b/src/oci/tenant_manager_control_plane/models/sender_invitation_collection.py new file mode 100644 index 0000000000..e6ee37be6a --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/sender_invitation_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class SenderInvitationCollection(object): + """ + Result of a query request for a list of sender invitations. Contains SenderInvitationSummary items. + """ + + def __init__(self, **kwargs): + """ + Initializes a new SenderInvitationCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this SenderInvitationCollection. + :type items: list[SenderInvitationSummary] + + """ + self.swagger_types = { + 'items': 'list[SenderInvitationSummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this SenderInvitationCollection. + Array containing SenderInvitationSummary items. + + + :return: The items of this SenderInvitationCollection. + :rtype: list[SenderInvitationSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this SenderInvitationCollection. + Array containing SenderInvitationSummary items. + + + :param items: The items of this SenderInvitationCollection. + :type: list[SenderInvitationSummary] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/sender_invitation_summary.py b/src/oci/tenant_manager_control_plane/models/sender_invitation_summary.py new file mode 100644 index 0000000000..6a907090bc --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/sender_invitation_summary.py @@ -0,0 +1,508 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class SenderInvitationSummary(object): + """ + The summary of the invitation model that the sender owns. + """ + + #: A constant which can be used with the lifecycle_state property of a SenderInvitationSummary. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the lifecycle_state property of a SenderInvitationSummary. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a SenderInvitationSummary. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a SenderInvitationSummary. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a SenderInvitationSummary. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a SenderInvitationSummary. + #: This constant has a value of "TERMINATED" + LIFECYCLE_STATE_TERMINATED = "TERMINATED" + + #: A constant which can be used with the status property of a SenderInvitationSummary. + #: This constant has a value of "PENDING" + STATUS_PENDING = "PENDING" + + #: A constant which can be used with the status property of a SenderInvitationSummary. + #: This constant has a value of "CANCELED" + STATUS_CANCELED = "CANCELED" + + #: A constant which can be used with the status property of a SenderInvitationSummary. + #: This constant has a value of "ACCEPTED" + STATUS_ACCEPTED = "ACCEPTED" + + #: A constant which can be used with the status property of a SenderInvitationSummary. + #: This constant has a value of "EXPIRED" + STATUS_EXPIRED = "EXPIRED" + + #: A constant which can be used with the status property of a SenderInvitationSummary. + #: This constant has a value of "FAILED" + STATUS_FAILED = "FAILED" + + def __init__(self, **kwargs): + """ + Initializes a new SenderInvitationSummary object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this SenderInvitationSummary. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this SenderInvitationSummary. + :type compartment_id: str + + :param display_name: + The value to assign to the display_name property of this SenderInvitationSummary. + :type display_name: str + + :param recipient_invitation_id: + The value to assign to the recipient_invitation_id property of this SenderInvitationSummary. + :type recipient_invitation_id: str + + :param recipient_tenancy_id: + The value to assign to the recipient_tenancy_id property of this SenderInvitationSummary. + :type recipient_tenancy_id: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this SenderInvitationSummary. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param status: + The value to assign to the status property of this SenderInvitationSummary. + Allowed values for this property are: "PENDING", "CANCELED", "ACCEPTED", "EXPIRED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param time_created: + The value to assign to the time_created property of this SenderInvitationSummary. + :type time_created: datetime + + :param time_updated: + The value to assign to the time_updated property of this SenderInvitationSummary. + :type time_updated: datetime + + :param recipient_email_address: + The value to assign to the recipient_email_address property of this SenderInvitationSummary. + :type recipient_email_address: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this SenderInvitationSummary. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this SenderInvitationSummary. + :type defined_tags: dict(str, dict(str, object)) + + :param system_tags: + The value to assign to the system_tags property of this SenderInvitationSummary. + :type system_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'display_name': 'str', + 'recipient_invitation_id': 'str', + 'recipient_tenancy_id': 'str', + 'lifecycle_state': 'str', + 'status': 'str', + 'time_created': 'datetime', + 'time_updated': 'datetime', + 'recipient_email_address': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))', + 'system_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'display_name': 'displayName', + 'recipient_invitation_id': 'recipientInvitationId', + 'recipient_tenancy_id': 'recipientTenancyId', + 'lifecycle_state': 'lifecycleState', + 'status': 'status', + 'time_created': 'timeCreated', + 'time_updated': 'timeUpdated', + 'recipient_email_address': 'recipientEmailAddress', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags', + 'system_tags': 'systemTags' + } + + self._id = None + self._compartment_id = None + self._display_name = None + self._recipient_invitation_id = None + self._recipient_tenancy_id = None + self._lifecycle_state = None + self._status = None + self._time_created = None + self._time_updated = None + self._recipient_email_address = None + self._freeform_tags = None + self._defined_tags = None + self._system_tags = None + + @property + def id(self): + """ + **[Required]** Gets the id of this SenderInvitationSummary. + OCID of the sender invitation. + + + :return: The id of this SenderInvitationSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this SenderInvitationSummary. + OCID of the sender invitation. + + + :param id: The id of this SenderInvitationSummary. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this SenderInvitationSummary. + OCID of the sender tenancy. + + + :return: The compartment_id of this SenderInvitationSummary. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this SenderInvitationSummary. + OCID of the sender tenancy. + + + :param compartment_id: The compartment_id of this SenderInvitationSummary. + :type: str + """ + self._compartment_id = compartment_id + + @property + def display_name(self): + """ + **[Required]** Gets the display_name of this SenderInvitationSummary. + A user-created name to describe the invitation. + + + :return: The display_name of this SenderInvitationSummary. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this SenderInvitationSummary. + A user-created name to describe the invitation. + + + :param display_name: The display_name of this SenderInvitationSummary. + :type: str + """ + self._display_name = display_name + + @property + def recipient_invitation_id(self): + """ + Gets the recipient_invitation_id of this SenderInvitationSummary. + OCID of the corresponding recipient invitation. + + + :return: The recipient_invitation_id of this SenderInvitationSummary. + :rtype: str + """ + return self._recipient_invitation_id + + @recipient_invitation_id.setter + def recipient_invitation_id(self, recipient_invitation_id): + """ + Sets the recipient_invitation_id of this SenderInvitationSummary. + OCID of the corresponding recipient invitation. + + + :param recipient_invitation_id: The recipient_invitation_id of this SenderInvitationSummary. + :type: str + """ + self._recipient_invitation_id = recipient_invitation_id + + @property + def recipient_tenancy_id(self): + """ + **[Required]** Gets the recipient_tenancy_id of this SenderInvitationSummary. + OCID of the recipient tenancy. + + + :return: The recipient_tenancy_id of this SenderInvitationSummary. + :rtype: str + """ + return self._recipient_tenancy_id + + @recipient_tenancy_id.setter + def recipient_tenancy_id(self, recipient_tenancy_id): + """ + Sets the recipient_tenancy_id of this SenderInvitationSummary. + OCID of the recipient tenancy. + + + :param recipient_tenancy_id: The recipient_tenancy_id of this SenderInvitationSummary. + :type: str + """ + self._recipient_tenancy_id = recipient_tenancy_id + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this SenderInvitationSummary. + Lifecycle state of the sender invitation. + + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this SenderInvitationSummary. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this SenderInvitationSummary. + Lifecycle state of the sender invitation. + + + :param lifecycle_state: The lifecycle_state of this SenderInvitationSummary. + :type: str + """ + allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def status(self): + """ + **[Required]** Gets the status of this SenderInvitationSummary. + Status of the sender invitation. + + Allowed values for this property are: "PENDING", "CANCELED", "ACCEPTED", "EXPIRED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this SenderInvitationSummary. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this SenderInvitationSummary. + Status of the sender invitation. + + + :param status: The status of this SenderInvitationSummary. + :type: str + """ + allowed_values = ["PENDING", "CANCELED", "ACCEPTED", "EXPIRED", "FAILED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def time_created(self): + """ + **[Required]** Gets the time_created of this SenderInvitationSummary. + Date-time when this sender invitation was created. + + + :return: The time_created of this SenderInvitationSummary. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this SenderInvitationSummary. + Date-time when this sender invitation was created. + + + :param time_created: The time_created of this SenderInvitationSummary. + :type: datetime + """ + self._time_created = time_created + + @property + def time_updated(self): + """ + Gets the time_updated of this SenderInvitationSummary. + Date-time when this sender invitation was last updated. + + + :return: The time_updated of this SenderInvitationSummary. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this SenderInvitationSummary. + Date-time when this sender invitation was last updated. + + + :param time_updated: The time_updated of this SenderInvitationSummary. + :type: datetime + """ + self._time_updated = time_updated + + @property + def recipient_email_address(self): + """ + Gets the recipient_email_address of this SenderInvitationSummary. + Email address of the recipient. + + + :return: The recipient_email_address of this SenderInvitationSummary. + :rtype: str + """ + return self._recipient_email_address + + @recipient_email_address.setter + def recipient_email_address(self, recipient_email_address): + """ + Sets the recipient_email_address of this SenderInvitationSummary. + Email address of the recipient. + + + :param recipient_email_address: The recipient_email_address of this SenderInvitationSummary. + :type: str + """ + self._recipient_email_address = recipient_email_address + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this SenderInvitationSummary. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :return: The freeform_tags of this SenderInvitationSummary. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this SenderInvitationSummary. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :param freeform_tags: The freeform_tags of this SenderInvitationSummary. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this SenderInvitationSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :return: The defined_tags of this SenderInvitationSummary. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this SenderInvitationSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :param defined_tags: The defined_tags of this SenderInvitationSummary. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def system_tags(self): + """ + Gets the system_tags of this SenderInvitationSummary. + Usage of system tag keys. These predefined keys are scoped to namespaces. + Example: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}` + + + :return: The system_tags of this SenderInvitationSummary. + :rtype: dict(str, dict(str, object)) + """ + return self._system_tags + + @system_tags.setter + def system_tags(self, system_tags): + """ + Sets the system_tags of this SenderInvitationSummary. + Usage of system tag keys. These predefined keys are scoped to namespaces. + Example: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}` + + + :param system_tags: The system_tags of this SenderInvitationSummary. + :type: dict(str, dict(str, object)) + """ + self._system_tags = system_tags + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/update_recipient_invitation_details.py b/src/oci/tenant_manager_control_plane/models/update_recipient_invitation_details.py new file mode 100644 index 0000000000..5c5315b187 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/update_recipient_invitation_details.py @@ -0,0 +1,136 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class UpdateRecipientInvitationDetails(object): + """ + The parameters for updating a recipient invitation. + """ + + def __init__(self, **kwargs): + """ + Initializes a new UpdateRecipientInvitationDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param display_name: + The value to assign to the display_name property of this UpdateRecipientInvitationDetails. + :type display_name: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this UpdateRecipientInvitationDetails. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this UpdateRecipientInvitationDetails. + :type defined_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'display_name': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'display_name': 'displayName', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags' + } + + self._display_name = None + self._freeform_tags = None + self._defined_tags = None + + @property + def display_name(self): + """ + Gets the display_name of this UpdateRecipientInvitationDetails. + A user-created name to describe the invitation. + + + :return: The display_name of this UpdateRecipientInvitationDetails. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this UpdateRecipientInvitationDetails. + A user-created name to describe the invitation. + + + :param display_name: The display_name of this UpdateRecipientInvitationDetails. + :type: str + """ + self._display_name = display_name + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this UpdateRecipientInvitationDetails. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :return: The freeform_tags of this UpdateRecipientInvitationDetails. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this UpdateRecipientInvitationDetails. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :param freeform_tags: The freeform_tags of this UpdateRecipientInvitationDetails. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this UpdateRecipientInvitationDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :return: The defined_tags of this UpdateRecipientInvitationDetails. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this UpdateRecipientInvitationDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :param defined_tags: The defined_tags of this UpdateRecipientInvitationDetails. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/update_sender_invitation_details.py b/src/oci/tenant_manager_control_plane/models/update_sender_invitation_details.py new file mode 100644 index 0000000000..404cd17226 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/update_sender_invitation_details.py @@ -0,0 +1,136 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class UpdateSenderInvitationDetails(object): + """ + The parameters for updating a sender invitation. + """ + + def __init__(self, **kwargs): + """ + Initializes a new UpdateSenderInvitationDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param display_name: + The value to assign to the display_name property of this UpdateSenderInvitationDetails. + :type display_name: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this UpdateSenderInvitationDetails. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this UpdateSenderInvitationDetails. + :type defined_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'display_name': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'display_name': 'displayName', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags' + } + + self._display_name = None + self._freeform_tags = None + self._defined_tags = None + + @property + def display_name(self): + """ + Gets the display_name of this UpdateSenderInvitationDetails. + A user-created name to describe the invitation. + + + :return: The display_name of this UpdateSenderInvitationDetails. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this UpdateSenderInvitationDetails. + A user-created name to describe the invitation. + + + :param display_name: The display_name of this UpdateSenderInvitationDetails. + :type: str + """ + self._display_name = display_name + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this UpdateSenderInvitationDetails. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :return: The freeform_tags of this UpdateSenderInvitationDetails. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this UpdateSenderInvitationDetails. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + Example: `{\"bar-key\": \"value\"}` + + + :param freeform_tags: The freeform_tags of this UpdateSenderInvitationDetails. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this UpdateSenderInvitationDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :return: The defined_tags of this UpdateSenderInvitationDetails. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this UpdateSenderInvitationDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + + :param defined_tags: The defined_tags of this UpdateSenderInvitationDetails. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/work_request.py b/src/oci/tenant_manager_control_plane/models/work_request.py new file mode 100644 index 0000000000..54fc89e689 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/work_request.py @@ -0,0 +1,392 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class WorkRequest(object): + """ + A description of workrequest status. + """ + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "CREATE_SENDER_INVITATION" + OPERATION_TYPE_CREATE_SENDER_INVITATION = "CREATE_SENDER_INVITATION" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "ACCEPT_RECIPIENT_INVITATION" + OPERATION_TYPE_ACCEPT_RECIPIENT_INVITATION = "ACCEPT_RECIPIENT_INVITATION" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "CANCEL_SENDER_INVITATION" + OPERATION_TYPE_CANCEL_SENDER_INVITATION = "CANCEL_SENDER_INVITATION" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "ACCEPTED" + STATUS_ACCEPTED = "ACCEPTED" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "IN_PROGRESS" + STATUS_IN_PROGRESS = "IN_PROGRESS" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "FAILED" + STATUS_FAILED = "FAILED" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "SUCCEEDED" + STATUS_SUCCEEDED = "SUCCEEDED" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "CANCELING" + STATUS_CANCELING = "CANCELING" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "CANCELED" + STATUS_CANCELED = "CANCELED" + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequest object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param operation_type: + The value to assign to the operation_type property of this WorkRequest. + Allowed values for this property are: "CREATE_SENDER_INVITATION", "ACCEPT_RECIPIENT_INVITATION", "CANCEL_SENDER_INVITATION", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type operation_type: str + + :param status: + The value to assign to the status property of this WorkRequest. + Allowed values for this property are: "ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param id: + The value to assign to the id property of this WorkRequest. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this WorkRequest. + :type compartment_id: str + + :param resources: + The value to assign to the resources property of this WorkRequest. + :type resources: list[WorkRequestResource] + + :param percent_complete: + The value to assign to the percent_complete property of this WorkRequest. + :type percent_complete: float + + :param time_accepted: + The value to assign to the time_accepted property of this WorkRequest. + :type time_accepted: datetime + + :param time_started: + The value to assign to the time_started property of this WorkRequest. + :type time_started: datetime + + :param time_finished: + The value to assign to the time_finished property of this WorkRequest. + :type time_finished: datetime + + """ + self.swagger_types = { + 'operation_type': 'str', + 'status': 'str', + 'id': 'str', + 'compartment_id': 'str', + 'resources': 'list[WorkRequestResource]', + 'percent_complete': 'float', + 'time_accepted': 'datetime', + 'time_started': 'datetime', + 'time_finished': 'datetime' + } + + self.attribute_map = { + 'operation_type': 'operationType', + 'status': 'status', + 'id': 'id', + 'compartment_id': 'compartmentId', + 'resources': 'resources', + 'percent_complete': 'percentComplete', + 'time_accepted': 'timeAccepted', + 'time_started': 'timeStarted', + 'time_finished': 'timeFinished' + } + + self._operation_type = None + self._status = None + self._id = None + self._compartment_id = None + self._resources = None + self._percent_complete = None + self._time_accepted = None + self._time_started = None + self._time_finished = None + + @property + def operation_type(self): + """ + **[Required]** Gets the operation_type of this WorkRequest. + Type of the work request. + + Allowed values for this property are: "CREATE_SENDER_INVITATION", "ACCEPT_RECIPIENT_INVITATION", "CANCEL_SENDER_INVITATION", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The operation_type of this WorkRequest. + :rtype: str + """ + return self._operation_type + + @operation_type.setter + def operation_type(self, operation_type): + """ + Sets the operation_type of this WorkRequest. + Type of the work request. + + + :param operation_type: The operation_type of this WorkRequest. + :type: str + """ + allowed_values = ["CREATE_SENDER_INVITATION", "ACCEPT_RECIPIENT_INVITATION", "CANCEL_SENDER_INVITATION"] + if not value_allowed_none_or_none_sentinel(operation_type, allowed_values): + operation_type = 'UNKNOWN_ENUM_VALUE' + self._operation_type = operation_type + + @property + def status(self): + """ + **[Required]** Gets the status of this WorkRequest. + Status of current work request. + + Allowed values for this property are: "ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this WorkRequest. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this WorkRequest. + Status of current work request. + + + :param status: The status of this WorkRequest. + :type: str + """ + allowed_values = ["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def id(self): + """ + **[Required]** Gets the id of this WorkRequest. + The ID of the work request. + + + :return: The id of this WorkRequest. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this WorkRequest. + The ID of the work request. + + + :param id: The id of this WorkRequest. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this WorkRequest. + The ocid of the compartment that contains the work request. Work requests should be scoped to + the same compartment as the resource the work request affects. If the work request affects multiple resources, + and those resources are not in the same compartment, it is up to the service team to pick the primary + resource whose compartment should be used. + + + :return: The compartment_id of this WorkRequest. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this WorkRequest. + The ocid of the compartment that contains the work request. Work requests should be scoped to + the same compartment as the resource the work request affects. If the work request affects multiple resources, + and those resources are not in the same compartment, it is up to the service team to pick the primary + resource whose compartment should be used. + + + :param compartment_id: The compartment_id of this WorkRequest. + :type: str + """ + self._compartment_id = compartment_id + + @property + def resources(self): + """ + **[Required]** Gets the resources of this WorkRequest. + The resources affected by this work request. + + + :return: The resources of this WorkRequest. + :rtype: list[WorkRequestResource] + """ + return self._resources + + @resources.setter + def resources(self, resources): + """ + Sets the resources of this WorkRequest. + The resources affected by this work request. + + + :param resources: The resources of this WorkRequest. + :type: list[WorkRequestResource] + """ + self._resources = resources + + @property + def percent_complete(self): + """ + **[Required]** Gets the percent_complete of this WorkRequest. + Percentage of the request completed. + + + :return: The percent_complete of this WorkRequest. + :rtype: float + """ + return self._percent_complete + + @percent_complete.setter + def percent_complete(self, percent_complete): + """ + Sets the percent_complete of this WorkRequest. + Percentage of the request completed. + + + :param percent_complete: The percent_complete of this WorkRequest. + :type: float + """ + self._percent_complete = percent_complete + + @property + def time_accepted(self): + """ + **[Required]** Gets the time_accepted of this WorkRequest. + The date and time the request was created, as described in + `RFC 3339`__, section 14.29. + + __ https://tools.ietf.org/rfc/rfc3339 + + + :return: The time_accepted of this WorkRequest. + :rtype: datetime + """ + return self._time_accepted + + @time_accepted.setter + def time_accepted(self, time_accepted): + """ + Sets the time_accepted of this WorkRequest. + The date and time the request was created, as described in + `RFC 3339`__, section 14.29. + + __ https://tools.ietf.org/rfc/rfc3339 + + + :param time_accepted: The time_accepted of this WorkRequest. + :type: datetime + """ + self._time_accepted = time_accepted + + @property + def time_started(self): + """ + Gets the time_started of this WorkRequest. + The date and time the request was started, as described in `RFC 3339`__, + section 14.29. + + __ https://tools.ietf.org/rfc/rfc3339 + + + :return: The time_started of this WorkRequest. + :rtype: datetime + """ + return self._time_started + + @time_started.setter + def time_started(self, time_started): + """ + Sets the time_started of this WorkRequest. + The date and time the request was started, as described in `RFC 3339`__, + section 14.29. + + __ https://tools.ietf.org/rfc/rfc3339 + + + :param time_started: The time_started of this WorkRequest. + :type: datetime + """ + self._time_started = time_started + + @property + def time_finished(self): + """ + Gets the time_finished of this WorkRequest. + The date and time the object was finished, as described in `RFC 3339`__. + + __ https://tools.ietf.org/rfc/rfc3339 + + + :return: The time_finished of this WorkRequest. + :rtype: datetime + """ + return self._time_finished + + @time_finished.setter + def time_finished(self, time_finished): + """ + Sets the time_finished of this WorkRequest. + The date and time the object was finished, as described in `RFC 3339`__. + + __ https://tools.ietf.org/rfc/rfc3339 + + + :param time_finished: The time_finished of this WorkRequest. + :type: datetime + """ + self._time_finished = time_finished + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/work_request_collection.py b/src/oci/tenant_manager_control_plane/models/work_request_collection.py new file mode 100644 index 0000000000..dae5b54f38 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/work_request_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class WorkRequestCollection(object): + """ + Result of a query request for a list of work requests. Contains WorkRequestSummary items. + """ + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequestCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this WorkRequestCollection. + :type items: list[WorkRequestSummary] + + """ + self.swagger_types = { + 'items': 'list[WorkRequestSummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this WorkRequestCollection. + Array containing WorkRequestSummary items. + + + :return: The items of this WorkRequestCollection. + :rtype: list[WorkRequestSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this WorkRequestCollection. + Array containing WorkRequestSummary items. + + + :param items: The items of this WorkRequestCollection. + :type: list[WorkRequestSummary] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/work_request_error.py b/src/oci/tenant_manager_control_plane/models/work_request_error.py new file mode 100644 index 0000000000..a75102b8e5 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/work_request_error.py @@ -0,0 +1,134 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class WorkRequestError(object): + """ + An error encountered while executing a work request. + """ + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequestError object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param code: + The value to assign to the code property of this WorkRequestError. + :type code: str + + :param message: + The value to assign to the message property of this WorkRequestError. + :type message: str + + :param timestamp: + The value to assign to the timestamp property of this WorkRequestError. + :type timestamp: datetime + + """ + self.swagger_types = { + 'code': 'str', + 'message': 'str', + 'timestamp': 'datetime' + } + + self.attribute_map = { + 'code': 'code', + 'message': 'message', + 'timestamp': 'timestamp' + } + + self._code = None + self._message = None + self._timestamp = None + + @property + def code(self): + """ + **[Required]** Gets the code of this WorkRequestError. + A machine-usable code for the error that occured. Error codes are listed on + (https://docs.cloud.oracle.com/Content/API/References/apierrors.htm). + + + :return: The code of this WorkRequestError. + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """ + Sets the code of this WorkRequestError. + A machine-usable code for the error that occured. Error codes are listed on + (https://docs.cloud.oracle.com/Content/API/References/apierrors.htm). + + + :param code: The code of this WorkRequestError. + :type: str + """ + self._code = code + + @property + def message(self): + """ + **[Required]** Gets the message of this WorkRequestError. + A human readable description of the issue encountered. + + + :return: The message of this WorkRequestError. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """ + Sets the message of this WorkRequestError. + A human readable description of the issue encountered. + + + :param message: The message of this WorkRequestError. + :type: str + """ + self._message = message + + @property + def timestamp(self): + """ + **[Required]** Gets the timestamp of this WorkRequestError. + The time the error occured. An RFC3339 formatted datetime string. + + + :return: The timestamp of this WorkRequestError. + :rtype: datetime + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """ + Sets the timestamp of this WorkRequestError. + The time the error occured. An RFC3339 formatted datetime string. + + + :param timestamp: The timestamp of this WorkRequestError. + :type: datetime + """ + self._timestamp = timestamp + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/work_request_error_collection.py b/src/oci/tenant_manager_control_plane/models/work_request_error_collection.py new file mode 100644 index 0000000000..eb37c27b60 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/work_request_error_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class WorkRequestErrorCollection(object): + """ + Result of a query request for a list of work request errors. Contains WorkRequestError items. + """ + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequestErrorCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this WorkRequestErrorCollection. + :type items: list[WorkRequestError] + + """ + self.swagger_types = { + 'items': 'list[WorkRequestError]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this WorkRequestErrorCollection. + Array containing WorkRequestError items. + + + :return: The items of this WorkRequestErrorCollection. + :rtype: list[WorkRequestError] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this WorkRequestErrorCollection. + Array containing WorkRequestError items. + + + :param items: The items of this WorkRequestErrorCollection. + :type: list[WorkRequestError] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/work_request_log_entry.py b/src/oci/tenant_manager_control_plane/models/work_request_log_entry.py new file mode 100644 index 0000000000..4202cc0813 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/work_request_log_entry.py @@ -0,0 +1,101 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class WorkRequestLogEntry(object): + """ + A log message from the execution of a work request. + """ + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequestLogEntry object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param message: + The value to assign to the message property of this WorkRequestLogEntry. + :type message: str + + :param timestamp: + The value to assign to the timestamp property of this WorkRequestLogEntry. + :type timestamp: datetime + + """ + self.swagger_types = { + 'message': 'str', + 'timestamp': 'datetime' + } + + self.attribute_map = { + 'message': 'message', + 'timestamp': 'timestamp' + } + + self._message = None + self._timestamp = None + + @property + def message(self): + """ + **[Required]** Gets the message of this WorkRequestLogEntry. + Human-readable log message. + + + :return: The message of this WorkRequestLogEntry. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """ + Sets the message of this WorkRequestLogEntry. + Human-readable log message. + + + :param message: The message of this WorkRequestLogEntry. + :type: str + """ + self._message = message + + @property + def timestamp(self): + """ + **[Required]** Gets the timestamp of this WorkRequestLogEntry. + The time the log message was written. An RFC3339 formatted datetime string. + + + :return: The timestamp of this WorkRequestLogEntry. + :rtype: datetime + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """ + Sets the timestamp of this WorkRequestLogEntry. + The time the log message was written. An RFC3339 formatted datetime string. + + + :param timestamp: The timestamp of this WorkRequestLogEntry. + :type: datetime + """ + self._timestamp = timestamp + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/work_request_log_entry_collection.py b/src/oci/tenant_manager_control_plane/models/work_request_log_entry_collection.py new file mode 100644 index 0000000000..e81b76e3ce --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/work_request_log_entry_collection.py @@ -0,0 +1,70 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class WorkRequestLogEntryCollection(object): + """ + Result of a query request for a list of work request log entries. Contains WorkRequestLogEntry items. + """ + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequestLogEntryCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this WorkRequestLogEntryCollection. + :type items: list[WorkRequestLogEntry] + + """ + self.swagger_types = { + 'items': 'list[WorkRequestLogEntry]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this WorkRequestLogEntryCollection. + Array containing WorkRequestLogEntry items. + + + :return: The items of this WorkRequestLogEntryCollection. + :rtype: list[WorkRequestLogEntry] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this WorkRequestLogEntryCollection. + Array containing WorkRequestLogEntry items. + + + :param items: The items of this WorkRequestLogEntryCollection. + :type: list[WorkRequestLogEntry] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/work_request_resource.py b/src/oci/tenant_manager_control_plane/models/work_request_resource.py new file mode 100644 index 0000000000..973061f193 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/work_request_resource.py @@ -0,0 +1,197 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class WorkRequestResource(object): + """ + A resource created or operated on by a work request. + """ + + #: A constant which can be used with the action_type property of a WorkRequestResource. + #: This constant has a value of "CREATED" + ACTION_TYPE_CREATED = "CREATED" + + #: A constant which can be used with the action_type property of a WorkRequestResource. + #: This constant has a value of "UPDATED" + ACTION_TYPE_UPDATED = "UPDATED" + + #: A constant which can be used with the action_type property of a WorkRequestResource. + #: This constant has a value of "DELETED" + ACTION_TYPE_DELETED = "DELETED" + + #: A constant which can be used with the action_type property of a WorkRequestResource. + #: This constant has a value of "IN_PROGRESS" + ACTION_TYPE_IN_PROGRESS = "IN_PROGRESS" + + #: A constant which can be used with the action_type property of a WorkRequestResource. + #: This constant has a value of "RELATED" + ACTION_TYPE_RELATED = "RELATED" + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequestResource object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param entity_type: + The value to assign to the entity_type property of this WorkRequestResource. + :type entity_type: str + + :param action_type: + The value to assign to the action_type property of this WorkRequestResource. + Allowed values for this property are: "CREATED", "UPDATED", "DELETED", "IN_PROGRESS", "RELATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type action_type: str + + :param identifier: + The value to assign to the identifier property of this WorkRequestResource. + :type identifier: str + + :param entity_uri: + The value to assign to the entity_uri property of this WorkRequestResource. + :type entity_uri: str + + """ + self.swagger_types = { + 'entity_type': 'str', + 'action_type': 'str', + 'identifier': 'str', + 'entity_uri': 'str' + } + + self.attribute_map = { + 'entity_type': 'entityType', + 'action_type': 'actionType', + 'identifier': 'identifier', + 'entity_uri': 'entityUri' + } + + self._entity_type = None + self._action_type = None + self._identifier = None + self._entity_uri = None + + @property + def entity_type(self): + """ + **[Required]** Gets the entity_type of this WorkRequestResource. + The resource type the work request affects. + + + :return: The entity_type of this WorkRequestResource. + :rtype: str + """ + return self._entity_type + + @entity_type.setter + def entity_type(self, entity_type): + """ + Sets the entity_type of this WorkRequestResource. + The resource type the work request affects. + + + :param entity_type: The entity_type of this WorkRequestResource. + :type: str + """ + self._entity_type = entity_type + + @property + def action_type(self): + """ + **[Required]** Gets the action_type of this WorkRequestResource. + The way in which this resource is affected by the work tracked in the work request. + A resource being created, updated, or deleted will remain in the IN_PROGRESS state until + work is complete for that resource at which point it will transition to CREATED, UPDATED, + or DELETED, respectively. + + Allowed values for this property are: "CREATED", "UPDATED", "DELETED", "IN_PROGRESS", "RELATED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The action_type of this WorkRequestResource. + :rtype: str + """ + return self._action_type + + @action_type.setter + def action_type(self, action_type): + """ + Sets the action_type of this WorkRequestResource. + The way in which this resource is affected by the work tracked in the work request. + A resource being created, updated, or deleted will remain in the IN_PROGRESS state until + work is complete for that resource at which point it will transition to CREATED, UPDATED, + or DELETED, respectively. + + + :param action_type: The action_type of this WorkRequestResource. + :type: str + """ + allowed_values = ["CREATED", "UPDATED", "DELETED", "IN_PROGRESS", "RELATED"] + if not value_allowed_none_or_none_sentinel(action_type, allowed_values): + action_type = 'UNKNOWN_ENUM_VALUE' + self._action_type = action_type + + @property + def identifier(self): + """ + **[Required]** Gets the identifier of this WorkRequestResource. + The identifier of the resource the work request affects. + + + :return: The identifier of this WorkRequestResource. + :rtype: str + """ + return self._identifier + + @identifier.setter + def identifier(self, identifier): + """ + Sets the identifier of this WorkRequestResource. + The identifier of the resource the work request affects. + + + :param identifier: The identifier of this WorkRequestResource. + :type: str + """ + self._identifier = identifier + + @property + def entity_uri(self): + """ + Gets the entity_uri of this WorkRequestResource. + The URI path that the user can do a GET on to access the resource metadata. + + + :return: The entity_uri of this WorkRequestResource. + :rtype: str + """ + return self._entity_uri + + @entity_uri.setter + def entity_uri(self, entity_uri): + """ + Sets the entity_uri of this WorkRequestResource. + The URI path that the user can do a GET on to access the resource metadata. + + + :param entity_uri: The entity_uri of this WorkRequestResource. + :type: str + """ + self._entity_uri = entity_uri + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/models/work_request_summary.py b/src/oci/tenant_manager_control_plane/models/work_request_summary.py new file mode 100644 index 0000000000..acf826ba6e --- /dev/null +++ b/src/oci/tenant_manager_control_plane/models/work_request_summary.py @@ -0,0 +1,392 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class WorkRequestSummary(object): + """ + A summary of workrequest status. + """ + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "CREATE_SENDER_INVITATION" + OPERATION_TYPE_CREATE_SENDER_INVITATION = "CREATE_SENDER_INVITATION" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "ACCEPT_RECIPIENT_INVITATION" + OPERATION_TYPE_ACCEPT_RECIPIENT_INVITATION = "ACCEPT_RECIPIENT_INVITATION" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "CANCEL_SENDER_INVITATION" + OPERATION_TYPE_CANCEL_SENDER_INVITATION = "CANCEL_SENDER_INVITATION" + + #: A constant which can be used with the status property of a WorkRequestSummary. + #: This constant has a value of "ACCEPTED" + STATUS_ACCEPTED = "ACCEPTED" + + #: A constant which can be used with the status property of a WorkRequestSummary. + #: This constant has a value of "IN_PROGRESS" + STATUS_IN_PROGRESS = "IN_PROGRESS" + + #: A constant which can be used with the status property of a WorkRequestSummary. + #: This constant has a value of "FAILED" + STATUS_FAILED = "FAILED" + + #: A constant which can be used with the status property of a WorkRequestSummary. + #: This constant has a value of "SUCCEEDED" + STATUS_SUCCEEDED = "SUCCEEDED" + + #: A constant which can be used with the status property of a WorkRequestSummary. + #: This constant has a value of "CANCELING" + STATUS_CANCELING = "CANCELING" + + #: A constant which can be used with the status property of a WorkRequestSummary. + #: This constant has a value of "CANCELED" + STATUS_CANCELED = "CANCELED" + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequestSummary object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param operation_type: + The value to assign to the operation_type property of this WorkRequestSummary. + Allowed values for this property are: "CREATE_SENDER_INVITATION", "ACCEPT_RECIPIENT_INVITATION", "CANCEL_SENDER_INVITATION", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type operation_type: str + + :param status: + The value to assign to the status property of this WorkRequestSummary. + Allowed values for this property are: "ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param id: + The value to assign to the id property of this WorkRequestSummary. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this WorkRequestSummary. + :type compartment_id: str + + :param resources: + The value to assign to the resources property of this WorkRequestSummary. + :type resources: list[WorkRequestResource] + + :param percent_complete: + The value to assign to the percent_complete property of this WorkRequestSummary. + :type percent_complete: float + + :param time_accepted: + The value to assign to the time_accepted property of this WorkRequestSummary. + :type time_accepted: datetime + + :param time_started: + The value to assign to the time_started property of this WorkRequestSummary. + :type time_started: datetime + + :param time_finished: + The value to assign to the time_finished property of this WorkRequestSummary. + :type time_finished: datetime + + """ + self.swagger_types = { + 'operation_type': 'str', + 'status': 'str', + 'id': 'str', + 'compartment_id': 'str', + 'resources': 'list[WorkRequestResource]', + 'percent_complete': 'float', + 'time_accepted': 'datetime', + 'time_started': 'datetime', + 'time_finished': 'datetime' + } + + self.attribute_map = { + 'operation_type': 'operationType', + 'status': 'status', + 'id': 'id', + 'compartment_id': 'compartmentId', + 'resources': 'resources', + 'percent_complete': 'percentComplete', + 'time_accepted': 'timeAccepted', + 'time_started': 'timeStarted', + 'time_finished': 'timeFinished' + } + + self._operation_type = None + self._status = None + self._id = None + self._compartment_id = None + self._resources = None + self._percent_complete = None + self._time_accepted = None + self._time_started = None + self._time_finished = None + + @property + def operation_type(self): + """ + **[Required]** Gets the operation_type of this WorkRequestSummary. + Type of the work request. + + Allowed values for this property are: "CREATE_SENDER_INVITATION", "ACCEPT_RECIPIENT_INVITATION", "CANCEL_SENDER_INVITATION", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The operation_type of this WorkRequestSummary. + :rtype: str + """ + return self._operation_type + + @operation_type.setter + def operation_type(self, operation_type): + """ + Sets the operation_type of this WorkRequestSummary. + Type of the work request. + + + :param operation_type: The operation_type of this WorkRequestSummary. + :type: str + """ + allowed_values = ["CREATE_SENDER_INVITATION", "ACCEPT_RECIPIENT_INVITATION", "CANCEL_SENDER_INVITATION"] + if not value_allowed_none_or_none_sentinel(operation_type, allowed_values): + operation_type = 'UNKNOWN_ENUM_VALUE' + self._operation_type = operation_type + + @property + def status(self): + """ + **[Required]** Gets the status of this WorkRequestSummary. + Status of current work request. + + Allowed values for this property are: "ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this WorkRequestSummary. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this WorkRequestSummary. + Status of current work request. + + + :param status: The status of this WorkRequestSummary. + :type: str + """ + allowed_values = ["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def id(self): + """ + **[Required]** Gets the id of this WorkRequestSummary. + The ID of the work request. + + + :return: The id of this WorkRequestSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this WorkRequestSummary. + The ID of the work request. + + + :param id: The id of this WorkRequestSummary. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this WorkRequestSummary. + The ocid of the compartment that contains the work request. Work requests should be scoped to + the same compartment as the resource the work request affects. If the work request affects multiple resources, + and those resources are not in the same compartment, it is up to the service team to pick the primary + resource whose compartment should be used. + + + :return: The compartment_id of this WorkRequestSummary. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this WorkRequestSummary. + The ocid of the compartment that contains the work request. Work requests should be scoped to + the same compartment as the resource the work request affects. If the work request affects multiple resources, + and those resources are not in the same compartment, it is up to the service team to pick the primary + resource whose compartment should be used. + + + :param compartment_id: The compartment_id of this WorkRequestSummary. + :type: str + """ + self._compartment_id = compartment_id + + @property + def resources(self): + """ + **[Required]** Gets the resources of this WorkRequestSummary. + The resources affected by this work request. + + + :return: The resources of this WorkRequestSummary. + :rtype: list[WorkRequestResource] + """ + return self._resources + + @resources.setter + def resources(self, resources): + """ + Sets the resources of this WorkRequestSummary. + The resources affected by this work request. + + + :param resources: The resources of this WorkRequestSummary. + :type: list[WorkRequestResource] + """ + self._resources = resources + + @property + def percent_complete(self): + """ + **[Required]** Gets the percent_complete of this WorkRequestSummary. + Percentage of the request completed. + + + :return: The percent_complete of this WorkRequestSummary. + :rtype: float + """ + return self._percent_complete + + @percent_complete.setter + def percent_complete(self, percent_complete): + """ + Sets the percent_complete of this WorkRequestSummary. + Percentage of the request completed. + + + :param percent_complete: The percent_complete of this WorkRequestSummary. + :type: float + """ + self._percent_complete = percent_complete + + @property + def time_accepted(self): + """ + **[Required]** Gets the time_accepted of this WorkRequestSummary. + The date and time the request was created, as described in + `RFC 3339`__, section 14.29. + + __ https://tools.ietf.org/rfc/rfc3339 + + + :return: The time_accepted of this WorkRequestSummary. + :rtype: datetime + """ + return self._time_accepted + + @time_accepted.setter + def time_accepted(self, time_accepted): + """ + Sets the time_accepted of this WorkRequestSummary. + The date and time the request was created, as described in + `RFC 3339`__, section 14.29. + + __ https://tools.ietf.org/rfc/rfc3339 + + + :param time_accepted: The time_accepted of this WorkRequestSummary. + :type: datetime + """ + self._time_accepted = time_accepted + + @property + def time_started(self): + """ + Gets the time_started of this WorkRequestSummary. + The date and time the request was started, as described in `RFC 3339`__, + section 14.29. + + __ https://tools.ietf.org/rfc/rfc3339 + + + :return: The time_started of this WorkRequestSummary. + :rtype: datetime + """ + return self._time_started + + @time_started.setter + def time_started(self, time_started): + """ + Sets the time_started of this WorkRequestSummary. + The date and time the request was started, as described in `RFC 3339`__, + section 14.29. + + __ https://tools.ietf.org/rfc/rfc3339 + + + :param time_started: The time_started of this WorkRequestSummary. + :type: datetime + """ + self._time_started = time_started + + @property + def time_finished(self): + """ + Gets the time_finished of this WorkRequestSummary. + The date and time the object was finished, as described in `RFC 3339`__. + + __ https://tools.ietf.org/rfc/rfc3339 + + + :return: The time_finished of this WorkRequestSummary. + :rtype: datetime + """ + return self._time_finished + + @time_finished.setter + def time_finished(self, time_finished): + """ + Sets the time_finished of this WorkRequestSummary. + The date and time the object was finished, as described in `RFC 3339`__. + + __ https://tools.ietf.org/rfc/rfc3339 + + + :param time_finished: The time_finished of this WorkRequestSummary. + :type: datetime + """ + self._time_finished = time_finished + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/tenant_manager_control_plane/recipient_invitation_client.py b/src/oci/tenant_manager_control_plane/recipient_invitation_client.py new file mode 100644 index 0000000000..cf63275d2b --- /dev/null +++ b/src/oci/tenant_manager_control_plane/recipient_invitation_client.py @@ -0,0 +1,531 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + +from __future__ import absolute_import + +from oci._vendor import requests # noqa: F401 +from oci._vendor import six + +from oci import retry # noqa: F401 +from oci.base_client import BaseClient +from oci.config import get_config_value_or_default, validate_config +from oci.signer import Signer +from oci.util import Sentinel, get_signer_from_authentication_type, AUTHENTICATION_TYPE_FIELD_NAME +from .models import tenant_manager_control_plane_type_mapping +missing = Sentinel("Missing") + + +class RecipientInvitationClient(object): + """ + A description of the TenantManager API + """ + + def __init__(self, config, **kwargs): + """ + Creates a new service client + + :param dict config: + Configuration keys and values as per `SDK and Tool Configuration `__. + The :py:meth:`~oci.config.from_file` method can be used to load configuration from a file. Alternatively, a ``dict`` can be passed. You can validate_config + the dict using :py:meth:`~oci.config.validate_config` + + :param str service_endpoint: (optional) + The endpoint of the service to call using this client. For example ``https://iaas.us-ashburn-1.oraclecloud.com``. If this keyword argument is + not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit + need to specify a service endpoint. + + :param timeout: (optional) + The connection and read timeouts for the client. The default values are connection timeout 10 seconds and read timeout 60 seconds. This keyword argument can be provided + as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If + a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout. + :type timeout: float or tuple(float, float) + + :param signer: (optional) + The signer to use when signing requests made by the service client. The default is to use a :py:class:`~oci.signer.Signer` based on the values + provided in the config parameter. + + One use case for this parameter is for `Instance Principals authentication `__ + by passing an instance of :py:class:`~oci.auth.signers.InstancePrincipalsSecurityTokenSigner` as the value for this keyword argument + :type signer: :py:class:`~oci.signer.AbstractBaseSigner` + + :param obj retry_strategy: (optional) + A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. + Retry strategies can also be applied at the operation level by passing a ``retry_strategy`` keyword argument as part of calling the operation. + Any value provided at the operation level will override whatever is specified at the client level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + """ + validate_config(config, signer=kwargs.get('signer')) + if 'signer' in kwargs: + signer = kwargs['signer'] + + elif AUTHENTICATION_TYPE_FIELD_NAME in config: + signer = get_signer_from_authentication_type(config) + + else: + signer = Signer( + tenancy=config["tenancy"], + user=config["user"], + fingerprint=config["fingerprint"], + private_key_file_location=config.get("key_file"), + pass_phrase=get_config_value_or_default(config, "pass_phrase"), + private_key_content=config.get("key_content") + ) + + base_client_init_kwargs = { + 'regional_client': True, + 'service_endpoint': kwargs.get('service_endpoint'), + 'timeout': kwargs.get('timeout'), + 'base_path': '/20200801', + 'service_endpoint_template': 'https://organizations.{region}.oci.{secondLevelDomain}', + 'skip_deserialization': kwargs.get('skip_deserialization', False) + } + self.base_client = BaseClient("recipient_invitation", config, signer, tenant_manager_control_plane_type_mapping, **base_client_init_kwargs) + self.retry_strategy = kwargs.get('retry_strategy') + + def accept_recipient_invitation(self, recipient_invitation_id, **kwargs): + """ + Accepts a recipient invitation. + + + :param str recipient_invitation_id: (required) + OCID of recipient invitation to accept. + + :param str if_match: (optional) + 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. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations. For example, if a resource + has been deleted and purged from the system, then a retry of the original creation request + might be rejected. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/recipientInvitations/{recipientInvitationId}/actions/accept" + method = "POST" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "if_match", + "opc_retry_token", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "accept_recipient_invitation got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "recipientInvitationId": recipient_invitation_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + + def get_recipient_invitation(self, recipient_invitation_id, **kwargs): + """ + Gets information about the recipient invitation. + + + :param str recipient_invitation_id: (required) + OCID of the recipient invitation to retrieve. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.tenant_manager_control_plane.models.RecipientInvitation` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/recipientInvitations/{recipientInvitationId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_recipient_invitation got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "recipientInvitationId": recipient_invitation_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="RecipientInvitation") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="RecipientInvitation") + + def ignore_recipient_invitation(self, recipient_invitation_id, **kwargs): + """ + Ignores a recipient invitation. + + + :param str recipient_invitation_id: (required) + OCID of recipient invitation to ignore. + + :param str if_match: (optional) + 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. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations. For example, if a resource + has been deleted and purged from the system, then a retry of the original creation request + might be rejected. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.tenant_manager_control_plane.models.RecipientInvitation` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/recipientInvitations/{recipientInvitationId}/actions/ignore" + method = "POST" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "if_match", + "opc_retry_token", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "ignore_recipient_invitation got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "recipientInvitationId": recipient_invitation_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="RecipientInvitation") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="RecipientInvitation") + + def list_recipient_invitations(self, compartment_id, **kwargs): + """ + Return a (paginated) list of recipient invitations. + + + :param str compartment_id: (required) + The ID of the compartment in which to list resources. + + :param str sender_tenancy_id: (optional) + The tenancy that sent the invitation. + + :param str lifecycle_state: (optional) + The lifecycle state of the resource. + + Allowed values are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED" + + :param str status: (optional) + The status of the recipient invitation. + + Allowed values are: "PENDING", "CANCELED", "ACCEPTED", "IGNORED", "EXPIRED", "FAILED" + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param str page: (optional) + The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.tenant_manager_control_plane.models.RecipientInvitationCollection` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/recipientInvitations" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "sender_tenancy_id", + "lifecycle_state", + "status", + "opc_request_id", + "page" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_recipient_invitations got unknown kwargs: {!r}".format(extra_kwargs)) + + if 'lifecycle_state' in kwargs: + lifecycle_state_allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED"] + if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: + raise ValueError( + "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) + ) + + if 'status' in kwargs: + status_allowed_values = ["PENDING", "CANCELED", "ACCEPTED", "IGNORED", "EXPIRED", "FAILED"] + if kwargs['status'] not in status_allowed_values: + raise ValueError( + "Invalid value for `status`, must be one of {0}".format(status_allowed_values) + ) + + query_params = { + "senderTenancyId": kwargs.get("sender_tenancy_id", missing), + "lifecycleState": kwargs.get("lifecycle_state", missing), + "status": kwargs.get("status", missing), + "compartmentId": compartment_id, + "page": kwargs.get("page", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="RecipientInvitationCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="RecipientInvitationCollection") + + def update_recipient_invitation(self, recipient_invitation_id, update_recipient_invitation_details, **kwargs): + """ + Updates the RecipientInvitation. + + + :param str recipient_invitation_id: (required) + OCID of the recipient invitation to update. + + :param UpdateRecipientInvitationDetails update_recipient_invitation_details: (required) + The information to be updated. + + :param str if_match: (optional) + 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. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.tenant_manager_control_plane.models.RecipientInvitation` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/recipientInvitations/{recipientInvitationId}" + method = "PUT" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "if_match", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "update_recipient_invitation got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "recipientInvitationId": recipient_invitation_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_recipient_invitation_details, + response_type="RecipientInvitation") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_recipient_invitation_details, + response_type="RecipientInvitation") diff --git a/src/oci/tenant_manager_control_plane/recipient_invitation_client_composite_operations.py b/src/oci/tenant_manager_control_plane/recipient_invitation_client_composite_operations.py new file mode 100644 index 0000000000..af2c7f5ef2 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/recipient_invitation_client_composite_operations.py @@ -0,0 +1,141 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + +import oci # noqa: F401 +from oci.util import WAIT_RESOURCE_NOT_FOUND # noqa: F401 + + +class RecipientInvitationClientCompositeOperations(object): + """ + This class provides a wrapper around :py:class:`~oci.tenant_manager_control_plane.RecipientInvitationClient` and offers convenience methods + for operations that would otherwise need to be chained together. For example, instead of performing an action + on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource + to enter a given state, you can call a single method in this class to accomplish the same functionality + """ + + def __init__(self, client, **kwargs): + """ + Creates a new RecipientInvitationClientCompositeOperations object + + :param RecipientInvitationClient client: + The service client which will be wrapped by this object + """ + self.client = client + + def accept_recipient_invitation_and_wait_for_state(self, recipient_invitation_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.tenant_manager_control_plane.RecipientInvitationClient.accept_recipient_invitation` and waits for the :py:class:`~oci.tenant_manager_control_plane.models.WorkRequest` + to enter the given state(s). + + :param str recipient_invitation_id: (required) + OCID of recipient invitation to accept. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.tenant_manager_control_plane.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.tenant_manager_control_plane.RecipientInvitationClient.accept_recipient_invitation` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.accept_recipient_invitation(recipient_invitation_id, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.headers['opc-work-request-id'] + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_work_request(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def ignore_recipient_invitation_and_wait_for_state(self, recipient_invitation_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.tenant_manager_control_plane.RecipientInvitationClient.ignore_recipient_invitation` and waits for the :py:class:`~oci.tenant_manager_control_plane.models.RecipientInvitation` acted upon + to enter the given state(s). + + :param str recipient_invitation_id: (required) + OCID of recipient invitation to ignore. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.tenant_manager_control_plane.models.RecipientInvitation.lifecycle_state` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.tenant_manager_control_plane.RecipientInvitationClient.ignore_recipient_invitation` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.ignore_recipient_invitation(recipient_invitation_id, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.data.id + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_recipient_invitation(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def update_recipient_invitation_and_wait_for_state(self, recipient_invitation_id, update_recipient_invitation_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.tenant_manager_control_plane.RecipientInvitationClient.update_recipient_invitation` and waits for the :py:class:`~oci.tenant_manager_control_plane.models.RecipientInvitation` acted upon + to enter the given state(s). + + :param str recipient_invitation_id: (required) + OCID of the recipient invitation to update. + + :param UpdateRecipientInvitationDetails update_recipient_invitation_details: (required) + The information to be updated. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.tenant_manager_control_plane.models.RecipientInvitation.lifecycle_state` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.tenant_manager_control_plane.RecipientInvitationClient.update_recipient_invitation` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.update_recipient_invitation(recipient_invitation_id, update_recipient_invitation_details, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.data.id + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_recipient_invitation(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) diff --git a/src/oci/tenant_manager_control_plane/sender_invitation_client.py b/src/oci/tenant_manager_control_plane/sender_invitation_client.py new file mode 100644 index 0000000000..1750e8dcb2 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/sender_invitation_client.py @@ -0,0 +1,550 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + +from __future__ import absolute_import + +from oci._vendor import requests # noqa: F401 +from oci._vendor import six + +from oci import retry # noqa: F401 +from oci.base_client import BaseClient +from oci.config import get_config_value_or_default, validate_config +from oci.signer import Signer +from oci.util import Sentinel, get_signer_from_authentication_type, AUTHENTICATION_TYPE_FIELD_NAME +from .models import tenant_manager_control_plane_type_mapping +missing = Sentinel("Missing") + + +class SenderInvitationClient(object): + """ + A description of the TenantManager API + """ + + def __init__(self, config, **kwargs): + """ + Creates a new service client + + :param dict config: + Configuration keys and values as per `SDK and Tool Configuration `__. + The :py:meth:`~oci.config.from_file` method can be used to load configuration from a file. Alternatively, a ``dict`` can be passed. You can validate_config + the dict using :py:meth:`~oci.config.validate_config` + + :param str service_endpoint: (optional) + The endpoint of the service to call using this client. For example ``https://iaas.us-ashburn-1.oraclecloud.com``. If this keyword argument is + not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit + need to specify a service endpoint. + + :param timeout: (optional) + The connection and read timeouts for the client. The default values are connection timeout 10 seconds and read timeout 60 seconds. This keyword argument can be provided + as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If + a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout. + :type timeout: float or tuple(float, float) + + :param signer: (optional) + The signer to use when signing requests made by the service client. The default is to use a :py:class:`~oci.signer.Signer` based on the values + provided in the config parameter. + + One use case for this parameter is for `Instance Principals authentication `__ + by passing an instance of :py:class:`~oci.auth.signers.InstancePrincipalsSecurityTokenSigner` as the value for this keyword argument + :type signer: :py:class:`~oci.signer.AbstractBaseSigner` + + :param obj retry_strategy: (optional) + A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. + Retry strategies can also be applied at the operation level by passing a ``retry_strategy`` keyword argument as part of calling the operation. + Any value provided at the operation level will override whatever is specified at the client level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + """ + validate_config(config, signer=kwargs.get('signer')) + if 'signer' in kwargs: + signer = kwargs['signer'] + + elif AUTHENTICATION_TYPE_FIELD_NAME in config: + signer = get_signer_from_authentication_type(config) + + else: + signer = Signer( + tenancy=config["tenancy"], + user=config["user"], + fingerprint=config["fingerprint"], + private_key_file_location=config.get("key_file"), + pass_phrase=get_config_value_or_default(config, "pass_phrase"), + private_key_content=config.get("key_content") + ) + + base_client_init_kwargs = { + 'regional_client': True, + 'service_endpoint': kwargs.get('service_endpoint'), + 'timeout': kwargs.get('timeout'), + 'base_path': '/20200801', + 'service_endpoint_template': 'https://organizations.{region}.oci.{secondLevelDomain}', + 'skip_deserialization': kwargs.get('skip_deserialization', False) + } + self.base_client = BaseClient("sender_invitation", config, signer, tenant_manager_control_plane_type_mapping, **base_client_init_kwargs) + self.retry_strategy = kwargs.get('retry_strategy') + + def cancel_sender_invitation(self, sender_invitation_id, **kwargs): + """ + Cancels a sender invitation. + + + :param str sender_invitation_id: (required) + OCID of the sender invitation to cancel. + + :param str if_match: (optional) + 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. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations. For example, if a resource + has been deleted and purged from the system, then a retry of the original creation request + might be rejected. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/senderInvitations/{senderInvitationId}/actions/cancel" + method = "POST" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "if_match", + "opc_retry_token", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "cancel_sender_invitation got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "senderInvitationId": sender_invitation_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + + def create_sender_invitation(self, create_sender_invitation_details, **kwargs): + """ + Creates a sender invitation and asynchronously sends the invitation to recipient. + + + :param CreateSenderInvitationDetails create_sender_invitation_details: (required) + Parameters for sender invitation creation. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations. For example, if a resource + has been deleted and purged from the system, then a retry of the original creation request + might be rejected. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.tenant_manager_control_plane.models.SenderInvitation` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/senderInvitations" + method = "POST" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_retry_token", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "create_sender_invitation got unknown kwargs: {!r}".format(extra_kwargs)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-retry-token": kwargs.get("opc_retry_token", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + header_params=header_params, + body=create_sender_invitation_details, + response_type="SenderInvitation") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + header_params=header_params, + body=create_sender_invitation_details, + response_type="SenderInvitation") + + def get_sender_invitation(self, sender_invitation_id, **kwargs): + """ + Gets information about the sender invitation. + + + :param str sender_invitation_id: (required) + OCID of the sender invitation to retrieve. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.tenant_manager_control_plane.models.SenderInvitation` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/senderInvitations/{senderInvitationId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_sender_invitation got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "senderInvitationId": sender_invitation_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="SenderInvitation") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="SenderInvitation") + + def list_sender_invitations(self, compartment_id, **kwargs): + """ + Return a (paginated) list of sender invitations. + + + :param str compartment_id: (required) + The ID of the compartment in which to list resources. + + :param str recipient_tenancy_id: (optional) + The tenancy that the invitation is addressed to. + + :param str lifecycle_state: (optional) + The lifecycle state of the resource. + + Allowed values are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED" + + :param str status: (optional) + The status of the sender invitation. + + Allowed values are: "PENDING", "CANCELED", "ACCEPTED", "EXPIRED", "FAILED" + + :param str display_name: (optional) + A filter to return only resources that match the entire display name given. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param str page: (optional) + The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + + :param int limit: (optional) + The maximum number of items to return. + + :param str sort_by: (optional) + 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. + + Allowed values are: "timeCreated", "displayName" + + :param str sort_order: (optional) + The sort order to use, either 'asc' or 'desc'. + + Allowed values are: "ASC", "DESC" + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.tenant_manager_control_plane.models.SenderInvitationCollection` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/senderInvitations" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "recipient_tenancy_id", + "lifecycle_state", + "status", + "display_name", + "opc_request_id", + "page", + "limit", + "sort_by", + "sort_order" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_sender_invitations got unknown kwargs: {!r}".format(extra_kwargs)) + + if 'lifecycle_state' in kwargs: + lifecycle_state_allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "FAILED", "TERMINATED"] + if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: + raise ValueError( + "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) + ) + + if 'status' in kwargs: + status_allowed_values = ["PENDING", "CANCELED", "ACCEPTED", "EXPIRED", "FAILED"] + if kwargs['status'] not in status_allowed_values: + raise ValueError( + "Invalid value for `status`, must be one of {0}".format(status_allowed_values) + ) + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["timeCreated", "displayName"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) + ) + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) + ) + + query_params = { + "compartmentId": compartment_id, + "recipientTenancyId": kwargs.get("recipient_tenancy_id", missing), + "lifecycleState": kwargs.get("lifecycle_state", missing), + "status": kwargs.get("status", missing), + "displayName": kwargs.get("display_name", missing), + "page": kwargs.get("page", missing), + "limit": kwargs.get("limit", missing), + "sortBy": kwargs.get("sort_by", missing), + "sortOrder": kwargs.get("sort_order", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="SenderInvitationCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="SenderInvitationCollection") + + def update_sender_invitation(self, sender_invitation_id, update_sender_invitation_details, **kwargs): + """ + Updates the SenderInvitation. + + + :param str sender_invitation_id: (required) + OCID of the sender invitation to update. + + :param UpdateSenderInvitationDetails update_sender_invitation_details: (required) + The information to be updated. + + :param str if_match: (optional) + 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. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.tenant_manager_control_plane.models.SenderInvitation` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/senderInvitations/{senderInvitationId}" + method = "PUT" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "if_match", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "update_sender_invitation got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "senderInvitationId": sender_invitation_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_sender_invitation_details, + response_type="SenderInvitation") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_sender_invitation_details, + response_type="SenderInvitation") diff --git a/src/oci/tenant_manager_control_plane/sender_invitation_client_composite_operations.py b/src/oci/tenant_manager_control_plane/sender_invitation_client_composite_operations.py new file mode 100644 index 0000000000..558a65774f --- /dev/null +++ b/src/oci/tenant_manager_control_plane/sender_invitation_client_composite_operations.py @@ -0,0 +1,141 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + +import oci # noqa: F401 +from oci.util import WAIT_RESOURCE_NOT_FOUND # noqa: F401 + + +class SenderInvitationClientCompositeOperations(object): + """ + This class provides a wrapper around :py:class:`~oci.tenant_manager_control_plane.SenderInvitationClient` and offers convenience methods + for operations that would otherwise need to be chained together. For example, instead of performing an action + on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource + to enter a given state, you can call a single method in this class to accomplish the same functionality + """ + + def __init__(self, client, **kwargs): + """ + Creates a new SenderInvitationClientCompositeOperations object + + :param SenderInvitationClient client: + The service client which will be wrapped by this object + """ + self.client = client + + def cancel_sender_invitation_and_wait_for_state(self, sender_invitation_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.tenant_manager_control_plane.SenderInvitationClient.cancel_sender_invitation` and waits for the :py:class:`~oci.tenant_manager_control_plane.models.WorkRequest` + to enter the given state(s). + + :param str sender_invitation_id: (required) + OCID of the sender invitation to cancel. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.tenant_manager_control_plane.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.tenant_manager_control_plane.SenderInvitationClient.cancel_sender_invitation` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.cancel_sender_invitation(sender_invitation_id, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.headers['opc-work-request-id'] + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_work_request(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def create_sender_invitation_and_wait_for_state(self, create_sender_invitation_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.tenant_manager_control_plane.SenderInvitationClient.create_sender_invitation` and waits for the :py:class:`~oci.tenant_manager_control_plane.models.WorkRequest` + to enter the given state(s). + + :param CreateSenderInvitationDetails create_sender_invitation_details: (required) + Parameters for sender invitation creation. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.tenant_manager_control_plane.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.tenant_manager_control_plane.SenderInvitationClient.create_sender_invitation` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.create_sender_invitation(create_sender_invitation_details, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.headers['opc-work-request-id'] + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_work_request(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def update_sender_invitation_and_wait_for_state(self, sender_invitation_id, update_sender_invitation_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.tenant_manager_control_plane.SenderInvitationClient.update_sender_invitation` and waits for the :py:class:`~oci.tenant_manager_control_plane.models.SenderInvitation` acted upon + to enter the given state(s). + + :param str sender_invitation_id: (required) + OCID of the sender invitation to update. + + :param UpdateSenderInvitationDetails update_sender_invitation_details: (required) + The information to be updated. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.tenant_manager_control_plane.models.SenderInvitation.lifecycle_state` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.tenant_manager_control_plane.SenderInvitationClient.update_sender_invitation` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.update_sender_invitation(sender_invitation_id, update_sender_invitation_details, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.data.id + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_sender_invitation(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) diff --git a/src/oci/tenant_manager_control_plane/work_request_client.py b/src/oci/tenant_manager_control_plane/work_request_client.py new file mode 100644 index 0000000000..be02bd0100 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/work_request_client.py @@ -0,0 +1,461 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + +from __future__ import absolute_import + +from oci._vendor import requests # noqa: F401 +from oci._vendor import six + +from oci import retry # noqa: F401 +from oci.base_client import BaseClient +from oci.config import get_config_value_or_default, validate_config +from oci.signer import Signer +from oci.util import Sentinel, get_signer_from_authentication_type, AUTHENTICATION_TYPE_FIELD_NAME +from .models import tenant_manager_control_plane_type_mapping +missing = Sentinel("Missing") + + +class WorkRequestClient(object): + """ + A description of the TenantManager API + """ + + def __init__(self, config, **kwargs): + """ + Creates a new service client + + :param dict config: + Configuration keys and values as per `SDK and Tool Configuration `__. + The :py:meth:`~oci.config.from_file` method can be used to load configuration from a file. Alternatively, a ``dict`` can be passed. You can validate_config + the dict using :py:meth:`~oci.config.validate_config` + + :param str service_endpoint: (optional) + The endpoint of the service to call using this client. For example ``https://iaas.us-ashburn-1.oraclecloud.com``. If this keyword argument is + not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit + need to specify a service endpoint. + + :param timeout: (optional) + The connection and read timeouts for the client. The default values are connection timeout 10 seconds and read timeout 60 seconds. This keyword argument can be provided + as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If + a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout. + :type timeout: float or tuple(float, float) + + :param signer: (optional) + The signer to use when signing requests made by the service client. The default is to use a :py:class:`~oci.signer.Signer` based on the values + provided in the config parameter. + + One use case for this parameter is for `Instance Principals authentication `__ + by passing an instance of :py:class:`~oci.auth.signers.InstancePrincipalsSecurityTokenSigner` as the value for this keyword argument + :type signer: :py:class:`~oci.signer.AbstractBaseSigner` + + :param obj retry_strategy: (optional) + A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. + Retry strategies can also be applied at the operation level by passing a ``retry_strategy`` keyword argument as part of calling the operation. + Any value provided at the operation level will override whatever is specified at the client level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + """ + validate_config(config, signer=kwargs.get('signer')) + if 'signer' in kwargs: + signer = kwargs['signer'] + + elif AUTHENTICATION_TYPE_FIELD_NAME in config: + signer = get_signer_from_authentication_type(config) + + else: + signer = Signer( + tenancy=config["tenancy"], + user=config["user"], + fingerprint=config["fingerprint"], + private_key_file_location=config.get("key_file"), + pass_phrase=get_config_value_or_default(config, "pass_phrase"), + private_key_content=config.get("key_content") + ) + + base_client_init_kwargs = { + 'regional_client': True, + 'service_endpoint': kwargs.get('service_endpoint'), + 'timeout': kwargs.get('timeout'), + 'base_path': '/20200801', + 'service_endpoint_template': 'https://organizations.{region}.oci.{secondLevelDomain}', + 'skip_deserialization': kwargs.get('skip_deserialization', False) + } + self.base_client = BaseClient("work_request", config, signer, tenant_manager_control_plane_type_mapping, **base_client_init_kwargs) + self.retry_strategy = kwargs.get('retry_strategy') + + def get_work_request(self, work_request_id, **kwargs): + """ + Gets the status of the work request with the given ID. + + + :param str work_request_id: (required) + The ID of the asynchronous request. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.tenant_manager_control_plane.models.WorkRequest` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/workRequests/{workRequestId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_work_request got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "workRequestId": work_request_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="WorkRequest") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="WorkRequest") + + def list_work_request_errors(self, work_request_id, compartment_id, **kwargs): + """ + Return a (paginated) list of errors for a given work request. + + + :param str work_request_id: (required) + The ID of the asynchronous request. + + :param str compartment_id: (required) + The ID of the compartment in which to list resources. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param str page: (optional) + The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + + :param int limit: (optional) + The maximum number of items to return. + + :param str sort_order: (optional) + The sort order to use, either 'asc' or 'desc'. + + Allowed values are: "ASC", "DESC" + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.tenant_manager_control_plane.models.WorkRequestErrorCollection` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/workRequests/{workRequestId}/errors" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id", + "page", + "limit", + "sort_order" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_work_request_errors got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "workRequestId": work_request_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) + ) + + query_params = { + "compartmentId": compartment_id, + "page": kwargs.get("page", missing), + "limit": kwargs.get("limit", missing), + "sortOrder": kwargs.get("sort_order", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="WorkRequestErrorCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="WorkRequestErrorCollection") + + def list_work_request_logs(self, work_request_id, compartment_id, **kwargs): + """ + Return a (paginated) list of logs for a given work request. + + + :param str work_request_id: (required) + The ID of the asynchronous request. + + :param str compartment_id: (required) + The ID of the compartment in which to list resources. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param str page: (optional) + The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + + :param int limit: (optional) + The maximum number of items to return. + + :param str sort_order: (optional) + The sort order to use, either 'asc' or 'desc'. + + Allowed values are: "ASC", "DESC" + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.tenant_manager_control_plane.models.WorkRequestLogEntryCollection` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/workRequests/{workRequestId}/logs" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id", + "page", + "limit", + "sort_order" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_work_request_logs got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "workRequestId": work_request_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) + ) + + query_params = { + "compartmentId": compartment_id, + "page": kwargs.get("page", missing), + "limit": kwargs.get("limit", missing), + "sortOrder": kwargs.get("sort_order", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="WorkRequestLogEntryCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="WorkRequestLogEntryCollection") + + def list_work_requests(self, compartment_id, **kwargs): + """ + Lists the work requests in a compartment. + + + :param str compartment_id: (required) + The ID of the compartment in which to list resources. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param str page: (optional) + The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + + :param int limit: (optional) + The maximum number of items to return. + + :param str sort_order: (optional) + The sort order to use, either 'asc' or 'desc'. + + Allowed values are: "ASC", "DESC" + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.tenant_manager_control_plane.models.WorkRequestCollection` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/workRequests" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id", + "page", + "limit", + "sort_order" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_work_requests got unknown kwargs: {!r}".format(extra_kwargs)) + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) + ) + + query_params = { + "compartmentId": compartment_id, + "page": kwargs.get("page", missing), + "limit": kwargs.get("limit", missing), + "sortOrder": kwargs.get("sort_order", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="WorkRequestCollection") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="WorkRequestCollection") diff --git a/src/oci/tenant_manager_control_plane/work_request_client_composite_operations.py b/src/oci/tenant_manager_control_plane/work_request_client_composite_operations.py new file mode 100644 index 0000000000..e331f04f88 --- /dev/null +++ b/src/oci/tenant_manager_control_plane/work_request_client_composite_operations.py @@ -0,0 +1,24 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# 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. + +import oci # noqa: F401 +from oci.util import WAIT_RESOURCE_NOT_FOUND # noqa: F401 + + +class WorkRequestClientCompositeOperations(object): + """ + This class provides a wrapper around :py:class:`~oci.tenant_manager_control_plane.WorkRequestClient` and offers convenience methods + for operations that would otherwise need to be chained together. For example, instead of performing an action + on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource + to enter a given state, you can call a single method in this class to accomplish the same functionality + """ + + def __init__(self, client, **kwargs): + """ + Creates a new WorkRequestClientCompositeOperations object + + :param WorkRequestClient client: + The service client which will be wrapped by this object + """ + self.client = client diff --git a/src/oci/usage_api/models/configuration.py b/src/oci/usage_api/models/configuration.py index f7a886b67c..9cbd9753ee 100644 --- a/src/oci/usage_api/models/configuration.py +++ b/src/oci/usage_api/models/configuration.py @@ -10,7 +10,7 @@ @init_model_state_from_kwargs class Configuration(object): """ - A configuration + A configuration. """ def __init__(self, **kwargs): @@ -44,7 +44,7 @@ def __init__(self, **kwargs): def key(self): """ **[Required]** Gets the key of this Configuration. - The key of the config + The configuration key. :return: The key of this Configuration. @@ -56,7 +56,7 @@ def key(self): def key(self, key): """ Sets the key of this Configuration. - The key of the config + The configuration key. :param key: The key of this Configuration. @@ -68,7 +68,7 @@ def key(self, key): def values(self): """ Gets the values of this Configuration. - The value of the config + The configuration value. :return: The values of this Configuration. @@ -80,7 +80,7 @@ def values(self): def values(self, values): """ Sets the values of this Configuration. - The value of the config + The configuration value. :param values: The values of this Configuration. diff --git a/src/oci/usage_api/models/configuration_aggregation.py b/src/oci/usage_api/models/configuration_aggregation.py index 3b9bc2f41e..573ce5ad65 100644 --- a/src/oci/usage_api/models/configuration_aggregation.py +++ b/src/oci/usage_api/models/configuration_aggregation.py @@ -10,7 +10,7 @@ @init_model_state_from_kwargs class ConfigurationAggregation(object): """ - The available configurations + The available configurations. """ def __init__(self, **kwargs): @@ -37,7 +37,7 @@ def __init__(self, **kwargs): def items(self): """ **[Required]** Gets the items of this ConfigurationAggregation. - The list of available configurations + The list of available configurations. :return: The items of this ConfigurationAggregation. @@ -49,7 +49,7 @@ def items(self): def items(self, items): """ Sets the items of this ConfigurationAggregation. - The list of available configurations + The list of available configurations. :param items: The items of this ConfigurationAggregation. diff --git a/src/oci/usage_api/models/dimension.py b/src/oci/usage_api/models/dimension.py index c10d39e1dc..974ff7b559 100644 --- a/src/oci/usage_api/models/dimension.py +++ b/src/oci/usage_api/models/dimension.py @@ -10,7 +10,7 @@ @init_model_state_from_kwargs class Dimension(object): """ - The dimension use for filtering. + The dimension used for filtering. availabe dimension are \"service\", \"skuName\", \"skuPartNumber\", \"unit\", \"compartmentName\", \"compartmentPath\", \"compartmentId\", \"platform\", \"region\", \"logicalAd\", \"resourceId\", \"tenantId\", \"tenantName\" example: `[{value: \"COMPUTE\", key: \"service\"}]` """ @@ -46,7 +46,7 @@ def __init__(self, **kwargs): def key(self): """ **[Required]** Gets the key of this Dimension. - The key of the dimension. + The dimension key. :return: The key of this Dimension. @@ -58,7 +58,7 @@ def key(self): def key(self, key): """ Sets the key of this Dimension. - The key of the dimension. + The dimension key. :param key: The key of this Dimension. @@ -70,7 +70,7 @@ def key(self, key): def value(self): """ **[Required]** Gets the value of this Dimension. - The value of the dimension. + The dimension value. :return: The value of this Dimension. @@ -82,7 +82,7 @@ def value(self): def value(self, value): """ Sets the value of this Dimension. - The value of the dimension. + The dimension value. :param value: The value of this Dimension. diff --git a/src/oci/usage_api/models/filter.py b/src/oci/usage_api/models/filter.py index 14430ebe0f..d30faf549a 100644 --- a/src/oci/usage_api/models/filter.py +++ b/src/oci/usage_api/models/filter.py @@ -71,7 +71,7 @@ def __init__(self, **kwargs): def operator(self): """ Gets the operator of this Filter. - The operator of the filter. Example: 'AND', 'OR', 'NOT'. + The filter operator. Example: 'AND', 'OR', 'NOT'. Allowed values for this property are: "AND", "NOT", "OR" @@ -85,7 +85,7 @@ def operator(self): def operator(self, operator): """ Sets the operator of this Filter. - The operator of the filter. Example: 'AND', 'OR', 'NOT'. + The filter operator. Example: 'AND', 'OR', 'NOT'. :param operator: The operator of this Filter. diff --git a/src/oci/usage_api/models/request_summarized_usages_details.py b/src/oci/usage_api/models/request_summarized_usages_details.py index cfcfa062b0..13684227b5 100644 --- a/src/oci/usage_api/models/request_summarized_usages_details.py +++ b/src/oci/usage_api/models/request_summarized_usages_details.py @@ -10,7 +10,7 @@ @init_model_state_from_kwargs class RequestSummarizedUsagesDetails(object): """ - details for the '/usage' query + Details for the '/usage' query. """ #: A constant which can be used with the granularity property of a RequestSummarizedUsagesDetails. @@ -112,7 +112,7 @@ def __init__(self, **kwargs): def tenant_id(self): """ **[Required]** Gets the tenant_id of this RequestSummarizedUsagesDetails. - tenant id + Tenant ID :return: The tenant_id of this RequestSummarizedUsagesDetails. @@ -124,7 +124,7 @@ def tenant_id(self): def tenant_id(self, tenant_id): """ Sets the tenant_id of this RequestSummarizedUsagesDetails. - tenant id + Tenant ID :param tenant_id: The tenant_id of this RequestSummarizedUsagesDetails. @@ -136,7 +136,7 @@ def tenant_id(self, tenant_id): def time_usage_started(self): """ **[Required]** Gets the time_usage_started of this RequestSummarizedUsagesDetails. - The start time of the usage. + The usage start time. :return: The time_usage_started of this RequestSummarizedUsagesDetails. @@ -148,7 +148,7 @@ def time_usage_started(self): def time_usage_started(self, time_usage_started): """ Sets the time_usage_started of this RequestSummarizedUsagesDetails. - The start time of the usage. + The usage start time. :param time_usage_started: The time_usage_started of this RequestSummarizedUsagesDetails. @@ -160,7 +160,7 @@ def time_usage_started(self, time_usage_started): def time_usage_ended(self): """ **[Required]** Gets the time_usage_ended of this RequestSummarizedUsagesDetails. - The end time of the usage. + The usage end time. :return: The time_usage_ended of this RequestSummarizedUsagesDetails. @@ -172,7 +172,7 @@ def time_usage_ended(self): def time_usage_ended(self, time_usage_ended): """ Sets the time_usage_ended of this RequestSummarizedUsagesDetails. - The end time of the usage. + The usage end time. :param time_usage_ended: The time_usage_ended of this RequestSummarizedUsagesDetails. @@ -184,11 +184,11 @@ def time_usage_ended(self, time_usage_ended): def granularity(self): """ **[Required]** Gets the granularity of this RequestSummarizedUsagesDetails. - The granularity of the usage. - HOURLY - Hourly aggregation of data - DAILY - Daily aggregation of data - MONTHLY - Monthly aggregation of data - TOTAL - Not Supported Yet + The usage granularity. + HOURLY - Hourly data aggregation. + DAILY - Daily data aggregation. + MONTHLY - Monthly data aggregation. + TOTAL - Not yet supported. Allowed values for this property are: "HOURLY", "DAILY", "MONTHLY", "TOTAL" @@ -202,11 +202,11 @@ def granularity(self): def granularity(self, granularity): """ Sets the granularity of this RequestSummarizedUsagesDetails. - The granularity of the usage. - HOURLY - Hourly aggregation of data - DAILY - Daily aggregation of data - MONTHLY - Monthly aggregation of data - TOTAL - Not Supported Yet + The usage granularity. + HOURLY - Hourly data aggregation. + DAILY - Daily data aggregation. + MONTHLY - Monthly data aggregation. + TOTAL - Not yet supported. :param granularity: The granularity of this RequestSummarizedUsagesDetails. @@ -224,9 +224,9 @@ def granularity(self, granularity): def query_type(self): """ Gets the query_type of this RequestSummarizedUsagesDetails. - The type of query of the usage. + The query usage type. Usage - Query the usage data. - Cost - Query the cost / billing data. + Cost - Query the cost/billing data. Allowed values for this property are: "USAGE", "COST" @@ -240,9 +240,9 @@ def query_type(self): def query_type(self, query_type): """ Sets the query_type of this RequestSummarizedUsagesDetails. - The type of query of the usage. + The query usage type. Usage - Query the usage data. - Cost - Query the cost / billing data. + Cost - Query the cost/billing data. :param query_type: The query_type of this RequestSummarizedUsagesDetails. @@ -288,7 +288,7 @@ def group_by(self, group_by): def compartment_depth(self): """ Gets the compartment_depth of this RequestSummarizedUsagesDetails. - The depth level of the compartment. + The compartment depth level. :return: The compartment_depth of this RequestSummarizedUsagesDetails. @@ -300,7 +300,7 @@ def compartment_depth(self): def compartment_depth(self, compartment_depth): """ Sets the compartment_depth of this RequestSummarizedUsagesDetails. - The depth level of the compartment. + The compartment depth level. :param compartment_depth: The compartment_depth of this RequestSummarizedUsagesDetails. diff --git a/src/oci/usage_api/models/tag.py b/src/oci/usage_api/models/tag.py index 254465aa11..564f0e94ee 100644 --- a/src/oci/usage_api/models/tag.py +++ b/src/oci/usage_api/models/tag.py @@ -10,7 +10,7 @@ @init_model_state_from_kwargs class Tag(object): """ - The tag use for filtering. + The tag used for filtering. """ def __init__(self, **kwargs): @@ -75,7 +75,7 @@ def namespace(self, namespace): def key(self): """ Gets the key of this Tag. - The key of the tag. + The tag key. :return: The key of this Tag. @@ -87,7 +87,7 @@ def key(self): def key(self, key): """ Sets the key of this Tag. - The key of the tag. + The tag key. :param key: The key of this Tag. @@ -99,7 +99,7 @@ def key(self, key): def value(self): """ Gets the value of this Tag. - The value of the tag. + The tag value. :return: The value of this Tag. @@ -111,7 +111,7 @@ def value(self): def value(self, value): """ Sets the value of this Tag. - The value of the tag. + The tag value. :param value: The value of this Tag. diff --git a/src/oci/usage_api/models/usage_aggregation.py b/src/oci/usage_api/models/usage_aggregation.py index 0eb55c2eb1..95d3345222 100644 --- a/src/oci/usage_api/models/usage_aggregation.py +++ b/src/oci/usage_api/models/usage_aggregation.py @@ -10,7 +10,7 @@ @init_model_state_from_kwargs class UsageAggregation(object): """ - The usage of the account (tenant) + The account (tenant) usage. """ def __init__(self, **kwargs): diff --git a/src/oci/usage_api/models/usage_summary.py b/src/oci/usage_api/models/usage_summary.py index 0098b3064b..68a0437b0c 100644 --- a/src/oci/usage_api/models/usage_summary.py +++ b/src/oci/usage_api/models/usage_summary.py @@ -10,7 +10,7 @@ @init_model_state_from_kwargs class UsageSummary(object): """ - The result from usage store. + The usage store result. """ def __init__(self, **kwargs): @@ -18,6 +18,14 @@ def __init__(self, **kwargs): Initializes a new UsageSummary object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class): + :param tenant_id: + The value to assign to the tenant_id property of this UsageSummary. + :type tenant_id: str + + :param tenant_name: + The value to assign to the tenant_name property of this UsageSummary. + :type tenant_name: str + :param compartment_id: The value to assign to the compartment_id property of this UsageSummary. :type compartment_id: str @@ -124,6 +132,8 @@ def __init__(self, **kwargs): """ self.swagger_types = { + 'tenant_id': 'str', + 'tenant_name': 'str', 'compartment_id': 'str', 'compartment_path': 'str', 'compartment_name': 'str', @@ -153,6 +163,8 @@ def __init__(self, **kwargs): } self.attribute_map = { + 'tenant_id': 'tenantId', + 'tenant_name': 'tenantName', 'compartment_id': 'compartmentId', 'compartment_path': 'compartmentPath', 'compartment_name': 'compartmentName', @@ -181,6 +193,8 @@ def __init__(self, **kwargs): 'tags': 'tags' } + self._tenant_id = None + self._tenant_name = None self._compartment_id = None self._compartment_path = None self._compartment_name = None @@ -208,11 +222,59 @@ def __init__(self, **kwargs): self._overage = None self._tags = None + @property + def tenant_id(self): + """ + Gets the tenant_id of this UsageSummary. + The tenancy OCID. + + + :return: The tenant_id of this UsageSummary. + :rtype: str + """ + return self._tenant_id + + @tenant_id.setter + def tenant_id(self, tenant_id): + """ + Sets the tenant_id of this UsageSummary. + The tenancy OCID. + + + :param tenant_id: The tenant_id of this UsageSummary. + :type: str + """ + self._tenant_id = tenant_id + + @property + def tenant_name(self): + """ + Gets the tenant_name of this UsageSummary. + The tenancy name. + + + :return: The tenant_name of this UsageSummary. + :rtype: str + """ + return self._tenant_name + + @tenant_name.setter + def tenant_name(self, tenant_name): + """ + Sets the tenant_name of this UsageSummary. + The tenancy name. + + + :param tenant_name: The tenant_name of this UsageSummary. + :type: str + """ + self._tenant_name = tenant_name + @property def compartment_id(self): """ Gets the compartment_id of this UsageSummary. - The OCID of the compartment. + The compartment OCID. :return: The compartment_id of this UsageSummary. @@ -224,7 +286,7 @@ def compartment_id(self): def compartment_id(self, compartment_id): """ Sets the compartment_id of this UsageSummary. - The OCID of the compartment. + The compartment OCID. :param compartment_id: The compartment_id of this UsageSummary. @@ -236,7 +298,7 @@ def compartment_id(self, compartment_id): def compartment_path(self): """ Gets the compartment_path of this UsageSummary. - The path of the compartment, starting from root. + The compartment path, starting from root. :return: The compartment_path of this UsageSummary. @@ -248,7 +310,7 @@ def compartment_path(self): def compartment_path(self, compartment_path): """ Sets the compartment_path of this UsageSummary. - The path of the compartment, starting from root. + The compartment path, starting from root. :param compartment_path: The compartment_path of this UsageSummary. @@ -260,7 +322,7 @@ def compartment_path(self, compartment_path): def compartment_name(self): """ Gets the compartment_name of this UsageSummary. - The name of the compartment. + The compartment name. :return: The compartment_name of this UsageSummary. @@ -272,7 +334,7 @@ def compartment_name(self): def compartment_name(self, compartment_name): """ Sets the compartment_name of this UsageSummary. - The name of the compartment. + The compartment name. :param compartment_name: The compartment_name of this UsageSummary. @@ -284,7 +346,7 @@ def compartment_name(self, compartment_name): def service(self): """ Gets the service of this UsageSummary. - The name of the service that is incurring the cost. + The service name that is incurring the cost. :return: The service of this UsageSummary. @@ -296,7 +358,7 @@ def service(self): def service(self, service): """ Sets the service of this UsageSummary. - The name of the service that is incurring the cost. + The service name that is incurring the cost. :param service: The service of this UsageSummary. @@ -308,7 +370,7 @@ def service(self, service): def resource_name(self): """ Gets the resource_name of this UsageSummary. - The name of the resource that is incurring the cost. + The resource name that is incurring the cost. :return: The resource_name of this UsageSummary. @@ -320,7 +382,7 @@ def resource_name(self): def resource_name(self, resource_name): """ Sets the resource_name of this UsageSummary. - The name of the resource that is incurring the cost. + The resource name that is incurring the cost. :param resource_name: The resource_name of this UsageSummary. @@ -332,7 +394,7 @@ def resource_name(self, resource_name): def resource_id(self): """ Gets the resource_id of this UsageSummary. - The Ocid of the resource that is incurring the cost. + The resource OCID that is incurring the cost. :return: The resource_id of this UsageSummary. @@ -344,7 +406,7 @@ def resource_id(self): def resource_id(self, resource_id): """ Sets the resource_id of this UsageSummary. - The Ocid of the resource that is incurring the cost. + The resource OCID that is incurring the cost. :param resource_id: The resource_id of this UsageSummary. @@ -404,7 +466,7 @@ def ad(self, ad): def weight(self): """ Gets the weight of this UsageSummary. - The size of resource being metered. + The resource size being metered. :return: The weight of this UsageSummary. @@ -416,7 +478,7 @@ def weight(self): def weight(self, weight): """ Sets the weight of this UsageSummary. - The size of resource being metered. + The resource size being metered. :param weight: The weight of this UsageSummary. @@ -428,7 +490,7 @@ def weight(self, weight): def shape(self): """ Gets the shape of this UsageSummary. - The shape of the resource. + The resource shape. :return: The shape of this UsageSummary. @@ -440,7 +502,7 @@ def shape(self): def shape(self, shape): """ Sets the shape of this UsageSummary. - The shape of the resource. + The resource shape. :param shape: The shape of this UsageSummary. @@ -452,7 +514,7 @@ def shape(self, shape): def sku_part_number(self): """ Gets the sku_part_number of this UsageSummary. - The part number of the SKU. + The SKU part number. :return: The sku_part_number of this UsageSummary. @@ -464,7 +526,7 @@ def sku_part_number(self): def sku_part_number(self, sku_part_number): """ Sets the sku_part_number of this UsageSummary. - The part number of the SKU. + The SKU part number. :param sku_part_number: The sku_part_number of this UsageSummary. @@ -476,7 +538,7 @@ def sku_part_number(self, sku_part_number): def sku_name(self): """ Gets the sku_name of this UsageSummary. - The friendly name for the SKU. + The SKU friendly name. :return: The sku_name of this UsageSummary. @@ -488,7 +550,7 @@ def sku_name(self): def sku_name(self, sku_name): """ Sets the sku_name of this UsageSummary. - The friendly name for the SKU. + The SKU friendly name. :param sku_name: The sku_name of this UsageSummary. @@ -500,7 +562,7 @@ def sku_name(self, sku_name): def unit(self): """ Gets the unit of this UsageSummary. - The unit of the usage. + The usage unit. :return: The unit of this UsageSummary. @@ -512,7 +574,7 @@ def unit(self): def unit(self, unit): """ Sets the unit of this UsageSummary. - The unit of the usage. + The usage unit. :param unit: The unit of this UsageSummary. @@ -548,7 +610,7 @@ def discount(self, discount): def list_rate(self): """ Gets the list_rate of this UsageSummary. - The list rate for the SKU (not discount). + The SKU list rate (not discount). :return: The list_rate of this UsageSummary. @@ -560,7 +622,7 @@ def list_rate(self): def list_rate(self, list_rate): """ Sets the list_rate of this UsageSummary. - The list rate for the SKU (not discount). + The SKU list rate (not discount). :param list_rate: The list_rate of this UsageSummary. @@ -596,7 +658,7 @@ def platform(self, platform): def time_usage_started(self): """ **[Required]** Gets the time_usage_started of this UsageSummary. - The start time of the usage. + The usage start time. :return: The time_usage_started of this UsageSummary. @@ -608,7 +670,7 @@ def time_usage_started(self): def time_usage_started(self, time_usage_started): """ Sets the time_usage_started of this UsageSummary. - The start time of the usage. + The usage start time. :param time_usage_started: The time_usage_started of this UsageSummary. @@ -620,7 +682,7 @@ def time_usage_started(self, time_usage_started): def time_usage_ended(self): """ **[Required]** Gets the time_usage_ended of this UsageSummary. - The end time of the usage. + The usage end time. :return: The time_usage_ended of this UsageSummary. @@ -632,7 +694,7 @@ def time_usage_ended(self): def time_usage_ended(self, time_usage_ended): """ Sets the time_usage_ended of this UsageSummary. - The end time of the usage. + The usage end time. :param time_usage_ended: The time_usage_ended of this UsageSummary. @@ -740,7 +802,7 @@ def unit_price(self, unit_price): def currency(self): """ Gets the currency of this UsageSummary. - The currency for the price. + The price currency. :return: The currency of this UsageSummary. @@ -752,7 +814,7 @@ def currency(self): def currency(self, currency): """ Sets the currency of this UsageSummary. - The currency for the price. + The price currency. :param currency: The currency of this UsageSummary. @@ -764,7 +826,7 @@ def currency(self, currency): def subscription_id(self): """ Gets the subscription_id of this UsageSummary. - The subscription Id. + The subscription ID. :return: The subscription_id of this UsageSummary. @@ -776,7 +838,7 @@ def subscription_id(self): def subscription_id(self, subscription_id): """ Sets the subscription_id of this UsageSummary. - The subscription Id. + The subscription ID. :param subscription_id: The subscription_id of this UsageSummary. @@ -812,7 +874,7 @@ def overage(self, overage): def tags(self): """ Gets the tags of this UsageSummary. - For grouping, a tag definition. For filtering, a definition and key + For grouping, a tag definition. For filtering, a definition and key. :return: The tags of this UsageSummary. @@ -824,7 +886,7 @@ def tags(self): def tags(self, tags): """ Sets the tags of this UsageSummary. - For grouping, a tag definition. For filtering, a definition and key + For grouping, a tag definition. For filtering, a definition and key. :param tags: The tags of this UsageSummary. diff --git a/src/oci/usage_api/usageapi_client.py b/src/oci/usage_api/usageapi_client.py index f6c4981170..c49cf8d3c8 100644 --- a/src/oci/usage_api/usageapi_client.py +++ b/src/oci/usage_api/usageapi_client.py @@ -18,7 +18,7 @@ class UsageapiClient(object): """ - A description of the UsageApi API. + Use the Usage API to view your Oracle Cloud usage and costs. The API allows you to request data that meets the specified filter criteria, and to group that data by the dimension of your choosing. The Usage API is used by the Cost Analysis tool in the Console. """ def __init__(self, config, **kwargs): @@ -87,7 +87,7 @@ def __init__(self, config, **kwargs): def request_summarized_configurations(self, tenant_id, **kwargs): """ - Returns the list of config for UI dropdown list + Returns the configurations list for the UI drop-down list. :param str tenant_id: (required) @@ -155,11 +155,11 @@ def request_summarized_configurations(self, tenant_id, **kwargs): def request_summarized_usages(self, request_summarized_usages_details, **kwargs): """ - Returns the usage for the given account + Returns usage for the given account. :param RequestSummarizedUsagesDetails request_summarized_usages_details: (required) - getUsageRequest contain query inforamtion + getUsageRequest contains query inforamtion. :param str opc_request_id: (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a diff --git a/src/oci/version.py b/src/oci/version.py index cf2e743caa..b482545a1b 100644 --- a/src/oci/version.py +++ b/src/oci/version.py @@ -2,4 +2,4 @@ # Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. # 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. -__version__ = "2.23.3" +__version__ = "2.23.4"