diff --git a/CHANGELOG.rst b/CHANGELOG.rst index cb5cd5ec1a..3ab6abb320 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,6 +3,25 @@ Change Log All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `_. +==================== +2.122.0 - 2024-02-20 +==================== + + +Added +----- +* Support for calling Oracle Cloud Infrastructure services in the me-dcc-doha-1 region +* Support for Secure Desktops service +* Support for enabling and disabling Simultaneous Multithreading (SMT) for virtual machines in the Compute service +* Support for Bring Your Own Container Jobs (BYOC v2) in the Data Science service +* Support for expanded language translation in the AI Language service +* Support for additional flags for ignoring transliteration and text length to be considered for determining dominant language in the AI Language service + +Breaking +-------- +* The model `PreTrainedPhiModelDetails` was removed in the AI Language service +* The field `system_tags` has changed type from `dict(str, object)` to `dict(str, dict(str, object))` in the models `endpoint`, `endpoint_summary`, `model`, `model_summary`, `project`, and `project_summary` in the AI Language service + ==================== 2.121.1 - 2024-02-13 ==================== diff --git a/THIRD_PARTY_LICENSES.txt b/THIRD_PARTY_LICENSES.txt index 2751536901..adf05a08bd 100644 --- a/THIRD_PARTY_LICENSES.txt +++ b/THIRD_PARTY_LICENSES.txt @@ -10,6 +10,8 @@ OCI toolkit for Python Third Party License File - BSD 3-Clause "New" or "Revised" License - GNU Lesser General Public License v2.1 - PSF License +- OpenSSL License +- Original SSLeay License -------------------------------- Notices ------------------------------- Requests Copyright 2019 Kenneth Reitz @@ -96,7 +98,7 @@ urllib3 circuitbreaker * Copyright (c) 2016-2020, Fabian Fuelling opensource@fabfuel.de. All rights reserved. -* License: MIT License +* License: BSD-3-Clause New License * Source code: https://github.com/fabfuel/circuitbreaker * Project home: https://pypi.org/project/circuitbreaker @@ -118,6 +120,19 @@ sseclient * Source code: https://github.com/mpetazzoni/sseclient * Project home: https://github.com/mpetazzoni/sseclient +openssl +* Copyright (c) 1998-2023 The OpenSSL Project Authors +* Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson +* License: Apache License 2.0, OpenSSL License, Original SSLeay License +* Source code: https://github.com/openssl/openssl +* Project home: https://www.openssl.org/ + +libffi +* Copyright (c) 1996-2024 Anthony Green, Red Hat, Inc and others. +* License: The MIT License +* Source code: https://github.com/libffi/libffi +* Project home: https://github.com/libffi/libffi + =============================== Licenses =============================== ------------------------------ MIT License ----------------------------- @@ -1234,4 +1249,123 @@ That's all there is to it! 8. By copying, installing or otherwise using Python 2.7.12, Licensee agrees to be bound by the terms and conditions of this License Agreement. ------------------------------------------------------------------------- \ No newline at end of file +------------------------------------------------------------------------ + +OpenSSL License + --------------- + +/* ==================================================================== + * Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + ------------------------------------------------------------------------ + + Original SSLeay License + ----------------------- + +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + ------------------------------------------------------------------------ diff --git a/docs/api/ai_language.rst b/docs/api/ai_language.rst index a697c0750d..5a2ba1c5be 100644 --- a/docs/api/ai_language.rst +++ b/docs/api/ai_language.rst @@ -98,7 +98,6 @@ Ai Language oci.ai_language.models.PreTrainedKeyPhraseExtractionModelDetails oci.ai_language.models.PreTrainedLanguageDetectionModelDetails oci.ai_language.models.PreTrainedNamedEntityRecognitionModelDetails - oci.ai_language.models.PreTrainedPhiModelDetails oci.ai_language.models.PreTrainedPiiModelDetails oci.ai_language.models.PreTrainedSentimentAnalysisModelDetails oci.ai_language.models.PreTrainedSummarization diff --git a/docs/api/core.rst b/docs/api/core.rst index ad15fc98ba..10c9b5003a 100644 --- a/docs/api/core.rst +++ b/docs/api/core.rst @@ -49,6 +49,7 @@ Core Services oci.core.models.AmdRomeBmPlatformConfig oci.core.models.AmdVmLaunchInstancePlatformConfig oci.core.models.AmdVmPlatformConfig + oci.core.models.AmdVmUpdateInstancePlatformConfig oci.core.models.AppCatalogListing oci.core.models.AppCatalogListingResourceVersion oci.core.models.AppCatalogListingResourceVersionAgreements @@ -391,6 +392,7 @@ Core Services oci.core.models.IntelSkylakeBmPlatformConfig oci.core.models.IntelVmLaunchInstancePlatformConfig oci.core.models.IntelVmPlatformConfig + oci.core.models.IntelVmUpdateInstancePlatformConfig oci.core.models.InternetGateway oci.core.models.IpsecTunnelDrgAttachmentNetworkDetails oci.core.models.Ipv6 @@ -524,6 +526,7 @@ Core Services oci.core.models.UpdateInstanceConfigurationDetails oci.core.models.UpdateInstanceConsoleConnectionDetails oci.core.models.UpdateInstanceDetails + oci.core.models.UpdateInstancePlatformConfig oci.core.models.UpdateInstancePoolDetails oci.core.models.UpdateInstancePoolPlacementConfigurationDetails oci.core.models.UpdateInstanceShapeConfigDetails diff --git a/docs/api/core/models/oci.core.models.AmdVmUpdateInstancePlatformConfig.rst b/docs/api/core/models/oci.core.models.AmdVmUpdateInstancePlatformConfig.rst new file mode 100644 index 0000000000..bf30deb98b --- /dev/null +++ b/docs/api/core/models/oci.core.models.AmdVmUpdateInstancePlatformConfig.rst @@ -0,0 +1,11 @@ +AmdVmUpdateInstancePlatformConfig +================================= + +.. currentmodule:: oci.core.models + +.. autoclass:: AmdVmUpdateInstancePlatformConfig + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/core/models/oci.core.models.IntelVmUpdateInstancePlatformConfig.rst b/docs/api/core/models/oci.core.models.IntelVmUpdateInstancePlatformConfig.rst new file mode 100644 index 0000000000..cf79420567 --- /dev/null +++ b/docs/api/core/models/oci.core.models.IntelVmUpdateInstancePlatformConfig.rst @@ -0,0 +1,11 @@ +IntelVmUpdateInstancePlatformConfig +=================================== + +.. currentmodule:: oci.core.models + +.. autoclass:: IntelVmUpdateInstancePlatformConfig + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/core/models/oci.core.models.UpdateInstancePlatformConfig.rst b/docs/api/core/models/oci.core.models.UpdateInstancePlatformConfig.rst new file mode 100644 index 0000000000..b626a2b9c4 --- /dev/null +++ b/docs/api/core/models/oci.core.models.UpdateInstancePlatformConfig.rst @@ -0,0 +1,11 @@ +UpdateInstancePlatformConfig +============================ + +.. currentmodule:: oci.core.models + +.. autoclass:: UpdateInstancePlatformConfig + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/data_science.rst b/docs/api/data_science.rst index 042abea2ee..c939f64ae3 100644 --- a/docs/api/data_science.rst +++ b/docs/api/data_science.rst @@ -56,6 +56,7 @@ Data Science oci.data_science.models.InstanceConfiguration oci.data_science.models.Job oci.data_science.models.JobConfigurationDetails + oci.data_science.models.JobEnvironmentConfigurationDetails oci.data_science.models.JobInfrastructureConfigurationDetails oci.data_science.models.JobLogConfigurationDetails oci.data_science.models.JobRun @@ -89,6 +90,7 @@ Data Science oci.data_science.models.NotebookSessionShapeSummary oci.data_science.models.NotebookSessionSummary oci.data_science.models.ObjectStorageMountConfigurationDetails + oci.data_science.models.OcirContainerJobEnvironmentConfigurationDetails oci.data_science.models.OcirModelDeploymentEnvironmentConfigurationDetails oci.data_science.models.Pipeline oci.data_science.models.PipelineConfigurationDetails diff --git a/docs/api/data_science/models/oci.data_science.models.JobEnvironmentConfigurationDetails.rst b/docs/api/data_science/models/oci.data_science.models.JobEnvironmentConfigurationDetails.rst new file mode 100644 index 0000000000..87f3c786c7 --- /dev/null +++ b/docs/api/data_science/models/oci.data_science.models.JobEnvironmentConfigurationDetails.rst @@ -0,0 +1,11 @@ +JobEnvironmentConfigurationDetails +================================== + +.. currentmodule:: oci.data_science.models + +.. autoclass:: JobEnvironmentConfigurationDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/data_science/models/oci.data_science.models.OcirContainerJobEnvironmentConfigurationDetails.rst b/docs/api/data_science/models/oci.data_science.models.OcirContainerJobEnvironmentConfigurationDetails.rst new file mode 100644 index 0000000000..43ebaed41d --- /dev/null +++ b/docs/api/data_science/models/oci.data_science.models.OcirContainerJobEnvironmentConfigurationDetails.rst @@ -0,0 +1,11 @@ +OcirContainerJobEnvironmentConfigurationDetails +=============================================== + +.. currentmodule:: oci.data_science.models + +.. autoclass:: OcirContainerJobEnvironmentConfigurationDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops.rst b/docs/api/desktops.rst new file mode 100644 index 0000000000..ec65527dd2 --- /dev/null +++ b/docs/api/desktops.rst @@ -0,0 +1,48 @@ +Desktops +======== + +.. autosummary:: + :toctree: desktops/client + :nosignatures: + :template: autosummary/service_client.rst + + oci.desktops.DesktopServiceClient + oci.desktops.DesktopServiceClientCompositeOperations + +-------- + Models +-------- + +.. autosummary:: + :toctree: desktops/models + :nosignatures: + :template: autosummary/model_class.rst + + oci.desktops.models.ChangeDesktopPoolCompartmentDetails + oci.desktops.models.CreateDesktopPoolDetails + oci.desktops.models.Desktop + oci.desktops.models.DesktopAvailabilityPolicy + oci.desktops.models.DesktopCollection + oci.desktops.models.DesktopDevicePolicy + oci.desktops.models.DesktopImage + oci.desktops.models.DesktopNetworkConfiguration + oci.desktops.models.DesktopPool + oci.desktops.models.DesktopPoolCollection + oci.desktops.models.DesktopPoolDesktopCollection + oci.desktops.models.DesktopPoolDesktopSummary + oci.desktops.models.DesktopPoolSummary + oci.desktops.models.DesktopPoolVolumeCollection + oci.desktops.models.DesktopPoolVolumeSummary + oci.desktops.models.DesktopSchedule + oci.desktops.models.DesktopSummary + oci.desktops.models.HostingOptions + oci.desktops.models.UpdateDesktopDetails + oci.desktops.models.UpdateDesktopPoolDetails + oci.desktops.models.WorkRequest + oci.desktops.models.WorkRequestError + oci.desktops.models.WorkRequestErrorCollection + oci.desktops.models.WorkRequestLogEntry + oci.desktops.models.WorkRequestLogEntryCollection + oci.desktops.models.WorkRequestResource + oci.desktops.models.WorkRequestSummary + oci.desktops.models.WorkRequestSummaryCollection diff --git a/docs/api/desktops/client/oci.desktops.DesktopServiceClient.rst b/docs/api/desktops/client/oci.desktops.DesktopServiceClient.rst new file mode 100644 index 0000000000..88717f2cc2 --- /dev/null +++ b/docs/api/desktops/client/oci.desktops.DesktopServiceClient.rst @@ -0,0 +1,8 @@ +DesktopServiceClient +==================== + +.. currentmodule:: oci.desktops + +.. autoclass:: DesktopServiceClient + :special-members: __init__ + :members: \ No newline at end of file diff --git a/docs/api/desktops/client/oci.desktops.DesktopServiceClientCompositeOperations.rst b/docs/api/desktops/client/oci.desktops.DesktopServiceClientCompositeOperations.rst new file mode 100644 index 0000000000..1b1f8f6f90 --- /dev/null +++ b/docs/api/desktops/client/oci.desktops.DesktopServiceClientCompositeOperations.rst @@ -0,0 +1,8 @@ +DesktopServiceClientCompositeOperations +======================================= + +.. currentmodule:: oci.desktops + +.. autoclass:: DesktopServiceClientCompositeOperations + :special-members: __init__ + :members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.ChangeDesktopPoolCompartmentDetails.rst b/docs/api/desktops/models/oci.desktops.models.ChangeDesktopPoolCompartmentDetails.rst new file mode 100644 index 0000000000..fb17039d4c --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.ChangeDesktopPoolCompartmentDetails.rst @@ -0,0 +1,11 @@ +ChangeDesktopPoolCompartmentDetails +=================================== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: ChangeDesktopPoolCompartmentDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.CreateDesktopPoolDetails.rst b/docs/api/desktops/models/oci.desktops.models.CreateDesktopPoolDetails.rst new file mode 100644 index 0000000000..b558c129c0 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.CreateDesktopPoolDetails.rst @@ -0,0 +1,11 @@ +CreateDesktopPoolDetails +======================== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: CreateDesktopPoolDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.Desktop.rst b/docs/api/desktops/models/oci.desktops.models.Desktop.rst new file mode 100644 index 0000000000..b884d326f9 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.Desktop.rst @@ -0,0 +1,11 @@ +Desktop +======= + +.. currentmodule:: oci.desktops.models + +.. autoclass:: Desktop + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/ai_language/models/oci.ai_language.models.PreTrainedPhiModelDetails.rst b/docs/api/desktops/models/oci.desktops.models.DesktopAvailabilityPolicy.rst similarity index 56% rename from docs/api/ai_language/models/oci.ai_language.models.PreTrainedPhiModelDetails.rst rename to docs/api/desktops/models/oci.desktops.models.DesktopAvailabilityPolicy.rst index 5d65183a62..36d529a688 100644 --- a/docs/api/ai_language/models/oci.ai_language.models.PreTrainedPhiModelDetails.rst +++ b/docs/api/desktops/models/oci.desktops.models.DesktopAvailabilityPolicy.rst @@ -1,9 +1,9 @@ -PreTrainedPhiModelDetails +DesktopAvailabilityPolicy ========================= -.. currentmodule:: oci.ai_language.models +.. currentmodule:: oci.desktops.models -.. autoclass:: PreTrainedPhiModelDetails +.. autoclass:: DesktopAvailabilityPolicy :show-inheritance: :special-members: __init__ :members: diff --git a/docs/api/desktops/models/oci.desktops.models.DesktopCollection.rst b/docs/api/desktops/models/oci.desktops.models.DesktopCollection.rst new file mode 100644 index 0000000000..1b4490a473 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.DesktopCollection.rst @@ -0,0 +1,11 @@ +DesktopCollection +================= + +.. currentmodule:: oci.desktops.models + +.. autoclass:: DesktopCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.DesktopDevicePolicy.rst b/docs/api/desktops/models/oci.desktops.models.DesktopDevicePolicy.rst new file mode 100644 index 0000000000..e09a0d864f --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.DesktopDevicePolicy.rst @@ -0,0 +1,11 @@ +DesktopDevicePolicy +=================== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: DesktopDevicePolicy + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.DesktopImage.rst b/docs/api/desktops/models/oci.desktops.models.DesktopImage.rst new file mode 100644 index 0000000000..ff0fb7391c --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.DesktopImage.rst @@ -0,0 +1,11 @@ +DesktopImage +============ + +.. currentmodule:: oci.desktops.models + +.. autoclass:: DesktopImage + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.DesktopNetworkConfiguration.rst b/docs/api/desktops/models/oci.desktops.models.DesktopNetworkConfiguration.rst new file mode 100644 index 0000000000..c3666e8054 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.DesktopNetworkConfiguration.rst @@ -0,0 +1,11 @@ +DesktopNetworkConfiguration +=========================== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: DesktopNetworkConfiguration + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.DesktopPool.rst b/docs/api/desktops/models/oci.desktops.models.DesktopPool.rst new file mode 100644 index 0000000000..e3601dc39c --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.DesktopPool.rst @@ -0,0 +1,11 @@ +DesktopPool +=========== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: DesktopPool + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.DesktopPoolCollection.rst b/docs/api/desktops/models/oci.desktops.models.DesktopPoolCollection.rst new file mode 100644 index 0000000000..68faf90dea --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.DesktopPoolCollection.rst @@ -0,0 +1,11 @@ +DesktopPoolCollection +===================== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: DesktopPoolCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.DesktopPoolDesktopCollection.rst b/docs/api/desktops/models/oci.desktops.models.DesktopPoolDesktopCollection.rst new file mode 100644 index 0000000000..2e05f05fc3 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.DesktopPoolDesktopCollection.rst @@ -0,0 +1,11 @@ +DesktopPoolDesktopCollection +============================ + +.. currentmodule:: oci.desktops.models + +.. autoclass:: DesktopPoolDesktopCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.DesktopPoolDesktopSummary.rst b/docs/api/desktops/models/oci.desktops.models.DesktopPoolDesktopSummary.rst new file mode 100644 index 0000000000..cd51bf551f --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.DesktopPoolDesktopSummary.rst @@ -0,0 +1,11 @@ +DesktopPoolDesktopSummary +========================= + +.. currentmodule:: oci.desktops.models + +.. autoclass:: DesktopPoolDesktopSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.DesktopPoolSummary.rst b/docs/api/desktops/models/oci.desktops.models.DesktopPoolSummary.rst new file mode 100644 index 0000000000..2175f79c03 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.DesktopPoolSummary.rst @@ -0,0 +1,11 @@ +DesktopPoolSummary +================== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: DesktopPoolSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.DesktopPoolVolumeCollection.rst b/docs/api/desktops/models/oci.desktops.models.DesktopPoolVolumeCollection.rst new file mode 100644 index 0000000000..fedceac4b7 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.DesktopPoolVolumeCollection.rst @@ -0,0 +1,11 @@ +DesktopPoolVolumeCollection +=========================== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: DesktopPoolVolumeCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.DesktopPoolVolumeSummary.rst b/docs/api/desktops/models/oci.desktops.models.DesktopPoolVolumeSummary.rst new file mode 100644 index 0000000000..149aeab744 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.DesktopPoolVolumeSummary.rst @@ -0,0 +1,11 @@ +DesktopPoolVolumeSummary +======================== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: DesktopPoolVolumeSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.DesktopSchedule.rst b/docs/api/desktops/models/oci.desktops.models.DesktopSchedule.rst new file mode 100644 index 0000000000..54f7e17069 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.DesktopSchedule.rst @@ -0,0 +1,11 @@ +DesktopSchedule +=============== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: DesktopSchedule + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.DesktopSummary.rst b/docs/api/desktops/models/oci.desktops.models.DesktopSummary.rst new file mode 100644 index 0000000000..4b224964d8 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.DesktopSummary.rst @@ -0,0 +1,11 @@ +DesktopSummary +============== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: DesktopSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.HostingOptions.rst b/docs/api/desktops/models/oci.desktops.models.HostingOptions.rst new file mode 100644 index 0000000000..632ce80f93 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.HostingOptions.rst @@ -0,0 +1,11 @@ +HostingOptions +============== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: HostingOptions + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.UpdateDesktopDetails.rst b/docs/api/desktops/models/oci.desktops.models.UpdateDesktopDetails.rst new file mode 100644 index 0000000000..90e0af6604 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.UpdateDesktopDetails.rst @@ -0,0 +1,11 @@ +UpdateDesktopDetails +==================== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: UpdateDesktopDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.UpdateDesktopPoolDetails.rst b/docs/api/desktops/models/oci.desktops.models.UpdateDesktopPoolDetails.rst new file mode 100644 index 0000000000..1bcf4ca914 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.UpdateDesktopPoolDetails.rst @@ -0,0 +1,11 @@ +UpdateDesktopPoolDetails +======================== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: UpdateDesktopPoolDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.WorkRequest.rst b/docs/api/desktops/models/oci.desktops.models.WorkRequest.rst new file mode 100644 index 0000000000..3e5cf2e920 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.WorkRequest.rst @@ -0,0 +1,11 @@ +WorkRequest +=========== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: WorkRequest + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.WorkRequestError.rst b/docs/api/desktops/models/oci.desktops.models.WorkRequestError.rst new file mode 100644 index 0000000000..6ad3c73ec3 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.WorkRequestError.rst @@ -0,0 +1,11 @@ +WorkRequestError +================ + +.. currentmodule:: oci.desktops.models + +.. autoclass:: WorkRequestError + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.WorkRequestErrorCollection.rst b/docs/api/desktops/models/oci.desktops.models.WorkRequestErrorCollection.rst new file mode 100644 index 0000000000..c9266e071d --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.WorkRequestErrorCollection.rst @@ -0,0 +1,11 @@ +WorkRequestErrorCollection +========================== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: WorkRequestErrorCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.WorkRequestLogEntry.rst b/docs/api/desktops/models/oci.desktops.models.WorkRequestLogEntry.rst new file mode 100644 index 0000000000..bf9adcfc87 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.WorkRequestLogEntry.rst @@ -0,0 +1,11 @@ +WorkRequestLogEntry +=================== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: WorkRequestLogEntry + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.WorkRequestLogEntryCollection.rst b/docs/api/desktops/models/oci.desktops.models.WorkRequestLogEntryCollection.rst new file mode 100644 index 0000000000..27318ef44d --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.WorkRequestLogEntryCollection.rst @@ -0,0 +1,11 @@ +WorkRequestLogEntryCollection +============================= + +.. currentmodule:: oci.desktops.models + +.. autoclass:: WorkRequestLogEntryCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.WorkRequestResource.rst b/docs/api/desktops/models/oci.desktops.models.WorkRequestResource.rst new file mode 100644 index 0000000000..e217e31e68 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.WorkRequestResource.rst @@ -0,0 +1,11 @@ +WorkRequestResource +=================== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: WorkRequestResource + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.WorkRequestSummary.rst b/docs/api/desktops/models/oci.desktops.models.WorkRequestSummary.rst new file mode 100644 index 0000000000..51271ad613 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.WorkRequestSummary.rst @@ -0,0 +1,11 @@ +WorkRequestSummary +================== + +.. currentmodule:: oci.desktops.models + +.. autoclass:: WorkRequestSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/desktops/models/oci.desktops.models.WorkRequestSummaryCollection.rst b/docs/api/desktops/models/oci.desktops.models.WorkRequestSummaryCollection.rst new file mode 100644 index 0000000000..8d0c170955 --- /dev/null +++ b/docs/api/desktops/models/oci.desktops.models.WorkRequestSummaryCollection.rst @@ -0,0 +1,11 @@ +WorkRequestSummaryCollection +============================ + +.. currentmodule:: oci.desktops.models + +.. autoclass:: WorkRequestSummaryCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/landing.rst b/docs/api/landing.rst index d254091b8e..2c0b7111f1 100644 --- a/docs/api/landing.rst +++ b/docs/api/landing.rst @@ -72,6 +72,7 @@ API Reference * :doc:`Db Management ` * :doc:`Db System ` * :doc:`Deployment ` +* :doc:`Desktop Service ` * :doc:`Devops ` * :doc:`Diagnosability ` * :doc:`Disaster Recovery ` @@ -297,6 +298,7 @@ API Reference database_management database_migration database_tools + desktops devops disaster_recovery dns diff --git a/examples/ai_summary_report.py b/examples/ai_summary_report.py new file mode 100644 index 0000000000..b2688a7e0e --- /dev/null +++ b/examples/ai_summary_report.py @@ -0,0 +1,62 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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 +import requests + +# OCI Setup +oci_config = oci.config.from_file() + +generative_ai_inference_client = oci.generative_ai_inference.GenerativeAiInferenceClient( + oci_config, service_endpoint="https://inference.generativeai.us-chicago-1.oci.oraclecloud.com") + +# NewsAPI Setup +# Create an API Key on NewsAPI, https://newsapi.org/. +# Replace 'YOUR_API_KEY' with the actual API key you obtained from NewsAPI +api_key = 'YOUR_API_KEY' + + +def create_media_dataset(api_key): + # We will collect the latest technology news. + news_dataset = str("Here is the latest technology news. ") + + response = requests.get(f'https://newsapi.org/v2/top-headlines?country=us&category=technology&apiKey={api_key}') + + if response.status_code == 200: + articles = response.json()['articles'] + + for article in articles: + if article['description']: + news_dataset = news_dataset + article['description'] + '. ' + + print("\n=== Today's Tech News ===\n", news_dataset) + return news_dataset + + elif response.status_code == 401: + print("Unable to fetch news data. Make sure your API Key is set within the script.") + quit(-1) + + else: + print(f"Unresolved Error: {response.status_code}") + quit(-1) + + +def generative_ai_function(oci_config, generative_ai_inference_client, news_dataset): + # Gen AI API Summary Model will be invoked with News Data. + + summarize_text_response = generative_ai_inference_client.summarize_text( + summarize_text_details=oci.generative_ai_inference.models.SummarizeTextDetails( + input=news_dataset, + serving_mode=oci.generative_ai_inference.models.OnDemandServingMode(model_id="cohere.command"), + compartment_id=oci_config['tenancy'], + is_echo=False, + temperature=1, + length="MEDIUM", + format="PARAGRAPH", + extractiveness="AUTO")).data + print("\n=== Generative AI Tech News Summary ===\n", summarize_text_response.summary) + + +news_dataset = create_media_dataset(api_key) +generative_ai_function(oci_config, generative_ai_inference_client, news_dataset) diff --git a/examples/generate_text_sse_example.py b/examples/generate_text_sse_example.py index 9c76242f3d..7212d6591d 100644 --- a/examples/generate_text_sse_example.py +++ b/examples/generate_text_sse_example.py @@ -1,5 +1,5 @@ # coding: utf-8 -# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2024, 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. ########################################################################## diff --git a/src/oci/__init__.py b/src/oci/__init__.py index 4cf8e79a40..ca023e3b41 100644 --- a/src/oci/__init__.py +++ b/src/oci/__init__.py @@ -19,7 +19,7 @@ else: __all__ = [ "BaseClient", "Error", "Request", "Response", "Signer", "config", "constants", "decorators", "exceptions", "regions", "wait_until", "pagination", "auth", "retry", "fips", "circuit_breaker", "alloy", - "access_governance_cp", "adm", "ai_anomaly_detection", "ai_document", "ai_language", "ai_speech", "ai_vision", "analytics", "announcements_service", "apigateway", "apm_config", "apm_control_plane", "apm_synthetics", "apm_traces", "application_migration", "appmgmt_control", "artifacts", "audit", "autoscaling", "bastion", "bds", "blockchain", "budget", "capacity_management", "certificates", "certificates_management", "cims", "cloud_bridge", "cloud_guard", "cloud_migrations", "compute_cloud_at_customer", "compute_instance_agent", "container_engine", "container_instances", "core", "dashboard_service", "data_catalog", "data_flow", "data_integration", "data_labeling_service", "data_labeling_service_dataplane", "data_safe", "data_science", "database", "database_management", "database_migration", "database_tools", "devops", "disaster_recovery", "dns", "dts", "em_warehouse", "email", "events", "file_storage", "fleet_software_update", "functions", "fusion_apps", "generative_ai", "generative_ai_inference", "generic_artifacts_content", "globally_distributed_database", "golden_gate", "governance_rules_control_plane", "healthchecks", "identity", "identity_data_plane", "identity_domains", "integration", "jms", "jms_java_downloads", "key_management", "license_manager", "limits", "load_balancer", "lockbox", "log_analytics", "logging", "loggingingestion", "loggingsearch", "management_agent", "management_dashboard", "marketplace", "marketplace_publisher", "media_services", "monitoring", "mysql", "network_firewall", "network_load_balancer", "nosql", "object_storage", "oce", "oci_control_center", "ocvp", "oda", "onesubscription", "ons", "opa", "opensearch", "operator_access_control", "opsi", "optimizer", "os_management", "os_management_hub", "osp_gateway", "osub_billing_schedule", "osub_organization_subscription", "osub_subscription", "osub_usage", "psql", "queue", "recovery", "redis", "resource_manager", "resource_search", "rover", "sch", "secrets", "service_catalog", "service_manager_proxy", "service_mesh", "stack_monitoring", "streaming", "tenant_manager_control_plane", "threat_intelligence", "usage", "usage_api", "vault", "vbs_inst", "visual_builder", "vn_monitoring", "vulnerability_scanning", "waa", "waas", "waf", "work_requests" + "access_governance_cp", "adm", "ai_anomaly_detection", "ai_document", "ai_language", "ai_speech", "ai_vision", "analytics", "announcements_service", "apigateway", "apm_config", "apm_control_plane", "apm_synthetics", "apm_traces", "application_migration", "appmgmt_control", "artifacts", "audit", "autoscaling", "bastion", "bds", "blockchain", "budget", "capacity_management", "certificates", "certificates_management", "cims", "cloud_bridge", "cloud_guard", "cloud_migrations", "compute_cloud_at_customer", "compute_instance_agent", "container_engine", "container_instances", "core", "dashboard_service", "data_catalog", "data_flow", "data_integration", "data_labeling_service", "data_labeling_service_dataplane", "data_safe", "data_science", "database", "database_management", "database_migration", "database_tools", "desktops", "devops", "disaster_recovery", "dns", "dts", "em_warehouse", "email", "events", "file_storage", "fleet_software_update", "functions", "fusion_apps", "generative_ai", "generative_ai_inference", "generic_artifacts_content", "globally_distributed_database", "golden_gate", "governance_rules_control_plane", "healthchecks", "identity", "identity_data_plane", "identity_domains", "integration", "jms", "jms_java_downloads", "key_management", "license_manager", "limits", "load_balancer", "lockbox", "log_analytics", "logging", "loggingingestion", "loggingsearch", "management_agent", "management_dashboard", "marketplace", "marketplace_publisher", "media_services", "monitoring", "mysql", "network_firewall", "network_load_balancer", "nosql", "object_storage", "oce", "oci_control_center", "ocvp", "oda", "onesubscription", "ons", "opa", "opensearch", "operator_access_control", "opsi", "optimizer", "os_management", "os_management_hub", "osp_gateway", "osub_billing_schedule", "osub_organization_subscription", "osub_subscription", "osub_usage", "psql", "queue", "recovery", "redis", "resource_manager", "resource_search", "rover", "sch", "secrets", "service_catalog", "service_manager_proxy", "service_mesh", "stack_monitoring", "streaming", "tenant_manager_control_plane", "threat_intelligence", "usage", "usage_api", "vault", "vbs_inst", "visual_builder", "vn_monitoring", "vulnerability_scanning", "waa", "waas", "waf", "work_requests" ] if sys.version_info >= (3, 7) and os.getenv("OCI_PYTHON_SDK_LAZY_IMPORTS_DISABLED", "False").lower() != "true": def __getattr__(x): @@ -30,4 +30,4 @@ def __getattr__(x): return importlib.import_module(__name__ + "." + x) raise AttributeError("module " + __name__ + " has no attribute" + x) else: - from . import access_governance_cp, adm, ai_anomaly_detection, ai_document, ai_language, ai_speech, ai_vision, analytics, announcements_service, apigateway, apm_config, apm_control_plane, apm_synthetics, apm_traces, application_migration, appmgmt_control, artifacts, audit, autoscaling, bastion, bds, blockchain, budget, capacity_management, certificates, certificates_management, cims, cloud_bridge, cloud_guard, cloud_migrations, compute_cloud_at_customer, compute_instance_agent, container_engine, container_instances, core, dashboard_service, data_catalog, data_flow, data_integration, data_labeling_service, data_labeling_service_dataplane, data_safe, data_science, database, database_management, database_migration, database_tools, devops, disaster_recovery, dns, dts, em_warehouse, email, events, file_storage, fleet_software_update, functions, fusion_apps, generative_ai, generative_ai_inference, generic_artifacts_content, globally_distributed_database, golden_gate, governance_rules_control_plane, healthchecks, identity, identity_data_plane, identity_domains, integration, jms, jms_java_downloads, key_management, license_manager, limits, load_balancer, lockbox, log_analytics, logging, loggingingestion, loggingsearch, management_agent, management_dashboard, marketplace, marketplace_publisher, media_services, monitoring, mysql, network_firewall, network_load_balancer, nosql, object_storage, oce, oci_control_center, ocvp, oda, onesubscription, ons, opa, opensearch, operator_access_control, opsi, optimizer, os_management, os_management_hub, osp_gateway, osub_billing_schedule, osub_organization_subscription, osub_subscription, osub_usage, psql, queue, recovery, redis, resource_manager, resource_search, rover, sch, secrets, service_catalog, service_manager_proxy, service_mesh, stack_monitoring, streaming, tenant_manager_control_plane, threat_intelligence, usage, usage_api, vault, vbs_inst, visual_builder, vn_monitoring, vulnerability_scanning, waa, waas, waf, work_requests + from . import access_governance_cp, adm, ai_anomaly_detection, ai_document, ai_language, ai_speech, ai_vision, analytics, announcements_service, apigateway, apm_config, apm_control_plane, apm_synthetics, apm_traces, application_migration, appmgmt_control, artifacts, audit, autoscaling, bastion, bds, blockchain, budget, capacity_management, certificates, certificates_management, cims, cloud_bridge, cloud_guard, cloud_migrations, compute_cloud_at_customer, compute_instance_agent, container_engine, container_instances, core, dashboard_service, data_catalog, data_flow, data_integration, data_labeling_service, data_labeling_service_dataplane, data_safe, data_science, database, database_management, database_migration, database_tools, desktops, devops, disaster_recovery, dns, dts, em_warehouse, email, events, file_storage, fleet_software_update, functions, fusion_apps, generative_ai, generative_ai_inference, generic_artifacts_content, globally_distributed_database, golden_gate, governance_rules_control_plane, healthchecks, identity, identity_data_plane, identity_domains, integration, jms, jms_java_downloads, key_management, license_manager, limits, load_balancer, lockbox, log_analytics, logging, loggingingestion, loggingsearch, management_agent, management_dashboard, marketplace, marketplace_publisher, media_services, monitoring, mysql, network_firewall, network_load_balancer, nosql, object_storage, oce, oci_control_center, ocvp, oda, onesubscription, ons, opa, opensearch, operator_access_control, opsi, optimizer, os_management, os_management_hub, osp_gateway, osub_billing_schedule, osub_organization_subscription, osub_subscription, osub_usage, psql, queue, recovery, redis, resource_manager, resource_search, rover, sch, secrets, service_catalog, service_manager_proxy, service_mesh, stack_monitoring, streaming, tenant_manager_control_plane, threat_intelligence, usage, usage_api, vault, vbs_inst, visual_builder, vn_monitoring, vulnerability_scanning, waa, waas, waf, work_requests diff --git a/src/oci/ai_language/ai_service_language_client.py b/src/oci/ai_language/ai_service_language_client.py index 5b549342f9..04b5f29c9f 100644 --- a/src/oci/ai_language/ai_service_language_client.py +++ b/src/oci/ai_language/ai_service_language_client.py @@ -712,12 +712,11 @@ def batch_detect_language_text_classification(self, batch_detect_language_text_c def batch_language_translation(self, batch_language_translation_details, **kwargs): """ - Translate text to other language over pre-deployed model. - Use state of the art neural machine translation to translate text between more than 15 languages. - Limitations: - - A batch may have up to 100 records. - - A record may be up to 5000 characters long. - - The total of characters to process in a request can be up to 20,000 characters. + Translates a batch of text documents from source to target language. + A batch can contain: + - up to 100 records. + - documents length less than 5000 characters. + - 20,000 characters in total as a sum of all documents length. :param oci.ai_language.models.BatchLanguageTranslationDetails batch_language_translation_details: (required) @@ -1766,14 +1765,17 @@ def delete_project(self, project_id, **kwargs): def detect_dominant_language(self, detect_dominant_language_details, **kwargs): """ - This API will be retired on Monday, 10 Oct 2023 00:00:00 GMT - The API returns the detected language and a related confidence score (between 0 and 1). + **Deprecated**: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT. + We recommend you replace this API with the batch API, `BatchDetectDominantLanguage`__. - `List of supported languages.`__ + The DetectDominantLanguage API returns the detected language and a related confidence score (between 0 and 1). + + `List of supported languages`__ Limitations: - A record may be up to 1000 characters long. + __ https://docs.cloud.oracle.com/iaas/api/#/en/language/20221001/BatchDetectDominantLanguage/BatchDetectDominantLanguage __ https://docs.cloud.oracle.com/iaas/language/using/pretrain-models.htm#lang-detect @@ -1860,12 +1862,16 @@ def detect_dominant_language(self, detect_dominant_language_details, **kwargs): def detect_language_entities(self, detect_language_entities_details, **kwargs): """ - This API will be retired on Monday, 10 Oct 2023 00:00:00 GMT - The API extracts entities in text records. For each entity, its type and confidence score (between 0 and 1) is returned. + **Deprecated**: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT. + We recommend you replace this API with the batch API, `BatchDetectLanguageEntities`__. + + The DetectLanguageEntities API extracts entities in text records. For each entity, its type and confidence score (between 0 and 1) is returned. Limitations: - A text may be up to 1000 characters long. + __ https://docs.cloud.oracle.com/iaas/api/#/en/language/20221001/BatchDetectLanguageEntities/BatchDetectLanguageEntities + :param oci.ai_language.models.DetectLanguageEntitiesDetails detect_language_entities_details: (required) The details to make a Entity detect call. @@ -1976,12 +1982,15 @@ def detect_language_entities(self, detect_language_entities_details, **kwargs): def detect_language_key_phrases(self, detect_language_key_phrases_details, **kwargs): """ - This API will be retired on Monday, 10 Oct 2023 00:00:00 GMT - The API extracts key-phrases in text records. For each key-phrase, a score (between 0 and 1) is returned that highlights the importance of the key-phrase in the context of the text. + **Deprecated**: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT. + We recommend you replace this API with the batch API, `BatchDetectLanguageKeyPhrases`__. + The DetectLanguageKeyPhrases API extracts key-phrases in text records. For each key-phrase, a score (between 0 and 1) is returned that highlights the importance of the key-phrase in the context of the text. Limitations: - A record may be up to 1000 characters long. + __ https://docs.cloud.oracle.com/iaas/api/#/en/language/20221001/BatchDetectLanguageKeyPhrases/BatchDetectLanguageKeyPhrases + :param oci.ai_language.models.DetectLanguageKeyPhrasesDetails detect_language_key_phrases_details: (required) The details to make keyPhrase detect call. @@ -2066,8 +2075,10 @@ def detect_language_key_phrases(self, detect_language_key_phrases_details, **kwa def detect_language_sentiments(self, detect_language_sentiments_details, **kwargs): """ - This API will be retired on Monday, 10 Oct 2023 00:00:00 GMT - The API extracts aspect-based in text records. + **Deprecated**: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT. + We recommend you replace this API with the batch API, `BatchDetectLanguageSentiments`__. + + The DetectLanguageSentiments API extracts aspect-based in text records. For aspect-based sentiment analysis, a set of aspects and their respective sentiment is returned. @@ -2078,6 +2089,7 @@ def detect_language_sentiments(self, detect_language_sentiments_details, **kwarg Limitations: - A record may be up to 1000 characters long. + __ https://docs.cloud.oracle.com/iaas/api/#/en/language/20221001/BatchDetectLanguageSentiments/BatchDetectLanguageSentiments __ https://docs.cloud.oracle.com/iaas/language/using/pretrain-models.htm#sentiment @@ -2164,14 +2176,17 @@ def detect_language_sentiments(self, detect_language_sentiments_details, **kwarg def detect_language_text_classification(self, detect_language_text_classification_details, **kwargs): """ - This API will be retired on Monday, 10 Oct 2023 00:00:00 GMT - The API automatically classifies text into a set of pre-determined classes and sub-classes. A single class/subclass is returned for each record classified. + **Deprecated**: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT. + We recommend you replace this API with the batch API, `BatchDetectLanguageTextClassification`__. + + The DetectLanguageTextClassification API automatically classifies text into a set of pre-determined classes and sub-classes. A single class/subclass is returned for each record classified. Learn more about text classification `here`__. Limitations: - A record may be up to 1000 characters long. + __ https://docs.cloud.oracle.com/iaas/api/#/en/language/20221001/BatchDetectLanguageTextClassification/BatchDetectLanguageTextClassification __ https://docs.cloud.oracle.com/iaas/language/using/pretrain-models.htm#text-class diff --git a/src/oci/ai_language/models/__init__.py b/src/oci/ai_language/models/__init__.py index 72d6c6f927..2a4bec2dd1 100644 --- a/src/oci/ai_language/models/__init__.py +++ b/src/oci/ai_language/models/__init__.py @@ -86,7 +86,6 @@ from .pre_trained_key_phrase_extraction_model_details import PreTrainedKeyPhraseExtractionModelDetails from .pre_trained_language_detection_model_details import PreTrainedLanguageDetectionModelDetails from .pre_trained_named_entity_recognition_model_details import PreTrainedNamedEntityRecognitionModelDetails -from .pre_trained_phi_model_details import PreTrainedPhiModelDetails from .pre_trained_pii_model_details import PreTrainedPiiModelDetails from .pre_trained_sentiment_analysis_model_details import PreTrainedSentimentAnalysisModelDetails from .pre_trained_summarization import PreTrainedSummarization @@ -202,7 +201,6 @@ "PreTrainedKeyPhraseExtractionModelDetails": PreTrainedKeyPhraseExtractionModelDetails, "PreTrainedLanguageDetectionModelDetails": PreTrainedLanguageDetectionModelDetails, "PreTrainedNamedEntityRecognitionModelDetails": PreTrainedNamedEntityRecognitionModelDetails, - "PreTrainedPhiModelDetails": PreTrainedPhiModelDetails, "PreTrainedPiiModelDetails": PreTrainedPiiModelDetails, "PreTrainedSentimentAnalysisModelDetails": PreTrainedSentimentAnalysisModelDetails, "PreTrainedSummarization": PreTrainedSummarization, diff --git a/src/oci/ai_language/models/batch_detect_dominant_language_details.py b/src/oci/ai_language/models/batch_detect_dominant_language_details.py index 3da004b99e..5b705c7037 100644 --- a/src/oci/ai_language/models/batch_detect_dominant_language_details.py +++ b/src/oci/ai_language/models/batch_detect_dominant_language_details.py @@ -20,6 +20,18 @@ def __init__(self, **kwargs): Initializes a new BatchDetectDominantLanguageDetails object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class): + :param should_ignore_transliteration: + The value to assign to the should_ignore_transliteration property of this BatchDetectDominantLanguageDetails. + :type should_ignore_transliteration: bool + + :param chars_to_consider: + The value to assign to the chars_to_consider property of this BatchDetectDominantLanguageDetails. + :type chars_to_consider: int + + :param endpoint_id: + The value to assign to the endpoint_id property of this BatchDetectDominantLanguageDetails. + :type endpoint_id: str + :param compartment_id: The value to assign to the compartment_id property of this BatchDetectDominantLanguageDetails. :type compartment_id: str @@ -30,18 +42,107 @@ def __init__(self, **kwargs): """ self.swagger_types = { + 'should_ignore_transliteration': 'bool', + 'chars_to_consider': 'int', + 'endpoint_id': 'str', 'compartment_id': 'str', 'documents': 'list[DominantLanguageDocument]' } self.attribute_map = { + 'should_ignore_transliteration': 'shouldIgnoreTransliteration', + 'chars_to_consider': 'charsToConsider', + 'endpoint_id': 'endpointId', 'compartment_id': 'compartmentId', 'documents': 'documents' } + self._should_ignore_transliteration = None + self._chars_to_consider = None + self._endpoint_id = None self._compartment_id = None self._documents = None + @property + def should_ignore_transliteration(self): + """ + Gets the should_ignore_transliteration of this BatchDetectDominantLanguageDetails. + Specifies whether to consider or ignore transliteration. For example \"hi, aap kaise ho? sab kuch teek hai? I will call you tomorrow.\" would be detected as English when ignore transliteration=true, Hindi when ignoreTransliteration=false. + + + :return: The should_ignore_transliteration of this BatchDetectDominantLanguageDetails. + :rtype: bool + """ + return self._should_ignore_transliteration + + @should_ignore_transliteration.setter + def should_ignore_transliteration(self, should_ignore_transliteration): + """ + Sets the should_ignore_transliteration of this BatchDetectDominantLanguageDetails. + Specifies whether to consider or ignore transliteration. For example \"hi, aap kaise ho? sab kuch teek hai? I will call you tomorrow.\" would be detected as English when ignore transliteration=true, Hindi when ignoreTransliteration=false. + + + :param should_ignore_transliteration: The should_ignore_transliteration of this BatchDetectDominantLanguageDetails. + :type: bool + """ + self._should_ignore_transliteration = should_ignore_transliteration + + @property + def chars_to_consider(self): + """ + Gets the chars_to_consider of this BatchDetectDominantLanguageDetails. + default value is None. + Specifies maximum number of characters to consider for determining the dominant language. + If unspecified, then optimum number characters will be considered. + If 0 is specified then all the characters are used to determine the language. + If the value is greater than 0, then specified number of characters will be considered from the beginning of the text. + + + :return: The chars_to_consider of this BatchDetectDominantLanguageDetails. + :rtype: int + """ + return self._chars_to_consider + + @chars_to_consider.setter + def chars_to_consider(self, chars_to_consider): + """ + Sets the chars_to_consider of this BatchDetectDominantLanguageDetails. + default value is None. + Specifies maximum number of characters to consider for determining the dominant language. + If unspecified, then optimum number characters will be considered. + If 0 is specified then all the characters are used to determine the language. + If the value is greater than 0, then specified number of characters will be considered from the beginning of the text. + + + :param chars_to_consider: The chars_to_consider of this BatchDetectDominantLanguageDetails. + :type: int + """ + self._chars_to_consider = chars_to_consider + + @property + def endpoint_id(self): + """ + Gets the endpoint_id of this BatchDetectDominantLanguageDetails. + The endpoint which have to be used for inferencing. If endpointId and compartmentId is provided, then inference will be served from custom model which is mapped to this Endpoint. + + + :return: The endpoint_id of this BatchDetectDominantLanguageDetails. + :rtype: str + """ + return self._endpoint_id + + @endpoint_id.setter + def endpoint_id(self, endpoint_id): + """ + Sets the endpoint_id of this BatchDetectDominantLanguageDetails. + The endpoint which have to be used for inferencing. If endpointId and compartmentId is provided, then inference will be served from custom model which is mapped to this Endpoint. + + + :param endpoint_id: The endpoint_id of this BatchDetectDominantLanguageDetails. + :type: str + """ + self._endpoint_id = endpoint_id + @property def compartment_id(self): """ diff --git a/src/oci/ai_language/models/batch_detect_language_key_phrases_details.py b/src/oci/ai_language/models/batch_detect_language_key_phrases_details.py index c79ae39e82..ae396f7524 100644 --- a/src/oci/ai_language/models/batch_detect_language_key_phrases_details.py +++ b/src/oci/ai_language/models/batch_detect_language_key_phrases_details.py @@ -20,6 +20,10 @@ def __init__(self, **kwargs): Initializes a new BatchDetectLanguageKeyPhrasesDetails object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class): + :param endpoint_id: + The value to assign to the endpoint_id property of this BatchDetectLanguageKeyPhrasesDetails. + :type endpoint_id: str + :param compartment_id: The value to assign to the compartment_id property of this BatchDetectLanguageKeyPhrasesDetails. :type compartment_id: str @@ -30,18 +34,45 @@ def __init__(self, **kwargs): """ self.swagger_types = { + 'endpoint_id': 'str', 'compartment_id': 'str', 'documents': 'list[TextDocument]' } self.attribute_map = { + 'endpoint_id': 'endpointId', 'compartment_id': 'compartmentId', 'documents': 'documents' } + self._endpoint_id = None self._compartment_id = None self._documents = None + @property + def endpoint_id(self): + """ + Gets the endpoint_id of this BatchDetectLanguageKeyPhrasesDetails. + The endpoint which have to be used for inferencing. If endpointId and compartmentId is provided, then inference will be served from custom model which is mapped to this Endpoint. + + + :return: The endpoint_id of this BatchDetectLanguageKeyPhrasesDetails. + :rtype: str + """ + return self._endpoint_id + + @endpoint_id.setter + def endpoint_id(self, endpoint_id): + """ + Sets the endpoint_id of this BatchDetectLanguageKeyPhrasesDetails. + The endpoint which have to be used for inferencing. If endpointId and compartmentId is provided, then inference will be served from custom model which is mapped to this Endpoint. + + + :param endpoint_id: The endpoint_id of this BatchDetectLanguageKeyPhrasesDetails. + :type: str + """ + self._endpoint_id = endpoint_id + @property def compartment_id(self): """ diff --git a/src/oci/ai_language/models/batch_detect_language_pii_entities_details.py b/src/oci/ai_language/models/batch_detect_language_pii_entities_details.py index 69b6ebbdd1..13b4a6d27d 100644 --- a/src/oci/ai_language/models/batch_detect_language_pii_entities_details.py +++ b/src/oci/ai_language/models/batch_detect_language_pii_entities_details.py @@ -20,6 +20,10 @@ def __init__(self, **kwargs): Initializes a new BatchDetectLanguagePiiEntitiesDetails object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class): + :param endpoint_id: + The value to assign to the endpoint_id property of this BatchDetectLanguagePiiEntitiesDetails. + :type endpoint_id: str + :param compartment_id: The value to assign to the compartment_id property of this BatchDetectLanguagePiiEntitiesDetails. :type compartment_id: str @@ -34,21 +38,48 @@ def __init__(self, **kwargs): """ self.swagger_types = { + 'endpoint_id': 'str', 'compartment_id': 'str', 'documents': 'list[TextDocument]', 'masking': 'dict(str, PiiEntityMasking)' } self.attribute_map = { + 'endpoint_id': 'endpointId', 'compartment_id': 'compartmentId', 'documents': 'documents', 'masking': 'masking' } + self._endpoint_id = None self._compartment_id = None self._documents = None self._masking = None + @property + def endpoint_id(self): + """ + Gets the endpoint_id of this BatchDetectLanguagePiiEntitiesDetails. + The endpoint which have to be used for inferencing. If endpointId and compartmentId is provided, then inference will be served from custom model which is mapped to this Endpoint. + + + :return: The endpoint_id of this BatchDetectLanguagePiiEntitiesDetails. + :rtype: str + """ + return self._endpoint_id + + @endpoint_id.setter + def endpoint_id(self, endpoint_id): + """ + Sets the endpoint_id of this BatchDetectLanguagePiiEntitiesDetails. + The endpoint which have to be used for inferencing. If endpointId and compartmentId is provided, then inference will be served from custom model which is mapped to this Endpoint. + + + :param endpoint_id: The endpoint_id of this BatchDetectLanguagePiiEntitiesDetails. + :type: str + """ + self._endpoint_id = endpoint_id + @property def compartment_id(self): """ diff --git a/src/oci/ai_language/models/batch_detect_language_sentiments_details.py b/src/oci/ai_language/models/batch_detect_language_sentiments_details.py index 4d6231c0ba..bb4c6ad980 100644 --- a/src/oci/ai_language/models/batch_detect_language_sentiments_details.py +++ b/src/oci/ai_language/models/batch_detect_language_sentiments_details.py @@ -20,6 +20,10 @@ def __init__(self, **kwargs): Initializes a new BatchDetectLanguageSentimentsDetails object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class): + :param endpoint_id: + The value to assign to the endpoint_id property of this BatchDetectLanguageSentimentsDetails. + :type endpoint_id: str + :param compartment_id: The value to assign to the compartment_id property of this BatchDetectLanguageSentimentsDetails. :type compartment_id: str @@ -30,18 +34,45 @@ def __init__(self, **kwargs): """ self.swagger_types = { + 'endpoint_id': 'str', 'compartment_id': 'str', 'documents': 'list[TextDocument]' } self.attribute_map = { + 'endpoint_id': 'endpointId', 'compartment_id': 'compartmentId', 'documents': 'documents' } + self._endpoint_id = None self._compartment_id = None self._documents = None + @property + def endpoint_id(self): + """ + Gets the endpoint_id of this BatchDetectLanguageSentimentsDetails. + The endpoint which have to be used for inferencing. If endpointId and compartmentId is provided, then inference will be served from custom model which is mapped to this Endpoint. + + + :return: The endpoint_id of this BatchDetectLanguageSentimentsDetails. + :rtype: str + """ + return self._endpoint_id + + @endpoint_id.setter + def endpoint_id(self, endpoint_id): + """ + Sets the endpoint_id of this BatchDetectLanguageSentimentsDetails. + The endpoint which have to be used for inferencing. If endpointId and compartmentId is provided, then inference will be served from custom model which is mapped to this Endpoint. + + + :param endpoint_id: The endpoint_id of this BatchDetectLanguageSentimentsDetails. + :type: str + """ + self._endpoint_id = endpoint_id + @property def compartment_id(self): """ diff --git a/src/oci/ai_language/models/batch_language_translation_details.py b/src/oci/ai_language/models/batch_language_translation_details.py index ed3951461f..2c367d27aa 100644 --- a/src/oci/ai_language/models/batch_language_translation_details.py +++ b/src/oci/ai_language/models/batch_language_translation_details.py @@ -82,30 +82,37 @@ def target_language_code(self): """ Gets the target_language_code of this BatchLanguageTranslationDetails. Language code supported - - auto : Automatically detect language - - ar : Arabic - - pt-BR : Brazilian Portuguese - - cs : Czech - - da : Danish - - nl : Dutch - - en : English - - fi : Finnish - - fr : French - - fr-CA : Canadian French - - de : German - - it : Italian - - ja : Japanese - - ko : Korean - - no : Norwegian - - pl : Polish - - ro : Romanian - - zh-CN : Simplified Chinese - - es : Spanish - - sv : Swedish - - zh-TW : Traditional Chinese - - tr : Turkish - - el : Greek - - he : Hebrew + Arabic - ar + Brazilian Portuguese - pt-BR + Canadian French - fr-CA + Croatian - hr + Czech - cs + Danish - da + Dutch - nl + English - en + Finnish - fi + French - fr + German - de + Greek - el + Hebrew - he + Hungarian - hu + Italian - it + Japanese - ja + Korean - ko + Norwegian - no + Polish - pl + Portuguese - pt + Romanian - ro + Russian - ru + Simplified Chinese - zh-CN + Slovak - sk + Slovenian - sl + Spanish - es + Swedish - sv + Thai - th + Traditional Chinese - zh-TW + Turkish - tr + Vietnamese - vi :return: The target_language_code of this BatchLanguageTranslationDetails. @@ -118,30 +125,37 @@ def target_language_code(self, target_language_code): """ Sets the target_language_code of this BatchLanguageTranslationDetails. Language code supported - - auto : Automatically detect language - - ar : Arabic - - pt-BR : Brazilian Portuguese - - cs : Czech - - da : Danish - - nl : Dutch - - en : English - - fi : Finnish - - fr : French - - fr-CA : Canadian French - - de : German - - it : Italian - - ja : Japanese - - ko : Korean - - no : Norwegian - - pl : Polish - - ro : Romanian - - zh-CN : Simplified Chinese - - es : Spanish - - sv : Swedish - - zh-TW : Traditional Chinese - - tr : Turkish - - el : Greek - - he : Hebrew + Arabic - ar + Brazilian Portuguese - pt-BR + Canadian French - fr-CA + Croatian - hr + Czech - cs + Danish - da + Dutch - nl + English - en + Finnish - fi + French - fr + German - de + Greek - el + Hebrew - he + Hungarian - hu + Italian - it + Japanese - ja + Korean - ko + Norwegian - no + Polish - pl + Portuguese - pt + Romanian - ro + Russian - ru + Simplified Chinese - zh-CN + Slovak - sk + Slovenian - sl + Spanish - es + Swedish - sv + Thai - th + Traditional Chinese - zh-TW + Turkish - tr + Vietnamese - vi :param target_language_code: The target_language_code of this BatchLanguageTranslationDetails. diff --git a/src/oci/ai_language/models/endpoint.py b/src/oci/ai_language/models/endpoint.py index e506db0817..3850b3e272 100644 --- a/src/oci/ai_language/models/endpoint.py +++ b/src/oci/ai_language/models/endpoint.py @@ -100,7 +100,7 @@ def __init__(self, **kwargs): :param system_tags: The value to assign to the system_tags property of this Endpoint. - :type system_tags: dict(str, object) + :type system_tags: dict(str, dict(str, object)) """ self.swagger_types = { @@ -117,7 +117,7 @@ def __init__(self, **kwargs): 'model_id': 'str', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))', - 'system_tags': 'dict(str, object)' + 'system_tags': 'dict(str, dict(str, object))' } self.attribute_map = { @@ -495,7 +495,7 @@ def system_tags(self): :return: The system_tags of this Endpoint. - :rtype: dict(str, object) + :rtype: dict(str, dict(str, object)) """ return self._system_tags @@ -508,7 +508,7 @@ def system_tags(self, system_tags): :param system_tags: The system_tags of this Endpoint. - :type: dict(str, object) + :type: dict(str, dict(str, object)) """ self._system_tags = system_tags diff --git a/src/oci/ai_language/models/endpoint_summary.py b/src/oci/ai_language/models/endpoint_summary.py index 9f9455f3e6..f0684a95f5 100644 --- a/src/oci/ai_language/models/endpoint_summary.py +++ b/src/oci/ai_language/models/endpoint_summary.py @@ -70,7 +70,7 @@ def __init__(self, **kwargs): :param system_tags: The value to assign to the system_tags property of this EndpointSummary. - :type system_tags: dict(str, object) + :type system_tags: dict(str, dict(str, object)) """ self.swagger_types = { @@ -86,7 +86,7 @@ def __init__(self, **kwargs): 'model_id': 'str', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))', - 'system_tags': 'dict(str, object)' + 'system_tags': 'dict(str, dict(str, object))' } self.attribute_map = { @@ -432,7 +432,7 @@ def system_tags(self): :return: The system_tags of this EndpointSummary. - :rtype: dict(str, object) + :rtype: dict(str, dict(str, object)) """ return self._system_tags @@ -445,7 +445,7 @@ def system_tags(self, system_tags): :param system_tags: The system_tags of this EndpointSummary. - :type: dict(str, object) + :type: dict(str, dict(str, object)) """ self._system_tags = system_tags diff --git a/src/oci/ai_language/models/model.py b/src/oci/ai_language/models/model.py index da8676aa5d..fcc1568e7f 100644 --- a/src/oci/ai_language/models/model.py +++ b/src/oci/ai_language/models/model.py @@ -112,7 +112,7 @@ def __init__(self, **kwargs): :param system_tags: The value to assign to the system_tags property of this Model. - :type system_tags: dict(str, object) + :type system_tags: dict(str, dict(str, object)) """ self.swagger_types = { @@ -132,7 +132,7 @@ def __init__(self, **kwargs): 'version': 'str', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))', - 'system_tags': 'dict(str, object)' + 'system_tags': 'dict(str, dict(str, object))' } self.attribute_map = { @@ -488,7 +488,7 @@ def version(self): """ Gets the version of this Model. For pre trained models this will identify model type version used for model creation - For custom identifying the model by model id is difficult. This param provides ease of use for end customer. + For custom this will identify model type version used for model creation and custom model on which training has to be done <>::<>_<>::<> ex: ai-lang::NER_V1::CUSTOM-V0 @@ -503,7 +503,7 @@ def version(self, version): """ Sets the version of this Model. For pre trained models this will identify model type version used for model creation - For custom identifying the model by model id is difficult. This param provides ease of use for end customer. + For custom this will identify model type version used for model creation and custom model on which training has to be done <>::<>_<>::<> ex: ai-lang::NER_V1::CUSTOM-V0 @@ -574,7 +574,7 @@ def system_tags(self): :return: The system_tags of this Model. - :rtype: dict(str, object) + :rtype: dict(str, dict(str, object)) """ return self._system_tags @@ -587,7 +587,7 @@ def system_tags(self, system_tags): :param system_tags: The system_tags of this Model. - :type: dict(str, object) + :type: dict(str, dict(str, object)) """ self._system_tags = system_tags diff --git a/src/oci/ai_language/models/model_details.py b/src/oci/ai_language/models/model_details.py index f0449b493c..8da9fe666c 100644 --- a/src/oci/ai_language/models/model_details.py +++ b/src/oci/ai_language/models/model_details.py @@ -75,7 +75,6 @@ def __init__(self, **kwargs): * :class:`~oci.ai_language.models.PreTrainedLanguageDetectionModelDetails` * :class:`~oci.ai_language.models.PreTrainedNamedEntityRecognitionModelDetails` * :class:`~oci.ai_language.models.PreTrainedSentimentAnalysisModelDetails` - * :class:`~oci.ai_language.models.PreTrainedPhiModelDetails` * :class:`~oci.ai_language.models.PreTrainedTextClassificationModelDetails` * :class:`~oci.ai_language.models.TextClassificationModelDetails` * :class:`~oci.ai_language.models.PreTrainedSummarization` @@ -136,9 +135,6 @@ def get_subtype(object_dictionary): if type == 'PRE_TRAINED_SENTIMENT_ANALYSIS': return 'PreTrainedSentimentAnalysisModelDetails' - if type == 'PRE_TRAINED_PHI': - return 'PreTrainedPhiModelDetails' - if type == 'PRE_TRAINED_TEXT_CLASSIFICATION': return 'PreTrainedTextClassificationModelDetails' diff --git a/src/oci/ai_language/models/model_summary.py b/src/oci/ai_language/models/model_summary.py index fa7cc61373..01e9126394 100644 --- a/src/oci/ai_language/models/model_summary.py +++ b/src/oci/ai_language/models/model_summary.py @@ -70,7 +70,7 @@ def __init__(self, **kwargs): :param system_tags: The value to assign to the system_tags property of this ModelSummary. - :type system_tags: dict(str, object) + :type system_tags: dict(str, dict(str, object)) """ self.swagger_types = { @@ -86,7 +86,7 @@ def __init__(self, **kwargs): 'version': 'str', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))', - 'system_tags': 'dict(str, object)' + 'system_tags': 'dict(str, dict(str, object))' } self.attribute_map = { @@ -344,8 +344,8 @@ def version(self): """ Gets the version of this ModelSummary. For pre trained models this will identify model type version used for model creation - For custom identifying the model by model id is difficult. This param provides ease of use for end customer. - <>::<>-<>::<> + For custom this will identify model type version used for model creation and custom model on which training has to be done + <>::<>_<>::<> ex: ai-lang::NER_V1::CUSTOM-V0 @@ -359,8 +359,8 @@ def version(self, version): """ Sets the version of this ModelSummary. For pre trained models this will identify model type version used for model creation - For custom identifying the model by model id is difficult. This param provides ease of use for end customer. - <>::<>-<>::<> + For custom this will identify model type version used for model creation and custom model on which training has to be done + <>::<>_<>::<> ex: ai-lang::NER_V1::CUSTOM-V0 @@ -430,7 +430,7 @@ def system_tags(self): :return: The system_tags of this ModelSummary. - :rtype: dict(str, object) + :rtype: dict(str, dict(str, object)) """ return self._system_tags @@ -443,7 +443,7 @@ def system_tags(self, system_tags): :param system_tags: The system_tags of this ModelSummary. - :type: dict(str, object) + :type: dict(str, dict(str, object)) """ self._system_tags = system_tags diff --git a/src/oci/ai_language/models/project.py b/src/oci/ai_language/models/project.py index 2cb9ff9974..f0649fed73 100644 --- a/src/oci/ai_language/models/project.py +++ b/src/oci/ai_language/models/project.py @@ -88,7 +88,7 @@ def __init__(self, **kwargs): :param system_tags: The value to assign to the system_tags property of this Project. - :type system_tags: dict(str, object) + :type system_tags: dict(str, dict(str, object)) """ self.swagger_types = { @@ -102,7 +102,7 @@ def __init__(self, **kwargs): 'lifecycle_details': 'str', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))', - 'system_tags': 'dict(str, object)' + 'system_tags': 'dict(str, dict(str, object))' } self.attribute_map = { @@ -402,7 +402,7 @@ def system_tags(self): :return: The system_tags of this Project. - :rtype: dict(str, object) + :rtype: dict(str, dict(str, object)) """ return self._system_tags @@ -415,7 +415,7 @@ def system_tags(self, system_tags): :param system_tags: The system_tags of this Project. - :type: dict(str, object) + :type: dict(str, dict(str, object)) """ self._system_tags = system_tags diff --git a/src/oci/ai_language/models/project_summary.py b/src/oci/ai_language/models/project_summary.py index b4b75e0aef..3ee0c2eb67 100644 --- a/src/oci/ai_language/models/project_summary.py +++ b/src/oci/ai_language/models/project_summary.py @@ -62,7 +62,7 @@ def __init__(self, **kwargs): :param system_tags: The value to assign to the system_tags property of this ProjectSummary. - :type system_tags: dict(str, object) + :type system_tags: dict(str, dict(str, object)) """ self.swagger_types = { @@ -76,7 +76,7 @@ def __init__(self, **kwargs): 'lifecycle_details': 'str', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))', - 'system_tags': 'dict(str, object)' + 'system_tags': 'dict(str, dict(str, object))' } self.attribute_map = { @@ -370,7 +370,7 @@ def system_tags(self): :return: The system_tags of this ProjectSummary. - :rtype: dict(str, object) + :rtype: dict(str, dict(str, object)) """ return self._system_tags @@ -383,7 +383,7 @@ def system_tags(self, system_tags): :param system_tags: The system_tags of this ProjectSummary. - :type: dict(str, object) + :type: dict(str, dict(str, object)) """ self._system_tags = system_tags diff --git a/src/oci/ai_language/models/translation_document_result.py b/src/oci/ai_language/models/translation_document_result.py index 1b2d821c1f..e0c2eab12b 100644 --- a/src/oci/ai_language/models/translation_document_result.py +++ b/src/oci/ai_language/models/translation_document_result.py @@ -108,31 +108,9 @@ def translated_text(self, translated_text): def source_language_code(self): """ **[Required]** Gets the source_language_code of this TranslationDocumentResult. - Language code supported - - auto : Automatically detect language - - ar : Arabic - - pt-BR : Brazilian Portuguese - - cs : Czech - - da : Danish - - nl : Dutch - - en : English - - fi : Finnish - - fr : French - - fr-CA : Canadian French - - de : German - - it : Italian - - ja : Japanese - - ko : Korean - - no : Norwegian - - pl : Polish - - ro : Romanian - - zh-CN : Simplified Chinese - - es : Spanish - - sv : Swedish - - zh-TW : Traditional Chinese - - tr : Turkish - - el : Greek - - he : Hebrew + Language code of the document. Please refer to respective model `API documentation`__ for supported languages. + + __ https://docs.cloud.oracle.com/iaas/language/using/overview.htm :return: The source_language_code of this TranslationDocumentResult. @@ -144,31 +122,9 @@ def source_language_code(self): def source_language_code(self, source_language_code): """ Sets the source_language_code of this TranslationDocumentResult. - Language code supported - - auto : Automatically detect language - - ar : Arabic - - pt-BR : Brazilian Portuguese - - cs : Czech - - da : Danish - - nl : Dutch - - en : English - - fi : Finnish - - fr : French - - fr-CA : Canadian French - - de : German - - it : Italian - - ja : Japanese - - ko : Korean - - no : Norwegian - - pl : Polish - - ro : Romanian - - zh-CN : Simplified Chinese - - es : Spanish - - sv : Swedish - - zh-TW : Traditional Chinese - - tr : Turkish - - el : Greek - - he : Hebrew + Language code of the document. Please refer to respective model `API documentation`__ for supported languages. + + __ https://docs.cloud.oracle.com/iaas/language/using/overview.htm :param source_language_code: The source_language_code of this TranslationDocumentResult. @@ -180,31 +136,9 @@ def source_language_code(self, source_language_code): def target_language_code(self): """ **[Required]** Gets the target_language_code of this TranslationDocumentResult. - Language code supported - - auto : Automatically detect language - - ar : Arabic - - pt-BR : Brazilian Portuguese - - cs : Czech - - da : Danish - - nl : Dutch - - en : English - - fi : Finnish - - fr : French - - fr-CA : Canadian French - - de : German - - it : Italian - - ja : Japanese - - ko : Korean - - no : Norwegian - - pl : Polish - - ro : Romanian - - zh-CN : Simplified Chinese - - es : Spanish - - sv : Swedish - - zh-TW : Traditional Chinese - - tr : Turkish - - el : Greek - - he : Hebrew + Language code of the document. Please refer to respective model `API documentation`__ for supported languages. + + __ https://docs.cloud.oracle.com/iaas/language/using/overview.htm :return: The target_language_code of this TranslationDocumentResult. @@ -216,31 +150,9 @@ def target_language_code(self): def target_language_code(self, target_language_code): """ Sets the target_language_code of this TranslationDocumentResult. - Language code supported - - auto : Automatically detect language - - ar : Arabic - - pt-BR : Brazilian Portuguese - - cs : Czech - - da : Danish - - nl : Dutch - - en : English - - fi : Finnish - - fr : French - - fr-CA : Canadian French - - de : German - - it : Italian - - ja : Japanese - - ko : Korean - - no : Norwegian - - pl : Polish - - ro : Romanian - - zh-CN : Simplified Chinese - - es : Spanish - - sv : Swedish - - zh-TW : Traditional Chinese - - tr : Turkish - - el : Greek - - he : Hebrew + Language code of the document. Please refer to respective model `API documentation`__ for supported languages. + + __ https://docs.cloud.oracle.com/iaas/language/using/overview.htm :param target_language_code: The target_language_code of this TranslationDocumentResult. diff --git a/src/oci/core/models/__init__.py b/src/oci/core/models/__init__.py index 4aabde0012..61d9b03f52 100644 --- a/src/oci/core/models/__init__.py +++ b/src/oci/core/models/__init__.py @@ -31,6 +31,7 @@ from .amd_rome_bm_platform_config import AmdRomeBmPlatformConfig from .amd_vm_launch_instance_platform_config import AmdVmLaunchInstancePlatformConfig from .amd_vm_platform_config import AmdVmPlatformConfig +from .amd_vm_update_instance_platform_config import AmdVmUpdateInstancePlatformConfig from .app_catalog_listing import AppCatalogListing from .app_catalog_listing_resource_version import AppCatalogListingResourceVersion from .app_catalog_listing_resource_version_agreements import AppCatalogListingResourceVersionAgreements @@ -373,6 +374,7 @@ from .intel_skylake_bm_platform_config import IntelSkylakeBmPlatformConfig from .intel_vm_launch_instance_platform_config import IntelVmLaunchInstancePlatformConfig from .intel_vm_platform_config import IntelVmPlatformConfig +from .intel_vm_update_instance_platform_config import IntelVmUpdateInstancePlatformConfig from .internet_gateway import InternetGateway from .ipsec_tunnel_drg_attachment_network_details import IpsecTunnelDrgAttachmentNetworkDetails from .ipv6 import Ipv6 @@ -506,6 +508,7 @@ from .update_instance_configuration_details import UpdateInstanceConfigurationDetails from .update_instance_console_connection_details import UpdateInstanceConsoleConnectionDetails from .update_instance_details import UpdateInstanceDetails +from .update_instance_platform_config import UpdateInstancePlatformConfig from .update_instance_pool_details import UpdateInstancePoolDetails from .update_instance_pool_placement_configuration_details import UpdateInstancePoolPlacementConfigurationDetails from .update_instance_shape_config_details import UpdateInstanceShapeConfigDetails @@ -607,6 +610,7 @@ "AmdRomeBmPlatformConfig": AmdRomeBmPlatformConfig, "AmdVmLaunchInstancePlatformConfig": AmdVmLaunchInstancePlatformConfig, "AmdVmPlatformConfig": AmdVmPlatformConfig, + "AmdVmUpdateInstancePlatformConfig": AmdVmUpdateInstancePlatformConfig, "AppCatalogListing": AppCatalogListing, "AppCatalogListingResourceVersion": AppCatalogListingResourceVersion, "AppCatalogListingResourceVersionAgreements": AppCatalogListingResourceVersionAgreements, @@ -949,6 +953,7 @@ "IntelSkylakeBmPlatformConfig": IntelSkylakeBmPlatformConfig, "IntelVmLaunchInstancePlatformConfig": IntelVmLaunchInstancePlatformConfig, "IntelVmPlatformConfig": IntelVmPlatformConfig, + "IntelVmUpdateInstancePlatformConfig": IntelVmUpdateInstancePlatformConfig, "InternetGateway": InternetGateway, "IpsecTunnelDrgAttachmentNetworkDetails": IpsecTunnelDrgAttachmentNetworkDetails, "Ipv6": Ipv6, @@ -1082,6 +1087,7 @@ "UpdateInstanceConfigurationDetails": UpdateInstanceConfigurationDetails, "UpdateInstanceConsoleConnectionDetails": UpdateInstanceConsoleConnectionDetails, "UpdateInstanceDetails": UpdateInstanceDetails, + "UpdateInstancePlatformConfig": UpdateInstancePlatformConfig, "UpdateInstancePoolDetails": UpdateInstancePoolDetails, "UpdateInstancePoolPlacementConfigurationDetails": UpdateInstancePoolPlacementConfigurationDetails, "UpdateInstanceShapeConfigDetails": UpdateInstanceShapeConfigDetails, diff --git a/src/oci/core/models/amd_vm_launch_instance_platform_config.py b/src/oci/core/models/amd_vm_launch_instance_platform_config.py index 8fe39edd43..d1ee7a0bc3 100644 --- a/src/oci/core/models/amd_vm_launch_instance_platform_config.py +++ b/src/oci/core/models/amd_vm_launch_instance_platform_config.py @@ -42,13 +42,18 @@ def __init__(self, **kwargs): The value to assign to the is_memory_encryption_enabled property of this AmdVmLaunchInstancePlatformConfig. :type is_memory_encryption_enabled: bool + :param is_symmetric_multi_threading_enabled: + The value to assign to the is_symmetric_multi_threading_enabled property of this AmdVmLaunchInstancePlatformConfig. + :type is_symmetric_multi_threading_enabled: bool + """ self.swagger_types = { 'type': 'str', 'is_secure_boot_enabled': 'bool', 'is_trusted_platform_module_enabled': 'bool', 'is_measured_boot_enabled': 'bool', - 'is_memory_encryption_enabled': 'bool' + 'is_memory_encryption_enabled': 'bool', + 'is_symmetric_multi_threading_enabled': 'bool' } self.attribute_map = { @@ -56,7 +61,8 @@ def __init__(self, **kwargs): 'is_secure_boot_enabled': 'isSecureBootEnabled', 'is_trusted_platform_module_enabled': 'isTrustedPlatformModuleEnabled', 'is_measured_boot_enabled': 'isMeasuredBootEnabled', - 'is_memory_encryption_enabled': 'isMemoryEncryptionEnabled' + 'is_memory_encryption_enabled': 'isMemoryEncryptionEnabled', + 'is_symmetric_multi_threading_enabled': 'isSymmetricMultiThreadingEnabled' } self._type = None @@ -64,8 +70,45 @@ def __init__(self, **kwargs): self._is_trusted_platform_module_enabled = None self._is_measured_boot_enabled = None self._is_memory_encryption_enabled = None + self._is_symmetric_multi_threading_enabled = None self._type = 'AMD_VM' + @property + def is_symmetric_multi_threading_enabled(self): + """ + Gets the is_symmetric_multi_threading_enabled of this AmdVmLaunchInstancePlatformConfig. + Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel Hyper-Threading. + + Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + independent threads of execution, to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + can provide higher or more predictable performance for some workloads. + + + :return: The is_symmetric_multi_threading_enabled of this AmdVmLaunchInstancePlatformConfig. + :rtype: bool + """ + return self._is_symmetric_multi_threading_enabled + + @is_symmetric_multi_threading_enabled.setter + def is_symmetric_multi_threading_enabled(self, is_symmetric_multi_threading_enabled): + """ + Sets the is_symmetric_multi_threading_enabled of this AmdVmLaunchInstancePlatformConfig. + Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel Hyper-Threading. + + Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + independent threads of execution, to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + can provide higher or more predictable performance for some workloads. + + + :param is_symmetric_multi_threading_enabled: The is_symmetric_multi_threading_enabled of this AmdVmLaunchInstancePlatformConfig. + :type: bool + """ + self._is_symmetric_multi_threading_enabled = is_symmetric_multi_threading_enabled + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/core/models/amd_vm_platform_config.py b/src/oci/core/models/amd_vm_platform_config.py index c1ea4d46a6..0d9e9c3185 100644 --- a/src/oci/core/models/amd_vm_platform_config.py +++ b/src/oci/core/models/amd_vm_platform_config.py @@ -42,13 +42,18 @@ def __init__(self, **kwargs): The value to assign to the is_memory_encryption_enabled property of this AmdVmPlatformConfig. :type is_memory_encryption_enabled: bool + :param is_symmetric_multi_threading_enabled: + The value to assign to the is_symmetric_multi_threading_enabled property of this AmdVmPlatformConfig. + :type is_symmetric_multi_threading_enabled: bool + """ self.swagger_types = { 'type': 'str', 'is_secure_boot_enabled': 'bool', 'is_trusted_platform_module_enabled': 'bool', 'is_measured_boot_enabled': 'bool', - 'is_memory_encryption_enabled': 'bool' + 'is_memory_encryption_enabled': 'bool', + 'is_symmetric_multi_threading_enabled': 'bool' } self.attribute_map = { @@ -56,7 +61,8 @@ def __init__(self, **kwargs): 'is_secure_boot_enabled': 'isSecureBootEnabled', 'is_trusted_platform_module_enabled': 'isTrustedPlatformModuleEnabled', 'is_measured_boot_enabled': 'isMeasuredBootEnabled', - 'is_memory_encryption_enabled': 'isMemoryEncryptionEnabled' + 'is_memory_encryption_enabled': 'isMemoryEncryptionEnabled', + 'is_symmetric_multi_threading_enabled': 'isSymmetricMultiThreadingEnabled' } self._type = None @@ -64,8 +70,45 @@ def __init__(self, **kwargs): self._is_trusted_platform_module_enabled = None self._is_measured_boot_enabled = None self._is_memory_encryption_enabled = None + self._is_symmetric_multi_threading_enabled = None self._type = 'AMD_VM' + @property + def is_symmetric_multi_threading_enabled(self): + """ + Gets the is_symmetric_multi_threading_enabled of this AmdVmPlatformConfig. + Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel Hyper-Threading. + + Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + independent threads of execution, to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + can provide higher or more predictable performance for some workloads. + + + :return: The is_symmetric_multi_threading_enabled of this AmdVmPlatformConfig. + :rtype: bool + """ + return self._is_symmetric_multi_threading_enabled + + @is_symmetric_multi_threading_enabled.setter + def is_symmetric_multi_threading_enabled(self, is_symmetric_multi_threading_enabled): + """ + Sets the is_symmetric_multi_threading_enabled of this AmdVmPlatformConfig. + Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel Hyper-Threading. + + Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + independent threads of execution, to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + can provide higher or more predictable performance for some workloads. + + + :param is_symmetric_multi_threading_enabled: The is_symmetric_multi_threading_enabled of this AmdVmPlatformConfig. + :type: bool + """ + self._is_symmetric_multi_threading_enabled = is_symmetric_multi_threading_enabled + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/core/models/amd_vm_update_instance_platform_config.py b/src/oci/core/models/amd_vm_update_instance_platform_config.py new file mode 100644 index 0000000000..93055362b5 --- /dev/null +++ b/src/oci/core/models/amd_vm_update_instance_platform_config.py @@ -0,0 +1,94 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20160918 + +from .update_instance_platform_config import UpdateInstancePlatformConfig +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 AmdVmUpdateInstancePlatformConfig(UpdateInstancePlatformConfig): + """ + The platform configuration used when updating a virtual machine instance with the AMD platform. + """ + + def __init__(self, **kwargs): + """ + Initializes a new AmdVmUpdateInstancePlatformConfig object with values from keyword arguments. The default value of the :py:attr:`~oci.core.models.AmdVmUpdateInstancePlatformConfig.type` attribute + of this class is ``AMD_VM`` and it should not be changed. + 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 AmdVmUpdateInstancePlatformConfig. + Allowed values for this property are: "AMD_VM", "INTEL_VM" + :type type: str + + :param is_symmetric_multi_threading_enabled: + The value to assign to the is_symmetric_multi_threading_enabled property of this AmdVmUpdateInstancePlatformConfig. + :type is_symmetric_multi_threading_enabled: bool + + """ + self.swagger_types = { + 'type': 'str', + 'is_symmetric_multi_threading_enabled': 'bool' + } + + self.attribute_map = { + 'type': 'type', + 'is_symmetric_multi_threading_enabled': 'isSymmetricMultiThreadingEnabled' + } + + self._type = None + self._is_symmetric_multi_threading_enabled = None + self._type = 'AMD_VM' + + @property + def is_symmetric_multi_threading_enabled(self): + """ + Gets the is_symmetric_multi_threading_enabled of this AmdVmUpdateInstancePlatformConfig. + Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel Hyper-Threading. + + Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + independent threads of execution, to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + can provide higher or more predictable performance for some workloads. + + + :return: The is_symmetric_multi_threading_enabled of this AmdVmUpdateInstancePlatformConfig. + :rtype: bool + """ + return self._is_symmetric_multi_threading_enabled + + @is_symmetric_multi_threading_enabled.setter + def is_symmetric_multi_threading_enabled(self, is_symmetric_multi_threading_enabled): + """ + Sets the is_symmetric_multi_threading_enabled of this AmdVmUpdateInstancePlatformConfig. + Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel Hyper-Threading. + + Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + independent threads of execution, to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + can provide higher or more predictable performance for some workloads. + + + :param is_symmetric_multi_threading_enabled: The is_symmetric_multi_threading_enabled of this AmdVmUpdateInstancePlatformConfig. + :type: bool + """ + self._is_symmetric_multi_threading_enabled = is_symmetric_multi_threading_enabled + + 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/core/models/instance_configuration_amd_vm_launch_instance_platform_config.py b/src/oci/core/models/instance_configuration_amd_vm_launch_instance_platform_config.py index 5a59bd3db1..1dd57fd561 100644 --- a/src/oci/core/models/instance_configuration_amd_vm_launch_instance_platform_config.py +++ b/src/oci/core/models/instance_configuration_amd_vm_launch_instance_platform_config.py @@ -42,13 +42,18 @@ def __init__(self, **kwargs): The value to assign to the is_memory_encryption_enabled property of this InstanceConfigurationAmdVmLaunchInstancePlatformConfig. :type is_memory_encryption_enabled: bool + :param is_symmetric_multi_threading_enabled: + The value to assign to the is_symmetric_multi_threading_enabled property of this InstanceConfigurationAmdVmLaunchInstancePlatformConfig. + :type is_symmetric_multi_threading_enabled: bool + """ self.swagger_types = { 'type': 'str', 'is_secure_boot_enabled': 'bool', 'is_trusted_platform_module_enabled': 'bool', 'is_measured_boot_enabled': 'bool', - 'is_memory_encryption_enabled': 'bool' + 'is_memory_encryption_enabled': 'bool', + 'is_symmetric_multi_threading_enabled': 'bool' } self.attribute_map = { @@ -56,7 +61,8 @@ def __init__(self, **kwargs): 'is_secure_boot_enabled': 'isSecureBootEnabled', 'is_trusted_platform_module_enabled': 'isTrustedPlatformModuleEnabled', 'is_measured_boot_enabled': 'isMeasuredBootEnabled', - 'is_memory_encryption_enabled': 'isMemoryEncryptionEnabled' + 'is_memory_encryption_enabled': 'isMemoryEncryptionEnabled', + 'is_symmetric_multi_threading_enabled': 'isSymmetricMultiThreadingEnabled' } self._type = None @@ -64,8 +70,45 @@ def __init__(self, **kwargs): self._is_trusted_platform_module_enabled = None self._is_measured_boot_enabled = None self._is_memory_encryption_enabled = None + self._is_symmetric_multi_threading_enabled = None self._type = 'AMD_VM' + @property + def is_symmetric_multi_threading_enabled(self): + """ + Gets the is_symmetric_multi_threading_enabled of this InstanceConfigurationAmdVmLaunchInstancePlatformConfig. + Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel Hyper-Threading. + + Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + independent threads of execution, to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + can provide higher or more predictable performance for some workloads. + + + :return: The is_symmetric_multi_threading_enabled of this InstanceConfigurationAmdVmLaunchInstancePlatformConfig. + :rtype: bool + """ + return self._is_symmetric_multi_threading_enabled + + @is_symmetric_multi_threading_enabled.setter + def is_symmetric_multi_threading_enabled(self, is_symmetric_multi_threading_enabled): + """ + Sets the is_symmetric_multi_threading_enabled of this InstanceConfigurationAmdVmLaunchInstancePlatformConfig. + Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel Hyper-Threading. + + Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + independent threads of execution, to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + can provide higher or more predictable performance for some workloads. + + + :param is_symmetric_multi_threading_enabled: The is_symmetric_multi_threading_enabled of this InstanceConfigurationAmdVmLaunchInstancePlatformConfig. + :type: bool + """ + self._is_symmetric_multi_threading_enabled = is_symmetric_multi_threading_enabled + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/core/models/instance_configuration_intel_vm_launch_instance_platform_config.py b/src/oci/core/models/instance_configuration_intel_vm_launch_instance_platform_config.py index 31e7c9700c..123ea7271c 100644 --- a/src/oci/core/models/instance_configuration_intel_vm_launch_instance_platform_config.py +++ b/src/oci/core/models/instance_configuration_intel_vm_launch_instance_platform_config.py @@ -42,13 +42,18 @@ def __init__(self, **kwargs): The value to assign to the is_memory_encryption_enabled property of this InstanceConfigurationIntelVmLaunchInstancePlatformConfig. :type is_memory_encryption_enabled: bool + :param is_symmetric_multi_threading_enabled: + The value to assign to the is_symmetric_multi_threading_enabled property of this InstanceConfigurationIntelVmLaunchInstancePlatformConfig. + :type is_symmetric_multi_threading_enabled: bool + """ self.swagger_types = { 'type': 'str', 'is_secure_boot_enabled': 'bool', 'is_trusted_platform_module_enabled': 'bool', 'is_measured_boot_enabled': 'bool', - 'is_memory_encryption_enabled': 'bool' + 'is_memory_encryption_enabled': 'bool', + 'is_symmetric_multi_threading_enabled': 'bool' } self.attribute_map = { @@ -56,7 +61,8 @@ def __init__(self, **kwargs): 'is_secure_boot_enabled': 'isSecureBootEnabled', 'is_trusted_platform_module_enabled': 'isTrustedPlatformModuleEnabled', 'is_measured_boot_enabled': 'isMeasuredBootEnabled', - 'is_memory_encryption_enabled': 'isMemoryEncryptionEnabled' + 'is_memory_encryption_enabled': 'isMemoryEncryptionEnabled', + 'is_symmetric_multi_threading_enabled': 'isSymmetricMultiThreadingEnabled' } self._type = None @@ -64,8 +70,45 @@ def __init__(self, **kwargs): self._is_trusted_platform_module_enabled = None self._is_measured_boot_enabled = None self._is_memory_encryption_enabled = None + self._is_symmetric_multi_threading_enabled = None self._type = 'INTEL_VM' + @property + def is_symmetric_multi_threading_enabled(self): + """ + Gets the is_symmetric_multi_threading_enabled of this InstanceConfigurationIntelVmLaunchInstancePlatformConfig. + Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel Hyper-Threading. + + Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + independent threads of execution, to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + can provide higher or more predictable performance for some workloads. + + + :return: The is_symmetric_multi_threading_enabled of this InstanceConfigurationIntelVmLaunchInstancePlatformConfig. + :rtype: bool + """ + return self._is_symmetric_multi_threading_enabled + + @is_symmetric_multi_threading_enabled.setter + def is_symmetric_multi_threading_enabled(self, is_symmetric_multi_threading_enabled): + """ + Sets the is_symmetric_multi_threading_enabled of this InstanceConfigurationIntelVmLaunchInstancePlatformConfig. + Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel Hyper-Threading. + + Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + independent threads of execution, to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + can provide higher or more predictable performance for some workloads. + + + :param is_symmetric_multi_threading_enabled: The is_symmetric_multi_threading_enabled of this InstanceConfigurationIntelVmLaunchInstancePlatformConfig. + :type: bool + """ + self._is_symmetric_multi_threading_enabled = is_symmetric_multi_threading_enabled + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/core/models/intel_vm_launch_instance_platform_config.py b/src/oci/core/models/intel_vm_launch_instance_platform_config.py index 2f715a6b3f..525100c524 100644 --- a/src/oci/core/models/intel_vm_launch_instance_platform_config.py +++ b/src/oci/core/models/intel_vm_launch_instance_platform_config.py @@ -42,13 +42,18 @@ def __init__(self, **kwargs): The value to assign to the is_memory_encryption_enabled property of this IntelVmLaunchInstancePlatformConfig. :type is_memory_encryption_enabled: bool + :param is_symmetric_multi_threading_enabled: + The value to assign to the is_symmetric_multi_threading_enabled property of this IntelVmLaunchInstancePlatformConfig. + :type is_symmetric_multi_threading_enabled: bool + """ self.swagger_types = { 'type': 'str', 'is_secure_boot_enabled': 'bool', 'is_trusted_platform_module_enabled': 'bool', 'is_measured_boot_enabled': 'bool', - 'is_memory_encryption_enabled': 'bool' + 'is_memory_encryption_enabled': 'bool', + 'is_symmetric_multi_threading_enabled': 'bool' } self.attribute_map = { @@ -56,7 +61,8 @@ def __init__(self, **kwargs): 'is_secure_boot_enabled': 'isSecureBootEnabled', 'is_trusted_platform_module_enabled': 'isTrustedPlatformModuleEnabled', 'is_measured_boot_enabled': 'isMeasuredBootEnabled', - 'is_memory_encryption_enabled': 'isMemoryEncryptionEnabled' + 'is_memory_encryption_enabled': 'isMemoryEncryptionEnabled', + 'is_symmetric_multi_threading_enabled': 'isSymmetricMultiThreadingEnabled' } self._type = None @@ -64,8 +70,45 @@ def __init__(self, **kwargs): self._is_trusted_platform_module_enabled = None self._is_measured_boot_enabled = None self._is_memory_encryption_enabled = None + self._is_symmetric_multi_threading_enabled = None self._type = 'INTEL_VM' + @property + def is_symmetric_multi_threading_enabled(self): + """ + Gets the is_symmetric_multi_threading_enabled of this IntelVmLaunchInstancePlatformConfig. + Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel Hyper-Threading. + + Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + independent threads of execution, to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + can provide higher or more predictable performance for some workloads. + + + :return: The is_symmetric_multi_threading_enabled of this IntelVmLaunchInstancePlatformConfig. + :rtype: bool + """ + return self._is_symmetric_multi_threading_enabled + + @is_symmetric_multi_threading_enabled.setter + def is_symmetric_multi_threading_enabled(self, is_symmetric_multi_threading_enabled): + """ + Sets the is_symmetric_multi_threading_enabled of this IntelVmLaunchInstancePlatformConfig. + Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel Hyper-Threading. + + Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + independent threads of execution, to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + can provide higher or more predictable performance for some workloads. + + + :param is_symmetric_multi_threading_enabled: The is_symmetric_multi_threading_enabled of this IntelVmLaunchInstancePlatformConfig. + :type: bool + """ + self._is_symmetric_multi_threading_enabled = is_symmetric_multi_threading_enabled + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/core/models/intel_vm_platform_config.py b/src/oci/core/models/intel_vm_platform_config.py index 86204400f4..dd870a9640 100644 --- a/src/oci/core/models/intel_vm_platform_config.py +++ b/src/oci/core/models/intel_vm_platform_config.py @@ -42,13 +42,18 @@ def __init__(self, **kwargs): The value to assign to the is_memory_encryption_enabled property of this IntelVmPlatformConfig. :type is_memory_encryption_enabled: bool + :param is_symmetric_multi_threading_enabled: + The value to assign to the is_symmetric_multi_threading_enabled property of this IntelVmPlatformConfig. + :type is_symmetric_multi_threading_enabled: bool + """ self.swagger_types = { 'type': 'str', 'is_secure_boot_enabled': 'bool', 'is_trusted_platform_module_enabled': 'bool', 'is_measured_boot_enabled': 'bool', - 'is_memory_encryption_enabled': 'bool' + 'is_memory_encryption_enabled': 'bool', + 'is_symmetric_multi_threading_enabled': 'bool' } self.attribute_map = { @@ -56,7 +61,8 @@ def __init__(self, **kwargs): 'is_secure_boot_enabled': 'isSecureBootEnabled', 'is_trusted_platform_module_enabled': 'isTrustedPlatformModuleEnabled', 'is_measured_boot_enabled': 'isMeasuredBootEnabled', - 'is_memory_encryption_enabled': 'isMemoryEncryptionEnabled' + 'is_memory_encryption_enabled': 'isMemoryEncryptionEnabled', + 'is_symmetric_multi_threading_enabled': 'isSymmetricMultiThreadingEnabled' } self._type = None @@ -64,8 +70,45 @@ def __init__(self, **kwargs): self._is_trusted_platform_module_enabled = None self._is_measured_boot_enabled = None self._is_memory_encryption_enabled = None + self._is_symmetric_multi_threading_enabled = None self._type = 'INTEL_VM' + @property + def is_symmetric_multi_threading_enabled(self): + """ + Gets the is_symmetric_multi_threading_enabled of this IntelVmPlatformConfig. + Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel Hyper-Threading. + + Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + independent threads of execution, to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + can provide higher or more predictable performance for some workloads. + + + :return: The is_symmetric_multi_threading_enabled of this IntelVmPlatformConfig. + :rtype: bool + """ + return self._is_symmetric_multi_threading_enabled + + @is_symmetric_multi_threading_enabled.setter + def is_symmetric_multi_threading_enabled(self, is_symmetric_multi_threading_enabled): + """ + Sets the is_symmetric_multi_threading_enabled of this IntelVmPlatformConfig. + Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel Hyper-Threading. + + Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + independent threads of execution, to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + can provide higher or more predictable performance for some workloads. + + + :param is_symmetric_multi_threading_enabled: The is_symmetric_multi_threading_enabled of this IntelVmPlatformConfig. + :type: bool + """ + self._is_symmetric_multi_threading_enabled = is_symmetric_multi_threading_enabled + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/core/models/intel_vm_update_instance_platform_config.py b/src/oci/core/models/intel_vm_update_instance_platform_config.py new file mode 100644 index 0000000000..7cd26e76f2 --- /dev/null +++ b/src/oci/core/models/intel_vm_update_instance_platform_config.py @@ -0,0 +1,94 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20160918 + +from .update_instance_platform_config import UpdateInstancePlatformConfig +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 IntelVmUpdateInstancePlatformConfig(UpdateInstancePlatformConfig): + """ + The platform configuration used when updating a virtual machine instance with the Intel platform. + """ + + def __init__(self, **kwargs): + """ + Initializes a new IntelVmUpdateInstancePlatformConfig object with values from keyword arguments. The default value of the :py:attr:`~oci.core.models.IntelVmUpdateInstancePlatformConfig.type` attribute + of this class is ``INTEL_VM`` and it should not be changed. + 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 IntelVmUpdateInstancePlatformConfig. + Allowed values for this property are: "AMD_VM", "INTEL_VM" + :type type: str + + :param is_symmetric_multi_threading_enabled: + The value to assign to the is_symmetric_multi_threading_enabled property of this IntelVmUpdateInstancePlatformConfig. + :type is_symmetric_multi_threading_enabled: bool + + """ + self.swagger_types = { + 'type': 'str', + 'is_symmetric_multi_threading_enabled': 'bool' + } + + self.attribute_map = { + 'type': 'type', + 'is_symmetric_multi_threading_enabled': 'isSymmetricMultiThreadingEnabled' + } + + self._type = None + self._is_symmetric_multi_threading_enabled = None + self._type = 'INTEL_VM' + + @property + def is_symmetric_multi_threading_enabled(self): + """ + Gets the is_symmetric_multi_threading_enabled of this IntelVmUpdateInstancePlatformConfig. + Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel Hyper-Threading. + + Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + independent threads of execution, to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + can provide higher or more predictable performance for some workloads. + + + :return: The is_symmetric_multi_threading_enabled of this IntelVmUpdateInstancePlatformConfig. + :rtype: bool + """ + return self._is_symmetric_multi_threading_enabled + + @is_symmetric_multi_threading_enabled.setter + def is_symmetric_multi_threading_enabled(self, is_symmetric_multi_threading_enabled): + """ + Sets the is_symmetric_multi_threading_enabled of this IntelVmUpdateInstancePlatformConfig. + Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel Hyper-Threading. + + Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + independent threads of execution, to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + can provide higher or more predictable performance for some workloads. + + + :param is_symmetric_multi_threading_enabled: The is_symmetric_multi_threading_enabled of this IntelVmUpdateInstancePlatformConfig. + :type: bool + """ + self._is_symmetric_multi_threading_enabled = is_symmetric_multi_threading_enabled + + 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/core/models/update_instance_details.py b/src/oci/core/models/update_instance_details.py index ae99572458..f9a076d4a0 100644 --- a/src/oci/core/models/update_instance_details.py +++ b/src/oci/core/models/update_instance_details.py @@ -93,6 +93,10 @@ def __init__(self, **kwargs): The value to assign to the dedicated_vm_host_id property of this UpdateInstanceDetails. :type dedicated_vm_host_id: str + :param platform_config: + The value to assign to the platform_config property of this UpdateInstanceDetails. + :type platform_config: oci.core.models.UpdateInstancePlatformConfig + """ self.swagger_types = { 'capacity_reservation_id': 'str', @@ -110,7 +114,8 @@ def __init__(self, **kwargs): 'launch_options': 'UpdateLaunchOptions', 'availability_config': 'UpdateInstanceAvailabilityConfigDetails', 'time_maintenance_reboot_due': 'datetime', - 'dedicated_vm_host_id': 'str' + 'dedicated_vm_host_id': 'str', + 'platform_config': 'UpdateInstancePlatformConfig' } self.attribute_map = { @@ -129,7 +134,8 @@ def __init__(self, **kwargs): 'launch_options': 'launchOptions', 'availability_config': 'availabilityConfig', 'time_maintenance_reboot_due': 'timeMaintenanceRebootDue', - 'dedicated_vm_host_id': 'dedicatedVmHostId' + 'dedicated_vm_host_id': 'dedicatedVmHostId', + 'platform_config': 'platformConfig' } self._capacity_reservation_id = None @@ -148,6 +154,7 @@ def __init__(self, **kwargs): self._availability_config = None self._time_maintenance_reboot_due = None self._dedicated_vm_host_id = None + self._platform_config = None @property def capacity_reservation_id(self): @@ -710,6 +717,26 @@ def dedicated_vm_host_id(self, dedicated_vm_host_id): """ self._dedicated_vm_host_id = dedicated_vm_host_id + @property + def platform_config(self): + """ + Gets the platform_config of this UpdateInstanceDetails. + + :return: The platform_config of this UpdateInstanceDetails. + :rtype: oci.core.models.UpdateInstancePlatformConfig + """ + return self._platform_config + + @platform_config.setter + def platform_config(self, platform_config): + """ + Sets the platform_config of this UpdateInstanceDetails. + + :param platform_config: The platform_config of this UpdateInstanceDetails. + :type: oci.core.models.UpdateInstancePlatformConfig + """ + self._platform_config = platform_config + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/core/models/update_instance_platform_config.py b/src/oci/core/models/update_instance_platform_config.py new file mode 100644 index 0000000000..686726580c --- /dev/null +++ b/src/oci/core/models/update_instance_platform_config.py @@ -0,0 +1,109 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20160918 + + +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 UpdateInstancePlatformConfig(object): + """ + The platform configuration to be updated for the instance. + """ + + #: A constant which can be used with the type property of a UpdateInstancePlatformConfig. + #: This constant has a value of "AMD_VM" + TYPE_AMD_VM = "AMD_VM" + + #: A constant which can be used with the type property of a UpdateInstancePlatformConfig. + #: This constant has a value of "INTEL_VM" + TYPE_INTEL_VM = "INTEL_VM" + + def __init__(self, **kwargs): + """ + Initializes a new UpdateInstancePlatformConfig object with values from keyword arguments. This class has the following subclasses and if you are using this class as input + to a service operations then you should favor using a subclass over the base class: + + * :class:`~oci.core.models.AmdVmUpdateInstancePlatformConfig` + * :class:`~oci.core.models.IntelVmUpdateInstancePlatformConfig` + + 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 UpdateInstancePlatformConfig. + Allowed values for this property are: "AMD_VM", "INTEL_VM" + :type type: str + + """ + self.swagger_types = { + 'type': 'str' + } + + self.attribute_map = { + 'type': 'type' + } + + self._type = None + + @staticmethod + def get_subtype(object_dictionary): + """ + Given the hash representation of a subtype of this class, + use the info in the hash to return the class of the subtype. + """ + type = object_dictionary['type'] + + if type == 'AMD_VM': + return 'AmdVmUpdateInstancePlatformConfig' + + if type == 'INTEL_VM': + return 'IntelVmUpdateInstancePlatformConfig' + else: + return 'UpdateInstancePlatformConfig' + + @property + def type(self): + """ + **[Required]** Gets the type of this UpdateInstancePlatformConfig. + The type of platform being configured. + + Allowed values for this property are: "AMD_VM", "INTEL_VM" + + + :return: The type of this UpdateInstancePlatformConfig. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """ + Sets the type of this UpdateInstancePlatformConfig. + The type of platform being configured. + + + :param type: The type of this UpdateInstancePlatformConfig. + :type: str + """ + allowed_values = ["AMD_VM", "INTEL_VM"] + if not value_allowed_none_or_none_sentinel(type, allowed_values): + raise ValueError( + f"Invalid value for `type`, must be None or one of {allowed_values}" + ) + self._type = type + + 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/data_science/models/__init__.py b/src/oci/data_science/models/__init__.py index 253feff522..59ab3e1008 100644 --- a/src/oci/data_science/models/__init__.py +++ b/src/oci/data_science/models/__init__.py @@ -44,6 +44,7 @@ from .instance_configuration import InstanceConfiguration from .job import Job from .job_configuration_details import JobConfigurationDetails +from .job_environment_configuration_details import JobEnvironmentConfigurationDetails from .job_infrastructure_configuration_details import JobInfrastructureConfigurationDetails from .job_log_configuration_details import JobLogConfigurationDetails from .job_run import JobRun @@ -77,6 +78,7 @@ from .notebook_session_shape_summary import NotebookSessionShapeSummary from .notebook_session_summary import NotebookSessionSummary from .object_storage_mount_configuration_details import ObjectStorageMountConfigurationDetails +from .ocir_container_job_environment_configuration_details import OcirContainerJobEnvironmentConfigurationDetails from .ocir_model_deployment_environment_configuration_details import OcirModelDeploymentEnvironmentConfigurationDetails from .pipeline import Pipeline from .pipeline_configuration_details import PipelineConfigurationDetails @@ -169,6 +171,7 @@ "InstanceConfiguration": InstanceConfiguration, "Job": Job, "JobConfigurationDetails": JobConfigurationDetails, + "JobEnvironmentConfigurationDetails": JobEnvironmentConfigurationDetails, "JobInfrastructureConfigurationDetails": JobInfrastructureConfigurationDetails, "JobLogConfigurationDetails": JobLogConfigurationDetails, "JobRun": JobRun, @@ -202,6 +205,7 @@ "NotebookSessionShapeSummary": NotebookSessionShapeSummary, "NotebookSessionSummary": NotebookSessionSummary, "ObjectStorageMountConfigurationDetails": ObjectStorageMountConfigurationDetails, + "OcirContainerJobEnvironmentConfigurationDetails": OcirContainerJobEnvironmentConfigurationDetails, "OcirModelDeploymentEnvironmentConfigurationDetails": OcirModelDeploymentEnvironmentConfigurationDetails, "Pipeline": Pipeline, "PipelineConfigurationDetails": PipelineConfigurationDetails, diff --git a/src/oci/data_science/models/create_job_details.py b/src/oci/data_science/models/create_job_details.py index b7f19a5f22..9d7568ca44 100644 --- a/src/oci/data_science/models/create_job_details.py +++ b/src/oci/data_science/models/create_job_details.py @@ -44,6 +44,10 @@ def __init__(self, **kwargs): The value to assign to the job_infrastructure_configuration_details property of this CreateJobDetails. :type job_infrastructure_configuration_details: oci.data_science.models.JobInfrastructureConfigurationDetails + :param job_environment_configuration_details: + The value to assign to the job_environment_configuration_details property of this CreateJobDetails. + :type job_environment_configuration_details: oci.data_science.models.JobEnvironmentConfigurationDetails + :param job_log_configuration_details: The value to assign to the job_log_configuration_details property of this CreateJobDetails. :type job_log_configuration_details: oci.data_science.models.JobLogConfigurationDetails @@ -68,6 +72,7 @@ def __init__(self, **kwargs): 'description': 'str', 'job_configuration_details': 'JobConfigurationDetails', 'job_infrastructure_configuration_details': 'JobInfrastructureConfigurationDetails', + 'job_environment_configuration_details': 'JobEnvironmentConfigurationDetails', 'job_log_configuration_details': 'JobLogConfigurationDetails', 'job_storage_mount_configuration_details_list': 'list[StorageMountConfigurationDetails]', 'freeform_tags': 'dict(str, str)', @@ -81,6 +86,7 @@ def __init__(self, **kwargs): 'description': 'description', 'job_configuration_details': 'jobConfigurationDetails', 'job_infrastructure_configuration_details': 'jobInfrastructureConfigurationDetails', + 'job_environment_configuration_details': 'jobEnvironmentConfigurationDetails', 'job_log_configuration_details': 'jobLogConfigurationDetails', 'job_storage_mount_configuration_details_list': 'jobStorageMountConfigurationDetailsList', 'freeform_tags': 'freeformTags', @@ -93,6 +99,7 @@ def __init__(self, **kwargs): self._description = None self._job_configuration_details = None self._job_infrastructure_configuration_details = None + self._job_environment_configuration_details = None self._job_log_configuration_details = None self._job_storage_mount_configuration_details_list = None self._freeform_tags = None @@ -242,6 +249,26 @@ def job_infrastructure_configuration_details(self, job_infrastructure_configurat """ self._job_infrastructure_configuration_details = job_infrastructure_configuration_details + @property + def job_environment_configuration_details(self): + """ + Gets the job_environment_configuration_details of this CreateJobDetails. + + :return: The job_environment_configuration_details of this CreateJobDetails. + :rtype: oci.data_science.models.JobEnvironmentConfigurationDetails + """ + return self._job_environment_configuration_details + + @job_environment_configuration_details.setter + def job_environment_configuration_details(self, job_environment_configuration_details): + """ + Sets the job_environment_configuration_details of this CreateJobDetails. + + :param job_environment_configuration_details: The job_environment_configuration_details of this CreateJobDetails. + :type: oci.data_science.models.JobEnvironmentConfigurationDetails + """ + self._job_environment_configuration_details = job_environment_configuration_details + @property def job_log_configuration_details(self): """ diff --git a/src/oci/data_science/models/create_job_run_details.py b/src/oci/data_science/models/create_job_run_details.py index fce3176ee0..a2b285082a 100644 --- a/src/oci/data_science/models/create_job_run_details.py +++ b/src/oci/data_science/models/create_job_run_details.py @@ -44,6 +44,10 @@ def __init__(self, **kwargs): The value to assign to the job_log_configuration_override_details property of this CreateJobRunDetails. :type job_log_configuration_override_details: oci.data_science.models.JobLogConfigurationDetails + :param job_environment_configuration_override_details: + The value to assign to the job_environment_configuration_override_details property of this CreateJobRunDetails. + :type job_environment_configuration_override_details: oci.data_science.models.JobEnvironmentConfigurationDetails + :param freeform_tags: The value to assign to the freeform_tags property of this CreateJobRunDetails. :type freeform_tags: dict(str, str) @@ -60,6 +64,7 @@ def __init__(self, **kwargs): 'job_id': 'str', 'job_configuration_override_details': 'JobConfigurationDetails', 'job_log_configuration_override_details': 'JobLogConfigurationDetails', + 'job_environment_configuration_override_details': 'JobEnvironmentConfigurationDetails', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))' } @@ -71,6 +76,7 @@ def __init__(self, **kwargs): 'job_id': 'jobId', 'job_configuration_override_details': 'jobConfigurationOverrideDetails', 'job_log_configuration_override_details': 'jobLogConfigurationOverrideDetails', + 'job_environment_configuration_override_details': 'jobEnvironmentConfigurationOverrideDetails', 'freeform_tags': 'freeformTags', 'defined_tags': 'definedTags' } @@ -81,6 +87,7 @@ def __init__(self, **kwargs): self._job_id = None self._job_configuration_override_details = None self._job_log_configuration_override_details = None + self._job_environment_configuration_override_details = None self._freeform_tags = None self._defined_tags = None @@ -232,6 +239,26 @@ def job_log_configuration_override_details(self, job_log_configuration_override_ """ self._job_log_configuration_override_details = job_log_configuration_override_details + @property + def job_environment_configuration_override_details(self): + """ + Gets the job_environment_configuration_override_details of this CreateJobRunDetails. + + :return: The job_environment_configuration_override_details of this CreateJobRunDetails. + :rtype: oci.data_science.models.JobEnvironmentConfigurationDetails + """ + return self._job_environment_configuration_override_details + + @job_environment_configuration_override_details.setter + def job_environment_configuration_override_details(self, job_environment_configuration_override_details): + """ + Sets the job_environment_configuration_override_details of this CreateJobRunDetails. + + :param job_environment_configuration_override_details: The job_environment_configuration_override_details of this CreateJobRunDetails. + :type: oci.data_science.models.JobEnvironmentConfigurationDetails + """ + self._job_environment_configuration_override_details = job_environment_configuration_override_details + @property def freeform_tags(self): """ diff --git a/src/oci/data_science/models/data_science_private_endpoint.py b/src/oci/data_science/models/data_science_private_endpoint.py index 5788a6993e..3d24eac892 100644 --- a/src/oci/data_science/models/data_science_private_endpoint.py +++ b/src/oci/data_science/models/data_science_private_endpoint.py @@ -72,6 +72,10 @@ def __init__(self, **kwargs): The value to assign to the freeform_tags property of this DataSciencePrivateEndpoint. :type freeform_tags: dict(str, str) + :param system_tags: + The value to assign to the system_tags property of this DataSciencePrivateEndpoint. + :type system_tags: dict(str, dict(str, object)) + :param id: The value to assign to the id property of this DataSciencePrivateEndpoint. :type id: str @@ -123,6 +127,7 @@ def __init__(self, **kwargs): 'description': 'str', 'display_name': 'str', 'freeform_tags': 'dict(str, str)', + 'system_tags': 'dict(str, dict(str, object))', 'id': 'str', 'lifecycle_details': 'str', 'lifecycle_state': 'str', @@ -141,6 +146,7 @@ def __init__(self, **kwargs): 'description': 'description', 'display_name': 'displayName', 'freeform_tags': 'freeformTags', + 'system_tags': 'systemTags', 'id': 'id', 'lifecycle_details': 'lifecycleDetails', 'lifecycle_state': 'lifecycleState', @@ -158,6 +164,7 @@ def __init__(self, **kwargs): self._description = None self._display_name = None self._freeform_tags = None + self._system_tags = None self._id = None self._lifecycle_details = None self._lifecycle_state = None @@ -305,6 +312,32 @@ def freeform_tags(self, freeform_tags): """ self._freeform_tags = freeform_tags + @property + def system_tags(self): + """ + Gets the system_tags of this DataSciencePrivateEndpoint. + 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 DataSciencePrivateEndpoint. + :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 DataSciencePrivateEndpoint. + 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 DataSciencePrivateEndpoint. + :type: dict(str, dict(str, object)) + """ + self._system_tags = system_tags + @property def id(self): """ diff --git a/src/oci/data_science/models/data_science_private_endpoint_summary.py b/src/oci/data_science/models/data_science_private_endpoint_summary.py index 0cc3d06920..1e8a0d5a30 100644 --- a/src/oci/data_science/models/data_science_private_endpoint_summary.py +++ b/src/oci/data_science/models/data_science_private_endpoint_summary.py @@ -68,6 +68,10 @@ def __init__(self, **kwargs): The value to assign to the freeform_tags property of this DataSciencePrivateEndpointSummary. :type freeform_tags: dict(str, str) + :param system_tags: + The value to assign to the system_tags property of this DataSciencePrivateEndpointSummary. + :type system_tags: dict(str, dict(str, object)) + :param id: The value to assign to the id property of this DataSciencePrivateEndpointSummary. :type id: str @@ -118,6 +122,7 @@ def __init__(self, **kwargs): 'defined_tags': 'dict(str, dict(str, object))', 'display_name': 'str', 'freeform_tags': 'dict(str, str)', + 'system_tags': 'dict(str, dict(str, object))', 'id': 'str', 'lifecycle_state': 'str', 'lifecycle_details': 'str', @@ -135,6 +140,7 @@ def __init__(self, **kwargs): 'defined_tags': 'definedTags', 'display_name': 'displayName', 'freeform_tags': 'freeformTags', + 'system_tags': 'systemTags', 'id': 'id', 'lifecycle_state': 'lifecycleState', 'lifecycle_details': 'lifecycleDetails', @@ -151,6 +157,7 @@ def __init__(self, **kwargs): self._defined_tags = None self._display_name = None self._freeform_tags = None + self._system_tags = None self._id = None self._lifecycle_state = None self._lifecycle_details = None @@ -274,6 +281,32 @@ def freeform_tags(self, freeform_tags): """ self._freeform_tags = freeform_tags + @property + def system_tags(self): + """ + Gets the system_tags of this DataSciencePrivateEndpointSummary. + 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 DataSciencePrivateEndpointSummary. + :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 DataSciencePrivateEndpointSummary. + 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 DataSciencePrivateEndpointSummary. + :type: dict(str, dict(str, object)) + """ + self._system_tags = system_tags + @property def id(self): """ diff --git a/src/oci/data_science/models/job.py b/src/oci/data_science/models/job.py index edd86d5714..6621a3b2ad 100644 --- a/src/oci/data_science/models/job.py +++ b/src/oci/data_science/models/job.py @@ -76,6 +76,10 @@ def __init__(self, **kwargs): The value to assign to the job_infrastructure_configuration_details property of this Job. :type job_infrastructure_configuration_details: oci.data_science.models.JobInfrastructureConfigurationDetails + :param job_environment_configuration_details: + The value to assign to the job_environment_configuration_details property of this Job. + :type job_environment_configuration_details: oci.data_science.models.JobEnvironmentConfigurationDetails + :param job_log_configuration_details: The value to assign to the job_log_configuration_details property of this Job. :type job_log_configuration_details: oci.data_science.models.JobLogConfigurationDetails @@ -113,6 +117,7 @@ def __init__(self, **kwargs): 'description': 'str', 'job_configuration_details': 'JobConfigurationDetails', 'job_infrastructure_configuration_details': 'JobInfrastructureConfigurationDetails', + 'job_environment_configuration_details': 'JobEnvironmentConfigurationDetails', 'job_log_configuration_details': 'JobLogConfigurationDetails', 'job_storage_mount_configuration_details_list': 'list[StorageMountConfigurationDetails]', 'lifecycle_state': 'str', @@ -131,6 +136,7 @@ def __init__(self, **kwargs): 'description': 'description', 'job_configuration_details': 'jobConfigurationDetails', 'job_infrastructure_configuration_details': 'jobInfrastructureConfigurationDetails', + 'job_environment_configuration_details': 'jobEnvironmentConfigurationDetails', 'job_log_configuration_details': 'jobLogConfigurationDetails', 'job_storage_mount_configuration_details_list': 'jobStorageMountConfigurationDetailsList', 'lifecycle_state': 'lifecycleState', @@ -148,6 +154,7 @@ def __init__(self, **kwargs): self._description = None self._job_configuration_details = None self._job_infrastructure_configuration_details = None + self._job_environment_configuration_details = None self._job_log_configuration_details = None self._job_storage_mount_configuration_details_list = None self._lifecycle_state = None @@ -385,6 +392,26 @@ def job_infrastructure_configuration_details(self, job_infrastructure_configurat """ self._job_infrastructure_configuration_details = job_infrastructure_configuration_details + @property + def job_environment_configuration_details(self): + """ + Gets the job_environment_configuration_details of this Job. + + :return: The job_environment_configuration_details of this Job. + :rtype: oci.data_science.models.JobEnvironmentConfigurationDetails + """ + return self._job_environment_configuration_details + + @job_environment_configuration_details.setter + def job_environment_configuration_details(self, job_environment_configuration_details): + """ + Sets the job_environment_configuration_details of this Job. + + :param job_environment_configuration_details: The job_environment_configuration_details of this Job. + :type: oci.data_science.models.JobEnvironmentConfigurationDetails + """ + self._job_environment_configuration_details = job_environment_configuration_details + @property def job_log_configuration_details(self): """ diff --git a/src/oci/data_science/models/job_environment_configuration_details.py b/src/oci/data_science/models/job_environment_configuration_details.py new file mode 100644 index 0000000000..4ab2f47484 --- /dev/null +++ b/src/oci/data_science/models/job_environment_configuration_details.py @@ -0,0 +1,101 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20190101 + + +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 JobEnvironmentConfigurationDetails(object): + """ + Environment configuration to capture job runtime dependencies. + """ + + #: A constant which can be used with the job_environment_type property of a JobEnvironmentConfigurationDetails. + #: This constant has a value of "OCIR_CONTAINER" + JOB_ENVIRONMENT_TYPE_OCIR_CONTAINER = "OCIR_CONTAINER" + + def __init__(self, **kwargs): + """ + Initializes a new JobEnvironmentConfigurationDetails object with values from keyword arguments. This class has the following subclasses and if you are using this class as input + to a service operations then you should favor using a subclass over the base class: + + * :class:`~oci.data_science.models.OcirContainerJobEnvironmentConfigurationDetails` + + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param job_environment_type: + The value to assign to the job_environment_type property of this JobEnvironmentConfigurationDetails. + Allowed values for this property are: "OCIR_CONTAINER", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type job_environment_type: str + + """ + self.swagger_types = { + 'job_environment_type': 'str' + } + + self.attribute_map = { + 'job_environment_type': 'jobEnvironmentType' + } + + self._job_environment_type = None + + @staticmethod + def get_subtype(object_dictionary): + """ + Given the hash representation of a subtype of this class, + use the info in the hash to return the class of the subtype. + """ + type = object_dictionary['jobEnvironmentType'] + + if type == 'OCIR_CONTAINER': + return 'OcirContainerJobEnvironmentConfigurationDetails' + else: + return 'JobEnvironmentConfigurationDetails' + + @property + def job_environment_type(self): + """ + **[Required]** Gets the job_environment_type of this JobEnvironmentConfigurationDetails. + The environment configuration type used for job runtime. + + Allowed values for this property are: "OCIR_CONTAINER", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The job_environment_type of this JobEnvironmentConfigurationDetails. + :rtype: str + """ + return self._job_environment_type + + @job_environment_type.setter + def job_environment_type(self, job_environment_type): + """ + Sets the job_environment_type of this JobEnvironmentConfigurationDetails. + The environment configuration type used for job runtime. + + + :param job_environment_type: The job_environment_type of this JobEnvironmentConfigurationDetails. + :type: str + """ + allowed_values = ["OCIR_CONTAINER"] + if not value_allowed_none_or_none_sentinel(job_environment_type, allowed_values): + job_environment_type = 'UNKNOWN_ENUM_VALUE' + self._job_environment_type = job_environment_type + + 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/data_science/models/job_run.py b/src/oci/data_science/models/job_run.py index 9a76a58642..7a7ebc0e19 100644 --- a/src/oci/data_science/models/job_run.py +++ b/src/oci/data_science/models/job_run.py @@ -96,6 +96,10 @@ def __init__(self, **kwargs): The value to assign to the job_infrastructure_configuration_details property of this JobRun. :type job_infrastructure_configuration_details: oci.data_science.models.JobInfrastructureConfigurationDetails + :param job_environment_configuration_override_details: + The value to assign to the job_environment_configuration_override_details property of this JobRun. + :type job_environment_configuration_override_details: oci.data_science.models.JobEnvironmentConfigurationDetails + :param job_log_configuration_override_details: The value to assign to the job_log_configuration_override_details property of this JobRun. :type job_log_configuration_override_details: oci.data_science.models.JobLogConfigurationDetails @@ -139,6 +143,7 @@ def __init__(self, **kwargs): 'display_name': 'str', 'job_configuration_override_details': 'JobConfigurationDetails', 'job_infrastructure_configuration_details': 'JobInfrastructureConfigurationDetails', + 'job_environment_configuration_override_details': 'JobEnvironmentConfigurationDetails', 'job_log_configuration_override_details': 'JobLogConfigurationDetails', 'job_storage_mount_configuration_details_list': 'list[StorageMountConfigurationDetails]', 'log_details': 'JobRunLogDetails', @@ -160,6 +165,7 @@ def __init__(self, **kwargs): 'display_name': 'displayName', 'job_configuration_override_details': 'jobConfigurationOverrideDetails', 'job_infrastructure_configuration_details': 'jobInfrastructureConfigurationDetails', + 'job_environment_configuration_override_details': 'jobEnvironmentConfigurationOverrideDetails', 'job_log_configuration_override_details': 'jobLogConfigurationOverrideDetails', 'job_storage_mount_configuration_details_list': 'jobStorageMountConfigurationDetailsList', 'log_details': 'logDetails', @@ -180,6 +186,7 @@ def __init__(self, **kwargs): self._display_name = None self._job_configuration_override_details = None self._job_infrastructure_configuration_details = None + self._job_environment_configuration_override_details = None self._job_log_configuration_override_details = None self._job_storage_mount_configuration_details_list = None self._log_details = None @@ -476,6 +483,26 @@ def job_infrastructure_configuration_details(self, job_infrastructure_configurat """ self._job_infrastructure_configuration_details = job_infrastructure_configuration_details + @property + def job_environment_configuration_override_details(self): + """ + Gets the job_environment_configuration_override_details of this JobRun. + + :return: The job_environment_configuration_override_details of this JobRun. + :rtype: oci.data_science.models.JobEnvironmentConfigurationDetails + """ + return self._job_environment_configuration_override_details + + @job_environment_configuration_override_details.setter + def job_environment_configuration_override_details(self, job_environment_configuration_override_details): + """ + Sets the job_environment_configuration_override_details of this JobRun. + + :param job_environment_configuration_override_details: The job_environment_configuration_override_details of this JobRun. + :type: oci.data_science.models.JobEnvironmentConfigurationDetails + """ + self._job_environment_configuration_override_details = job_environment_configuration_override_details + @property def job_log_configuration_override_details(self): """ diff --git a/src/oci/data_science/models/model_version_set.py b/src/oci/data_science/models/model_version_set.py index be2d0c4c5e..f25931b324 100644 --- a/src/oci/data_science/models/model_version_set.py +++ b/src/oci/data_science/models/model_version_set.py @@ -82,6 +82,10 @@ def __init__(self, **kwargs): The value to assign to the defined_tags property of this ModelVersionSet. :type defined_tags: dict(str, dict(str, object)) + :param system_tags: + The value to assign to the system_tags property of this ModelVersionSet. + :type system_tags: dict(str, dict(str, object)) + """ self.swagger_types = { 'id': 'str', @@ -94,7 +98,8 @@ def __init__(self, **kwargs): 'time_updated': 'datetime', 'created_by': '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 = { @@ -108,7 +113,8 @@ def __init__(self, **kwargs): 'time_updated': 'timeUpdated', 'created_by': 'createdBy', 'freeform_tags': 'freeformTags', - 'defined_tags': 'definedTags' + 'defined_tags': 'definedTags', + 'system_tags': 'systemTags' } self._id = None @@ -122,6 +128,7 @@ def __init__(self, **kwargs): self._created_by = None self._freeform_tags = None self._defined_tags = None + self._system_tags = None @property def id(self): @@ -433,6 +440,32 @@ def defined_tags(self, defined_tags): """ self._defined_tags = defined_tags + @property + def system_tags(self): + """ + Gets the system_tags of this ModelVersionSet. + 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 ModelVersionSet. + :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 ModelVersionSet. + 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 ModelVersionSet. + :type: dict(str, dict(str, object)) + """ + self._system_tags = system_tags + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/data_science/models/model_version_set_summary.py b/src/oci/data_science/models/model_version_set_summary.py index a8afa4ae60..864f075e41 100644 --- a/src/oci/data_science/models/model_version_set_summary.py +++ b/src/oci/data_science/models/model_version_set_summary.py @@ -78,6 +78,10 @@ def __init__(self, **kwargs): The value to assign to the defined_tags property of this ModelVersionSetSummary. :type defined_tags: dict(str, dict(str, object)) + :param system_tags: + The value to assign to the system_tags property of this ModelVersionSetSummary. + :type system_tags: dict(str, dict(str, object)) + """ self.swagger_types = { 'id': 'str', @@ -89,7 +93,8 @@ def __init__(self, **kwargs): 'time_updated': 'datetime', 'created_by': '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 = { @@ -102,7 +107,8 @@ def __init__(self, **kwargs): 'time_updated': 'timeUpdated', 'created_by': 'createdBy', 'freeform_tags': 'freeformTags', - 'defined_tags': 'definedTags' + 'defined_tags': 'definedTags', + 'system_tags': 'systemTags' } self._id = None @@ -115,6 +121,7 @@ def __init__(self, **kwargs): self._created_by = None self._freeform_tags = None self._defined_tags = None + self._system_tags = None @property def id(self): @@ -402,6 +409,32 @@ def defined_tags(self, defined_tags): """ self._defined_tags = defined_tags + @property + def system_tags(self): + """ + Gets the system_tags of this ModelVersionSetSummary. + 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 ModelVersionSetSummary. + :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 ModelVersionSetSummary. + 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 ModelVersionSetSummary. + :type: dict(str, dict(str, object)) + """ + self._system_tags = system_tags + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/data_science/models/ocir_container_job_environment_configuration_details.py b/src/oci/data_science/models/ocir_container_job_environment_configuration_details.py new file mode 100644 index 0000000000..5b297115f4 --- /dev/null +++ b/src/oci/data_science/models/ocir_container_job_environment_configuration_details.py @@ -0,0 +1,234 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20190101 + +from .job_environment_configuration_details import JobEnvironmentConfigurationDetails +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 OcirContainerJobEnvironmentConfigurationDetails(JobEnvironmentConfigurationDetails): + """ + Environment configuration based on container image stored in OCI Container Registry. + """ + + def __init__(self, **kwargs): + """ + Initializes a new OcirContainerJobEnvironmentConfigurationDetails object with values from keyword arguments. The default value of the :py:attr:`~oci.data_science.models.OcirContainerJobEnvironmentConfigurationDetails.job_environment_type` attribute + of this class is ``OCIR_CONTAINER`` and it should not be changed. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param job_environment_type: + The value to assign to the job_environment_type property of this OcirContainerJobEnvironmentConfigurationDetails. + Allowed values for this property are: "OCIR_CONTAINER" + :type job_environment_type: str + + :param image: + The value to assign to the image property of this OcirContainerJobEnvironmentConfigurationDetails. + :type image: str + + :param cmd: + The value to assign to the cmd property of this OcirContainerJobEnvironmentConfigurationDetails. + :type cmd: list[str] + + :param entrypoint: + The value to assign to the entrypoint property of this OcirContainerJobEnvironmentConfigurationDetails. + :type entrypoint: list[str] + + :param image_digest: + The value to assign to the image_digest property of this OcirContainerJobEnvironmentConfigurationDetails. + :type image_digest: str + + :param image_signature_id: + The value to assign to the image_signature_id property of this OcirContainerJobEnvironmentConfigurationDetails. + :type image_signature_id: str + + """ + self.swagger_types = { + 'job_environment_type': 'str', + 'image': 'str', + 'cmd': 'list[str]', + 'entrypoint': 'list[str]', + 'image_digest': 'str', + 'image_signature_id': 'str' + } + + self.attribute_map = { + 'job_environment_type': 'jobEnvironmentType', + 'image': 'image', + 'cmd': 'cmd', + 'entrypoint': 'entrypoint', + 'image_digest': 'imageDigest', + 'image_signature_id': 'imageSignatureId' + } + + self._job_environment_type = None + self._image = None + self._cmd = None + self._entrypoint = None + self._image_digest = None + self._image_signature_id = None + self._job_environment_type = 'OCIR_CONTAINER' + + @property + def image(self): + """ + **[Required]** Gets the image of this OcirContainerJobEnvironmentConfigurationDetails. + The full path to the Oracle Container Repository (OCIR) registry, image, and tag in a canonical format. + Acceptable format: + `.ocir.io//:` + `.ocir.io//:@digest` + + + :return: The image of this OcirContainerJobEnvironmentConfigurationDetails. + :rtype: str + """ + return self._image + + @image.setter + def image(self, image): + """ + Sets the image of this OcirContainerJobEnvironmentConfigurationDetails. + The full path to the Oracle Container Repository (OCIR) registry, image, and tag in a canonical format. + Acceptable format: + `.ocir.io//:` + `.ocir.io//:@digest` + + + :param image: The image of this OcirContainerJobEnvironmentConfigurationDetails. + :type: str + """ + self._image = image + + @property + def cmd(self): + """ + Gets the cmd of this OcirContainerJobEnvironmentConfigurationDetails. + The container image run `CMD`__ as a list of strings. + Use `CMD` as arguments to the `ENTRYPOINT` or the only command to run in the absence of an `ENTRYPOINT`. + The combined size of `CMD` and `ENTRYPOINT` must be less than 2048 bytes. + + __ https://docs.docker.com/engine/reference/builder/#cmd + + + :return: The cmd of this OcirContainerJobEnvironmentConfigurationDetails. + :rtype: list[str] + """ + return self._cmd + + @cmd.setter + def cmd(self, cmd): + """ + Sets the cmd of this OcirContainerJobEnvironmentConfigurationDetails. + The container image run `CMD`__ as a list of strings. + Use `CMD` as arguments to the `ENTRYPOINT` or the only command to run in the absence of an `ENTRYPOINT`. + The combined size of `CMD` and `ENTRYPOINT` must be less than 2048 bytes. + + __ https://docs.docker.com/engine/reference/builder/#cmd + + + :param cmd: The cmd of this OcirContainerJobEnvironmentConfigurationDetails. + :type: list[str] + """ + self._cmd = cmd + + @property + def entrypoint(self): + """ + Gets the entrypoint of this OcirContainerJobEnvironmentConfigurationDetails. + The container image run `ENTRYPOINT`__ as a list of strings. + Accept the `CMD` as extra arguments. + The combined size of `CMD` and `ENTRYPOINT` must be less than 2048 bytes. + More information on how `CMD` and `ENTRYPOINT` interact are `here`__. + + __ https://docs.docker.com/engine/reference/builder/#entrypoint + __ https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact + + + :return: The entrypoint of this OcirContainerJobEnvironmentConfigurationDetails. + :rtype: list[str] + """ + return self._entrypoint + + @entrypoint.setter + def entrypoint(self, entrypoint): + """ + Sets the entrypoint of this OcirContainerJobEnvironmentConfigurationDetails. + The container image run `ENTRYPOINT`__ as a list of strings. + Accept the `CMD` as extra arguments. + The combined size of `CMD` and `ENTRYPOINT` must be less than 2048 bytes. + More information on how `CMD` and `ENTRYPOINT` interact are `here`__. + + __ https://docs.docker.com/engine/reference/builder/#entrypoint + __ https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact + + + :param entrypoint: The entrypoint of this OcirContainerJobEnvironmentConfigurationDetails. + :type: list[str] + """ + self._entrypoint = entrypoint + + @property + def image_digest(self): + """ + Gets the image_digest of this OcirContainerJobEnvironmentConfigurationDetails. + The digest of the container image. For example, + `sha256:881303a6b2738834d795a32b4a98eb0e5e3d1cad590a712d1e04f9b2fa90a030` + + + :return: The image_digest of this OcirContainerJobEnvironmentConfigurationDetails. + :rtype: str + """ + return self._image_digest + + @image_digest.setter + def image_digest(self, image_digest): + """ + Sets the image_digest of this OcirContainerJobEnvironmentConfigurationDetails. + The digest of the container image. For example, + `sha256:881303a6b2738834d795a32b4a98eb0e5e3d1cad590a712d1e04f9b2fa90a030` + + + :param image_digest: The image_digest of this OcirContainerJobEnvironmentConfigurationDetails. + :type: str + """ + self._image_digest = image_digest + + @property + def image_signature_id(self): + """ + Gets the image_signature_id of this OcirContainerJobEnvironmentConfigurationDetails. + OCID of the container image signature + + + :return: The image_signature_id of this OcirContainerJobEnvironmentConfigurationDetails. + :rtype: str + """ + return self._image_signature_id + + @image_signature_id.setter + def image_signature_id(self, image_signature_id): + """ + Sets the image_signature_id of this OcirContainerJobEnvironmentConfigurationDetails. + OCID of the container image signature + + + :param image_signature_id: The image_signature_id of this OcirContainerJobEnvironmentConfigurationDetails. + :type: str + """ + self._image_signature_id = image_signature_id + + 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/data_science/models/project.py b/src/oci/data_science/models/project.py index 036b0d2cff..b3f7df109f 100644 --- a/src/oci/data_science/models/project.py +++ b/src/oci/data_science/models/project.py @@ -70,6 +70,10 @@ def __init__(self, **kwargs): The value to assign to the defined_tags property of this Project. :type defined_tags: dict(str, dict(str, object)) + :param system_tags: + The value to assign to the system_tags property of this Project. + :type system_tags: dict(str, dict(str, object)) + """ self.swagger_types = { 'id': 'str', @@ -80,7 +84,8 @@ def __init__(self, **kwargs): 'created_by': 'str', 'lifecycle_state': '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 = { @@ -92,7 +97,8 @@ def __init__(self, **kwargs): 'created_by': 'createdBy', 'lifecycle_state': 'lifecycleState', 'freeform_tags': 'freeformTags', - 'defined_tags': 'definedTags' + 'defined_tags': 'definedTags', + 'system_tags': 'systemTags' } self._id = None @@ -104,6 +110,7 @@ def __init__(self, **kwargs): self._lifecycle_state = None self._freeform_tags = None self._defined_tags = None + self._system_tags = None @property def id(self): @@ -357,6 +364,32 @@ def defined_tags(self, defined_tags): """ self._defined_tags = defined_tags + @property + def system_tags(self): + """ + Gets the system_tags of this Project. + 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 Project. + :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 Project. + 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 Project. + :type: dict(str, dict(str, object)) + """ + self._system_tags = system_tags + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/data_science/models/project_summary.py b/src/oci/data_science/models/project_summary.py index 11a57cd587..fcc67ff2d0 100644 --- a/src/oci/data_science/models/project_summary.py +++ b/src/oci/data_science/models/project_summary.py @@ -70,6 +70,10 @@ def __init__(self, **kwargs): The value to assign to the defined_tags property of this ProjectSummary. :type defined_tags: dict(str, dict(str, object)) + :param system_tags: + The value to assign to the system_tags property of this ProjectSummary. + :type system_tags: dict(str, dict(str, object)) + """ self.swagger_types = { 'id': 'str', @@ -80,7 +84,8 @@ def __init__(self, **kwargs): 'created_by': 'str', 'lifecycle_state': '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 = { @@ -92,7 +97,8 @@ def __init__(self, **kwargs): 'created_by': 'createdBy', 'lifecycle_state': 'lifecycleState', 'freeform_tags': 'freeformTags', - 'defined_tags': 'definedTags' + 'defined_tags': 'definedTags', + 'system_tags': 'systemTags' } self._id = None @@ -104,6 +110,7 @@ def __init__(self, **kwargs): self._lifecycle_state = None self._freeform_tags = None self._defined_tags = None + self._system_tags = None @property def id(self): @@ -357,6 +364,32 @@ def defined_tags(self, defined_tags): """ self._defined_tags = defined_tags + @property + def system_tags(self): + """ + Gets the system_tags of this ProjectSummary. + 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 ProjectSummary. + :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 ProjectSummary. + 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 ProjectSummary. + :type: dict(str, dict(str, object)) + """ + self._system_tags = system_tags + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/desktops/__init__.py b/src/oci/desktops/__init__.py new file mode 100644 index 0000000000..eea748e600 --- /dev/null +++ b/src/oci/desktops/__init__.py @@ -0,0 +1,14 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + +from __future__ import absolute_import + + +from .desktop_service_client import DesktopServiceClient +from .desktop_service_client_composite_operations import DesktopServiceClientCompositeOperations +from . import models + +__all__ = ["DesktopServiceClient", "DesktopServiceClientCompositeOperations", "models"] diff --git a/src/oci/desktops/desktop_service_client.py b/src/oci/desktops/desktop_service_client.py new file mode 100644 index 0000000000..bc451a8c53 --- /dev/null +++ b/src/oci/desktops/desktop_service_client.py @@ -0,0 +1,2649 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + +from __future__ import absolute_import + +from oci._vendor import requests # noqa: F401 +from oci._vendor import six + +from oci import retry, circuit_breaker # 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 oci.exceptions import InvalidAlloyConfig +from oci.alloy import OCI_SDK_ENABLED_SERVICES_SET +from .models import desktops_type_mapping +missing = Sentinel("Missing") + + +class DesktopServiceClient(object): + """ + Create and manage cloud-hosted desktops which can be accessed from a web browser or installed client. + """ + + 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 `__. + + :param obj circuit_breaker_strategy: (optional) + A circuit breaker strategy to apply to all calls made by this service client (i.e. at the client level). + This client uses :py:data:`~oci.circuit_breaker.DEFAULT_CIRCUIT_BREAKER_STRATEGY` as default if no circuit breaker strategy is provided. + The specifics of circuit breaker strategy are described `here `__. + + :param function circuit_breaker_callback: (optional) + Callback function to receive any exceptions triggerred by the circuit breaker. + + :param bool client_level_realm_specific_endpoint_template_enabled: (optional) + A boolean flag to indicate whether or not this client should be created with realm specific endpoint template enabled or disable. By default, this will be set as None. + + :param allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this client should allow control characters in the response object. By default, the client will not + allow control characters to be in the response object. + """ + if not OCI_SDK_ENABLED_SERVICES_SET.is_service_enabled("desktops"): + raise InvalidAlloyConfig("The Alloy configuration has disabled this service, this behavior is controlled by OCI_SDK_ENABLED_SERVICES_SET variable. Please check if your local alloy-config file configured the service you're targeting or contact the cloud provider on the availability of this service") + + 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'), + 'base_path': '/20220618', + 'service_endpoint_template': 'https://api.desktops.{region}.oci.{secondLevelDomain}', + 'service_endpoint_template_per_realm': { }, # noqa: E201 E202 + 'skip_deserialization': kwargs.get('skip_deserialization', False), + 'circuit_breaker_strategy': kwargs.get('circuit_breaker_strategy', circuit_breaker.GLOBAL_CIRCUIT_BREAKER_STRATEGY), + 'client_level_realm_specific_endpoint_template_enabled': kwargs.get('client_level_realm_specific_endpoint_template_enabled') + } + if 'timeout' in kwargs: + base_client_init_kwargs['timeout'] = kwargs.get('timeout') + if base_client_init_kwargs.get('circuit_breaker_strategy') is None: + base_client_init_kwargs['circuit_breaker_strategy'] = circuit_breaker.DEFAULT_CIRCUIT_BREAKER_STRATEGY + if 'allow_control_chars' in kwargs: + base_client_init_kwargs['allow_control_chars'] = kwargs.get('allow_control_chars') + self.base_client = BaseClient("desktop_service", config, signer, desktops_type_mapping, **base_client_init_kwargs) + self.retry_strategy = kwargs.get('retry_strategy') + self.circuit_breaker_callback = kwargs.get('circuit_breaker_callback') + + def cancel_work_request(self, work_request_id, **kwargs): + """ + Cancel work request with the given ID. + + + :param str work_request_id: (required) + The ID of the asynchronous request. + + :param str if_match: (optional) + For optimistic concurrency control. + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use cancel_work_request API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['workRequestId'] + resource_path = "/workRequests/{workRequestId}" + method = "DELETE" + operation_name = "cancel_work_request" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "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( + f"cancel_work_request got unknown kwargs: {extra_kwargs!r}") + + 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(f'Parameter {k} cannot be None, whitespace or empty string') + + 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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def change_desktop_pool_compartment(self, desktop_pool_id, change_desktop_pool_compartment_details, **kwargs): + """ + Moves a desktop pool into a different compartment within the same tenancy. You must provide the OCID of the desktop pool and the OCID of the compartment that you are moving the pool to. + + + :param str desktop_pool_id: (required) + The OCID of the desktop pool. + + :param oci.desktops.models.ChangeDesktopPoolCompartmentDetails change_desktop_pool_compartment_details: (required) + The details of the new compartment of the desktop pool. + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :param str if_match: (optional) + For optimistic concurrency control. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use change_desktop_pool_compartment API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['desktopPoolId'] + resource_path = "/desktopPools/{desktopPoolId}/actions/changeCompartment" + method = "POST" + operation_name = "change_desktop_pool_compartment" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "opc_request_id", + "if_match", + "opc_retry_token" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"change_desktop_pool_compartment got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "desktopPoolId": desktop_pool_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(f'Parameter {k} cannot be None, whitespace or empty string') + + 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), + "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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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=change_desktop_pool_compartment_details, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=change_desktop_pool_compartment_details, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def create_desktop_pool(self, create_desktop_pool_details, **kwargs): + """ + Creates a desktop pool with the given configuration parameters. + + + :param oci.desktops.models.CreateDesktopPoolDetails create_desktop_pool_details: (required) + The details of the desktop pool to create. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request. + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.desktops.models.DesktopPool` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use create_desktop_pool API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = [] + resource_path = "/desktopPools" + method = "POST" + operation_name = "create_desktop_pool" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "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( + f"create_desktop_pool got unknown kwargs: {extra_kwargs!r}") + + 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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + header_params=header_params, + body=create_desktop_pool_details, + response_type="DesktopPool", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + header_params=header_params, + body=create_desktop_pool_details, + response_type="DesktopPool", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def delete_desktop(self, desktop_id, **kwargs): + """ + Deletes the desktop with the specified OCID. The service terminates the associated compute instance. The end-user loses access to the desktop instance permanently. Any associated block volume becomes inactive but is not deleted. + + + :param str desktop_id: (required) + The OCID of the desktop. + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :param str if_match: (optional) + For optimistic concurrency control. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use delete_desktop API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['desktopId'] + resource_path = "/desktops/{desktopId}" + method = "DELETE" + operation_name = "delete_desktop" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "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( + f"delete_desktop got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "desktopId": desktop_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(f'Parameter {k} cannot be None, whitespace or empty string') + + 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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def delete_desktop_pool(self, desktop_pool_id, **kwargs): + """ + Deletes a desktop pool with the specified OCID. The service terminates all compute instances and users immediately lose access to their desktops. You can choose to preserve the block volumes associated with the pool. + + + :param str desktop_pool_id: (required) + The OCID of the desktop pool. + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :param str if_match: (optional) + For optimistic concurrency control. + + :param bool are_volumes_preserved: (optional) + Whether the volumes are preserved when a desktop pool is deleted. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use delete_desktop_pool API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['desktopPoolId'] + resource_path = "/desktopPools/{desktopPoolId}" + method = "DELETE" + operation_name = "delete_desktop_pool" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "opc_request_id", + "if_match", + "are_volumes_preserved" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"delete_desktop_pool got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "desktopPoolId": desktop_pool_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(f'Parameter {k} cannot be None, whitespace or empty string') + + query_params = { + "areVolumesPreserved": kwargs.get("are_volumes_preserved", 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), + "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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + 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, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def get_desktop(self, desktop_id, **kwargs): + """ + Provides information about the desktop with the specified OCID. + + + :param str desktop_id: (required) + The OCID of the desktop. + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.desktops.models.Desktop` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use get_desktop API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['desktopId'] + resource_path = "/desktops/{desktopId}" + method = "GET" + operation_name = "get_desktop" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "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( + f"get_desktop got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "desktopId": desktop_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(f'Parameter {k} cannot be None, whitespace or empty string') + + 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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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="Desktop", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="Desktop", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def get_desktop_pool(self, desktop_pool_id, **kwargs): + """ + Returns information about the desktop pool including all configuration parameters and the current state. + + + :param str desktop_pool_id: (required) + The OCID of the desktop pool. + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.desktops.models.DesktopPool` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use get_desktop_pool API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['desktopPoolId'] + resource_path = "/desktopPools/{desktopPoolId}" + method = "GET" + operation_name = "get_desktop_pool" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "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( + f"get_desktop_pool got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "desktopPoolId": desktop_pool_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(f'Parameter {k} cannot be None, whitespace or empty string') + + 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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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="DesktopPool", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="DesktopPool", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + 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 unique identifier of the request. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.desktops.models.WorkRequest` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use get_work_request API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['workRequestId'] + resource_path = "/workRequests/{workRequestId}" + method = "GET" + operation_name = "get_work_request" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "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( + f"get_work_request got unknown kwargs: {extra_kwargs!r}") + + 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(f'Parameter {k} cannot be None, whitespace or empty string') + + 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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="WorkRequest", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def list_desktop_pool_desktops(self, compartment_id, desktop_pool_id, **kwargs): + """ + Returns a list of desktops within a given desktop pool. You can limit the results to an availability domain, desktop name, or desktop state. You can limit the number of results returned, sort the results by time or name, and sort in ascending or descending order. + + + :param str compartment_id: (required) + The OCID of the compartment of the desktop pool. + + :param str desktop_pool_id: (required) + The OCID of the desktop pool. + + :param str availability_domain: (optional) + The name of the availability domain. + + :param str display_name: (optional) + A filter to return only results with the given displayName. + + :param str id: (optional) + A filter to return only results with the given OCID. + + :param str lifecycle_state: (optional) + A filter to return only results with the given lifecycleState. + + :param int limit: (optional) + The maximum number of results to return. + + :param str sort_by: (optional) + A field to sort by. + + Allowed values are: "TIMECREATED", "DISPLAYNAME" + + :param str sort_order: (optional) + A field to indicate the sort order. + + Allowed values are: "ASC", "DESC" + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :param str page: (optional) + For list pagination. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.desktops.models.DesktopPoolDesktopCollection` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use list_desktop_pool_desktops API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['desktopPoolId', 'compartmentId'] + resource_path = "/desktopPools/{desktopPoolId}/desktops" + method = "GET" + operation_name = "list_desktop_pool_desktops" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "availability_domain", + "display_name", + "id", + "lifecycle_state", + "limit", + "sort_by", + "sort_order", + "opc_request_id", + "page" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"list_desktop_pool_desktops got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "desktopPoolId": desktop_pool_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(f'Parameter {k} cannot be None, whitespace or empty string') + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + f"Invalid value for `sort_by`, must be one of { 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( + f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" + ) + + query_params = { + "compartmentId": compartment_id, + "availabilityDomain": kwargs.get("availability_domain", missing), + "displayName": kwargs.get("display_name", missing), + "id": kwargs.get("id", missing), + "lifecycleState": kwargs.get("lifecycle_state", missing), + "limit": kwargs.get("limit", missing), + "sortBy": kwargs.get("sort_by", missing), + "sortOrder": kwargs.get("sort_order", missing), + "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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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="DesktopPoolDesktopCollection", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + 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="DesktopPoolDesktopCollection", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def list_desktop_pool_volumes(self, desktop_pool_id, compartment_id, **kwargs): + """ + Returns a list of volumes within the given desktop pool. You can limit the results to an availability domain, volume name, or volume state. You can limit the number of results returned, sort the results by time or name, and sort in ascending or descending order. + + + :param str desktop_pool_id: (required) + The OCID of the desktop pool. + + :param str compartment_id: (required) + The OCID of the compartment of the desktop pool. + + :param str availability_domain: (optional) + The name of the availability domain. + + :param str display_name: (optional) + A filter to return only results with the given displayName. + + :param str id: (optional) + A filter to return only results with the given OCID. + + :param str lifecycle_state: (optional) + A filter to return only results with the given lifecycleState. + + :param int limit: (optional) + The maximum number of results to return. + + :param str sort_by: (optional) + A field to sort by. + + Allowed values are: "TIMECREATED", "DISPLAYNAME" + + :param str sort_order: (optional) + A field to indicate the sort order. + + Allowed values are: "ASC", "DESC" + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :param str page: (optional) + For list pagination. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.desktops.models.DesktopPoolVolumeCollection` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use list_desktop_pool_volumes API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['desktopPoolId', 'compartmentId'] + resource_path = "/desktopPools/{desktopPoolId}/volumes" + method = "GET" + operation_name = "list_desktop_pool_volumes" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "availability_domain", + "display_name", + "id", + "lifecycle_state", + "limit", + "sort_by", + "sort_order", + "opc_request_id", + "page" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"list_desktop_pool_volumes got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "desktopPoolId": desktop_pool_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(f'Parameter {k} cannot be None, whitespace or empty string') + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + f"Invalid value for `sort_by`, must be one of { 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( + f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" + ) + + query_params = { + "compartmentId": compartment_id, + "availabilityDomain": kwargs.get("availability_domain", missing), + "displayName": kwargs.get("display_name", missing), + "id": kwargs.get("id", missing), + "lifecycleState": kwargs.get("lifecycle_state", missing), + "limit": kwargs.get("limit", missing), + "sortBy": kwargs.get("sort_by", missing), + "sortOrder": kwargs.get("sort_order", missing), + "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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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="DesktopPoolVolumeCollection", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + 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="DesktopPoolVolumeCollection", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def list_desktop_pools(self, compartment_id, **kwargs): + """ + Returns a list of desktop pools within the given compartment. You can limit the results to an availability domain, pool name, or pool state. You can limit the number of results returned, sort the results by time or name, and sort in ascending or descending order. + + + :param str compartment_id: (required) + The OCID of the compartment of the desktop pool. + + :param str availability_domain: (optional) + The name of the availability domain. + + :param str display_name: (optional) + A filter to return only results with the given displayName. + + :param str id: (optional) + A filter to return only results with the given OCID. + + :param str lifecycle_state: (optional) + A filter to return only results with the given lifecycleState. + + :param int limit: (optional) + The maximum number of results to return. + + :param str sort_by: (optional) + A field to sort by. + + Allowed values are: "TIMECREATED", "DISPLAYNAME" + + :param str sort_order: (optional) + A field to indicate the sort order. + + Allowed values are: "ASC", "DESC" + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :param str page: (optional) + For list pagination. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.desktops.models.DesktopPoolCollection` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use list_desktop_pools API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['compartmentId'] + resource_path = "/desktopPools" + method = "GET" + operation_name = "list_desktop_pools" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "availability_domain", + "display_name", + "id", + "lifecycle_state", + "limit", + "sort_by", + "sort_order", + "opc_request_id", + "page" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"list_desktop_pools got unknown kwargs: {extra_kwargs!r}") + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + f"Invalid value for `sort_by`, must be one of { 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( + f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" + ) + + query_params = { + "compartmentId": compartment_id, + "availabilityDomain": kwargs.get("availability_domain", missing), + "displayName": kwargs.get("display_name", missing), + "id": kwargs.get("id", missing), + "lifecycleState": kwargs.get("lifecycle_state", missing), + "limit": kwargs.get("limit", missing), + "sortBy": kwargs.get("sort_by", missing), + "sortOrder": kwargs.get("sort_order", missing), + "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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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="DesktopPoolCollection", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="DesktopPoolCollection", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def list_desktops(self, compartment_id, **kwargs): + """ + Returns a list of desktops filtered by the specified parameters. You can limit the results to an availability domain, desktop name, desktop OCID, desktop state, pool OCID, or compartment OCID. You can limit the number of results returned, sort the results by time or name, and sort in ascending or descending order. + + + :param str compartment_id: (required) + The OCID of the compartment of the desktop pool. + + :param str availability_domain: (optional) + The name of the availability domain. + + :param str display_name: (optional) + A filter to return only results with the given displayName. + + :param str id: (optional) + A filter to return only results with the given OCID. + + :param str lifecycle_state: (optional) + A filter to return only results with the given lifecycleState. + + :param int limit: (optional) + The maximum number of results to return. + + :param str sort_by: (optional) + A field to sort by. + + Allowed values are: "TIMECREATED", "DISPLAYNAME" + + :param str sort_order: (optional) + A field to indicate the sort order. + + Allowed values are: "ASC", "DESC" + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :param str page: (optional) + For list pagination. + + :param str desktop_pool_id: (optional) + The OCID of the desktop pool. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.desktops.models.DesktopCollection` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use list_desktops API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['compartmentId'] + resource_path = "/desktops" + method = "GET" + operation_name = "list_desktops" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "availability_domain", + "display_name", + "id", + "lifecycle_state", + "limit", + "sort_by", + "sort_order", + "opc_request_id", + "page", + "desktop_pool_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"list_desktops got unknown kwargs: {extra_kwargs!r}") + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + f"Invalid value for `sort_by`, must be one of { 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( + f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" + ) + + query_params = { + "availabilityDomain": kwargs.get("availability_domain", missing), + "displayName": kwargs.get("display_name", missing), + "id": kwargs.get("id", missing), + "lifecycleState": kwargs.get("lifecycle_state", missing), + "limit": kwargs.get("limit", missing), + "sortBy": kwargs.get("sort_by", missing), + "sortOrder": kwargs.get("sort_order", missing), + "compartmentId": compartment_id, + "page": kwargs.get("page", missing), + "desktopPoolId": kwargs.get("desktop_pool_id", 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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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="DesktopCollection", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="DesktopCollection", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def list_work_request_errors(self, work_request_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 opc_request_id: (optional) + The unique identifier of the request. + + :param str page: (optional) + For list pagination. + + :param int limit: (optional) + The maximum number of results to return. + + :param str sort_by: (optional) + The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending. + + Allowed values are: "timeAccepted" + + :param str sort_order: (optional) + A field to indicate the sort order. + + 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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.desktops.models.WorkRequestErrorCollection` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use list_work_request_errors API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['workRequestId'] + resource_path = "/workRequests/{workRequestId}/errors" + method = "GET" + operation_name = "list_work_request_errors" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "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( + f"list_work_request_errors got unknown kwargs: {extra_kwargs!r}") + + 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(f'Parameter {k} cannot be None, whitespace or empty string') + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["timeAccepted"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + f"Invalid value for `sort_by`, must be one of { 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( + f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" + ) + + query_params = { + "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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + 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", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def list_work_request_logs(self, work_request_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 opc_request_id: (optional) + The unique identifier of the request. + + :param str page: (optional) + For list pagination. + + :param int limit: (optional) + The maximum number of results to return. + + :param str sort_by: (optional) + The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending. + + Allowed values are: "timeAccepted" + + :param str sort_order: (optional) + A field to indicate the sort order. + + 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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.desktops.models.WorkRequestLogEntryCollection` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use list_work_request_logs API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['workRequestId'] + resource_path = "/workRequests/{workRequestId}/logs" + method = "GET" + operation_name = "list_work_request_logs" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "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( + f"list_work_request_logs got unknown kwargs: {extra_kwargs!r}") + + 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(f'Parameter {k} cannot be None, whitespace or empty string') + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["timeAccepted"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + f"Invalid value for `sort_by`, must be one of { 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( + f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" + ) + + query_params = { + "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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + 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", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def list_work_requests(self, compartment_id, **kwargs): + """ + Lists the work requests in a compartment. + + + :param str compartment_id: (required) + The OCID of the compartment of the desktop pool. + + :param str work_request_id: (optional) + The ID of the asynchronous work request. + + :param str status: (optional) + A filter to return only resources their lifecycleState matches the given OperationStatus. + + Allowed values are: "ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED" + + :param str resource_id: (optional) + The ID of the resource affected by the work request. + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :param str page: (optional) + For list pagination. + + :param int limit: (optional) + The maximum number of results to return. + + :param str sort_order: (optional) + A field to indicate the sort order. + + Allowed values are: "ASC", "DESC" + + :param str sort_by: (optional) + The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending. + + Allowed values are: "timeAccepted" + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.desktops.models.WorkRequestSummaryCollection` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use list_work_requests API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['compartmentId'] + resource_path = "/workRequests" + method = "GET" + operation_name = "list_work_requests" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "work_request_id", + "status", + "resource_id", + "opc_request_id", + "page", + "limit", + "sort_order", + "sort_by" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"list_work_requests got unknown kwargs: {extra_kwargs!r}") + + if 'status' in kwargs: + status_allowed_values = ["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"] + if kwargs['status'] not in status_allowed_values: + raise ValueError( + f"Invalid value for `status`, must be one of { status_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( + f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" + ) + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["timeAccepted"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" + ) + + query_params = { + "compartmentId": compartment_id, + "workRequestId": kwargs.get("work_request_id", missing), + "status": kwargs.get("status", missing), + "resourceId": kwargs.get("resource_id", missing), + "page": kwargs.get("page", missing), + "limit": kwargs.get("limit", missing), + "sortOrder": kwargs.get("sort_order", missing), + "sortBy": kwargs.get("sort_by", 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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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="WorkRequestSummaryCollection", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="WorkRequestSummaryCollection", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def start_desktop(self, desktop_id, **kwargs): + """ + Starts the desktop with the specified OCID. + + + :param str desktop_id: (required) + The OCID of the desktop. + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :param str if_match: (optional) + For optimistic concurrency control. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use start_desktop API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['desktopId'] + resource_path = "/desktops/{desktopId}/actions/start" + method = "POST" + operation_name = "start_desktop" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "opc_request_id", + "if_match", + "opc_retry_token" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"start_desktop got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "desktopId": desktop_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(f'Parameter {k} cannot be None, whitespace or empty string') + + 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), + "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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def start_desktop_pool(self, desktop_pool_id, **kwargs): + """ + Starts the desktop pool with the specified OCID. Once the pool is ACTIVE, users will have access to their desktops within the pool. + + + :param str desktop_pool_id: (required) + The OCID of the desktop pool. + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :param str if_match: (optional) + For optimistic concurrency control. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use start_desktop_pool API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['desktopPoolId'] + resource_path = "/desktopPools/{desktopPoolId}/actions/start" + method = "POST" + operation_name = "start_desktop_pool" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "opc_request_id", + "if_match", + "opc_retry_token" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"start_desktop_pool got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "desktopPoolId": desktop_pool_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(f'Parameter {k} cannot be None, whitespace or empty string') + + 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), + "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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def stop_desktop(self, desktop_id, **kwargs): + """ + Stops the desktop with the specified OCID. Stopping a desktop causes the end-user to lose access to their desktop instance until the desktop is restarted. + + + :param str desktop_id: (required) + The OCID of the desktop. + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :param str if_match: (optional) + For optimistic concurrency control. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use stop_desktop API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['desktopId'] + resource_path = "/desktops/{desktopId}/actions/stop" + method = "POST" + operation_name = "stop_desktop" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "opc_request_id", + "if_match", + "opc_retry_token" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"stop_desktop got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "desktopId": desktop_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(f'Parameter {k} cannot be None, whitespace or empty string') + + 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), + "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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def stop_desktop_pool(self, desktop_pool_id, **kwargs): + """ + Stops the desktop pool with the specified OCID. Users will lose access to their desktops until you explicitly start the pool again. + + + :param str desktop_pool_id: (required) + The OCID of the desktop pool. + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :param str if_match: (optional) + For optimistic concurrency control. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use stop_desktop_pool API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['desktopPoolId'] + resource_path = "/desktopPools/{desktopPoolId}/actions/stop" + method = "POST" + operation_name = "stop_desktop_pool" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "opc_request_id", + "if_match", + "opc_retry_token" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"stop_desktop_pool got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "desktopPoolId": desktop_pool_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(f'Parameter {k} cannot be None, whitespace or empty string') + + 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), + "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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def update_desktop(self, desktop_id, update_desktop_details, **kwargs): + """ + Modifies information about the desktop such as the name. + + + :param str desktop_id: (required) + The OCID of the desktop. + + :param oci.desktops.models.UpdateDesktopDetails update_desktop_details: (required) + The details of the update. + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :param str if_match: (optional) + For optimistic concurrency control. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use update_desktop API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['desktopId'] + resource_path = "/desktops/{desktopId}" + method = "PUT" + operation_name = "update_desktop" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "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( + f"update_desktop got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "desktopId": desktop_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(f'Parameter {k} cannot be None, whitespace or empty string') + + 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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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_desktop_details, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_desktop_details, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def update_desktop_pool(self, desktop_pool_id, update_desktop_pool_details, **kwargs): + """ + Modifies the configuration of the desktop pool such as the availability, contact information, description, name, device policy, pool size, standby size, and start or stop time. + + + :param str desktop_pool_id: (required) + The OCID of the desktop pool. + + :param oci.desktops.models.UpdateDesktopPoolDetails update_desktop_pool_details: (required) + The details of the update. + + :param str opc_request_id: (optional) + The unique identifier of the request. + + :param str if_match: (optional) + For optimistic concurrency control. + + :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. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + 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`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use update_desktop_pool API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['desktopPoolId'] + resource_path = "/desktopPools/{desktopPoolId}" + method = "PUT" + operation_name = "update_desktop_pool" + api_reference_link = "" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "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( + f"update_desktop_pool got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "desktopPoolId": desktop_pool_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(f'Parameter {k} cannot be None, whitespace or empty string') + + 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.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + 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_desktop_pool_details, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_desktop_pool_details, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) diff --git a/src/oci/desktops/desktop_service_client_composite_operations.py b/src/oci/desktops/desktop_service_client_composite_operations.py new file mode 100644 index 0000000000..d77adfc3e4 --- /dev/null +++ b/src/oci/desktops/desktop_service_client_composite_operations.py @@ -0,0 +1,441 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + +import oci # noqa: F401 +from oci.util import WAIT_RESOURCE_NOT_FOUND # noqa: F401 + + +class DesktopServiceClientCompositeOperations(object): + """ + This class provides a wrapper around :py:class:`~oci.desktops.DesktopServiceClient` 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 DesktopServiceClientCompositeOperations object + + :param DesktopServiceClient client: + The service client which will be wrapped by this object + """ + self.client = client + + def change_desktop_pool_compartment_and_wait_for_state(self, desktop_pool_id, change_desktop_pool_compartment_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.desktops.DesktopServiceClient.change_desktop_pool_compartment` and waits for the :py:class:`~oci.desktops.models.WorkRequest` + to enter the given state(s). + + :param str desktop_pool_id: (required) + The OCID of the desktop pool. + + :param oci.desktops.models.ChangeDesktopPoolCompartmentDetails change_desktop_pool_compartment_details: (required) + The details of the new compartment of the desktop pool. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.desktops.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.desktops.DesktopServiceClient.change_desktop_pool_compartment` + + :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.change_desktop_pool_compartment(desktop_pool_id, change_desktop_pool_compartment_details, **operation_kwargs) + if not wait_for_states: + return operation_result + lowered_wait_for_states = [w.lower() for w in wait_for_states] + if 'opc-work-request-id' not in operation_result.headers: + return operation_result + 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_desktop_pool_and_wait_for_state(self, create_desktop_pool_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.desktops.DesktopServiceClient.create_desktop_pool` and waits for the :py:class:`~oci.desktops.models.WorkRequest` + to enter the given state(s). + + :param oci.desktops.models.CreateDesktopPoolDetails create_desktop_pool_details: (required) + The details of the desktop pool to create. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.desktops.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.desktops.DesktopServiceClient.create_desktop_pool` + + :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_desktop_pool(create_desktop_pool_details, **operation_kwargs) + if not wait_for_states: + return operation_result + lowered_wait_for_states = [w.lower() for w in wait_for_states] + if 'opc-work-request-id' not in operation_result.headers: + return operation_result + 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 delete_desktop_and_wait_for_state(self, desktop_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.desktops.DesktopServiceClient.delete_desktop` and waits for the :py:class:`~oci.desktops.models.WorkRequest` + to enter the given state(s). + + :param str desktop_id: (required) + The OCID of the desktop. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.desktops.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.desktops.DesktopServiceClient.delete_desktop` + + :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 = None + try: + operation_result = self.client.delete_desktop(desktop_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] + if 'opc-work-request-id' not in operation_result.headers: + return operation_result + 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 delete_desktop_pool_and_wait_for_state(self, desktop_pool_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.desktops.DesktopServiceClient.delete_desktop_pool` and waits for the :py:class:`~oci.desktops.models.WorkRequest` + to enter the given state(s). + + :param str desktop_pool_id: (required) + The OCID of the desktop pool. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.desktops.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.desktops.DesktopServiceClient.delete_desktop_pool` + + :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 = None + try: + operation_result = self.client.delete_desktop_pool(desktop_pool_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] + if 'opc-work-request-id' not in operation_result.headers: + return operation_result + 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 start_desktop_and_wait_for_state(self, desktop_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.desktops.DesktopServiceClient.start_desktop` and waits for the :py:class:`~oci.desktops.models.WorkRequest` + to enter the given state(s). + + :param str desktop_id: (required) + The OCID of the desktop. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.desktops.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.desktops.DesktopServiceClient.start_desktop` + + :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.start_desktop(desktop_id, **operation_kwargs) + if not wait_for_states: + return operation_result + lowered_wait_for_states = [w.lower() for w in wait_for_states] + if 'opc-work-request-id' not in operation_result.headers: + return operation_result + 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 start_desktop_pool_and_wait_for_state(self, desktop_pool_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.desktops.DesktopServiceClient.start_desktop_pool` and waits for the :py:class:`~oci.desktops.models.WorkRequest` + to enter the given state(s). + + :param str desktop_pool_id: (required) + The OCID of the desktop pool. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.desktops.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.desktops.DesktopServiceClient.start_desktop_pool` + + :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.start_desktop_pool(desktop_pool_id, **operation_kwargs) + if not wait_for_states: + return operation_result + lowered_wait_for_states = [w.lower() for w in wait_for_states] + if 'opc-work-request-id' not in operation_result.headers: + return operation_result + 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 stop_desktop_and_wait_for_state(self, desktop_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.desktops.DesktopServiceClient.stop_desktop` and waits for the :py:class:`~oci.desktops.models.WorkRequest` + to enter the given state(s). + + :param str desktop_id: (required) + The OCID of the desktop. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.desktops.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.desktops.DesktopServiceClient.stop_desktop` + + :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.stop_desktop(desktop_id, **operation_kwargs) + if not wait_for_states: + return operation_result + lowered_wait_for_states = [w.lower() for w in wait_for_states] + if 'opc-work-request-id' not in operation_result.headers: + return operation_result + 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 stop_desktop_pool_and_wait_for_state(self, desktop_pool_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.desktops.DesktopServiceClient.stop_desktop_pool` and waits for the :py:class:`~oci.desktops.models.WorkRequest` + to enter the given state(s). + + :param str desktop_pool_id: (required) + The OCID of the desktop pool. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.desktops.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.desktops.DesktopServiceClient.stop_desktop_pool` + + :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.stop_desktop_pool(desktop_pool_id, **operation_kwargs) + if not wait_for_states: + return operation_result + lowered_wait_for_states = [w.lower() for w in wait_for_states] + if 'opc-work-request-id' not in operation_result.headers: + return operation_result + 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_desktop_and_wait_for_state(self, desktop_id, update_desktop_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.desktops.DesktopServiceClient.update_desktop` and waits for the :py:class:`~oci.desktops.models.WorkRequest` + to enter the given state(s). + + :param str desktop_id: (required) + The OCID of the desktop. + + :param oci.desktops.models.UpdateDesktopDetails update_desktop_details: (required) + The details of the update. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.desktops.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.desktops.DesktopServiceClient.update_desktop` + + :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_desktop(desktop_id, update_desktop_details, **operation_kwargs) + if not wait_for_states: + return operation_result + lowered_wait_for_states = [w.lower() for w in wait_for_states] + if 'opc-work-request-id' not in operation_result.headers: + return operation_result + 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_desktop_pool_and_wait_for_state(self, desktop_pool_id, update_desktop_pool_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.desktops.DesktopServiceClient.update_desktop_pool` and waits for the :py:class:`~oci.desktops.models.WorkRequest` + to enter the given state(s). + + :param str desktop_pool_id: (required) + The OCID of the desktop pool. + + :param oci.desktops.models.UpdateDesktopPoolDetails update_desktop_pool_details: (required) + The details of the update. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.desktops.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.desktops.DesktopServiceClient.update_desktop_pool` + + :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_desktop_pool(desktop_pool_id, update_desktop_pool_details, **operation_kwargs) + if not wait_for_states: + return operation_result + lowered_wait_for_states = [w.lower() for w in wait_for_states] + if 'opc-work-request-id' not in operation_result.headers: + return operation_result + 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) diff --git a/src/oci/desktops/models/__init__.py b/src/oci/desktops/models/__init__.py new file mode 100644 index 0000000000..b695403061 --- /dev/null +++ b/src/oci/desktops/models/__init__.py @@ -0,0 +1,68 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + +from __future__ import absolute_import + +from .change_desktop_pool_compartment_details import ChangeDesktopPoolCompartmentDetails +from .create_desktop_pool_details import CreateDesktopPoolDetails +from .desktop import Desktop +from .desktop_availability_policy import DesktopAvailabilityPolicy +from .desktop_collection import DesktopCollection +from .desktop_device_policy import DesktopDevicePolicy +from .desktop_image import DesktopImage +from .desktop_network_configuration import DesktopNetworkConfiguration +from .desktop_pool import DesktopPool +from .desktop_pool_collection import DesktopPoolCollection +from .desktop_pool_desktop_collection import DesktopPoolDesktopCollection +from .desktop_pool_desktop_summary import DesktopPoolDesktopSummary +from .desktop_pool_summary import DesktopPoolSummary +from .desktop_pool_volume_collection import DesktopPoolVolumeCollection +from .desktop_pool_volume_summary import DesktopPoolVolumeSummary +from .desktop_schedule import DesktopSchedule +from .desktop_summary import DesktopSummary +from .hosting_options import HostingOptions +from .update_desktop_details import UpdateDesktopDetails +from .update_desktop_pool_details import UpdateDesktopPoolDetails +from .work_request import WorkRequest +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 +from .work_request_summary_collection import WorkRequestSummaryCollection + +# Maps type names to classes for desktops services. +desktops_type_mapping = { + "ChangeDesktopPoolCompartmentDetails": ChangeDesktopPoolCompartmentDetails, + "CreateDesktopPoolDetails": CreateDesktopPoolDetails, + "Desktop": Desktop, + "DesktopAvailabilityPolicy": DesktopAvailabilityPolicy, + "DesktopCollection": DesktopCollection, + "DesktopDevicePolicy": DesktopDevicePolicy, + "DesktopImage": DesktopImage, + "DesktopNetworkConfiguration": DesktopNetworkConfiguration, + "DesktopPool": DesktopPool, + "DesktopPoolCollection": DesktopPoolCollection, + "DesktopPoolDesktopCollection": DesktopPoolDesktopCollection, + "DesktopPoolDesktopSummary": DesktopPoolDesktopSummary, + "DesktopPoolSummary": DesktopPoolSummary, + "DesktopPoolVolumeCollection": DesktopPoolVolumeCollection, + "DesktopPoolVolumeSummary": DesktopPoolVolumeSummary, + "DesktopSchedule": DesktopSchedule, + "DesktopSummary": DesktopSummary, + "HostingOptions": HostingOptions, + "UpdateDesktopDetails": UpdateDesktopDetails, + "UpdateDesktopPoolDetails": UpdateDesktopPoolDetails, + "WorkRequest": WorkRequest, + "WorkRequestError": WorkRequestError, + "WorkRequestErrorCollection": WorkRequestErrorCollection, + "WorkRequestLogEntry": WorkRequestLogEntry, + "WorkRequestLogEntryCollection": WorkRequestLogEntryCollection, + "WorkRequestResource": WorkRequestResource, + "WorkRequestSummary": WorkRequestSummary, + "WorkRequestSummaryCollection": WorkRequestSummaryCollection +} diff --git a/src/oci/desktops/models/change_desktop_pool_compartment_details.py b/src/oci/desktops/models/change_desktop_pool_compartment_details.py new file mode 100644 index 0000000000..53fa6709ea --- /dev/null +++ b/src/oci/desktops/models/change_desktop_pool_compartment_details.py @@ -0,0 +1,72 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 ChangeDesktopPoolCompartmentDetails(object): + """ + Provides the OCID of the new compartment that will contain the desktop pool. + """ + + def __init__(self, **kwargs): + """ + Initializes a new ChangeDesktopPoolCompartmentDetails 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 ChangeDesktopPoolCompartmentDetails. + :type compartment_id: str + + """ + self.swagger_types = { + 'compartment_id': 'str' + } + + self.attribute_map = { + 'compartment_id': 'compartmentId' + } + + self._compartment_id = None + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this ChangeDesktopPoolCompartmentDetails. + The OCID of the compartment which will contain the desktop pool. + + + :return: The compartment_id of this ChangeDesktopPoolCompartmentDetails. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this ChangeDesktopPoolCompartmentDetails. + The OCID of the compartment which will contain the desktop pool. + + + :param compartment_id: The compartment_id of this ChangeDesktopPoolCompartmentDetails. + :type: str + """ + self._compartment_id = compartment_id + + 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/desktops/models/create_desktop_pool_details.py b/src/oci/desktops/models/create_desktop_pool_details.py new file mode 100644 index 0000000000..ed6001b716 --- /dev/null +++ b/src/oci/desktops/models/create_desktop_pool_details.py @@ -0,0 +1,694 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 CreateDesktopPoolDetails(object): + """ + Provides the configuration information used to create the desktop pool. + """ + + def __init__(self, **kwargs): + """ + Initializes a new CreateDesktopPoolDetails 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 CreateDesktopPoolDetails. + :type compartment_id: str + + :param display_name: + The value to assign to the display_name property of this CreateDesktopPoolDetails. + :type display_name: str + + :param description: + The value to assign to the description property of this CreateDesktopPoolDetails. + :type description: str + + :param maximum_size: + The value to assign to the maximum_size property of this CreateDesktopPoolDetails. + :type maximum_size: int + + :param standby_size: + The value to assign to the standby_size property of this CreateDesktopPoolDetails. + :type standby_size: int + + :param shape_name: + The value to assign to the shape_name property of this CreateDesktopPoolDetails. + :type shape_name: str + + :param is_storage_enabled: + The value to assign to the is_storage_enabled property of this CreateDesktopPoolDetails. + :type is_storage_enabled: bool + + :param storage_size_in_gbs: + The value to assign to the storage_size_in_gbs property of this CreateDesktopPoolDetails. + :type storage_size_in_gbs: int + + :param storage_backup_policy_id: + The value to assign to the storage_backup_policy_id property of this CreateDesktopPoolDetails. + :type storage_backup_policy_id: str + + :param device_policy: + The value to assign to the device_policy property of this CreateDesktopPoolDetails. + :type device_policy: oci.desktops.models.DesktopDevicePolicy + + :param availability_policy: + The value to assign to the availability_policy property of this CreateDesktopPoolDetails. + :type availability_policy: oci.desktops.models.DesktopAvailabilityPolicy + + :param image: + The value to assign to the image property of this CreateDesktopPoolDetails. + :type image: oci.desktops.models.DesktopImage + + :param network_configuration: + The value to assign to the network_configuration property of this CreateDesktopPoolDetails. + :type network_configuration: oci.desktops.models.DesktopNetworkConfiguration + + :param time_start_scheduled: + The value to assign to the time_start_scheduled property of this CreateDesktopPoolDetails. + :type time_start_scheduled: datetime + + :param time_stop_scheduled: + The value to assign to the time_stop_scheduled property of this CreateDesktopPoolDetails. + :type time_stop_scheduled: datetime + + :param contact_details: + The value to assign to the contact_details property of this CreateDesktopPoolDetails. + :type contact_details: str + + :param are_privileged_users: + The value to assign to the are_privileged_users property of this CreateDesktopPoolDetails. + :type are_privileged_users: bool + + :param availability_domain: + The value to assign to the availability_domain property of this CreateDesktopPoolDetails. + :type availability_domain: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this CreateDesktopPoolDetails. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this CreateDesktopPoolDetails. + :type defined_tags: dict(str, dict(str, object)) + + :param nsg_ids: + The value to assign to the nsg_ids property of this CreateDesktopPoolDetails. + :type nsg_ids: list[str] + + """ + self.swagger_types = { + 'compartment_id': 'str', + 'display_name': 'str', + 'description': 'str', + 'maximum_size': 'int', + 'standby_size': 'int', + 'shape_name': 'str', + 'is_storage_enabled': 'bool', + 'storage_size_in_gbs': 'int', + 'storage_backup_policy_id': 'str', + 'device_policy': 'DesktopDevicePolicy', + 'availability_policy': 'DesktopAvailabilityPolicy', + 'image': 'DesktopImage', + 'network_configuration': 'DesktopNetworkConfiguration', + 'time_start_scheduled': 'datetime', + 'time_stop_scheduled': 'datetime', + 'contact_details': 'str', + 'are_privileged_users': 'bool', + 'availability_domain': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))', + 'nsg_ids': 'list[str]' + } + + self.attribute_map = { + 'compartment_id': 'compartmentId', + 'display_name': 'displayName', + 'description': 'description', + 'maximum_size': 'maximumSize', + 'standby_size': 'standbySize', + 'shape_name': 'shapeName', + 'is_storage_enabled': 'isStorageEnabled', + 'storage_size_in_gbs': 'storageSizeInGBs', + 'storage_backup_policy_id': 'storageBackupPolicyId', + 'device_policy': 'devicePolicy', + 'availability_policy': 'availabilityPolicy', + 'image': 'image', + 'network_configuration': 'networkConfiguration', + 'time_start_scheduled': 'timeStartScheduled', + 'time_stop_scheduled': 'timeStopScheduled', + 'contact_details': 'contactDetails', + 'are_privileged_users': 'arePrivilegedUsers', + 'availability_domain': 'availabilityDomain', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags', + 'nsg_ids': 'nsgIds' + } + + self._compartment_id = None + self._display_name = None + self._description = None + self._maximum_size = None + self._standby_size = None + self._shape_name = None + self._is_storage_enabled = None + self._storage_size_in_gbs = None + self._storage_backup_policy_id = None + self._device_policy = None + self._availability_policy = None + self._image = None + self._network_configuration = None + self._time_start_scheduled = None + self._time_stop_scheduled = None + self._contact_details = None + self._are_privileged_users = None + self._availability_domain = None + self._freeform_tags = None + self._defined_tags = None + self._nsg_ids = None + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this CreateDesktopPoolDetails. + The OCID of the compartment which will contain the desktop pool. + + + :return: The compartment_id of this CreateDesktopPoolDetails. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this CreateDesktopPoolDetails. + The OCID of the compartment which will contain the desktop pool. + + + :param compartment_id: The compartment_id of this CreateDesktopPoolDetails. + :type: str + """ + self._compartment_id = compartment_id + + @property + def display_name(self): + """ + **[Required]** Gets the display_name of this CreateDesktopPoolDetails. + A user friendly display name. Avoid entering confidential information. + + + :return: The display_name of this CreateDesktopPoolDetails. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this CreateDesktopPoolDetails. + A user friendly display name. Avoid entering confidential information. + + + :param display_name: The display_name of this CreateDesktopPoolDetails. + :type: str + """ + self._display_name = display_name + + @property + def description(self): + """ + Gets the description of this CreateDesktopPoolDetails. + A user friendly description providing additional information about the resource. + Avoid entering confidential information. + + + :return: The description of this CreateDesktopPoolDetails. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """ + Sets the description of this CreateDesktopPoolDetails. + A user friendly description providing additional information about the resource. + Avoid entering confidential information. + + + :param description: The description of this CreateDesktopPoolDetails. + :type: str + """ + self._description = description + + @property + def maximum_size(self): + """ + **[Required]** Gets the maximum_size of this CreateDesktopPoolDetails. + The maximum number of desktops permitted in the desktop pool. + + + :return: The maximum_size of this CreateDesktopPoolDetails. + :rtype: int + """ + return self._maximum_size + + @maximum_size.setter + def maximum_size(self, maximum_size): + """ + Sets the maximum_size of this CreateDesktopPoolDetails. + The maximum number of desktops permitted in the desktop pool. + + + :param maximum_size: The maximum_size of this CreateDesktopPoolDetails. + :type: int + """ + self._maximum_size = maximum_size + + @property + def standby_size(self): + """ + **[Required]** Gets the standby_size of this CreateDesktopPoolDetails. + The maximum number of standby desktops available in the desktop pool. + + + :return: The standby_size of this CreateDesktopPoolDetails. + :rtype: int + """ + return self._standby_size + + @standby_size.setter + def standby_size(self, standby_size): + """ + Sets the standby_size of this CreateDesktopPoolDetails. + The maximum number of standby desktops available in the desktop pool. + + + :param standby_size: The standby_size of this CreateDesktopPoolDetails. + :type: int + """ + self._standby_size = standby_size + + @property + def shape_name(self): + """ + **[Required]** Gets the shape_name of this CreateDesktopPoolDetails. + The shape of the desktop pool. + + + :return: The shape_name of this CreateDesktopPoolDetails. + :rtype: str + """ + return self._shape_name + + @shape_name.setter + def shape_name(self, shape_name): + """ + Sets the shape_name of this CreateDesktopPoolDetails. + The shape of the desktop pool. + + + :param shape_name: The shape_name of this CreateDesktopPoolDetails. + :type: str + """ + self._shape_name = shape_name + + @property + def is_storage_enabled(self): + """ + **[Required]** Gets the is_storage_enabled of this CreateDesktopPoolDetails. + Indicates whether storage is enabled for the desktop pool. + + + :return: The is_storage_enabled of this CreateDesktopPoolDetails. + :rtype: bool + """ + return self._is_storage_enabled + + @is_storage_enabled.setter + def is_storage_enabled(self, is_storage_enabled): + """ + Sets the is_storage_enabled of this CreateDesktopPoolDetails. + Indicates whether storage is enabled for the desktop pool. + + + :param is_storage_enabled: The is_storage_enabled of this CreateDesktopPoolDetails. + :type: bool + """ + self._is_storage_enabled = is_storage_enabled + + @property + def storage_size_in_gbs(self): + """ + **[Required]** Gets the storage_size_in_gbs of this CreateDesktopPoolDetails. + The size in GBs of the storage for the desktop pool. + + + :return: The storage_size_in_gbs of this CreateDesktopPoolDetails. + :rtype: int + """ + return self._storage_size_in_gbs + + @storage_size_in_gbs.setter + def storage_size_in_gbs(self, storage_size_in_gbs): + """ + Sets the storage_size_in_gbs of this CreateDesktopPoolDetails. + The size in GBs of the storage for the desktop pool. + + + :param storage_size_in_gbs: The storage_size_in_gbs of this CreateDesktopPoolDetails. + :type: int + """ + self._storage_size_in_gbs = storage_size_in_gbs + + @property + def storage_backup_policy_id(self): + """ + **[Required]** Gets the storage_backup_policy_id of this CreateDesktopPoolDetails. + The backup policy OCID of the storage. + + + :return: The storage_backup_policy_id of this CreateDesktopPoolDetails. + :rtype: str + """ + return self._storage_backup_policy_id + + @storage_backup_policy_id.setter + def storage_backup_policy_id(self, storage_backup_policy_id): + """ + Sets the storage_backup_policy_id of this CreateDesktopPoolDetails. + The backup policy OCID of the storage. + + + :param storage_backup_policy_id: The storage_backup_policy_id of this CreateDesktopPoolDetails. + :type: str + """ + self._storage_backup_policy_id = storage_backup_policy_id + + @property + def device_policy(self): + """ + **[Required]** Gets the device_policy of this CreateDesktopPoolDetails. + + :return: The device_policy of this CreateDesktopPoolDetails. + :rtype: oci.desktops.models.DesktopDevicePolicy + """ + return self._device_policy + + @device_policy.setter + def device_policy(self, device_policy): + """ + Sets the device_policy of this CreateDesktopPoolDetails. + + :param device_policy: The device_policy of this CreateDesktopPoolDetails. + :type: oci.desktops.models.DesktopDevicePolicy + """ + self._device_policy = device_policy + + @property + def availability_policy(self): + """ + **[Required]** Gets the availability_policy of this CreateDesktopPoolDetails. + + :return: The availability_policy of this CreateDesktopPoolDetails. + :rtype: oci.desktops.models.DesktopAvailabilityPolicy + """ + return self._availability_policy + + @availability_policy.setter + def availability_policy(self, availability_policy): + """ + Sets the availability_policy of this CreateDesktopPoolDetails. + + :param availability_policy: The availability_policy of this CreateDesktopPoolDetails. + :type: oci.desktops.models.DesktopAvailabilityPolicy + """ + self._availability_policy = availability_policy + + @property + def image(self): + """ + **[Required]** Gets the image of this CreateDesktopPoolDetails. + + :return: The image of this CreateDesktopPoolDetails. + :rtype: oci.desktops.models.DesktopImage + """ + return self._image + + @image.setter + def image(self, image): + """ + Sets the image of this CreateDesktopPoolDetails. + + :param image: The image of this CreateDesktopPoolDetails. + :type: oci.desktops.models.DesktopImage + """ + self._image = image + + @property + def network_configuration(self): + """ + **[Required]** Gets the network_configuration of this CreateDesktopPoolDetails. + + :return: The network_configuration of this CreateDesktopPoolDetails. + :rtype: oci.desktops.models.DesktopNetworkConfiguration + """ + return self._network_configuration + + @network_configuration.setter + def network_configuration(self, network_configuration): + """ + Sets the network_configuration of this CreateDesktopPoolDetails. + + :param network_configuration: The network_configuration of this CreateDesktopPoolDetails. + :type: oci.desktops.models.DesktopNetworkConfiguration + """ + self._network_configuration = network_configuration + + @property + def time_start_scheduled(self): + """ + Gets the time_start_scheduled of this CreateDesktopPoolDetails. + The start time of the desktop pool. + + + :return: The time_start_scheduled of this CreateDesktopPoolDetails. + :rtype: datetime + """ + return self._time_start_scheduled + + @time_start_scheduled.setter + def time_start_scheduled(self, time_start_scheduled): + """ + Sets the time_start_scheduled of this CreateDesktopPoolDetails. + The start time of the desktop pool. + + + :param time_start_scheduled: The time_start_scheduled of this CreateDesktopPoolDetails. + :type: datetime + """ + self._time_start_scheduled = time_start_scheduled + + @property + def time_stop_scheduled(self): + """ + Gets the time_stop_scheduled of this CreateDesktopPoolDetails. + The stop time of the desktop pool. + + + :return: The time_stop_scheduled of this CreateDesktopPoolDetails. + :rtype: datetime + """ + return self._time_stop_scheduled + + @time_stop_scheduled.setter + def time_stop_scheduled(self, time_stop_scheduled): + """ + Sets the time_stop_scheduled of this CreateDesktopPoolDetails. + The stop time of the desktop pool. + + + :param time_stop_scheduled: The time_stop_scheduled of this CreateDesktopPoolDetails. + :type: datetime + """ + self._time_stop_scheduled = time_stop_scheduled + + @property + def contact_details(self): + """ + **[Required]** Gets the contact_details of this CreateDesktopPoolDetails. + Contact information of the desktop pool administrator. + Avoid entering confidential information. + + + :return: The contact_details of this CreateDesktopPoolDetails. + :rtype: str + """ + return self._contact_details + + @contact_details.setter + def contact_details(self, contact_details): + """ + Sets the contact_details of this CreateDesktopPoolDetails. + Contact information of the desktop pool administrator. + Avoid entering confidential information. + + + :param contact_details: The contact_details of this CreateDesktopPoolDetails. + :type: str + """ + self._contact_details = contact_details + + @property + def are_privileged_users(self): + """ + **[Required]** Gets the are_privileged_users of this CreateDesktopPoolDetails. + Indicates whether desktop pool users have administrative privileges on their desktop. + + + :return: The are_privileged_users of this CreateDesktopPoolDetails. + :rtype: bool + """ + return self._are_privileged_users + + @are_privileged_users.setter + def are_privileged_users(self, are_privileged_users): + """ + Sets the are_privileged_users of this CreateDesktopPoolDetails. + Indicates whether desktop pool users have administrative privileges on their desktop. + + + :param are_privileged_users: The are_privileged_users of this CreateDesktopPoolDetails. + :type: bool + """ + self._are_privileged_users = are_privileged_users + + @property + def availability_domain(self): + """ + **[Required]** Gets the availability_domain of this CreateDesktopPoolDetails. + The availability domain of the desktop pool. + + + :return: The availability_domain of this CreateDesktopPoolDetails. + :rtype: str + """ + return self._availability_domain + + @availability_domain.setter + def availability_domain(self, availability_domain): + """ + Sets the availability_domain of this CreateDesktopPoolDetails. + The availability domain of the desktop pool. + + + :param availability_domain: The availability_domain of this CreateDesktopPoolDetails. + :type: str + """ + self._availability_domain = availability_domain + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this CreateDesktopPoolDetails. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this CreateDesktopPoolDetails. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this CreateDesktopPoolDetails. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this CreateDesktopPoolDetails. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this CreateDesktopPoolDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this CreateDesktopPoolDetails. + :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 CreateDesktopPoolDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this CreateDesktopPoolDetails. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def nsg_ids(self): + """ + Gets the nsg_ids of this CreateDesktopPoolDetails. + A list of network security groups for the desktop pool. + + + :return: The nsg_ids of this CreateDesktopPoolDetails. + :rtype: list[str] + """ + return self._nsg_ids + + @nsg_ids.setter + def nsg_ids(self, nsg_ids): + """ + Sets the nsg_ids of this CreateDesktopPoolDetails. + A list of network security groups for the desktop pool. + + + :param nsg_ids: The nsg_ids of this CreateDesktopPoolDetails. + :type: list[str] + """ + self._nsg_ids = nsg_ids + + 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/desktops/models/desktop.py b/src/oci/desktops/models/desktop.py new file mode 100644 index 0000000000..19802ece66 --- /dev/null +++ b/src/oci/desktops/models/desktop.py @@ -0,0 +1,393 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 Desktop(object): + """ + Provides information about a desktop including name, state, id, configuration, owner, and time created. + """ + + #: A constant which can be used with the lifecycle_state property of a Desktop. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the lifecycle_state property of a Desktop. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a Desktop. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a Desktop. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a Desktop. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a Desktop. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a Desktop. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + def __init__(self, **kwargs): + """ + Initializes a new Desktop 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 Desktop. + :type id: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this Desktop. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED", '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 Desktop. + :type time_created: datetime + + :param display_name: + The value to assign to the display_name property of this Desktop. + :type display_name: str + + :param device_policy: + The value to assign to the device_policy property of this Desktop. + :type device_policy: oci.desktops.models.DesktopDevicePolicy + + :param hosting_options: + The value to assign to the hosting_options property of this Desktop. + :type hosting_options: oci.desktops.models.HostingOptions + + :param user_name: + The value to assign to the user_name property of this Desktop. + :type user_name: str + + :param pool_id: + The value to assign to the pool_id property of this Desktop. + :type pool_id: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this Desktop. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this Desktop. + :type defined_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'id': 'str', + 'lifecycle_state': 'str', + 'time_created': 'datetime', + 'display_name': 'str', + 'device_policy': 'DesktopDevicePolicy', + 'hosting_options': 'HostingOptions', + 'user_name': 'str', + 'pool_id': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'id': 'id', + 'lifecycle_state': 'lifecycleState', + 'time_created': 'timeCreated', + 'display_name': 'displayName', + 'device_policy': 'devicePolicy', + 'hosting_options': 'hostingOptions', + 'user_name': 'userName', + 'pool_id': 'poolId', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags' + } + + self._id = None + self._lifecycle_state = None + self._time_created = None + self._display_name = None + self._device_policy = None + self._hosting_options = None + self._user_name = None + self._pool_id = None + self._freeform_tags = None + self._defined_tags = None + + @property + def id(self): + """ + **[Required]** Gets the id of this Desktop. + The OCID of the desktop. + + + :return: The id of this Desktop. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this Desktop. + The OCID of the desktop. + + + :param id: The id of this Desktop. + :type: str + """ + self._id = id + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this Desktop. + The state of the desktop. + + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this Desktop. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this Desktop. + The state of the desktop. + + + :param lifecycle_state: The lifecycle_state of this Desktop. + :type: str + """ + allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"] + 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 Desktop. + The date and time the resource was created. + + + :return: The time_created of this Desktop. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this Desktop. + The date and time the resource was created. + + + :param time_created: The time_created of this Desktop. + :type: datetime + """ + self._time_created = time_created + + @property + def display_name(self): + """ + **[Required]** Gets the display_name of this Desktop. + A user friendly display name. Avoid entering confidential information. + + + :return: The display_name of this Desktop. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this Desktop. + A user friendly display name. Avoid entering confidential information. + + + :param display_name: The display_name of this Desktop. + :type: str + """ + self._display_name = display_name + + @property + def device_policy(self): + """ + **[Required]** Gets the device_policy of this Desktop. + + :return: The device_policy of this Desktop. + :rtype: oci.desktops.models.DesktopDevicePolicy + """ + return self._device_policy + + @device_policy.setter + def device_policy(self, device_policy): + """ + Sets the device_policy of this Desktop. + + :param device_policy: The device_policy of this Desktop. + :type: oci.desktops.models.DesktopDevicePolicy + """ + self._device_policy = device_policy + + @property + def hosting_options(self): + """ + **[Required]** Gets the hosting_options of this Desktop. + + :return: The hosting_options of this Desktop. + :rtype: oci.desktops.models.HostingOptions + """ + return self._hosting_options + + @hosting_options.setter + def hosting_options(self, hosting_options): + """ + Sets the hosting_options of this Desktop. + + :param hosting_options: The hosting_options of this Desktop. + :type: oci.desktops.models.HostingOptions + """ + self._hosting_options = hosting_options + + @property + def user_name(self): + """ + **[Required]** Gets the user_name of this Desktop. + The owner of the desktop. + + + :return: The user_name of this Desktop. + :rtype: str + """ + return self._user_name + + @user_name.setter + def user_name(self, user_name): + """ + Sets the user_name of this Desktop. + The owner of the desktop. + + + :param user_name: The user_name of this Desktop. + :type: str + """ + self._user_name = user_name + + @property + def pool_id(self): + """ + **[Required]** Gets the pool_id of this Desktop. + The OCID of the desktop pool the desktop is a member of. + + + :return: The pool_id of this Desktop. + :rtype: str + """ + return self._pool_id + + @pool_id.setter + def pool_id(self, pool_id): + """ + Sets the pool_id of this Desktop. + The OCID of the desktop pool the desktop is a member of. + + + :param pool_id: The pool_id of this Desktop. + :type: str + """ + self._pool_id = pool_id + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this Desktop. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this Desktop. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this Desktop. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this Desktop. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this Desktop. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this Desktop. + :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 Desktop. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this Desktop. + :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/desktops/models/desktop_availability_policy.py b/src/oci/desktops/models/desktop_availability_policy.py new file mode 100644 index 0000000000..aaf293a76b --- /dev/null +++ b/src/oci/desktops/models/desktop_availability_policy.py @@ -0,0 +1,95 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 DesktopAvailabilityPolicy(object): + """ + Provides the start and stop schedule information for desktop availability of the desktop pool. + """ + + def __init__(self, **kwargs): + """ + Initializes a new DesktopAvailabilityPolicy object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param start_schedule: + The value to assign to the start_schedule property of this DesktopAvailabilityPolicy. + :type start_schedule: oci.desktops.models.DesktopSchedule + + :param stop_schedule: + The value to assign to the stop_schedule property of this DesktopAvailabilityPolicy. + :type stop_schedule: oci.desktops.models.DesktopSchedule + + """ + self.swagger_types = { + 'start_schedule': 'DesktopSchedule', + 'stop_schedule': 'DesktopSchedule' + } + + self.attribute_map = { + 'start_schedule': 'startSchedule', + 'stop_schedule': 'stopSchedule' + } + + self._start_schedule = None + self._stop_schedule = None + + @property + def start_schedule(self): + """ + **[Required]** Gets the start_schedule of this DesktopAvailabilityPolicy. + + :return: The start_schedule of this DesktopAvailabilityPolicy. + :rtype: oci.desktops.models.DesktopSchedule + """ + return self._start_schedule + + @start_schedule.setter + def start_schedule(self, start_schedule): + """ + Sets the start_schedule of this DesktopAvailabilityPolicy. + + :param start_schedule: The start_schedule of this DesktopAvailabilityPolicy. + :type: oci.desktops.models.DesktopSchedule + """ + self._start_schedule = start_schedule + + @property + def stop_schedule(self): + """ + **[Required]** Gets the stop_schedule of this DesktopAvailabilityPolicy. + + :return: The stop_schedule of this DesktopAvailabilityPolicy. + :rtype: oci.desktops.models.DesktopSchedule + """ + return self._stop_schedule + + @stop_schedule.setter + def stop_schedule(self, stop_schedule): + """ + Sets the stop_schedule of this DesktopAvailabilityPolicy. + + :param stop_schedule: The stop_schedule of this DesktopAvailabilityPolicy. + :type: oci.desktops.models.DesktopSchedule + """ + self._stop_schedule = stop_schedule + + 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/desktops/models/desktop_collection.py b/src/oci/desktops/models/desktop_collection.py new file mode 100644 index 0000000000..63922880a3 --- /dev/null +++ b/src/oci/desktops/models/desktop_collection.py @@ -0,0 +1,72 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 DesktopCollection(object): + """ + A list of desktops. + """ + + def __init__(self, **kwargs): + """ + Initializes a new DesktopCollection 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 DesktopCollection. + :type items: list[oci.desktops.models.DesktopSummary] + + """ + self.swagger_types = { + 'items': 'list[DesktopSummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this DesktopCollection. + A list of desktop summaries. + + + :return: The items of this DesktopCollection. + :rtype: list[oci.desktops.models.DesktopSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this DesktopCollection. + A list of desktop summaries. + + + :param items: The items of this DesktopCollection. + :type: list[oci.desktops.models.DesktopSummary] + """ + 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/desktops/models/desktop_device_policy.py b/src/oci/desktops/models/desktop_device_policy.py new file mode 100644 index 0000000000..45612069b9 --- /dev/null +++ b/src/oci/desktops/models/desktop_device_policy.py @@ -0,0 +1,348 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 DesktopDevicePolicy(object): + """ + Provides the settings for desktop and client device options, such as audio in and out, client drive mapping, and clipboard access. + """ + + #: A constant which can be used with the clipboard_mode property of a DesktopDevicePolicy. + #: This constant has a value of "NONE" + CLIPBOARD_MODE_NONE = "NONE" + + #: A constant which can be used with the clipboard_mode property of a DesktopDevicePolicy. + #: This constant has a value of "TODESKTOP" + CLIPBOARD_MODE_TODESKTOP = "TODESKTOP" + + #: A constant which can be used with the clipboard_mode property of a DesktopDevicePolicy. + #: This constant has a value of "FROMDESKTOP" + CLIPBOARD_MODE_FROMDESKTOP = "FROMDESKTOP" + + #: A constant which can be used with the clipboard_mode property of a DesktopDevicePolicy. + #: This constant has a value of "FULL" + CLIPBOARD_MODE_FULL = "FULL" + + #: A constant which can be used with the audio_mode property of a DesktopDevicePolicy. + #: This constant has a value of "NONE" + AUDIO_MODE_NONE = "NONE" + + #: A constant which can be used with the audio_mode property of a DesktopDevicePolicy. + #: This constant has a value of "TODESKTOP" + AUDIO_MODE_TODESKTOP = "TODESKTOP" + + #: A constant which can be used with the audio_mode property of a DesktopDevicePolicy. + #: This constant has a value of "FROMDESKTOP" + AUDIO_MODE_FROMDESKTOP = "FROMDESKTOP" + + #: A constant which can be used with the audio_mode property of a DesktopDevicePolicy. + #: This constant has a value of "FULL" + AUDIO_MODE_FULL = "FULL" + + #: A constant which can be used with the cdm_mode property of a DesktopDevicePolicy. + #: This constant has a value of "NONE" + CDM_MODE_NONE = "NONE" + + #: A constant which can be used with the cdm_mode property of a DesktopDevicePolicy. + #: This constant has a value of "READONLY" + CDM_MODE_READONLY = "READONLY" + + #: A constant which can be used with the cdm_mode property of a DesktopDevicePolicy. + #: This constant has a value of "FULL" + CDM_MODE_FULL = "FULL" + + def __init__(self, **kwargs): + """ + Initializes a new DesktopDevicePolicy object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param clipboard_mode: + The value to assign to the clipboard_mode property of this DesktopDevicePolicy. + Allowed values for this property are: "NONE", "TODESKTOP", "FROMDESKTOP", "FULL", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type clipboard_mode: str + + :param audio_mode: + The value to assign to the audio_mode property of this DesktopDevicePolicy. + Allowed values for this property are: "NONE", "TODESKTOP", "FROMDESKTOP", "FULL", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type audio_mode: str + + :param cdm_mode: + The value to assign to the cdm_mode property of this DesktopDevicePolicy. + Allowed values for this property are: "NONE", "READONLY", "FULL", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type cdm_mode: str + + :param is_printing_enabled: + The value to assign to the is_printing_enabled property of this DesktopDevicePolicy. + :type is_printing_enabled: bool + + :param is_pointer_enabled: + The value to assign to the is_pointer_enabled property of this DesktopDevicePolicy. + :type is_pointer_enabled: bool + + :param is_keyboard_enabled: + The value to assign to the is_keyboard_enabled property of this DesktopDevicePolicy. + :type is_keyboard_enabled: bool + + :param is_display_enabled: + The value to assign to the is_display_enabled property of this DesktopDevicePolicy. + :type is_display_enabled: bool + + """ + self.swagger_types = { + 'clipboard_mode': 'str', + 'audio_mode': 'str', + 'cdm_mode': 'str', + 'is_printing_enabled': 'bool', + 'is_pointer_enabled': 'bool', + 'is_keyboard_enabled': 'bool', + 'is_display_enabled': 'bool' + } + + self.attribute_map = { + 'clipboard_mode': 'clipboardMode', + 'audio_mode': 'audioMode', + 'cdm_mode': 'cdmMode', + 'is_printing_enabled': 'isPrintingEnabled', + 'is_pointer_enabled': 'isPointerEnabled', + 'is_keyboard_enabled': 'isKeyboardEnabled', + 'is_display_enabled': 'isDisplayEnabled' + } + + self._clipboard_mode = None + self._audio_mode = None + self._cdm_mode = None + self._is_printing_enabled = None + self._is_pointer_enabled = None + self._is_keyboard_enabled = None + self._is_display_enabled = None + + @property + def clipboard_mode(self): + """ + **[Required]** Gets the clipboard_mode of this DesktopDevicePolicy. + The clipboard mode. + NONE: No access to the local clipboard is permitted. + TODESKTOP: The clipboard can be used to transfer data to the desktop only. + FROMDESKTOP: The clipboard can be used to transfer data from the desktop only. + FULL: The clipboard can be used to transfer data to and from the desktop. + + Allowed values for this property are: "NONE", "TODESKTOP", "FROMDESKTOP", "FULL", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The clipboard_mode of this DesktopDevicePolicy. + :rtype: str + """ + return self._clipboard_mode + + @clipboard_mode.setter + def clipboard_mode(self, clipboard_mode): + """ + Sets the clipboard_mode of this DesktopDevicePolicy. + The clipboard mode. + NONE: No access to the local clipboard is permitted. + TODESKTOP: The clipboard can be used to transfer data to the desktop only. + FROMDESKTOP: The clipboard can be used to transfer data from the desktop only. + FULL: The clipboard can be used to transfer data to and from the desktop. + + + :param clipboard_mode: The clipboard_mode of this DesktopDevicePolicy. + :type: str + """ + allowed_values = ["NONE", "TODESKTOP", "FROMDESKTOP", "FULL"] + if not value_allowed_none_or_none_sentinel(clipboard_mode, allowed_values): + clipboard_mode = 'UNKNOWN_ENUM_VALUE' + self._clipboard_mode = clipboard_mode + + @property + def audio_mode(self): + """ + **[Required]** Gets the audio_mode of this DesktopDevicePolicy. + The audio mode. + NONE: No access to the local audio devices is permitted. + TODESKTOP: The user may record audio on their desktop. + FROMDESKTOP: The user may play audio on their desktop. + FULL: The user may play and record audio on their desktop. + + Allowed values for this property are: "NONE", "TODESKTOP", "FROMDESKTOP", "FULL", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The audio_mode of this DesktopDevicePolicy. + :rtype: str + """ + return self._audio_mode + + @audio_mode.setter + def audio_mode(self, audio_mode): + """ + Sets the audio_mode of this DesktopDevicePolicy. + The audio mode. + NONE: No access to the local audio devices is permitted. + TODESKTOP: The user may record audio on their desktop. + FROMDESKTOP: The user may play audio on their desktop. + FULL: The user may play and record audio on their desktop. + + + :param audio_mode: The audio_mode of this DesktopDevicePolicy. + :type: str + """ + allowed_values = ["NONE", "TODESKTOP", "FROMDESKTOP", "FULL"] + if not value_allowed_none_or_none_sentinel(audio_mode, allowed_values): + audio_mode = 'UNKNOWN_ENUM_VALUE' + self._audio_mode = audio_mode + + @property + def cdm_mode(self): + """ + **[Required]** Gets the cdm_mode of this DesktopDevicePolicy. + The client local drive access mode. + NONE: No access to local drives permitted. + READONLY: The user may read from local drives on their desktop. + FULL: The user may read from and write to their local drives on their desktop. + + Allowed values for this property are: "NONE", "READONLY", "FULL", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The cdm_mode of this DesktopDevicePolicy. + :rtype: str + """ + return self._cdm_mode + + @cdm_mode.setter + def cdm_mode(self, cdm_mode): + """ + Sets the cdm_mode of this DesktopDevicePolicy. + The client local drive access mode. + NONE: No access to local drives permitted. + READONLY: The user may read from local drives on their desktop. + FULL: The user may read from and write to their local drives on their desktop. + + + :param cdm_mode: The cdm_mode of this DesktopDevicePolicy. + :type: str + """ + allowed_values = ["NONE", "READONLY", "FULL"] + if not value_allowed_none_or_none_sentinel(cdm_mode, allowed_values): + cdm_mode = 'UNKNOWN_ENUM_VALUE' + self._cdm_mode = cdm_mode + + @property + def is_printing_enabled(self): + """ + **[Required]** Gets the is_printing_enabled of this DesktopDevicePolicy. + Indicates whether printing is enabled. + + + :return: The is_printing_enabled of this DesktopDevicePolicy. + :rtype: bool + """ + return self._is_printing_enabled + + @is_printing_enabled.setter + def is_printing_enabled(self, is_printing_enabled): + """ + Sets the is_printing_enabled of this DesktopDevicePolicy. + Indicates whether printing is enabled. + + + :param is_printing_enabled: The is_printing_enabled of this DesktopDevicePolicy. + :type: bool + """ + self._is_printing_enabled = is_printing_enabled + + @property + def is_pointer_enabled(self): + """ + **[Required]** Gets the is_pointer_enabled of this DesktopDevicePolicy. + Indicates whether the pointer is enabled. + + + :return: The is_pointer_enabled of this DesktopDevicePolicy. + :rtype: bool + """ + return self._is_pointer_enabled + + @is_pointer_enabled.setter + def is_pointer_enabled(self, is_pointer_enabled): + """ + Sets the is_pointer_enabled of this DesktopDevicePolicy. + Indicates whether the pointer is enabled. + + + :param is_pointer_enabled: The is_pointer_enabled of this DesktopDevicePolicy. + :type: bool + """ + self._is_pointer_enabled = is_pointer_enabled + + @property + def is_keyboard_enabled(self): + """ + **[Required]** Gets the is_keyboard_enabled of this DesktopDevicePolicy. + Indicates whether the keyboard is enabled. + + + :return: The is_keyboard_enabled of this DesktopDevicePolicy. + :rtype: bool + """ + return self._is_keyboard_enabled + + @is_keyboard_enabled.setter + def is_keyboard_enabled(self, is_keyboard_enabled): + """ + Sets the is_keyboard_enabled of this DesktopDevicePolicy. + Indicates whether the keyboard is enabled. + + + :param is_keyboard_enabled: The is_keyboard_enabled of this DesktopDevicePolicy. + :type: bool + """ + self._is_keyboard_enabled = is_keyboard_enabled + + @property + def is_display_enabled(self): + """ + **[Required]** Gets the is_display_enabled of this DesktopDevicePolicy. + Indicates whether the display is enabled. + + + :return: The is_display_enabled of this DesktopDevicePolicy. + :rtype: bool + """ + return self._is_display_enabled + + @is_display_enabled.setter + def is_display_enabled(self, is_display_enabled): + """ + Sets the is_display_enabled of this DesktopDevicePolicy. + Indicates whether the display is enabled. + + + :param is_display_enabled: The is_display_enabled of this DesktopDevicePolicy. + :type: bool + """ + self._is_display_enabled = is_display_enabled + + 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/desktops/models/desktop_image.py b/src/oci/desktops/models/desktop_image.py new file mode 100644 index 0000000000..412616a795 --- /dev/null +++ b/src/oci/desktops/models/desktop_image.py @@ -0,0 +1,103 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 DesktopImage(object): + """ + Provides information about the desktop image. + """ + + def __init__(self, **kwargs): + """ + Initializes a new DesktopImage object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param image_id: + The value to assign to the image_id property of this DesktopImage. + :type image_id: str + + :param image_name: + The value to assign to the image_name property of this DesktopImage. + :type image_name: str + + """ + self.swagger_types = { + 'image_id': 'str', + 'image_name': 'str' + } + + self.attribute_map = { + 'image_id': 'imageId', + 'image_name': 'imageName' + } + + self._image_id = None + self._image_name = None + + @property + def image_id(self): + """ + **[Required]** Gets the image_id of this DesktopImage. + The OCID of the desktop image. + + + :return: The image_id of this DesktopImage. + :rtype: str + """ + return self._image_id + + @image_id.setter + def image_id(self, image_id): + """ + Sets the image_id of this DesktopImage. + The OCID of the desktop image. + + + :param image_id: The image_id of this DesktopImage. + :type: str + """ + self._image_id = image_id + + @property + def image_name(self): + """ + **[Required]** Gets the image_name of this DesktopImage. + The name of the desktop image. + + + :return: The image_name of this DesktopImage. + :rtype: str + """ + return self._image_name + + @image_name.setter + def image_name(self, image_name): + """ + Sets the image_name of this DesktopImage. + The name of the desktop image. + + + :param image_name: The image_name of this DesktopImage. + :type: str + """ + self._image_name = image_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/desktops/models/desktop_network_configuration.py b/src/oci/desktops/models/desktop_network_configuration.py new file mode 100644 index 0000000000..2647502e96 --- /dev/null +++ b/src/oci/desktops/models/desktop_network_configuration.py @@ -0,0 +1,103 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 DesktopNetworkConfiguration(object): + """ + Provides information about the network configuration of the desktop pool. + """ + + def __init__(self, **kwargs): + """ + Initializes a new DesktopNetworkConfiguration object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param vcn_id: + The value to assign to the vcn_id property of this DesktopNetworkConfiguration. + :type vcn_id: str + + :param subnet_id: + The value to assign to the subnet_id property of this DesktopNetworkConfiguration. + :type subnet_id: str + + """ + self.swagger_types = { + 'vcn_id': 'str', + 'subnet_id': 'str' + } + + self.attribute_map = { + 'vcn_id': 'vcnId', + 'subnet_id': 'subnetId' + } + + self._vcn_id = None + self._subnet_id = None + + @property + def vcn_id(self): + """ + **[Required]** Gets the vcn_id of this DesktopNetworkConfiguration. + The OCID of the VCN used by the desktop pool. + + + :return: The vcn_id of this DesktopNetworkConfiguration. + :rtype: str + """ + return self._vcn_id + + @vcn_id.setter + def vcn_id(self, vcn_id): + """ + Sets the vcn_id of this DesktopNetworkConfiguration. + The OCID of the VCN used by the desktop pool. + + + :param vcn_id: The vcn_id of this DesktopNetworkConfiguration. + :type: str + """ + self._vcn_id = vcn_id + + @property + def subnet_id(self): + """ + **[Required]** Gets the subnet_id of this DesktopNetworkConfiguration. + The OCID of the subnet to use for the desktop pool. + + + :return: The subnet_id of this DesktopNetworkConfiguration. + :rtype: str + """ + return self._subnet_id + + @subnet_id.setter + def subnet_id(self, subnet_id): + """ + Sets the subnet_id of this DesktopNetworkConfiguration. + The OCID of the subnet to use for the desktop pool. + + + :param subnet_id: The subnet_id of this DesktopNetworkConfiguration. + :type: str + """ + self._subnet_id = subnet_id + + 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/desktops/models/desktop_pool.py b/src/oci/desktops/models/desktop_pool.py new file mode 100644 index 0000000000..2c5d5bdf9f --- /dev/null +++ b/src/oci/desktops/models/desktop_pool.py @@ -0,0 +1,823 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 DesktopPool(object): + """ + Provides information about a desktop pool including all configuration parameters. + """ + + #: A constant which can be used with the lifecycle_state property of a DesktopPool. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the lifecycle_state property of a DesktopPool. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a DesktopPool. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a DesktopPool. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a DesktopPool. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a DesktopPool. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a DesktopPool. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + def __init__(self, **kwargs): + """ + Initializes a new DesktopPool 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 DesktopPool. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this DesktopPool. + :type compartment_id: str + + :param display_name: + The value to assign to the display_name property of this DesktopPool. + :type display_name: str + + :param description: + The value to assign to the description property of this DesktopPool. + :type description: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this DesktopPool. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED", '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 DesktopPool. + :type time_created: datetime + + :param maximum_size: + The value to assign to the maximum_size property of this DesktopPool. + :type maximum_size: int + + :param standby_size: + The value to assign to the standby_size property of this DesktopPool. + :type standby_size: int + + :param shape_name: + The value to assign to the shape_name property of this DesktopPool. + :type shape_name: str + + :param is_storage_enabled: + The value to assign to the is_storage_enabled property of this DesktopPool. + :type is_storage_enabled: bool + + :param storage_size_in_gbs: + The value to assign to the storage_size_in_gbs property of this DesktopPool. + :type storage_size_in_gbs: int + + :param storage_backup_policy_id: + The value to assign to the storage_backup_policy_id property of this DesktopPool. + :type storage_backup_policy_id: str + + :param device_policy: + The value to assign to the device_policy property of this DesktopPool. + :type device_policy: oci.desktops.models.DesktopDevicePolicy + + :param availability_policy: + The value to assign to the availability_policy property of this DesktopPool. + :type availability_policy: oci.desktops.models.DesktopAvailabilityPolicy + + :param image: + The value to assign to the image property of this DesktopPool. + :type image: oci.desktops.models.DesktopImage + + :param network_configuration: + The value to assign to the network_configuration property of this DesktopPool. + :type network_configuration: oci.desktops.models.DesktopNetworkConfiguration + + :param time_start_scheduled: + The value to assign to the time_start_scheduled property of this DesktopPool. + :type time_start_scheduled: datetime + + :param time_stop_scheduled: + The value to assign to the time_stop_scheduled property of this DesktopPool. + :type time_stop_scheduled: datetime + + :param contact_details: + The value to assign to the contact_details property of this DesktopPool. + :type contact_details: str + + :param are_privileged_users: + The value to assign to the are_privileged_users property of this DesktopPool. + :type are_privileged_users: bool + + :param availability_domain: + The value to assign to the availability_domain property of this DesktopPool. + :type availability_domain: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this DesktopPool. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this DesktopPool. + :type defined_tags: dict(str, dict(str, object)) + + :param nsg_ids: + The value to assign to the nsg_ids property of this DesktopPool. + :type nsg_ids: list[str] + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'display_name': 'str', + 'description': 'str', + 'lifecycle_state': 'str', + 'time_created': 'datetime', + 'maximum_size': 'int', + 'standby_size': 'int', + 'shape_name': 'str', + 'is_storage_enabled': 'bool', + 'storage_size_in_gbs': 'int', + 'storage_backup_policy_id': 'str', + 'device_policy': 'DesktopDevicePolicy', + 'availability_policy': 'DesktopAvailabilityPolicy', + 'image': 'DesktopImage', + 'network_configuration': 'DesktopNetworkConfiguration', + 'time_start_scheduled': 'datetime', + 'time_stop_scheduled': 'datetime', + 'contact_details': 'str', + 'are_privileged_users': 'bool', + 'availability_domain': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))', + 'nsg_ids': 'list[str]' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'display_name': 'displayName', + 'description': 'description', + 'lifecycle_state': 'lifecycleState', + 'time_created': 'timeCreated', + 'maximum_size': 'maximumSize', + 'standby_size': 'standbySize', + 'shape_name': 'shapeName', + 'is_storage_enabled': 'isStorageEnabled', + 'storage_size_in_gbs': 'storageSizeInGBs', + 'storage_backup_policy_id': 'storageBackupPolicyId', + 'device_policy': 'devicePolicy', + 'availability_policy': 'availabilityPolicy', + 'image': 'image', + 'network_configuration': 'networkConfiguration', + 'time_start_scheduled': 'timeStartScheduled', + 'time_stop_scheduled': 'timeStopScheduled', + 'contact_details': 'contactDetails', + 'are_privileged_users': 'arePrivilegedUsers', + 'availability_domain': 'availabilityDomain', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags', + 'nsg_ids': 'nsgIds' + } + + self._id = None + self._compartment_id = None + self._display_name = None + self._description = None + self._lifecycle_state = None + self._time_created = None + self._maximum_size = None + self._standby_size = None + self._shape_name = None + self._is_storage_enabled = None + self._storage_size_in_gbs = None + self._storage_backup_policy_id = None + self._device_policy = None + self._availability_policy = None + self._image = None + self._network_configuration = None + self._time_start_scheduled = None + self._time_stop_scheduled = None + self._contact_details = None + self._are_privileged_users = None + self._availability_domain = None + self._freeform_tags = None + self._defined_tags = None + self._nsg_ids = None + + @property + def id(self): + """ + **[Required]** Gets the id of this DesktopPool. + The OCID of the desktop pool. + + + :return: The id of this DesktopPool. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this DesktopPool. + The OCID of the desktop pool. + + + :param id: The id of this DesktopPool. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this DesktopPool. + The OCID of the compartment of the desktop pool. + + + :return: The compartment_id of this DesktopPool. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this DesktopPool. + The OCID of the compartment of the desktop pool. + + + :param compartment_id: The compartment_id of this DesktopPool. + :type: str + """ + self._compartment_id = compartment_id + + @property + def display_name(self): + """ + **[Required]** Gets the display_name of this DesktopPool. + A user friendly display name. Avoid entering confidential information. + + + :return: The display_name of this DesktopPool. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this DesktopPool. + A user friendly display name. Avoid entering confidential information. + + + :param display_name: The display_name of this DesktopPool. + :type: str + """ + self._display_name = display_name + + @property + def description(self): + """ + Gets the description of this DesktopPool. + A user friendly description providing additional information about the resource. + Avoid entering confidential information. + + + :return: The description of this DesktopPool. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """ + Sets the description of this DesktopPool. + A user friendly description providing additional information about the resource. + Avoid entering confidential information. + + + :param description: The description of this DesktopPool. + :type: str + """ + self._description = description + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this DesktopPool. + The current state of the desktop pool. + + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this DesktopPool. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this DesktopPool. + The current state of the desktop pool. + + + :param lifecycle_state: The lifecycle_state of this DesktopPool. + :type: str + """ + allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"] + 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 DesktopPool. + The date and time the resource was created. + + + :return: The time_created of this DesktopPool. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this DesktopPool. + The date and time the resource was created. + + + :param time_created: The time_created of this DesktopPool. + :type: datetime + """ + self._time_created = time_created + + @property + def maximum_size(self): + """ + **[Required]** Gets the maximum_size of this DesktopPool. + The maximum number of desktops permitted in the desktop pool. + + + :return: The maximum_size of this DesktopPool. + :rtype: int + """ + return self._maximum_size + + @maximum_size.setter + def maximum_size(self, maximum_size): + """ + Sets the maximum_size of this DesktopPool. + The maximum number of desktops permitted in the desktop pool. + + + :param maximum_size: The maximum_size of this DesktopPool. + :type: int + """ + self._maximum_size = maximum_size + + @property + def standby_size(self): + """ + **[Required]** Gets the standby_size of this DesktopPool. + The maximum number of standby desktops available in the desktop pool. + + + :return: The standby_size of this DesktopPool. + :rtype: int + """ + return self._standby_size + + @standby_size.setter + def standby_size(self, standby_size): + """ + Sets the standby_size of this DesktopPool. + The maximum number of standby desktops available in the desktop pool. + + + :param standby_size: The standby_size of this DesktopPool. + :type: int + """ + self._standby_size = standby_size + + @property + def shape_name(self): + """ + **[Required]** Gets the shape_name of this DesktopPool. + The shape of the desktop pool. + + + :return: The shape_name of this DesktopPool. + :rtype: str + """ + return self._shape_name + + @shape_name.setter + def shape_name(self, shape_name): + """ + Sets the shape_name of this DesktopPool. + The shape of the desktop pool. + + + :param shape_name: The shape_name of this DesktopPool. + :type: str + """ + self._shape_name = shape_name + + @property + def is_storage_enabled(self): + """ + **[Required]** Gets the is_storage_enabled of this DesktopPool. + Indicates whether storage is enabled for the desktop pool. + + + :return: The is_storage_enabled of this DesktopPool. + :rtype: bool + """ + return self._is_storage_enabled + + @is_storage_enabled.setter + def is_storage_enabled(self, is_storage_enabled): + """ + Sets the is_storage_enabled of this DesktopPool. + Indicates whether storage is enabled for the desktop pool. + + + :param is_storage_enabled: The is_storage_enabled of this DesktopPool. + :type: bool + """ + self._is_storage_enabled = is_storage_enabled + + @property + def storage_size_in_gbs(self): + """ + **[Required]** Gets the storage_size_in_gbs of this DesktopPool. + The size in GBs of the storage for the desktop pool. + + + :return: The storage_size_in_gbs of this DesktopPool. + :rtype: int + """ + return self._storage_size_in_gbs + + @storage_size_in_gbs.setter + def storage_size_in_gbs(self, storage_size_in_gbs): + """ + Sets the storage_size_in_gbs of this DesktopPool. + The size in GBs of the storage for the desktop pool. + + + :param storage_size_in_gbs: The storage_size_in_gbs of this DesktopPool. + :type: int + """ + self._storage_size_in_gbs = storage_size_in_gbs + + @property + def storage_backup_policy_id(self): + """ + **[Required]** Gets the storage_backup_policy_id of this DesktopPool. + The backup policy OCID of the storage. + + + :return: The storage_backup_policy_id of this DesktopPool. + :rtype: str + """ + return self._storage_backup_policy_id + + @storage_backup_policy_id.setter + def storage_backup_policy_id(self, storage_backup_policy_id): + """ + Sets the storage_backup_policy_id of this DesktopPool. + The backup policy OCID of the storage. + + + :param storage_backup_policy_id: The storage_backup_policy_id of this DesktopPool. + :type: str + """ + self._storage_backup_policy_id = storage_backup_policy_id + + @property + def device_policy(self): + """ + **[Required]** Gets the device_policy of this DesktopPool. + + :return: The device_policy of this DesktopPool. + :rtype: oci.desktops.models.DesktopDevicePolicy + """ + return self._device_policy + + @device_policy.setter + def device_policy(self, device_policy): + """ + Sets the device_policy of this DesktopPool. + + :param device_policy: The device_policy of this DesktopPool. + :type: oci.desktops.models.DesktopDevicePolicy + """ + self._device_policy = device_policy + + @property + def availability_policy(self): + """ + **[Required]** Gets the availability_policy of this DesktopPool. + + :return: The availability_policy of this DesktopPool. + :rtype: oci.desktops.models.DesktopAvailabilityPolicy + """ + return self._availability_policy + + @availability_policy.setter + def availability_policy(self, availability_policy): + """ + Sets the availability_policy of this DesktopPool. + + :param availability_policy: The availability_policy of this DesktopPool. + :type: oci.desktops.models.DesktopAvailabilityPolicy + """ + self._availability_policy = availability_policy + + @property + def image(self): + """ + **[Required]** Gets the image of this DesktopPool. + + :return: The image of this DesktopPool. + :rtype: oci.desktops.models.DesktopImage + """ + return self._image + + @image.setter + def image(self, image): + """ + Sets the image of this DesktopPool. + + :param image: The image of this DesktopPool. + :type: oci.desktops.models.DesktopImage + """ + self._image = image + + @property + def network_configuration(self): + """ + **[Required]** Gets the network_configuration of this DesktopPool. + + :return: The network_configuration of this DesktopPool. + :rtype: oci.desktops.models.DesktopNetworkConfiguration + """ + return self._network_configuration + + @network_configuration.setter + def network_configuration(self, network_configuration): + """ + Sets the network_configuration of this DesktopPool. + + :param network_configuration: The network_configuration of this DesktopPool. + :type: oci.desktops.models.DesktopNetworkConfiguration + """ + self._network_configuration = network_configuration + + @property + def time_start_scheduled(self): + """ + Gets the time_start_scheduled of this DesktopPool. + The start time of the desktop pool. + + + :return: The time_start_scheduled of this DesktopPool. + :rtype: datetime + """ + return self._time_start_scheduled + + @time_start_scheduled.setter + def time_start_scheduled(self, time_start_scheduled): + """ + Sets the time_start_scheduled of this DesktopPool. + The start time of the desktop pool. + + + :param time_start_scheduled: The time_start_scheduled of this DesktopPool. + :type: datetime + """ + self._time_start_scheduled = time_start_scheduled + + @property + def time_stop_scheduled(self): + """ + Gets the time_stop_scheduled of this DesktopPool. + The stop time of the desktop pool. + + + :return: The time_stop_scheduled of this DesktopPool. + :rtype: datetime + """ + return self._time_stop_scheduled + + @time_stop_scheduled.setter + def time_stop_scheduled(self, time_stop_scheduled): + """ + Sets the time_stop_scheduled of this DesktopPool. + The stop time of the desktop pool. + + + :param time_stop_scheduled: The time_stop_scheduled of this DesktopPool. + :type: datetime + """ + self._time_stop_scheduled = time_stop_scheduled + + @property + def contact_details(self): + """ + **[Required]** Gets the contact_details of this DesktopPool. + Contact information of the desktop pool administrator. + Avoid entering confidential information. + + + :return: The contact_details of this DesktopPool. + :rtype: str + """ + return self._contact_details + + @contact_details.setter + def contact_details(self, contact_details): + """ + Sets the contact_details of this DesktopPool. + Contact information of the desktop pool administrator. + Avoid entering confidential information. + + + :param contact_details: The contact_details of this DesktopPool. + :type: str + """ + self._contact_details = contact_details + + @property + def are_privileged_users(self): + """ + **[Required]** Gets the are_privileged_users of this DesktopPool. + Indicates whether desktop pool users have administrative privileges on their desktop. + + + :return: The are_privileged_users of this DesktopPool. + :rtype: bool + """ + return self._are_privileged_users + + @are_privileged_users.setter + def are_privileged_users(self, are_privileged_users): + """ + Sets the are_privileged_users of this DesktopPool. + Indicates whether desktop pool users have administrative privileges on their desktop. + + + :param are_privileged_users: The are_privileged_users of this DesktopPool. + :type: bool + """ + self._are_privileged_users = are_privileged_users + + @property + def availability_domain(self): + """ + **[Required]** Gets the availability_domain of this DesktopPool. + The availability domain of the desktop pool. + + + :return: The availability_domain of this DesktopPool. + :rtype: str + """ + return self._availability_domain + + @availability_domain.setter + def availability_domain(self, availability_domain): + """ + Sets the availability_domain of this DesktopPool. + The availability domain of the desktop pool. + + + :param availability_domain: The availability_domain of this DesktopPool. + :type: str + """ + self._availability_domain = availability_domain + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this DesktopPool. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this DesktopPool. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this DesktopPool. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this DesktopPool. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this DesktopPool. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this DesktopPool. + :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 DesktopPool. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this DesktopPool. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def nsg_ids(self): + """ + Gets the nsg_ids of this DesktopPool. + A list of network security groups for the desktop pool. + + + :return: The nsg_ids of this DesktopPool. + :rtype: list[str] + """ + return self._nsg_ids + + @nsg_ids.setter + def nsg_ids(self, nsg_ids): + """ + Sets the nsg_ids of this DesktopPool. + A list of network security groups for the desktop pool. + + + :param nsg_ids: The nsg_ids of this DesktopPool. + :type: list[str] + """ + self._nsg_ids = nsg_ids + + 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/desktops/models/desktop_pool_collection.py b/src/oci/desktops/models/desktop_pool_collection.py new file mode 100644 index 0000000000..e5c6650fc4 --- /dev/null +++ b/src/oci/desktops/models/desktop_pool_collection.py @@ -0,0 +1,72 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 DesktopPoolCollection(object): + """ + A list of desktop pools. + """ + + def __init__(self, **kwargs): + """ + Initializes a new DesktopPoolCollection 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 DesktopPoolCollection. + :type items: list[oci.desktops.models.DesktopPoolSummary] + + """ + self.swagger_types = { + 'items': 'list[DesktopPoolSummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this DesktopPoolCollection. + A list of desktop pool summaries. + + + :return: The items of this DesktopPoolCollection. + :rtype: list[oci.desktops.models.DesktopPoolSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this DesktopPoolCollection. + A list of desktop pool summaries. + + + :param items: The items of this DesktopPoolCollection. + :type: list[oci.desktops.models.DesktopPoolSummary] + """ + 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/desktops/models/desktop_pool_desktop_collection.py b/src/oci/desktops/models/desktop_pool_desktop_collection.py new file mode 100644 index 0000000000..de09eee5b5 --- /dev/null +++ b/src/oci/desktops/models/desktop_pool_desktop_collection.py @@ -0,0 +1,72 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 DesktopPoolDesktopCollection(object): + """ + A list of desktops within a desktop pool. + """ + + def __init__(self, **kwargs): + """ + Initializes a new DesktopPoolDesktopCollection 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 DesktopPoolDesktopCollection. + :type items: list[oci.desktops.models.DesktopPoolDesktopSummary] + + """ + self.swagger_types = { + 'items': 'list[DesktopPoolDesktopSummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this DesktopPoolDesktopCollection. + A list of desktops. + + + :return: The items of this DesktopPoolDesktopCollection. + :rtype: list[oci.desktops.models.DesktopPoolDesktopSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this DesktopPoolDesktopCollection. + A list of desktops. + + + :param items: The items of this DesktopPoolDesktopCollection. + :type: list[oci.desktops.models.DesktopPoolDesktopSummary] + """ + 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/desktops/models/desktop_pool_desktop_summary.py b/src/oci/desktops/models/desktop_pool_desktop_summary.py new file mode 100644 index 0000000000..90e4b6a6f6 --- /dev/null +++ b/src/oci/desktops/models/desktop_pool_desktop_summary.py @@ -0,0 +1,339 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 DesktopPoolDesktopSummary(object): + """ + Provides information about a desktop within a desktop pool, such as if it is assigned to a user, the state, owner, desktop pool, resource id, and time created. + """ + + #: A constant which can be used with the lifecycle_state property of a DesktopPoolDesktopSummary. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the lifecycle_state property of a DesktopPoolDesktopSummary. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a DesktopPoolDesktopSummary. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a DesktopPoolDesktopSummary. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a DesktopPoolDesktopSummary. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a DesktopPoolDesktopSummary. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a DesktopPoolDesktopSummary. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + def __init__(self, **kwargs): + """ + Initializes a new DesktopPoolDesktopSummary object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this DesktopPoolDesktopSummary. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param instance_id: + The value to assign to the instance_id property of this DesktopPoolDesktopSummary. + :type instance_id: str + + :param user_name: + The value to assign to the user_name property of this DesktopPoolDesktopSummary. + :type user_name: str + + :param desktop_id: + The value to assign to the desktop_id property of this DesktopPoolDesktopSummary. + :type desktop_id: str + + :param is_assigned: + The value to assign to the is_assigned property of this DesktopPoolDesktopSummary. + :type is_assigned: bool + + :param time_created: + The value to assign to the time_created property of this DesktopPoolDesktopSummary. + :type time_created: datetime + + :param freeform_tags: + The value to assign to the freeform_tags property of this DesktopPoolDesktopSummary. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this DesktopPoolDesktopSummary. + :type defined_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'lifecycle_state': 'str', + 'instance_id': 'str', + 'user_name': 'str', + 'desktop_id': 'str', + 'is_assigned': 'bool', + 'time_created': 'datetime', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'lifecycle_state': 'lifecycleState', + 'instance_id': 'instanceId', + 'user_name': 'userName', + 'desktop_id': 'desktopId', + 'is_assigned': 'isAssigned', + 'time_created': 'timeCreated', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags' + } + + self._lifecycle_state = None + self._instance_id = None + self._user_name = None + self._desktop_id = None + self._is_assigned = None + self._time_created = None + self._freeform_tags = None + self._defined_tags = None + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this DesktopPoolDesktopSummary. + The state of the desktop. + + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this DesktopPoolDesktopSummary. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this DesktopPoolDesktopSummary. + The state of the desktop. + + + :param lifecycle_state: The lifecycle_state of this DesktopPoolDesktopSummary. + :type: str + """ + allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def instance_id(self): + """ + **[Required]** Gets the instance_id of this DesktopPoolDesktopSummary. + The OCID of the compute resource used by this desktop. + + + :return: The instance_id of this DesktopPoolDesktopSummary. + :rtype: str + """ + return self._instance_id + + @instance_id.setter + def instance_id(self, instance_id): + """ + Sets the instance_id of this DesktopPoolDesktopSummary. + The OCID of the compute resource used by this desktop. + + + :param instance_id: The instance_id of this DesktopPoolDesktopSummary. + :type: str + """ + self._instance_id = instance_id + + @property + def user_name(self): + """ + Gets the user_name of this DesktopPoolDesktopSummary. + The owner of the desktop. + + + :return: The user_name of this DesktopPoolDesktopSummary. + :rtype: str + """ + return self._user_name + + @user_name.setter + def user_name(self, user_name): + """ + Sets the user_name of this DesktopPoolDesktopSummary. + The owner of the desktop. + + + :param user_name: The user_name of this DesktopPoolDesktopSummary. + :type: str + """ + self._user_name = user_name + + @property + def desktop_id(self): + """ + **[Required]** Gets the desktop_id of this DesktopPoolDesktopSummary. + The OCID of the desktop. + + + :return: The desktop_id of this DesktopPoolDesktopSummary. + :rtype: str + """ + return self._desktop_id + + @desktop_id.setter + def desktop_id(self, desktop_id): + """ + Sets the desktop_id of this DesktopPoolDesktopSummary. + The OCID of the desktop. + + + :param desktop_id: The desktop_id of this DesktopPoolDesktopSummary. + :type: str + """ + self._desktop_id = desktop_id + + @property + def is_assigned(self): + """ + **[Required]** Gets the is_assigned of this DesktopPoolDesktopSummary. + Indicates whether the desktop is assigned to a user. + + + :return: The is_assigned of this DesktopPoolDesktopSummary. + :rtype: bool + """ + return self._is_assigned + + @is_assigned.setter + def is_assigned(self, is_assigned): + """ + Sets the is_assigned of this DesktopPoolDesktopSummary. + Indicates whether the desktop is assigned to a user. + + + :param is_assigned: The is_assigned of this DesktopPoolDesktopSummary. + :type: bool + """ + self._is_assigned = is_assigned + + @property + def time_created(self): + """ + **[Required]** Gets the time_created of this DesktopPoolDesktopSummary. + The date and time the resource was created. + + + :return: The time_created of this DesktopPoolDesktopSummary. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this DesktopPoolDesktopSummary. + The date and time the resource was created. + + + :param time_created: The time_created of this DesktopPoolDesktopSummary. + :type: datetime + """ + self._time_created = time_created + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this DesktopPoolDesktopSummary. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this DesktopPoolDesktopSummary. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this DesktopPoolDesktopSummary. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this DesktopPoolDesktopSummary. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this DesktopPoolDesktopSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this DesktopPoolDesktopSummary. + :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 DesktopPoolDesktopSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this DesktopPoolDesktopSummary. + :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/desktops/models/desktop_pool_summary.py b/src/oci/desktops/models/desktop_pool_summary.py new file mode 100644 index 0000000000..a023fef591 --- /dev/null +++ b/src/oci/desktops/models/desktop_pool_summary.py @@ -0,0 +1,403 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 DesktopPoolSummary(object): + """ + Provides information about the desktop pool such as number of active desktops, name, OCID, state, and maximum size. + """ + + #: A constant which can be used with the lifecycle_state property of a DesktopPoolSummary. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the lifecycle_state property of a DesktopPoolSummary. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a DesktopPoolSummary. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a DesktopPoolSummary. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a DesktopPoolSummary. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a DesktopPoolSummary. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a DesktopPoolSummary. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + def __init__(self, **kwargs): + """ + Initializes a new DesktopPoolSummary 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 DesktopPoolSummary. + :type id: str + + :param display_name: + The value to assign to the display_name property of this DesktopPoolSummary. + :type display_name: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this DesktopPoolSummary. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param maximum_size: + The value to assign to the maximum_size property of this DesktopPoolSummary. + :type maximum_size: int + + :param active_desktops: + The value to assign to the active_desktops property of this DesktopPoolSummary. + :type active_desktops: int + + :param freeform_tags: + The value to assign to the freeform_tags property of this DesktopPoolSummary. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this DesktopPoolSummary. + :type defined_tags: dict(str, dict(str, object)) + + :param contact_details: + The value to assign to the contact_details property of this DesktopPoolSummary. + :type contact_details: str + + :param compartment_id: + The value to assign to the compartment_id property of this DesktopPoolSummary. + :type compartment_id: str + + :param time_created: + The value to assign to the time_created property of this DesktopPoolSummary. + :type time_created: datetime + + """ + self.swagger_types = { + 'id': 'str', + 'display_name': 'str', + 'lifecycle_state': 'str', + 'maximum_size': 'int', + 'active_desktops': 'int', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))', + 'contact_details': 'str', + 'compartment_id': 'str', + 'time_created': 'datetime' + } + + self.attribute_map = { + 'id': 'id', + 'display_name': 'displayName', + 'lifecycle_state': 'lifecycleState', + 'maximum_size': 'maximumSize', + 'active_desktops': 'activeDesktops', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags', + 'contact_details': 'contactDetails', + 'compartment_id': 'compartmentId', + 'time_created': 'timeCreated' + } + + self._id = None + self._display_name = None + self._lifecycle_state = None + self._maximum_size = None + self._active_desktops = None + self._freeform_tags = None + self._defined_tags = None + self._contact_details = None + self._compartment_id = None + self._time_created = None + + @property + def id(self): + """ + **[Required]** Gets the id of this DesktopPoolSummary. + The OCID of the desktop pool. + + + :return: The id of this DesktopPoolSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this DesktopPoolSummary. + The OCID of the desktop pool. + + + :param id: The id of this DesktopPoolSummary. + :type: str + """ + self._id = id + + @property + def display_name(self): + """ + **[Required]** Gets the display_name of this DesktopPoolSummary. + A user friendly display name. Avoid entering confidential information. + + + :return: The display_name of this DesktopPoolSummary. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this DesktopPoolSummary. + A user friendly display name. Avoid entering confidential information. + + + :param display_name: The display_name of this DesktopPoolSummary. + :type: str + """ + self._display_name = display_name + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this DesktopPoolSummary. + The current state of the desktop pool. + + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this DesktopPoolSummary. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this DesktopPoolSummary. + The current state of the desktop pool. + + + :param lifecycle_state: The lifecycle_state of this DesktopPoolSummary. + :type: str + """ + allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def maximum_size(self): + """ + **[Required]** Gets the maximum_size of this DesktopPoolSummary. + The maximum number of desktops permitted in the desktop pool. + + + :return: The maximum_size of this DesktopPoolSummary. + :rtype: int + """ + return self._maximum_size + + @maximum_size.setter + def maximum_size(self, maximum_size): + """ + Sets the maximum_size of this DesktopPoolSummary. + The maximum number of desktops permitted in the desktop pool. + + + :param maximum_size: The maximum_size of this DesktopPoolSummary. + :type: int + """ + self._maximum_size = maximum_size + + @property + def active_desktops(self): + """ + Gets the active_desktops of this DesktopPoolSummary. + The number of active desktops in the desktop pool. + + + :return: The active_desktops of this DesktopPoolSummary. + :rtype: int + """ + return self._active_desktops + + @active_desktops.setter + def active_desktops(self, active_desktops): + """ + Sets the active_desktops of this DesktopPoolSummary. + The number of active desktops in the desktop pool. + + + :param active_desktops: The active_desktops of this DesktopPoolSummary. + :type: int + """ + self._active_desktops = active_desktops + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this DesktopPoolSummary. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this DesktopPoolSummary. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this DesktopPoolSummary. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this DesktopPoolSummary. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this DesktopPoolSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this DesktopPoolSummary. + :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 DesktopPoolSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this DesktopPoolSummary. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def contact_details(self): + """ + **[Required]** Gets the contact_details of this DesktopPoolSummary. + Contact information of the desktop pool administrator. + Avoid entering confidential information. + + + :return: The contact_details of this DesktopPoolSummary. + :rtype: str + """ + return self._contact_details + + @contact_details.setter + def contact_details(self, contact_details): + """ + Sets the contact_details of this DesktopPoolSummary. + Contact information of the desktop pool administrator. + Avoid entering confidential information. + + + :param contact_details: The contact_details of this DesktopPoolSummary. + :type: str + """ + self._contact_details = contact_details + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this DesktopPoolSummary. + The OCID of the compartment which will contain the desktop pool. + + + :return: The compartment_id of this DesktopPoolSummary. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this DesktopPoolSummary. + The OCID of the compartment which will contain the desktop pool. + + + :param compartment_id: The compartment_id of this DesktopPoolSummary. + :type: str + """ + self._compartment_id = compartment_id + + @property + def time_created(self): + """ + **[Required]** Gets the time_created of this DesktopPoolSummary. + The date and time the resource was created. + + + :return: The time_created of this DesktopPoolSummary. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this DesktopPoolSummary. + The date and time the resource was created. + + + :param time_created: The time_created of this DesktopPoolSummary. + :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/desktops/models/desktop_pool_volume_collection.py b/src/oci/desktops/models/desktop_pool_volume_collection.py new file mode 100644 index 0000000000..b2c4a3fe2e --- /dev/null +++ b/src/oci/desktops/models/desktop_pool_volume_collection.py @@ -0,0 +1,72 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 DesktopPoolVolumeCollection(object): + """ + A list of volumes within a desktop pool. + """ + + def __init__(self, **kwargs): + """ + Initializes a new DesktopPoolVolumeCollection 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 DesktopPoolVolumeCollection. + :type items: list[oci.desktops.models.DesktopPoolVolumeSummary] + + """ + self.swagger_types = { + 'items': 'list[DesktopPoolVolumeSummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this DesktopPoolVolumeCollection. + A list of desktop pool volumes. + + + :return: The items of this DesktopPoolVolumeCollection. + :rtype: list[oci.desktops.models.DesktopPoolVolumeSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this DesktopPoolVolumeCollection. + A list of desktop pool volumes. + + + :param items: The items of this DesktopPoolVolumeCollection. + :type: list[oci.desktops.models.DesktopPoolVolumeSummary] + """ + 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/desktops/models/desktop_pool_volume_summary.py b/src/oci/desktops/models/desktop_pool_volume_summary.py new file mode 100644 index 0000000000..d9ceadf5a5 --- /dev/null +++ b/src/oci/desktops/models/desktop_pool_volume_summary.py @@ -0,0 +1,319 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 DesktopPoolVolumeSummary(object): + """ + Provides information about a volume within the desktop pool. + """ + + #: A constant which can be used with the lifecycle_state property of a DesktopPoolVolumeSummary. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a DesktopPoolVolumeSummary. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + def __init__(self, **kwargs): + """ + Initializes a new DesktopPoolVolumeSummary 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 DesktopPoolVolumeSummary. + :type id: str + + :param name: + The value to assign to the name property of this DesktopPoolVolumeSummary. + :type name: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this DesktopPoolVolumeSummary. + 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 lifecycle_state: str + + :param user_name: + The value to assign to the user_name property of this DesktopPoolVolumeSummary. + :type user_name: str + + :param pool_id: + The value to assign to the pool_id property of this DesktopPoolVolumeSummary. + :type pool_id: str + + :param availability_domain: + The value to assign to the availability_domain property of this DesktopPoolVolumeSummary. + :type availability_domain: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this DesktopPoolVolumeSummary. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this DesktopPoolVolumeSummary. + :type defined_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'id': 'str', + 'name': 'str', + 'lifecycle_state': 'str', + 'user_name': 'str', + 'pool_id': 'str', + 'availability_domain': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'id': 'id', + 'name': 'name', + 'lifecycle_state': 'lifecycleState', + 'user_name': 'userName', + 'pool_id': 'poolId', + 'availability_domain': 'availabilityDomain', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags' + } + + self._id = None + self._name = None + self._lifecycle_state = None + self._user_name = None + self._pool_id = None + self._availability_domain = None + self._freeform_tags = None + self._defined_tags = None + + @property + def id(self): + """ + **[Required]** Gets the id of this DesktopPoolVolumeSummary. + The OCID of the desktop pool volume. + + + :return: The id of this DesktopPoolVolumeSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this DesktopPoolVolumeSummary. + The OCID of the desktop pool volume. + + + :param id: The id of this DesktopPoolVolumeSummary. + :type: str + """ + self._id = id + + @property + def name(self): + """ + **[Required]** Gets the name of this DesktopPoolVolumeSummary. + The name of the desktop pool volume. + + + :return: The name of this DesktopPoolVolumeSummary. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this DesktopPoolVolumeSummary. + The name of the desktop pool volume. + + + :param name: The name of this DesktopPoolVolumeSummary. + :type: str + """ + self._name = name + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this DesktopPoolVolumeSummary. + The state of the desktop pool volume. + + 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 lifecycle_state of this DesktopPoolVolumeSummary. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this DesktopPoolVolumeSummary. + The state of the desktop pool volume. + + + :param lifecycle_state: The lifecycle_state of this DesktopPoolVolumeSummary. + :type: str + """ + allowed_values = ["ACTIVE", "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 user_name(self): + """ + **[Required]** Gets the user_name of this DesktopPoolVolumeSummary. + The owner of the desktop pool volume. + + + :return: The user_name of this DesktopPoolVolumeSummary. + :rtype: str + """ + return self._user_name + + @user_name.setter + def user_name(self, user_name): + """ + Sets the user_name of this DesktopPoolVolumeSummary. + The owner of the desktop pool volume. + + + :param user_name: The user_name of this DesktopPoolVolumeSummary. + :type: str + """ + self._user_name = user_name + + @property + def pool_id(self): + """ + Gets the pool_id of this DesktopPoolVolumeSummary. + The OCID of the desktop pool to which this volume belongs. + + + :return: The pool_id of this DesktopPoolVolumeSummary. + :rtype: str + """ + return self._pool_id + + @pool_id.setter + def pool_id(self, pool_id): + """ + Sets the pool_id of this DesktopPoolVolumeSummary. + The OCID of the desktop pool to which this volume belongs. + + + :param pool_id: The pool_id of this DesktopPoolVolumeSummary. + :type: str + """ + self._pool_id = pool_id + + @property + def availability_domain(self): + """ + **[Required]** Gets the availability_domain of this DesktopPoolVolumeSummary. + The availability domain of the desktop pool. + + + :return: The availability_domain of this DesktopPoolVolumeSummary. + :rtype: str + """ + return self._availability_domain + + @availability_domain.setter + def availability_domain(self, availability_domain): + """ + Sets the availability_domain of this DesktopPoolVolumeSummary. + The availability domain of the desktop pool. + + + :param availability_domain: The availability_domain of this DesktopPoolVolumeSummary. + :type: str + """ + self._availability_domain = availability_domain + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this DesktopPoolVolumeSummary. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this DesktopPoolVolumeSummary. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this DesktopPoolVolumeSummary. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this DesktopPoolVolumeSummary. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this DesktopPoolVolumeSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this DesktopPoolVolumeSummary. + :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 DesktopPoolVolumeSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this DesktopPoolVolumeSummary. + :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/desktops/models/desktop_schedule.py b/src/oci/desktops/models/desktop_schedule.py new file mode 100644 index 0000000000..570c7e7aa6 --- /dev/null +++ b/src/oci/desktops/models/desktop_schedule.py @@ -0,0 +1,103 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 DesktopSchedule(object): + """ + Provides the schedule information for a desktop. + """ + + def __init__(self, **kwargs): + """ + Initializes a new DesktopSchedule object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param cron_expression: + The value to assign to the cron_expression property of this DesktopSchedule. + :type cron_expression: str + + :param timezone: + The value to assign to the timezone property of this DesktopSchedule. + :type timezone: str + + """ + self.swagger_types = { + 'cron_expression': 'str', + 'timezone': 'str' + } + + self.attribute_map = { + 'cron_expression': 'cronExpression', + 'timezone': 'timezone' + } + + self._cron_expression = None + self._timezone = None + + @property + def cron_expression(self): + """ + **[Required]** Gets the cron_expression of this DesktopSchedule. + A cron expression describing the desktop's schedule. + + + :return: The cron_expression of this DesktopSchedule. + :rtype: str + """ + return self._cron_expression + + @cron_expression.setter + def cron_expression(self, cron_expression): + """ + Sets the cron_expression of this DesktopSchedule. + A cron expression describing the desktop's schedule. + + + :param cron_expression: The cron_expression of this DesktopSchedule. + :type: str + """ + self._cron_expression = cron_expression + + @property + def timezone(self): + """ + **[Required]** Gets the timezone of this DesktopSchedule. + The timezone of the desktop's schedule. + + + :return: The timezone of this DesktopSchedule. + :rtype: str + """ + return self._timezone + + @timezone.setter + def timezone(self, timezone): + """ + Sets the timezone of this DesktopSchedule. + The timezone of the desktop's schedule. + + + :param timezone: The timezone of this DesktopSchedule. + :type: str + """ + self._timezone = timezone + + 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/desktops/models/desktop_summary.py b/src/oci/desktops/models/desktop_summary.py new file mode 100644 index 0000000000..60b0127c96 --- /dev/null +++ b/src/oci/desktops/models/desktop_summary.py @@ -0,0 +1,339 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 DesktopSummary(object): + """ + Provides information about a desktop. + """ + + #: A constant which can be used with the lifecycle_state property of a DesktopSummary. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the lifecycle_state property of a DesktopSummary. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a DesktopSummary. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + #: A constant which can be used with the lifecycle_state property of a DesktopSummary. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a DesktopSummary. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a DesktopSummary. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a DesktopSummary. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + def __init__(self, **kwargs): + """ + Initializes a new DesktopSummary 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 DesktopSummary. + :type id: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this DesktopSummary. + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED", '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 DesktopSummary. + :type time_created: datetime + + :param display_name: + The value to assign to the display_name property of this DesktopSummary. + :type display_name: str + + :param user_name: + The value to assign to the user_name property of this DesktopSummary. + :type user_name: str + + :param pool_id: + The value to assign to the pool_id property of this DesktopSummary. + :type pool_id: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this DesktopSummary. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this DesktopSummary. + :type defined_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'id': 'str', + 'lifecycle_state': 'str', + 'time_created': 'datetime', + 'display_name': 'str', + 'user_name': 'str', + 'pool_id': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'id': 'id', + 'lifecycle_state': 'lifecycleState', + 'time_created': 'timeCreated', + 'display_name': 'displayName', + 'user_name': 'userName', + 'pool_id': 'poolId', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags' + } + + self._id = None + self._lifecycle_state = None + self._time_created = None + self._display_name = None + self._user_name = None + self._pool_id = None + self._freeform_tags = None + self._defined_tags = None + + @property + def id(self): + """ + **[Required]** Gets the id of this DesktopSummary. + The OCID of the desktop. + + + :return: The id of this DesktopSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this DesktopSummary. + The OCID of the desktop. + + + :param id: The id of this DesktopSummary. + :type: str + """ + self._id = id + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this DesktopSummary. + The state of the desktop. + + Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this DesktopSummary. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this DesktopSummary. + The state of the desktop. + + + :param lifecycle_state: The lifecycle_state of this DesktopSummary. + :type: str + """ + allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"] + 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 DesktopSummary. + The date and time the resource was created. + + + :return: The time_created of this DesktopSummary. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this DesktopSummary. + The date and time the resource was created. + + + :param time_created: The time_created of this DesktopSummary. + :type: datetime + """ + self._time_created = time_created + + @property + def display_name(self): + """ + **[Required]** Gets the display_name of this DesktopSummary. + A user friendly display name. Avoid entering confidential information. + + + :return: The display_name of this DesktopSummary. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this DesktopSummary. + A user friendly display name. Avoid entering confidential information. + + + :param display_name: The display_name of this DesktopSummary. + :type: str + """ + self._display_name = display_name + + @property + def user_name(self): + """ + **[Required]** Gets the user_name of this DesktopSummary. + The owner of the desktop. + + + :return: The user_name of this DesktopSummary. + :rtype: str + """ + return self._user_name + + @user_name.setter + def user_name(self, user_name): + """ + Sets the user_name of this DesktopSummary. + The owner of the desktop. + + + :param user_name: The user_name of this DesktopSummary. + :type: str + """ + self._user_name = user_name + + @property + def pool_id(self): + """ + **[Required]** Gets the pool_id of this DesktopSummary. + The pool ID of the desktop. + + + :return: The pool_id of this DesktopSummary. + :rtype: str + """ + return self._pool_id + + @pool_id.setter + def pool_id(self, pool_id): + """ + Sets the pool_id of this DesktopSummary. + The pool ID of the desktop. + + + :param pool_id: The pool_id of this DesktopSummary. + :type: str + """ + self._pool_id = pool_id + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this DesktopSummary. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this DesktopSummary. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this DesktopSummary. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this DesktopSummary. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this DesktopSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this DesktopSummary. + :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 DesktopSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this DesktopSummary. + :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/desktops/models/hosting_options.py b/src/oci/desktops/models/hosting_options.py new file mode 100644 index 0000000000..d8de9c3101 --- /dev/null +++ b/src/oci/desktops/models/hosting_options.py @@ -0,0 +1,99 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 HostingOptions(object): + """ + Provides information about where a desktop is hosted. + """ + + def __init__(self, **kwargs): + """ + Initializes a new HostingOptions object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param image: + The value to assign to the image property of this HostingOptions. + :type image: oci.desktops.models.DesktopImage + + :param connect_address: + The value to assign to the connect_address property of this HostingOptions. + :type connect_address: str + + """ + self.swagger_types = { + 'image': 'DesktopImage', + 'connect_address': 'str' + } + + self.attribute_map = { + 'image': 'image', + 'connect_address': 'connectAddress' + } + + self._image = None + self._connect_address = None + + @property + def image(self): + """ + **[Required]** Gets the image of this HostingOptions. + + :return: The image of this HostingOptions. + :rtype: oci.desktops.models.DesktopImage + """ + return self._image + + @image.setter + def image(self, image): + """ + Sets the image of this HostingOptions. + + :param image: The image of this HostingOptions. + :type: oci.desktops.models.DesktopImage + """ + self._image = image + + @property + def connect_address(self): + """ + **[Required]** Gets the connect_address of this HostingOptions. + The connection address of the desktop. + + + :return: The connect_address of this HostingOptions. + :rtype: str + """ + return self._connect_address + + @connect_address.setter + def connect_address(self, connect_address): + """ + Sets the connect_address of this HostingOptions. + The connection address of the desktop. + + + :param connect_address: The connect_address of this HostingOptions. + :type: str + """ + self._connect_address = connect_address + + 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/desktops/models/update_desktop_details.py b/src/oci/desktops/models/update_desktop_details.py new file mode 100644 index 0000000000..b75f4c1941 --- /dev/null +++ b/src/oci/desktops/models/update_desktop_details.py @@ -0,0 +1,148 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 UpdateDesktopDetails(object): + """ + Provides the details of an updated desktop. + """ + + def __init__(self, **kwargs): + """ + Initializes a new UpdateDesktopDetails 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 UpdateDesktopDetails. + :type display_name: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this UpdateDesktopDetails. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this UpdateDesktopDetails. + :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 UpdateDesktopDetails. + A user friendly display name. Avoid entering confidential information. + + + :return: The display_name of this UpdateDesktopDetails. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this UpdateDesktopDetails. + A user friendly display name. Avoid entering confidential information. + + + :param display_name: The display_name of this UpdateDesktopDetails. + :type: str + """ + self._display_name = display_name + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this UpdateDesktopDetails. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this UpdateDesktopDetails. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this UpdateDesktopDetails. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this UpdateDesktopDetails. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this UpdateDesktopDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this UpdateDesktopDetails. + :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 UpdateDesktopDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this UpdateDesktopDetails. + :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/desktops/models/update_desktop_pool_details.py b/src/oci/desktops/models/update_desktop_pool_details.py new file mode 100644 index 0000000000..273b2f7df6 --- /dev/null +++ b/src/oci/desktops/models/update_desktop_pool_details.py @@ -0,0 +1,392 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 UpdateDesktopPoolDetails(object): + """ + Provides the details of a request to update the desktop pool. + """ + + def __init__(self, **kwargs): + """ + Initializes a new UpdateDesktopPoolDetails 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 UpdateDesktopPoolDetails. + :type display_name: str + + :param description: + The value to assign to the description property of this UpdateDesktopPoolDetails. + :type description: str + + :param maximum_size: + The value to assign to the maximum_size property of this UpdateDesktopPoolDetails. + :type maximum_size: int + + :param standby_size: + The value to assign to the standby_size property of this UpdateDesktopPoolDetails. + :type standby_size: int + + :param device_policy: + The value to assign to the device_policy property of this UpdateDesktopPoolDetails. + :type device_policy: oci.desktops.models.DesktopDevicePolicy + + :param availability_policy: + The value to assign to the availability_policy property of this UpdateDesktopPoolDetails. + :type availability_policy: oci.desktops.models.DesktopAvailabilityPolicy + + :param contact_details: + The value to assign to the contact_details property of this UpdateDesktopPoolDetails. + :type contact_details: str + + :param time_start_scheduled: + The value to assign to the time_start_scheduled property of this UpdateDesktopPoolDetails. + :type time_start_scheduled: datetime + + :param time_stop_scheduled: + The value to assign to the time_stop_scheduled property of this UpdateDesktopPoolDetails. + :type time_stop_scheduled: datetime + + :param freeform_tags: + The value to assign to the freeform_tags property of this UpdateDesktopPoolDetails. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this UpdateDesktopPoolDetails. + :type defined_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'display_name': 'str', + 'description': 'str', + 'maximum_size': 'int', + 'standby_size': 'int', + 'device_policy': 'DesktopDevicePolicy', + 'availability_policy': 'DesktopAvailabilityPolicy', + 'contact_details': 'str', + 'time_start_scheduled': 'datetime', + 'time_stop_scheduled': 'datetime', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'display_name': 'displayName', + 'description': 'description', + 'maximum_size': 'maximumSize', + 'standby_size': 'standbySize', + 'device_policy': 'devicePolicy', + 'availability_policy': 'availabilityPolicy', + 'contact_details': 'contactDetails', + 'time_start_scheduled': 'timeStartScheduled', + 'time_stop_scheduled': 'timeStopScheduled', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags' + } + + self._display_name = None + self._description = None + self._maximum_size = None + self._standby_size = None + self._device_policy = None + self._availability_policy = None + self._contact_details = None + self._time_start_scheduled = None + self._time_stop_scheduled = None + self._freeform_tags = None + self._defined_tags = None + + @property + def display_name(self): + """ + Gets the display_name of this UpdateDesktopPoolDetails. + A user friendly display name. Avoid entering confidential information. + + + :return: The display_name of this UpdateDesktopPoolDetails. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this UpdateDesktopPoolDetails. + A user friendly display name. Avoid entering confidential information. + + + :param display_name: The display_name of this UpdateDesktopPoolDetails. + :type: str + """ + self._display_name = display_name + + @property + def description(self): + """ + Gets the description of this UpdateDesktopPoolDetails. + A user friendly description providing additional information about the resource. + Avoid entering confidential information. + + + :return: The description of this UpdateDesktopPoolDetails. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """ + Sets the description of this UpdateDesktopPoolDetails. + A user friendly description providing additional information about the resource. + Avoid entering confidential information. + + + :param description: The description of this UpdateDesktopPoolDetails. + :type: str + """ + self._description = description + + @property + def maximum_size(self): + """ + Gets the maximum_size of this UpdateDesktopPoolDetails. + The maximum number of desktops permitted in the desktop pool. + + + :return: The maximum_size of this UpdateDesktopPoolDetails. + :rtype: int + """ + return self._maximum_size + + @maximum_size.setter + def maximum_size(self, maximum_size): + """ + Sets the maximum_size of this UpdateDesktopPoolDetails. + The maximum number of desktops permitted in the desktop pool. + + + :param maximum_size: The maximum_size of this UpdateDesktopPoolDetails. + :type: int + """ + self._maximum_size = maximum_size + + @property + def standby_size(self): + """ + Gets the standby_size of this UpdateDesktopPoolDetails. + The maximum number of standby desktops available in the desktop pool. + + + :return: The standby_size of this UpdateDesktopPoolDetails. + :rtype: int + """ + return self._standby_size + + @standby_size.setter + def standby_size(self, standby_size): + """ + Sets the standby_size of this UpdateDesktopPoolDetails. + The maximum number of standby desktops available in the desktop pool. + + + :param standby_size: The standby_size of this UpdateDesktopPoolDetails. + :type: int + """ + self._standby_size = standby_size + + @property + def device_policy(self): + """ + Gets the device_policy of this UpdateDesktopPoolDetails. + + :return: The device_policy of this UpdateDesktopPoolDetails. + :rtype: oci.desktops.models.DesktopDevicePolicy + """ + return self._device_policy + + @device_policy.setter + def device_policy(self, device_policy): + """ + Sets the device_policy of this UpdateDesktopPoolDetails. + + :param device_policy: The device_policy of this UpdateDesktopPoolDetails. + :type: oci.desktops.models.DesktopDevicePolicy + """ + self._device_policy = device_policy + + @property + def availability_policy(self): + """ + Gets the availability_policy of this UpdateDesktopPoolDetails. + + :return: The availability_policy of this UpdateDesktopPoolDetails. + :rtype: oci.desktops.models.DesktopAvailabilityPolicy + """ + return self._availability_policy + + @availability_policy.setter + def availability_policy(self, availability_policy): + """ + Sets the availability_policy of this UpdateDesktopPoolDetails. + + :param availability_policy: The availability_policy of this UpdateDesktopPoolDetails. + :type: oci.desktops.models.DesktopAvailabilityPolicy + """ + self._availability_policy = availability_policy + + @property + def contact_details(self): + """ + Gets the contact_details of this UpdateDesktopPoolDetails. + Contact information of the desktop pool administrator. + Avoid entering confidential information. + + + :return: The contact_details of this UpdateDesktopPoolDetails. + :rtype: str + """ + return self._contact_details + + @contact_details.setter + def contact_details(self, contact_details): + """ + Sets the contact_details of this UpdateDesktopPoolDetails. + Contact information of the desktop pool administrator. + Avoid entering confidential information. + + + :param contact_details: The contact_details of this UpdateDesktopPoolDetails. + :type: str + """ + self._contact_details = contact_details + + @property + def time_start_scheduled(self): + """ + Gets the time_start_scheduled of this UpdateDesktopPoolDetails. + The start time of the desktop pool. + + + :return: The time_start_scheduled of this UpdateDesktopPoolDetails. + :rtype: datetime + """ + return self._time_start_scheduled + + @time_start_scheduled.setter + def time_start_scheduled(self, time_start_scheduled): + """ + Sets the time_start_scheduled of this UpdateDesktopPoolDetails. + The start time of the desktop pool. + + + :param time_start_scheduled: The time_start_scheduled of this UpdateDesktopPoolDetails. + :type: datetime + """ + self._time_start_scheduled = time_start_scheduled + + @property + def time_stop_scheduled(self): + """ + Gets the time_stop_scheduled of this UpdateDesktopPoolDetails. + The stop time of the desktop pool. + + + :return: The time_stop_scheduled of this UpdateDesktopPoolDetails. + :rtype: datetime + """ + return self._time_stop_scheduled + + @time_stop_scheduled.setter + def time_stop_scheduled(self, time_stop_scheduled): + """ + Sets the time_stop_scheduled of this UpdateDesktopPoolDetails. + The stop time of the desktop pool. + + + :param time_stop_scheduled: The time_stop_scheduled of this UpdateDesktopPoolDetails. + :type: datetime + """ + self._time_stop_scheduled = time_stop_scheduled + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this UpdateDesktopPoolDetails. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this UpdateDesktopPoolDetails. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this UpdateDesktopPoolDetails. + Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see `Resource Tags`__. + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this UpdateDesktopPoolDetails. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this UpdateDesktopPoolDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this UpdateDesktopPoolDetails. + :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 UpdateDesktopPoolDetails. + Defined tags for this resource. Each key is predefined and scoped to a namespace. + For more information, see `Resource Tags`__. + Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this UpdateDesktopPoolDetails. + :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/desktops/models/work_request.py b/src/oci/desktops/models/work_request.py new file mode 100644 index 0000000000..15a7075882 --- /dev/null +++ b/src/oci/desktops/models/work_request.py @@ -0,0 +1,420 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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_DESKTOP_POOL" + OPERATION_TYPE_CREATE_DESKTOP_POOL = "CREATE_DESKTOP_POOL" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "UPDATE_DESKTOP_POOL" + OPERATION_TYPE_UPDATE_DESKTOP_POOL = "UPDATE_DESKTOP_POOL" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "DELETE_DESKTOP_POOL" + OPERATION_TYPE_DELETE_DESKTOP_POOL = "DELETE_DESKTOP_POOL" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "MOVE_DESKTOP_POOL" + OPERATION_TYPE_MOVE_DESKTOP_POOL = "MOVE_DESKTOP_POOL" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "START_DESKTOP_POOL" + OPERATION_TYPE_START_DESKTOP_POOL = "START_DESKTOP_POOL" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "STOP_DESKTOP_POOL" + OPERATION_TYPE_STOP_DESKTOP_POOL = "STOP_DESKTOP_POOL" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "DELETE_DESKTOP" + OPERATION_TYPE_DELETE_DESKTOP = "DELETE_DESKTOP" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "UPDATE_DESKTOP" + OPERATION_TYPE_UPDATE_DESKTOP = "UPDATE_DESKTOP" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "START_DESKTOP" + OPERATION_TYPE_START_DESKTOP = "START_DESKTOP" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "STOP_DESKTOP" + OPERATION_TYPE_STOP_DESKTOP = "STOP_DESKTOP" + + #: 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 "WAITING" + STATUS_WAITING = "WAITING" + + #: 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_DESKTOP_POOL", "UPDATE_DESKTOP_POOL", "DELETE_DESKTOP_POOL", "MOVE_DESKTOP_POOL", "START_DESKTOP_POOL", "STOP_DESKTOP_POOL", "DELETE_DESKTOP", "UPDATE_DESKTOP", "START_DESKTOP", "STOP_DESKTOP", '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", "WAITING", "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[oci.desktops.models.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_DESKTOP_POOL", "UPDATE_DESKTOP_POOL", "DELETE_DESKTOP_POOL", "MOVE_DESKTOP_POOL", "START_DESKTOP_POOL", "STOP_DESKTOP_POOL", "DELETE_DESKTOP", "UPDATE_DESKTOP", "START_DESKTOP", "STOP_DESKTOP", '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_DESKTOP_POOL", "UPDATE_DESKTOP_POOL", "DELETE_DESKTOP_POOL", "MOVE_DESKTOP_POOL", "START_DESKTOP_POOL", "STOP_DESKTOP_POOL", "DELETE_DESKTOP", "UPDATE_DESKTOP", "START_DESKTOP", "STOP_DESKTOP"] + 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", "WAITING", "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", "WAITING", "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. + + + :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 affected by this work request. + + + :return: The resources of this WorkRequest. + :rtype: list[oci.desktops.models.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[oci.desktops.models.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/desktops/models/work_request_error.py b/src/oci/desktops/models/work_request_error.py new file mode 100644 index 0000000000..304447040c --- /dev/null +++ b/src/oci/desktops/models/work_request_error.py @@ -0,0 +1,136 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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/desktops/models/work_request_error_collection.py b/src/oci/desktops/models/work_request_error_collection.py new file mode 100644 index 0000000000..39ed17c6df --- /dev/null +++ b/src/oci/desktops/models/work_request_error_collection.py @@ -0,0 +1,72 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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): + """ + Results of a workRequestError search. + """ + + 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[oci.desktops.models.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. + List of workRequestError objects. + + + :return: The items of this WorkRequestErrorCollection. + :rtype: list[oci.desktops.models.WorkRequestError] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this WorkRequestErrorCollection. + List of workRequestError objects. + + + :param items: The items of this WorkRequestErrorCollection. + :type: list[oci.desktops.models.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/desktops/models/work_request_log_entry.py b/src/oci/desktops/models/work_request_log_entry.py new file mode 100644 index 0000000000..7e6e4cd685 --- /dev/null +++ b/src/oci/desktops/models/work_request_log_entry.py @@ -0,0 +1,103 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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/desktops/models/work_request_log_entry_collection.py b/src/oci/desktops/models/work_request_log_entry_collection.py new file mode 100644 index 0000000000..ab349cf21f --- /dev/null +++ b/src/oci/desktops/models/work_request_log_entry_collection.py @@ -0,0 +1,72 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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): + """ + Results of a workRequestLog search. + """ + + 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[oci.desktops.models.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. + List of workRequestLogEntries. + + + :return: The items of this WorkRequestLogEntryCollection. + :rtype: list[oci.desktops.models.WorkRequestLogEntry] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this WorkRequestLogEntryCollection. + List of workRequestLogEntries. + + + :param items: The items of this WorkRequestLogEntryCollection. + :type: list[oci.desktops.models.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/desktops/models/work_request_resource.py b/src/oci/desktops/models/work_request_resource.py new file mode 100644 index 0000000000..5156f8039b --- /dev/null +++ b/src/oci/desktops/models/work_request_resource.py @@ -0,0 +1,203 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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" + + #: A constant which can be used with the action_type property of a WorkRequestResource. + #: This constant has a value of "FAILED" + ACTION_TYPE_FAILED = "FAILED" + + 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", "FAILED", '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", "FAILED", '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", "FAILED"] + 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/desktops/models/work_request_summary.py b/src/oci/desktops/models/work_request_summary.py new file mode 100644 index 0000000000..2493e28aca --- /dev/null +++ b/src/oci/desktops/models/work_request_summary.py @@ -0,0 +1,420 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 the status of a work request. + """ + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "CREATE_DESKTOP_POOL" + OPERATION_TYPE_CREATE_DESKTOP_POOL = "CREATE_DESKTOP_POOL" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "UPDATE_DESKTOP_POOL" + OPERATION_TYPE_UPDATE_DESKTOP_POOL = "UPDATE_DESKTOP_POOL" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "DELETE_DESKTOP_POOL" + OPERATION_TYPE_DELETE_DESKTOP_POOL = "DELETE_DESKTOP_POOL" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "MOVE_DESKTOP_POOL" + OPERATION_TYPE_MOVE_DESKTOP_POOL = "MOVE_DESKTOP_POOL" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "START_DESKTOP_POOL" + OPERATION_TYPE_START_DESKTOP_POOL = "START_DESKTOP_POOL" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "STOP_DESKTOP_POOL" + OPERATION_TYPE_STOP_DESKTOP_POOL = "STOP_DESKTOP_POOL" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "DELETE_DESKTOP" + OPERATION_TYPE_DELETE_DESKTOP = "DELETE_DESKTOP" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "UPDATE_DESKTOP" + OPERATION_TYPE_UPDATE_DESKTOP = "UPDATE_DESKTOP" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "START_DESKTOP" + OPERATION_TYPE_START_DESKTOP = "START_DESKTOP" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "STOP_DESKTOP" + OPERATION_TYPE_STOP_DESKTOP = "STOP_DESKTOP" + + #: 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 "WAITING" + STATUS_WAITING = "WAITING" + + #: 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_DESKTOP_POOL", "UPDATE_DESKTOP_POOL", "DELETE_DESKTOP_POOL", "MOVE_DESKTOP_POOL", "START_DESKTOP_POOL", "STOP_DESKTOP_POOL", "DELETE_DESKTOP", "UPDATE_DESKTOP", "START_DESKTOP", "STOP_DESKTOP", '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", "WAITING", "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[oci.desktops.models.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_DESKTOP_POOL", "UPDATE_DESKTOP_POOL", "DELETE_DESKTOP_POOL", "MOVE_DESKTOP_POOL", "START_DESKTOP_POOL", "STOP_DESKTOP_POOL", "DELETE_DESKTOP", "UPDATE_DESKTOP", "START_DESKTOP", "STOP_DESKTOP", '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_DESKTOP_POOL", "UPDATE_DESKTOP_POOL", "DELETE_DESKTOP_POOL", "MOVE_DESKTOP_POOL", "START_DESKTOP_POOL", "STOP_DESKTOP_POOL", "DELETE_DESKTOP", "UPDATE_DESKTOP", "START_DESKTOP", "STOP_DESKTOP"] + 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", "WAITING", "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", "WAITING", "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. + + + :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. + + + :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[oci.desktops.models.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[oci.desktops.models.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/desktops/models/work_request_summary_collection.py b/src/oci/desktops/models/work_request_summary_collection.py new file mode 100644 index 0000000000..e973f6f6e0 --- /dev/null +++ b/src/oci/desktops/models/work_request_summary_collection.py @@ -0,0 +1,72 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220618 + + +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 WorkRequestSummaryCollection(object): + """ + Results of a workRequest search. + """ + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequestSummaryCollection 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 WorkRequestSummaryCollection. + :type items: list[oci.desktops.models.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 WorkRequestSummaryCollection. + List of workRequestSummary objects. + + + :return: The items of this WorkRequestSummaryCollection. + :rtype: list[oci.desktops.models.WorkRequestSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this WorkRequestSummaryCollection. + List of workRequestSummary objects. + + + :param items: The items of this WorkRequestSummaryCollection. + :type: list[oci.desktops.models.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/regions_definitions.py b/src/oci/regions_definitions.py index 5d4e57383c..a80de7c41a 100644 --- a/src/oci/regions_definitions.py +++ b/src/oci/regions_definitions.py @@ -61,6 +61,7 @@ 'vll': 'eu-madrid-2', 'str': 'eu-frankfurt-2', 'beg': 'eu-jovanovac-1', + 'doh': 'me-dcc-doha-1', 'avz': 'eu-dcc-zurich-1' } REGION_REALMS = { @@ -132,6 +133,8 @@ 'eu-jovanovac-1': 'oc20', + 'me-dcc-doha-1': 'oc21', + 'eu-dcc-zurich-1': 'oc24' } REALMS = { @@ -145,6 +148,7 @@ 'oc14': 'oraclecloud14.com', 'oc19': 'oraclecloud.eu', 'oc20': 'oraclecloud20.com', + 'oc21': 'oraclecloud21.com', 'oc24': 'oraclecloud24.com' } REGIONS = [ @@ -206,5 +210,6 @@ 'eu-madrid-2', 'eu-frankfurt-2', 'eu-jovanovac-1', + 'me-dcc-doha-1', 'eu-dcc-zurich-1' ] diff --git a/src/oci/version.py b/src/oci/version.py index c1bf419766..b9a80700ff 100644 --- a/src/oci/version.py +++ b/src/oci/version.py @@ -2,4 +2,4 @@ # Copyright (c) 2016, 2024, 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.121.1" +__version__ = "2.122.0" diff --git a/tests/unit/test_waiters.py b/tests/unit/test_waiters.py index 5eb5de07dd..f2ab884c15 100644 --- a/tests/unit/test_waiters.py +++ b/tests/unit/test_waiters.py @@ -112,67 +112,69 @@ def test_wait_multiple_states(virtual_network, config): assert total_time < 60 * 5 -def test_invalid_operation(identity, config): - # Create User - request = oci.identity.models.CreateUserDetails() +def test_invalid_operation(object_storage, config): + # Create Bucket + namespace_name = object_storage.get_namespace().data + request = oci.object_storage.models.CreateBucketDetails() request.compartment_id = config["tenancy"] - request.name = tests.util.unique_name('python_wait_test_user', ignore_vcr=True) - request.description = 'test user' - response = identity.create_user(request) - user_id = response.data.id + bucket_name = tests.util.unique_name('python_wait_test_bucket', ignore_vcr=True) + request.name = bucket_name + response = object_storage.create_bucket(namespace_name, request) with pytest.raises(oci.exceptions.WaitUntilNotSupported): - oci.wait_until(identity, response, 'name', 'test') + oci.wait_until(object_storage, response, 'name', 'test') with pytest.raises(ValueError): - response = identity.get_user(user_id) - oci.wait_until(identity, response, 'fake_property', 'test') + response = object_storage.get_bucket(namespace_name, bucket_name) + oci.wait_until(object_storage, response, 'fake_property', 'test') - # Delete User - response = identity.delete_user(user_id) + # Delete Bucket + response = object_storage.delete_bucket(namespace_name, bucket_name) with pytest.raises(oci.exceptions.WaitUntilNotSupported): - oci.wait_until(identity, response, 'not a real property', 'test') + oci.wait_until(object_storage, response, 'not a real property', 'test') -def test_already_in_state(identity, config): - description = 'test user' - request = oci.identity.models.CreateUserDetails() +def test_already_in_state(object_storage, config): + # Create Bucket + namespace_name = object_storage.get_namespace().data + request = oci.object_storage.models.CreateBucketDetails() request.compartment_id = config["tenancy"] - request.name = tests.util.unique_name('python_wait_test_user', ignore_vcr=True) - request.description = description - response = identity.create_user(request) - user_id = response.data.id + bucket_name = tests.util.unique_name('python_wait_test_bucket', ignore_vcr=True) + request.name = bucket_name + response = object_storage.create_bucket(namespace_name, request) + bucket_id = response.data.id - response = identity.get_user(user_id) - assert description == response.data.description + response = object_storage.get_bucket(namespace_name, bucket_name) + assert bucket_id == response.data.id start_time = time.time() - oci.wait_until(identity, response, 'description', description) + oci.wait_until(object_storage, response, 'id', bucket_id) assert start_time - time.time() < 1 # clean up - identity.delete_user(user_id) + object_storage.delete_bucket(namespace_name, bucket_name) -def test_wait_time_exceeded(identity, config): - description = 'test user' - request = oci.identity.models.CreateUserDetails() +def test_wait_time_exceeded(object_storage, config): + # Create Bucket + namespace_name = object_storage.get_namespace().data + request = oci.object_storage.models.CreateBucketDetails() request.compartment_id = config["tenancy"] - request.name = tests.util.unique_name('python_wait_test_user', ignore_vcr=True) - request.description = description - response = identity.create_user(request) - user_id = response.data.id + bucket_name = tests.util.unique_name('python_wait_test_bucket', ignore_vcr=True) + request.name = bucket_name + response = object_storage.create_bucket(namespace_name, request) + bucket_id = response.data.id - response = identity.get_user(user_id) - assert description == response.data.description + response = object_storage.get_bucket(namespace_name, bucket_name) + assert bucket_id == response.data.id with pytest.raises(oci.exceptions.MaximumWaitTimeExceeded): # Wait on a property that will not change until we time out. - oci.wait_until(identity, response, 'name', 'test', max_wait_seconds=2) + oci.wait_until(object_storage, response, 'name', 'test', max_wait_seconds=2) # clean up - identity.delete_user(user_id) + object_storage.delete_bucket(namespace_name, bucket_name) def test_property_and_eval_function_provided(virtual_network): @@ -182,70 +184,74 @@ def test_property_and_eval_function_provided(virtual_network): assert str(ve.value) == 'Invalid wait_until configuration - can not provide both evaluate_response function and property argument, only one should be specified' -def test_eval_function_lambda(identity, config): - user_id = None +def test_eval_function_lambda(object_storage, config): + bucket_id = None + namespace_name = "" + bucket_name = "" try: - description = 'test user' - request = oci.identity.models.CreateUserDetails() + namespace_name = object_storage.get_namespace().data + request = oci.object_storage.models.CreateBucketDetails() request.compartment_id = config["tenancy"] - request.name = tests.util.unique_name('python_wait_test_user', ignore_vcr=True) - request.description = description - response = identity.create_user(request) - user_id = response.data.id + bucket_name = tests.util.unique_name('python_wait_test_bucket', ignore_vcr=True) + request.name = bucket_name + response = object_storage.create_bucket(namespace_name, request) + bucket_id = response.data.id - response = identity.get_user(user_id) - assert description == response.data.description + response = object_storage.get_bucket(namespace_name, bucket_name) + assert bucket_id == response.data.id - response = oci.wait_until(identity, response, evaluate_response=lambda x: x.data.description == description and x.data.name == request.name and x.data.lifecycle_state == 'ACTIVE') - assert response.data.id == user_id - assert response.data.description == description + response = oci.wait_until(object_storage, response, evaluate_response=lambda x: x.data.id == bucket_id and x.data.name == request.name and x.data.namespace == namespace_name) + assert response.data.id == bucket_id + assert response.data.compartment_id == config["tenancy"] assert response.data.name == request.name - assert response.data.lifecycle_state == 'ACTIVE' + assert response.data.namespace == namespace_name finally: - if user_id: - identity.delete_user(user_id) + if bucket_id: + object_storage.delete_bucket(namespace_name, bucket_name) -def test_eval_function_func_ref(identity, config): - user_id = None +def test_eval_function_func_ref(object_storage, config): + bucket_id = None + namespace_name = "" + bucket_name = "" try: - description = 'test user' - request = oci.identity.models.CreateUserDetails() + namespace_name = object_storage.get_namespace().data + request = oci.object_storage.models.CreateBucketDetails() request.compartment_id = config["tenancy"] - request.name = tests.util.unique_name('python_wait_test_user', ignore_vcr=True) - request.description = description - response = identity.create_user(request) - user_id = response.data.id - - response = identity.get_user(user_id) - assert description == response.data.description - - def test_user_response(user_response): - print('Invoked function reference in test_user_response') - user = user_response.data - return user.description == description and user.name == request.name and user.lifecycle_state == 'ACTIVE' - - response = oci.wait_until(identity, response, evaluate_response=test_user_response) - assert response.data.id == user_id - assert response.data.description == description + bucket_name = tests.util.unique_name('python_wait_test_bucket', ignore_vcr=True) + request.name = bucket_name + response = object_storage.create_bucket(namespace_name, request) + bucket_id = response.data.id + + response = object_storage.get_bucket(namespace_name, bucket_name) + assert bucket_id == response.data.id + + def test_bucket_response(bucket_response): + print('Invoked function reference in test_bucket_response') + bucket = bucket_response.data + return bucket.id == bucket_id and bucket.name == request.name and bucket.compartment_id == config["tenancy"] + + response = oci.wait_until(object_storage, response, evaluate_response=test_bucket_response) + assert response.data.id == bucket_id + assert response.data.namespace == namespace_name assert response.data.name == request.name - assert response.data.lifecycle_state == 'ACTIVE' + assert response.data.compartment_id == config["tenancy"] times_called = {'counter': 0} - def test_user_response_for_timeout(user_response): - print('Invoked function reference in test_user_response_for_timeout') - user = user_response.data + def test_bucket_response_for_timeout(bucket_response): + print('Invoked function reference in test_bucket_response_for_timeout') + bucket = bucket_response.data times_called['counter'] += 1 - return user.description == description and user.name == request.name and user.lifecycle_state == 'superman' + return bucket.id == bucket_id and bucket.name == request.name and bucket.compartment_id == 'superman' with pytest.raises(oci.exceptions.MaximumWaitTimeExceeded): - response = oci.wait_until(identity, response, evaluate_response=test_user_response_for_timeout, max_wait_seconds=45, max_interval_seconds=10) + response = oci.wait_until(object_storage, response, evaluate_response=test_bucket_response_for_timeout, max_wait_seconds=45, max_interval_seconds=10) assert times_called['counter'] >= 2 finally: - if user_id: - identity.delete_user(user_id) + if bucket_id: + object_storage.delete_bucket(namespace_name, bucket_name) def test_callback_func(virtual_network, config):