diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8d749da862..3420c4d2f6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,30 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `_. +==================== +1.4.3 - 2018-06-14 +==================== + +Added +----- +* Support for the Container Engine service + + * A sample showing how to use this service from the SDK is available on `GitHub `__. + +Fixed +------- +* Add dependency to idna >=2.5,<2.7 since cryptography and requests both have a dependency on the library and pip can install a version that is incompatable with requests. + +==================== +1.4.2 - 2018-06-14 +==================== + +This version was removed from PyPi due to a potential dependency conflict between cryptography and requests. + +* Support for the Container Engine service + + * A sample showing how to use this service from the SDK is available on `GitHub `__. + ==================== 1.4.1 - 2018-05-31 ==================== @@ -103,7 +127,7 @@ Added Added ----- * Added support for the Email Service - + * An example on using the Email Service can be found on `GitHub `__. * Added support for SMTP credentials in the Identity Service @@ -123,7 +147,7 @@ Added Added ----- * Support for File Storage Service - + * An example on using the File Storage Service can be found on `GitHub `__. * Added support for tagging Bucket resources in the Object Storage Service @@ -167,7 +191,7 @@ Added * Support for using the ``ObjectReadWithoutList`` public access type when creating and updating buckets * Support for dynamic groups in Identity Service * Support for instance principals authentication when calling OCI services. An example of how to use instance principals authentication can be found on `GitHub `_. -* Support for configuring idle timeout for listeners in Load Balancer Service +* Support for configuring idle timeout for listeners in Load Balancer Service * Support for VNC console connections in Compute Service ==================== diff --git a/README.rst b/README.rst index b7969a7cc1..73115cfe2e 100644 --- a/README.rst +++ b/README.rst @@ -37,15 +37,23 @@ __ https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/index Installation ============ -:: +It is highly recommended that a Python virtual environment be used when installing oci. - pip install oci +Please consult the `Installing packages using pip and virtualenv`__ guide from the Python Software Foundation for more information about virtual environments. +__ https://packaging.python.org/guides/installing-using-pip-and-virtualenv/ See `the installation guide`__ for installation troubleshooting and alternative install methods. __ https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/installation.html +Once your virtual environment is active, oci can be installed using pip. + +:: + + pip install oci + + ============ Development ============ diff --git a/docs/api/container_engine.rst b/docs/api/container_engine.rst new file mode 100644 index 0000000000..2283562fcd --- /dev/null +++ b/docs/api/container_engine.rst @@ -0,0 +1,44 @@ +Container Engine +================ + +.. autosummary:: + :toctree: container_engine/client + :nosignatures: + :template: autosummary/service_client.rst + + oci.container_engine.ContainerEngineClient + oci.container_engine.ContainerEngineClientCompositeOperations + +-------- + Models +-------- + +.. autosummary:: + :toctree: container_engine/models + :nosignatures: + :template: autosummary/model_class.rst + + oci.container_engine.models.AddOnOptions + oci.container_engine.models.Cluster + oci.container_engine.models.ClusterCreateOptions + oci.container_engine.models.ClusterEndpoints + oci.container_engine.models.ClusterMetadata + oci.container_engine.models.ClusterOptions + oci.container_engine.models.ClusterSummary + oci.container_engine.models.CreateClusterDetails + oci.container_engine.models.CreateClusterKubeconfigContentDetails + oci.container_engine.models.CreateNodePoolDetails + oci.container_engine.models.KeyValue + oci.container_engine.models.KubernetesNetworkConfig + oci.container_engine.models.Node + oci.container_engine.models.NodeError + oci.container_engine.models.NodePool + oci.container_engine.models.NodePoolOptions + oci.container_engine.models.NodePoolSummary + oci.container_engine.models.UpdateClusterDetails + oci.container_engine.models.UpdateNodePoolDetails + oci.container_engine.models.WorkRequest + oci.container_engine.models.WorkRequestError + oci.container_engine.models.WorkRequestLogEntry + oci.container_engine.models.WorkRequestResource + oci.container_engine.models.WorkRequestSummary diff --git a/docs/api/container_engine/client/oci.container_engine.ContainerEngineClient.rst b/docs/api/container_engine/client/oci.container_engine.ContainerEngineClient.rst new file mode 100644 index 0000000000..299a0958de --- /dev/null +++ b/docs/api/container_engine/client/oci.container_engine.ContainerEngineClient.rst @@ -0,0 +1,8 @@ +ContainerEngineClient +===================== + +.. currentmodule:: oci.container_engine + +.. autoclass:: ContainerEngineClient + :special-members: __init__ + :members: \ No newline at end of file diff --git a/docs/api/container_engine/client/oci.container_engine.ContainerEngineClientCompositeOperations.rst b/docs/api/container_engine/client/oci.container_engine.ContainerEngineClientCompositeOperations.rst new file mode 100644 index 0000000000..114e428dab --- /dev/null +++ b/docs/api/container_engine/client/oci.container_engine.ContainerEngineClientCompositeOperations.rst @@ -0,0 +1,8 @@ +ContainerEngineClientCompositeOperations +======================================== + +.. currentmodule:: oci.container_engine + +.. autoclass:: ContainerEngineClientCompositeOperations + :special-members: __init__ + :members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.AddOnOptions.rst b/docs/api/container_engine/models/oci.container_engine.models.AddOnOptions.rst new file mode 100644 index 0000000000..9ddd0e9d5d --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.AddOnOptions.rst @@ -0,0 +1,11 @@ +AddOnOptions +============ + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: AddOnOptions + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.Cluster.rst b/docs/api/container_engine/models/oci.container_engine.models.Cluster.rst new file mode 100644 index 0000000000..079fe8b766 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.Cluster.rst @@ -0,0 +1,11 @@ +Cluster +======= + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: Cluster + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.ClusterCreateOptions.rst b/docs/api/container_engine/models/oci.container_engine.models.ClusterCreateOptions.rst new file mode 100644 index 0000000000..bffb3b7924 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.ClusterCreateOptions.rst @@ -0,0 +1,11 @@ +ClusterCreateOptions +==================== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: ClusterCreateOptions + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.ClusterEndpoints.rst b/docs/api/container_engine/models/oci.container_engine.models.ClusterEndpoints.rst new file mode 100644 index 0000000000..c9af44313e --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.ClusterEndpoints.rst @@ -0,0 +1,11 @@ +ClusterEndpoints +================ + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: ClusterEndpoints + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.ClusterMetadata.rst b/docs/api/container_engine/models/oci.container_engine.models.ClusterMetadata.rst new file mode 100644 index 0000000000..6e1c1c7f50 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.ClusterMetadata.rst @@ -0,0 +1,11 @@ +ClusterMetadata +=============== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: ClusterMetadata + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.ClusterOptions.rst b/docs/api/container_engine/models/oci.container_engine.models.ClusterOptions.rst new file mode 100644 index 0000000000..041450cdcd --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.ClusterOptions.rst @@ -0,0 +1,11 @@ +ClusterOptions +============== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: ClusterOptions + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.ClusterSummary.rst b/docs/api/container_engine/models/oci.container_engine.models.ClusterSummary.rst new file mode 100644 index 0000000000..0cd49cebb4 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.ClusterSummary.rst @@ -0,0 +1,11 @@ +ClusterSummary +============== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: ClusterSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.CreateClusterDetails.rst b/docs/api/container_engine/models/oci.container_engine.models.CreateClusterDetails.rst new file mode 100644 index 0000000000..d1b115c8d4 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.CreateClusterDetails.rst @@ -0,0 +1,11 @@ +CreateClusterDetails +==================== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: CreateClusterDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.CreateClusterKubeconfigContentDetails.rst b/docs/api/container_engine/models/oci.container_engine.models.CreateClusterKubeconfigContentDetails.rst new file mode 100644 index 0000000000..2916ef9b37 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.CreateClusterKubeconfigContentDetails.rst @@ -0,0 +1,11 @@ +CreateClusterKubeconfigContentDetails +===================================== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: CreateClusterKubeconfigContentDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.CreateNodePoolDetails.rst b/docs/api/container_engine/models/oci.container_engine.models.CreateNodePoolDetails.rst new file mode 100644 index 0000000000..15bbb5189d --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.CreateNodePoolDetails.rst @@ -0,0 +1,11 @@ +CreateNodePoolDetails +===================== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: CreateNodePoolDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.KeyValue.rst b/docs/api/container_engine/models/oci.container_engine.models.KeyValue.rst new file mode 100644 index 0000000000..62aae0dab8 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.KeyValue.rst @@ -0,0 +1,11 @@ +KeyValue +======== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: KeyValue + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.KubernetesNetworkConfig.rst b/docs/api/container_engine/models/oci.container_engine.models.KubernetesNetworkConfig.rst new file mode 100644 index 0000000000..e8d7b5f32e --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.KubernetesNetworkConfig.rst @@ -0,0 +1,11 @@ +KubernetesNetworkConfig +======================= + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: KubernetesNetworkConfig + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.Node.rst b/docs/api/container_engine/models/oci.container_engine.models.Node.rst new file mode 100644 index 0000000000..68967f8c21 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.Node.rst @@ -0,0 +1,11 @@ +Node +==== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: Node + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.NodeError.rst b/docs/api/container_engine/models/oci.container_engine.models.NodeError.rst new file mode 100644 index 0000000000..a9a801afc8 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.NodeError.rst @@ -0,0 +1,11 @@ +NodeError +========= + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: NodeError + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.NodePool.rst b/docs/api/container_engine/models/oci.container_engine.models.NodePool.rst new file mode 100644 index 0000000000..9fa2f3d0b3 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.NodePool.rst @@ -0,0 +1,11 @@ +NodePool +======== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: NodePool + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.NodePoolOptions.rst b/docs/api/container_engine/models/oci.container_engine.models.NodePoolOptions.rst new file mode 100644 index 0000000000..1621b37d28 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.NodePoolOptions.rst @@ -0,0 +1,11 @@ +NodePoolOptions +=============== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: NodePoolOptions + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.NodePoolSummary.rst b/docs/api/container_engine/models/oci.container_engine.models.NodePoolSummary.rst new file mode 100644 index 0000000000..f83b61f32f --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.NodePoolSummary.rst @@ -0,0 +1,11 @@ +NodePoolSummary +=============== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: NodePoolSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.UpdateClusterDetails.rst b/docs/api/container_engine/models/oci.container_engine.models.UpdateClusterDetails.rst new file mode 100644 index 0000000000..85c2cb93b4 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.UpdateClusterDetails.rst @@ -0,0 +1,11 @@ +UpdateClusterDetails +==================== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: UpdateClusterDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.UpdateNodePoolDetails.rst b/docs/api/container_engine/models/oci.container_engine.models.UpdateNodePoolDetails.rst new file mode 100644 index 0000000000..227ce7eed9 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.UpdateNodePoolDetails.rst @@ -0,0 +1,11 @@ +UpdateNodePoolDetails +===================== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: UpdateNodePoolDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.WorkRequest.rst b/docs/api/container_engine/models/oci.container_engine.models.WorkRequest.rst new file mode 100644 index 0000000000..fc06760b47 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.WorkRequest.rst @@ -0,0 +1,11 @@ +WorkRequest +=========== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: WorkRequest + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.WorkRequestError.rst b/docs/api/container_engine/models/oci.container_engine.models.WorkRequestError.rst new file mode 100644 index 0000000000..4d6b0ecc23 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.WorkRequestError.rst @@ -0,0 +1,11 @@ +WorkRequestError +================ + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: WorkRequestError + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.WorkRequestLogEntry.rst b/docs/api/container_engine/models/oci.container_engine.models.WorkRequestLogEntry.rst new file mode 100644 index 0000000000..f4a2277d7c --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.WorkRequestLogEntry.rst @@ -0,0 +1,11 @@ +WorkRequestLogEntry +=================== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: WorkRequestLogEntry + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.WorkRequestResource.rst b/docs/api/container_engine/models/oci.container_engine.models.WorkRequestResource.rst new file mode 100644 index 0000000000..133df65e25 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.WorkRequestResource.rst @@ -0,0 +1,11 @@ +WorkRequestResource +=================== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: WorkRequestResource + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/container_engine/models/oci.container_engine.models.WorkRequestSummary.rst b/docs/api/container_engine/models/oci.container_engine.models.WorkRequestSummary.rst new file mode 100644 index 0000000000..39b9e4c7c7 --- /dev/null +++ b/docs/api/container_engine/models/oci.container_engine.models.WorkRequestSummary.rst @@ -0,0 +1,11 @@ +WorkRequestSummary +================== + +.. currentmodule:: oci.container_engine.models + +.. autoclass:: WorkRequestSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/index.rst b/docs/api/index.rst index 70f1d57768..7abbd13a11 100644 --- a/docs/api/index.rst +++ b/docs/api/index.rst @@ -38,6 +38,31 @@ Audit :noindex: +================ +Container Engine +================ + +-------- + Client +-------- + +.. autoclass:: oci.container_engine.container_engine_client.ContainerEngineClient + :members: + :noindex: + +-------- + Models +-------- + +.. automodule:: oci.container_engine.models + :special-members: __init__ + :members: + :undoc-members: + :imported-members: + :inherited-members: + :noindex: + + ============= Core Services ============= diff --git a/docs/api/landing.rst b/docs/api/landing.rst index 00635263d3..d7f8a4fc5f 100644 --- a/docs/api/landing.rst +++ b/docs/api/landing.rst @@ -4,6 +4,7 @@ API Reference .. rubric:: Service Clients * :doc:`Audit ` +* :doc:`Container Engine ` * :doc:`Block Storage ` * :doc:`Compute ` * :doc:`Virtual Network ` @@ -36,6 +37,7 @@ API Reference :maxdepth: 5 audit + container_engine core database dns diff --git a/examples/container_engine.py b/examples/container_engine.py new file mode 100644 index 0000000000..199d79a8d3 --- /dev/null +++ b/examples/container_engine.py @@ -0,0 +1,631 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +from __future__ import print_function +import oci + + +# This script demonstrates some of the Container Engine operations. +# Please review the documentation for more information about +# how Container Engine works, including permissions needed. +# +# https://docs.us-phoenix-1.oraclecloud.com/Content/ContEng/Concepts/contengoverview.htm + +# Note: Exception handling is rudimentary and would need to be expanded for use in +# production. Please be aware resources may need to be cleaned up manually +# if an exception occures. + +# Load the default configuration +config = oci.config.from_file() + +# This is the root compartment. You can use another compartment in your tenancy. +compartment_id = config["tenancy"] + +print("Compartment id: {}".format(compartment_id)) + +############################# +# Container Engine operations +############################# + + +def create_cluster(ce_client, vcn): + """ + create_cluster + + This function demonstrates the process of creating a cluster. The cidrs + and other values are just for demonstration purposes. + """ + success = True + + kubernetes_network_config = oci.container_engine.models.KubernetesNetworkConfig(pods_cidr="10.244.0.0/16", + services_cidr="10.96.0.0/16") + + cluster_create_options = oci.container_engine.models.ClusterCreateOptions(service_lb_subnet_ids=vcn['lb_subnets'], + kubernetes_network_config=kubernetes_network_config) + + cluster_details = oci.container_engine.models.CreateClusterDetails(name="PythonSDK_cluster1", + compartment_id=compartment_id, + vcn_id=vcn['id'], + kubernetes_version=get_kubernetes_version(ce_client), + options=cluster_create_options) + + ce_composite_ops = oci.container_engine.ContainerEngineClientCompositeOperations(ce_client) + + response = ce_composite_ops.create_cluster_and_wait_for_state(cluster_details, + wait_for_states=[oci.container_engine.models.WorkRequest.STATUS_SUCCEEDED, + oci.container_engine.models.WorkRequest.STATUS_FAILED]) + + # response.data is a WorkRequestSummary + # gather the created resources from the work request + resources = {} + for resource in response.data.resources: + print("{}: {}".format(resource.entity_type, resource.identifier)) + resources[resource.entity_type] = resource.identifier + + # If the workrequest failed, get the work request errors. + if response.data.status == oci.container_engine.models.WorkRequest.STATUS_FAILED: + get_work_request_errors(ce_client, compartment_id, response.data.id) + success = False + else: + print("Create cluster succeed") + + # Get the work request logs + print_header("Work request logs:") + response = ce_client.list_work_request_logs(compartment_id, response.data.id) + print(response.data) + + return success, resources + + +def update_cluster(ce_client, cluster_id): + """ + update_cluster + + Currently there are two items you can update on the cluster the name and the kubernetes version. + This function demonstrates updating the name. Updating the kubernetes version works in + a similar fashion. + """ + + update_cluster_details = oci.container_engine.models.UpdateClusterDetails(name="PythonSDK_cluster_1") + + ce_composite_ops = oci.container_engine.ContainerEngineClientCompositeOperations(ce_client) + + response = ce_composite_ops.update_cluster_and_wait_for_state(cluster_id, + update_cluster_details, + wait_for_states=[oci.container_engine.models.WorkRequest.STATUS_SUCCEEDED, + oci.container_engine.models.WorkRequest.STATUS_FAILED]) + + # If the workrequest failed, get the work request errors. + if response.data.status == oci.container_engine.models.WorkRequest.STATUS_FAILED: + get_work_request_errors(ce_client, compartment_id, response.data.id) + else: + print("Update cluster succeeded") + + return + + +def delete_cluster(ce_client, cluster_id): + """ + delete_cluster + + Delete the clusted associated with the cluster_id passed in + """ + ce_composite_ops = oci.container_engine.ContainerEngineClientCompositeOperations(ce_client) + + response = ce_composite_ops.delete_cluster_and_wait_for_state(cluster_id, + wait_for_states=[oci.container_engine.models.WorkRequest.STATUS_SUCCEEDED]) + + if response.status == 200: + print("Cluster deleted successfully") + else: + print("Recieved '{}' when attempting to delete the cluster".format(response.status)) + + return + + +def get_kubeconfig(ce_client, cluster_id): + """ + get_kubeconfig + + Given a cluster id, retrieve the kubconfig. + """ + + response = ce_client.create_kubeconfig(cluster_id) + + # response.data.text contains the contents of the kubeconfig file which + # can be writen to a file using code like the following snippet. + """ + with open('kubconfig.txt', 'w') as f: + f.write(response.data.text) + """ + if response.data.text: + print("kubeconfig retrieved") + else: + print("Error retrieving the kubeconfig") + + return + + +def create_node_pool(ce_client, cluster_id, subnets): + """ + create_node_pool + + Creates a node pool inside of a cluser + """ + success = True + node_pool_create_details = oci.container_engine.models.CreateNodePoolDetails(compartment_id=compartment_id, + cluster_id=cluster_id, + name="PythonSDK_nodepool1", + kubernetes_version=get_kubernetes_version(ce_client), + node_image_name="Oracle-Linux-7.4", + node_shape="VM.Standard1.1", + initial_node_labels=[{"nodes": "Example Nodes"}], + quantity_per_subnet=1, + subnet_ids=subnets) + + ce_composite_ops = oci.container_engine.ContainerEngineClientCompositeOperations(ce_client) + + response = ce_composite_ops.create_node_pool_and_wait_for_state(node_pool_create_details, + wait_for_states=[oci.container_engine.models.WorkRequest.STATUS_SUCCEEDED, + oci.container_engine.models.WorkRequest.STATUS_FAILED]) + + # gather the created resources from the work request + resources = {} + for resource in response.data.resources: + resources[resource.entity_type] = resource.identifier + + # If the workrequest failed, get the work request errors. + if response.data.status == oci.container_engine.models.WorkRequest.STATUS_FAILED: + get_work_request_errors(ce_client, compartment_id, response.data.id) + success = False + else: + print("Create node pool succeeded") + + return success, resources + + +def update_node_pool(ce_client, node_pool_id): + """ + update_node_pool + + Currently there are a number of features that can be updated in the node pool. + This example will only update the name. Please see the documentation for + the other features which can be updated + """ + + update_node_pool_details = oci.container_engine.models.UpdateNodePoolDetails(name="PythonSDK_noodpool_1") + + ce_composite_ops = oci.container_engine.ContainerEngineClientCompositeOperations(ce_client) + + response = ce_composite_ops.update_node_pool_and_wait_for_state(node_pool_id, + update_node_pool_details, + wait_for_states=[oci.container_engine.models.WorkRequest.STATUS_SUCCEEDED, + oci.container_engine.models.WorkRequest.STATUS_FAILED]) + + if response.data.status == oci.container_engine.models.WorkRequest.STATUS_FAILED: + get_work_request_errors(ce_client, compartment_id, response.data.id) + else: + print("Update node pool succeeded") + + return + + +def delete_node_pool(ca_client, node_pool_id): + """ + delete_node_pool + + Deletes the specified node pool. The cluster is not deleted. + """ + ce_composite_ops = oci.container_engine.ContainerEngineClientCompositeOperations(ce_client) + + response = ce_composite_ops.delete_node_pool_and_wait_for_state(node_pool_id, + wait_for_states=[oci.container_engine.models.WorkRequest.STATUS_SUCCEEDED]) + + if response.status == 200: + print("Node pool deleted successfully") + else: + print("Recieved '{}' when attempting to delete the node pool".format(response.status)) + + return + + +def get_kubernetes_version(ce_client): + """ + get_kubernetes_version + + Get the supported kubernetes versions from the service. There are multiple + versions supported but for the example we will just use the last one in the + list. + """ + response = ce_client.get_cluster_options(cluster_option_id="all") + + versions = response.data.kubernetes_versions + if len(versions) > 0: + kubernetes_version = versions[-1] + else: + raise RuntimeError("No supported Kubernetes versions found") + + return kubernetes_version + +################ +# VCN operations +################ + + +def create_vcn(vn_client, ads, number_of_worker_subnets=3, number_of_lb_subnets=2): + """ + create_vcn + + See https://docs.us-phoenix-1.oraclecloud.com/Content/ContEng/Concepts/contengnetworkconfig.htm#VCN + for details on how the VCN should be configured for container engine. + + This function will build a Virtual Cloud Network based on the example network resource configuration: + https://docs.us-phoenix-1.oraclecloud.com/Content/ContEng/Concepts/contengnetworkconfigexample.htm + + The function returns a dictionary containing the id of the VCN created, a list of worker subnets and + a list of load balancer subnets + """ + + vcn = {'id': None, + 'worker_subnets': [], + 'lb_subnets': []} + + subnet_template = "10.0.{}.0/24" + + vn_composite_ops = oci.core.VirtualNetworkClientCompositeOperations(vn_client) + + vcn_details = oci.core.models.CreateVcnDetails(cidr_block='10.0.0.0/16', + display_name='PythonSDKContainerEngineExampleVcn', + dns_label='cevcn', + compartment_id=compartment_id, + ) + + result = vn_composite_ops.create_vcn_and_wait_for_state(vcn_details, + wait_for_states=[oci.core.models.Vcn.LIFECYCLE_STATE_AVAILABLE]) + + vcn['id'] = result.data.id + print("VCN Id: {}".format(vcn['id'])) + + # Setup the gateway + gateway_details = oci.core.models.CreateInternetGatewayDetails(compartment_id=compartment_id, + display_name='PythonCE-gateway-0', + is_enabled=True, + vcn_id=vcn['id']) + + result = vn_composite_ops.create_internet_gateway_and_wait_for_state(gateway_details, + wait_for_states=[oci.core.models.InternetGateway.LIFECYCLE_STATE_AVAILABLE]) + + gateway_id = result.data.id + print('Gateway Id: {}'.format(gateway_id)) + + # Setup the route table + route_table_rule = oci.core.models.RouteRule(cidr_block='0.0.0.0/0', + network_entity_id=gateway_id) + + route_table_details = oci.core.models.CreateRouteTableDetails(compartment_id=compartment_id, + display_name='PythonCE-routetable-0', + route_rules=[route_table_rule], + vcn_id=vcn['id']) + + result = vn_composite_ops.create_route_table_and_wait_for_state(route_table_details, + wait_for_states=[oci.core.models.RouteTable.LIFECYCLE_STATE_AVAILABLE]) + + route_table_id = result.data.id + print('Route Table Id: {}'.format(route_table_id)) + + ################ + # Security Lists and Security Rules + # More information on the security list configuration for container engine can be found here: + # https://docs.us-phoenix-1.oraclecloud.com/Content/ContEng/Concepts/contengnetworkconfig.htm#securitylistconfig + ################ + + # Load balancer security rules + load_balancer_egress_rule = oci.core.models.EgressSecurityRule(destination='0.0.0.0/0', + destination_type=oci.core.models.EgressSecurityRule.DESTINATION_TYPE_CIDR_BLOCK, + is_stateless=True, + protocol='6', + tcp_options=oci.core.models.TcpOptions()) + + load_balancer_ingress_rule = oci.core.models.IngressSecurityRule(source='0.0.0.0/0', + source_type=oci.core.models.IngressSecurityRule.SOURCE_TYPE_CIDR_BLOCK, + is_stateless=True, + protocol='6', + tcp_options=oci.core.models.TcpOptions()) + + load_balancers_security_list_details = oci.core.models.CreateSecurityListDetails(compartment_id=compartment_id, + display_name='PythonCE-LB-SecurityList', + egress_security_rules=[load_balancer_egress_rule], + ingress_security_rules=[load_balancer_ingress_rule], + vcn_id=vcn['id']) + + result = vn_composite_ops.create_security_list_and_wait_for_state(load_balancers_security_list_details, + wait_for_states=[oci.core.models.SecurityList.LIFECYCLE_STATE_AVAILABLE]) + + load_balancer_security_list_id = result.data.id + print('Load Balancer Security List Id: {}'.format(load_balancer_security_list_id)) + + # Worker security rules + worker_egress_rules = [] + + for i in range(number_of_worker_subnets): + destination = subnet_template.format(10 + i) + worker_egress_rules.append(oci.core.models.EgressSecurityRule(destination=destination, + destination_type=oci.core.models.EgressSecurityRule.DESTINATION_TYPE_CIDR_BLOCK, + is_stateless=True, + protocol='all')) + + worker_egress_rules.append(oci.core.models.EgressSecurityRule(destination='0.0.0.0/0', + destination_type=oci.core.models.EgressSecurityRule.DESTINATION_TYPE_CIDR_BLOCK, + is_stateless=False, + protocol='all')) + worker_ingress_rules = [] + + for i in range(number_of_worker_subnets): + source = subnet_template.format(10 + i) + worker_ingress_rules.append(oci.core.models.IngressSecurityRule(source=source, + source_type=oci.core.models.IngressSecurityRule.SOURCE_TYPE_CIDR_BLOCK, + is_stateless=True, + protocol='all')) + + worker_ingress_rules.append(oci.core.models.IngressSecurityRule(source='0.0.0.0/0', + source_type=oci.core.models.IngressSecurityRule.SOURCE_TYPE_CIDR_BLOCK, + is_stateless=False, + protocol='1', + icmp_options=oci.core.models.IcmpOptions(type=3, code=4))) + + worker_ingress_rules.append(oci.core.models.IngressSecurityRule(source='130.35.0.0/16', + source_type=oci.core.models.IngressSecurityRule.SOURCE_TYPE_CIDR_BLOCK, + is_stateless=False, + protocol='6', + tcp_options=oci.core.models.TcpOptions(destination_port_range=oci.core.models.PortRange(min=22, max=22)))) + + worker_ingress_rules.append(oci.core.models.IngressSecurityRule(source='138.1.0.0/17', + source_type=oci.core.models.IngressSecurityRule.SOURCE_TYPE_CIDR_BLOCK, + is_stateless=False, + protocol='6', + tcp_options=oci.core.models.TcpOptions(destination_port_range=oci.core.models.PortRange(min=22, max=22)))) + + worker_ingress_rules.append(oci.core.models.IngressSecurityRule(source='0.0.0.0/0', + source_type=oci.core.models.IngressSecurityRule.SOURCE_TYPE_CIDR_BLOCK, + is_stateless=False, + protocol='6', + tcp_options=oci.core.models.TcpOptions(destination_port_range=oci.core.models.PortRange(min=22, max=22)))) + + worker_security_list_details = oci.core.models.CreateSecurityListDetails(compartment_id=compartment_id, + display_name='PythonCE-Worker-SecurityList', + egress_security_rules=worker_egress_rules, + ingress_security_rules=worker_ingress_rules, + vcn_id=vcn['id']) + + result = vn_composite_ops.create_security_list_and_wait_for_state(worker_security_list_details, + wait_for_states=[oci.core.models.SecurityList.LIFECYCLE_STATE_AVAILABLE]) + + worker_security_list_id = result.data.id + print('Worker Security List Id: {}'.format(worker_security_list_id)) + + ################ + # Subnets + # More information on the subnet configuration for container engine can be found here: + # https://docs.us-phoenix-1.oraclecloud.com/Content/ContEng/Concepts/contengnetworkconfig.htm#subnetconfig + ################ + + # Worker subnets + display_name_template = 'PythonSDKCE-workers-{}' + dns_label_template = 'workers{}' + for i in range(number_of_worker_subnets): + cidr_block = subnet_template.format(10 + i) + display_name = display_name_template.format(1 + i) + dns_label = dns_label_template.format(1 + i) + + subnet_details = oci.core.models.CreateSubnetDetails(availability_domain=ads[i], + compartment_id=compartment_id, + cidr_block=cidr_block, + display_name=display_name, + dns_label=dns_label, + vcn_id=vcn['id'], + route_table_id=route_table_id, + security_list_ids=[worker_security_list_id]) + + result = vn_composite_ops.create_subnet_and_wait_for_state(subnet_details, + wait_for_states=[oci.core.models.Subnet.LIFECYCLE_STATE_AVAILABLE]) + vcn['worker_subnets'].append(result.data.id) + + print("Worker Subnets: {}".format(vcn['worker_subnets'])) + + # Load balancer subnets + display_name_template = 'PythonSDKCE-loadbalancers-{}' + dns_label_template = 'loadbalancers{}' + for i in range(number_of_lb_subnets): + cidr_block = subnet_template.format(20 + i) + display_name = display_name_template.format(1 + i) + dns_label = dns_label_template.format(1 + i) + subnet_details = oci.core.models.CreateSubnetDetails(availability_domain=ads[i], + compartment_id=compartment_id, + cidr_block=cidr_block, + display_name=display_name, + dns_label=dns_label, + vcn_id=vcn['id'], + route_table_id=route_table_id, + security_list_ids=[load_balancer_security_list_id]) + + result = vn_composite_ops.create_subnet_and_wait_for_state(subnet_details, + wait_for_states=[oci.core.models.Subnet.LIFECYCLE_STATE_AVAILABLE]) + vcn['lb_subnets'].append(result.data.id) + + print("Loadbalancer Subnets: {}".format(vcn['lb_subnets'])) + + return vcn + + +def delete_vcn(vn_client, vcn_resources): + """ + delete_vcn + + Deletes the example VCN. There are more resources associated + with the VCN than passed in with the vcn_resources dictionary. Those + resources will be discovered and deleted. + """ + + vn_composite_ops = oci.core.VirtualNetworkClientCompositeOperations(vn_client) + + # Delete the load balancer subnets + print("Deleting load balancer subnets...") + for subnet in vcn_resources['lb_subnets']: + vn_composite_ops.delete_subnet_and_wait_for_state(subnet, + wait_for_states=[oci.core.models.Subnet.LIFECYCLE_STATE_TERMINATED]) + + # Delete the worker subnets + print("Deleting worker subnets...") + for subnet in vcn_resources['worker_subnets']: + vn_composite_ops.delete_subnet_and_wait_for_state(subnet, + wait_for_states=[oci.core.models.Subnet.LIFECYCLE_STATE_TERMINATED]) + + # VCNs have default security lists, route tables which cannot be deleted. + # Get the details of the VCN to get the default security list and default route table ids so + # they can be skipped when getting the security lists ans route tables + response = vn_client.get_vcn(vcn_resources['id']) + default_security_list_id = response.data.default_security_list_id + default_route_table_id = response.data.default_route_table_id + + # Retrieve and delete the security lists + print("Deleting security lists...") + # We could just retrieve all of the security lists, but there may be cases where not all of them + # would come back in a single page. Here is another example of using the pagaination to + # retrieve items from a list call. More examples are in pagination.py + for security_list in oci.pagination.list_call_get_all_results_generator(vn_client.list_security_lists, + 'record', + compartment_id, + vcn_resources['id'], + lifecycle_state=oci.core.models.SecurityList.LIFECYCLE_STATE_AVAILABLE): + if security_list.id != default_security_list_id: + vn_composite_ops.delete_security_list_and_wait_for_state(security_list.id, + wait_for_states=[oci.core.models.SecurityList.LIFECYCLE_STATE_TERMINATED]) + + # Retrieve and delete the route tables + print("Deleting route tables...") + for route_table in oci.pagination.list_call_get_all_results_generator(vn_client.list_route_tables, + 'record', + compartment_id, + vcn_resources['id'], + lifecycle_state=oci.core.models.RouteTable.LIFECYCLE_STATE_AVAILABLE): + if route_table.id != default_route_table_id: + vn_composite_ops.delete_route_table_and_wait_for_state(route_table.id, + wait_for_states=[oci.core.models.RouteTable.LIFECYCLE_STATE_TERMINATED]) + + # Retrieve and delete the gateway + print("Deleting internet gateways...") + for gateway in oci.pagination.list_call_get_all_results_generator(vn_client.list_internet_gateways, + 'record', + compartment_id, + vcn_resources['id'], + lifecycle_state=oci.core.models.InternetGateway.LIFECYCLE_STATE_AVAILABLE): + vn_composite_ops.delete_internet_gateway_and_wait_for_state(gateway.id, wait_for_states=[oci.core.models.InternetGateway.LIFECYCLE_STATE_TERMINATED]) + + print("Deleting virtual cloud network...") + response = vn_composite_ops.delete_vcn_and_wait_for_state(vcn_resources['id'], + wait_for_states=[oci.core.models.Vcn.LIFECYCLE_STATE_TERMINATED]) + + print("VCN {} has been deleted".format(vcn_resources['id'])) + + +######### +# Helpers +######### + +def get_work_request_errors(ce_client, compartment_id, work_request_id): + """ + get_work_request_errors + + Retrieves the errors for a work request and prints them. + """ + print_header('Work request errors:') + response = ce_client.list_work_request_errors(compartment_id, work_request_id) + print(response.data) + + +def print_header(header): + """ + print_header + + Prints a section header + """ + + print('\n') + print(header) + print("=" * len(header)) + + +if __name__ == "__main__": + # Initialize clients + ce_client = oci.container_engine.ContainerEngineClient(config) + vn_client = oci.core.VirtualNetworkClient(config) + id_client = oci.identity.IdentityClient(config) + + # Get the Availability Domains for the compartment + response = id_client.list_availability_domains(compartment_id) + ads = [x.name for x in response.data] + + try: + ################## + # Create resources + ################## + print_header("Create the Virtual Cloud Network") + vcn_resources = create_vcn(vn_client, ads) + print("VNC resources: {}".format(vcn_resources)) + + print_header("Create the Cluster") + cluster_success, cluster_resources = create_cluster(ce_client, vcn_resources) + print("Cluster resourse: {}".format(cluster_resources)) + + if cluster_success: + print_header('Create a node pool') + node_pool_success, node_pool_resources = create_node_pool(ce_client, + cluster_resources['cluster'], + vcn_resources['worker_subnets']) + print("Node pool resources: {}".format(node_pool_resources)) + + if cluster_success: + print_header("Get kubeconf") + get_kubeconfig(ce_client, cluster_resources['cluster']) + + ################## + # Update resources + ################## + + if cluster_success: + print_header("Update the Cluster") + update_cluster(ce_client, cluster_resources['cluster']) + + if cluster_success and node_pool_success: + print_header('Update the node pool') + update_node_pool(ce_client, node_pool_resources['nodepool']) + + finally: + #################### + # Delete resources + #################### + + # Note: Any exceptions caught while trying to clean up resources are printed, but not + # handled. + if node_pool_resources: + print_header('Delete the node pool') + try: + delete_node_pool(ce_client, node_pool_resources['nodepool']) + except Exception as e: + print("Failed to delete node pool: {}".format(node_pool_resources['nodepool'])) + print(e) + + if cluster_resources: + print_header("Delete the Cluster") + try: + delete_cluster(ce_client, cluster_resources['cluster']) + except Exception as e: + print("Failed to delete cluster: {}".format(cluster_resources['cluster'])) + print(e) + + print_header("Delete the Virtual Cloud Network") + try: + delete_vcn(vn_client, vcn_resources) + except Exception as e: + print("Failed to delete VCN: {}".format(vcn_resources['id'])) + print(e) diff --git a/setup.py b/setup.py index 08c765f78c..7111850de9 100644 --- a/setup.py +++ b/setup.py @@ -32,6 +32,7 @@ def open_relative(*path): "certifi", "configparser==3.5.0", "cryptography==2.1.3", + "idna>=2.5,<2.7", "PyJWT==1.5.3", "pyOpenSSL<=17.4.0", "python-dateutil==2.7.3", diff --git a/src/oci/__init__.py b/src/oci/__init__.py index 7ce162c48e..d4aee6000a 100644 --- a/src/oci/__init__.py +++ b/src/oci/__init__.py @@ -1,7 +1,7 @@ # coding: utf-8 # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. -from . import audit, core, database, dns, email, file_storage, identity, load_balancer, object_storage +from . import audit, container_engine, core, database, dns, email, file_storage, identity, load_balancer, object_storage from . import auth, config, constants, decorators, exceptions, regions, pagination, retry from .base_client import BaseClient from .request import Request @@ -13,5 +13,5 @@ __all__ = [ "BaseClient", "Error", "Request", "Response", "Signer", "config", "constants", "decorators", "exceptions", "regions", "wait_until", "pagination", "auth", "retry", - "audit", "core", "database", "dns", "email", "file_storage", "identity", "load_balancer", "object_storage" + "audit", "container_engine", "core", "database", "dns", "email", "file_storage", "identity", "load_balancer", "object_storage" ] diff --git a/src/oci/container_engine/__init__.py b/src/oci/container_engine/__init__.py new file mode 100644 index 0000000000..728354bd78 --- /dev/null +++ b/src/oci/container_engine/__init__.py @@ -0,0 +1,11 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +from __future__ import absolute_import + + +from .container_engine_client import ContainerEngineClient +from .container_engine_client_composite_operations import ContainerEngineClientCompositeOperations +from . import models + +__all__ = ["ContainerEngineClient", "ContainerEngineClientCompositeOperations", "models"] diff --git a/src/oci/container_engine/container_engine_client.py b/src/oci/container_engine/container_engine_client.py new file mode 100644 index 0000000000..d222bc5145 --- /dev/null +++ b/src/oci/container_engine/container_engine_client.py @@ -0,0 +1,1632 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +from __future__ import absolute_import + +import requests # noqa: F401 +import six + +from oci import retry # noqa: F401 +from oci.base_client import BaseClient +from oci.config import get_config_value_or_default, validate_config +from oci.signer import Signer +from oci.util import Sentinel +from .models import container_engine_type_mapping +missing = Sentinel("Missing") + + +class ContainerEngineClient(object): + """ + Container Engine for Kubernetes API + """ + + def __init__(self, config, **kwargs): + """ + Creates a new service client + + :param dict config: + Configuration keys and values as per `SDK and Tool Configuration `__. + The :py:meth:`~oci.config.from_file` method can be used to load configuration from a file. Alternatively, a ``dict`` can be passed. You can validate_config + the dict using :py:meth:`~oci.config.validate_config` + + :param str service_endpoint: (optional) + The endpoint of the service to call using this client. For example ``https://iaas.us-ashburn-1.oraclecloud.com``. If this keyword argument is + not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit + need to specify a service endpoint. + + :param timeout: (optional) + The connection and read timeouts for the client. The default is that the client never times out. This keyword argument can be provided + as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If + a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout. + :type timeout: float or tuple(float, float) + + :param signer: (optional) + The signer to use when signing requests made by the service client. The default is to use a :py:class:`~oci.signer.Signer` based on the values + provided in the config parameter. + + One use case for this parameter is for `Instance Principals authentication `__ + by passing an instance of :py:class:`~oci.auth.signers.InstancePrincipalsSecurityTokenSigner` as the value for this keyword argument + :type signer: :py:class:`~oci.signer.AbstractBaseSigner` + + :param obj retry_strategy: (optional) + A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. + Retry strategies can also be applied at the operation level by passing a ``retry_strategy`` keyword argument as part of calling the operation. + Any value provided at the operation level will override whatever is specified at the client level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + """ + validate_config(config, signer=kwargs.get('signer')) + if 'signer' in kwargs: + signer = kwargs['signer'] + else: + signer = Signer( + tenancy=config["tenancy"], + user=config["user"], + fingerprint=config["fingerprint"], + private_key_file_location=config.get("key_file"), + pass_phrase=get_config_value_or_default(config, "pass_phrase"), + private_key_content=config.get("key_content") + ) + + base_client_init_kwargs = { + 'regional_client': True, + 'service_endpoint': kwargs.get('service_endpoint'), + 'timeout': kwargs.get('timeout'), + 'base_path': '/20180222' + } + self.base_client = BaseClient("container_engine", config, signer, container_engine_type_mapping, **base_client_init_kwargs) + self.retry_strategy = kwargs.get('retry_strategy') + + def create_cluster(self, create_cluster_details, **kwargs): + """ + Create a new cluster. + Create a new cluster. + + + :param CreateClusterDetails create_cluster_details: (required) + The details of the cluster to create. + + :param str opc_retry_token: (optional) + A token you supply to uniquely identify the request and provide idempotency if + the request is retried. Idempotency tokens expire after 24 hours. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/clusters" + method = "POST" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_retry_token", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "create_cluster got unknown kwargs: {!r}".format(extra_kwargs)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-retry-token": kwargs.get("opc_retry_token", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + header_params=header_params, + body=create_cluster_details) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + header_params=header_params, + body=create_cluster_details) + + def create_kubeconfig(self, cluster_id, **kwargs): + """ + Create the cluster kubeconfig. + Create the Kubeconfig YAML for a cluster. + + + :param str cluster_id: (required) + The OCID of the cluster. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param CreateClusterKubeconfigContentDetails create_cluster_kubeconfig_content_details: (optional) + The details of the cluster kubeconfig to create. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type stream + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/clusters/{clusterId}/kubeconfig/content" + method = "POST" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id", + "create_cluster_kubeconfig_content_details" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "create_kubeconfig got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "clusterId": cluster_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/x-yaml", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=kwargs.get('create_cluster_kubeconfig_content_details'), + response_type="stream") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=kwargs.get('create_cluster_kubeconfig_content_details'), + response_type="stream") + + def create_node_pool(self, create_node_pool_details, **kwargs): + """ + Create a new node pool. + Create a new node pool. + + + :param CreateNodePoolDetails create_node_pool_details: (required) + The details of the node pool to create. + + :param str opc_retry_token: (optional) + A token you supply to uniquely identify the request and provide idempotency if + the request is retried. Idempotency tokens expire after 24 hours. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/nodePools" + method = "POST" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_retry_token", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "create_node_pool got unknown kwargs: {!r}".format(extra_kwargs)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-retry-token": kwargs.get("opc_retry_token", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + header_params=header_params, + body=create_node_pool_details) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + header_params=header_params, + body=create_node_pool_details) + + def delete_cluster(self, cluster_id, **kwargs): + """ + Delete a cluster. + Delete a cluster. + + + :param str cluster_id: (required) + The OCID of the cluster. + + :param str if_match: (optional) + For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + parameter to the value of the etag from a previous GET or POST response for that resource. The resource + will be updated or deleted only if the etag you provide matches the resource's current etag value. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/clusters/{clusterId}" + method = "DELETE" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "if_match", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "delete_cluster got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "clusterId": cluster_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + + def delete_node_pool(self, node_pool_id, **kwargs): + """ + Delete a node pool. + Delete a node pool. + + + :param str node_pool_id: (required) + The OCID of the node pool. + + :param str if_match: (optional) + For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + parameter to the value of the etag from a previous GET or POST response for that resource. The resource + will be updated or deleted only if the etag you provide matches the resource's current etag value. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/nodePools/{nodePoolId}" + method = "DELETE" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "if_match", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "delete_node_pool got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "nodePoolId": node_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('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + + def delete_work_request(self, work_request_id, **kwargs): + """ + Cancel a work request. + Cancel a work request that has not started. + + + :param str work_request_id: (required) + The OCID of the work request. + + :param str if_match: (optional) + For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + parameter to the value of the etag from a previous GET or POST response for that resource. The resource + will be updated or deleted only if the etag you provide matches the resource's current etag value. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/workRequests/{workRequestId}" + method = "DELETE" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "if_match", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "delete_work_request got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "workRequestId": work_request_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + + def get_cluster(self, cluster_id, **kwargs): + """ + Get cluster details. + Get the details of a cluster. + + + :param str cluster_id: (required) + The OCID of the cluster. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.container_engine.models.Cluster` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/clusters/{clusterId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_cluster got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "clusterId": cluster_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="Cluster") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="Cluster") + + def get_cluster_options(self, cluster_option_id, **kwargs): + """ + Get cluster options. + Get options available for clusters. + + + :param str cluster_option_id: (required) + The id of the option set to retrieve. Only \"all\" is supported. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.container_engine.models.ClusterOptions` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/clusterOptions/{clusterOptionId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_cluster_options got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "clusterOptionId": cluster_option_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="ClusterOptions") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="ClusterOptions") + + def get_node_pool(self, node_pool_id, **kwargs): + """ + Get node pool details. + Get the details of a node pool. + + + :param str node_pool_id: (required) + The OCID of the node pool. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.container_engine.models.NodePool` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/nodePools/{nodePoolId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_node_pool got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "nodePoolId": node_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('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="NodePool") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="NodePool") + + def get_node_pool_options(self, node_pool_option_id, **kwargs): + """ + Get node pool options. + Get options available for node pools. + + + :param str node_pool_option_id: (required) + The id of the option set to retrieve. Use \"all\" get all options, or use a cluster ID to get options specific to the provided cluster. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.container_engine.models.NodePoolOptions` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/nodePoolOptions/{nodePoolOptionId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_node_pool_options got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "nodePoolOptionId": node_pool_option_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="NodePoolOptions") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="NodePoolOptions") + + def get_work_request(self, work_request_id, **kwargs): + """ + Get work request details. + Get the details of a work request. + + + :param str work_request_id: (required) + The OCID of the work request. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.container_engine.models.WorkRequest` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/workRequests/{workRequestId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_work_request got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "workRequestId": work_request_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="WorkRequest") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="WorkRequest") + + def list_clusters(self, compartment_id, **kwargs): + """ + List all cluster objects. + List all the cluster objects in a compartment. + + + :param str compartment_id: (required) + The OCID of the compartment. + + :param list[str] lifecycle_state: (optional) + A cluster lifecycle state to filter on. Can have multiple parameters of this name. + + Allowed values are: "CREATING", "ACTIVE", "FAILED", "DELETING", "DELETED", "UPDATING" + + :param str name: (optional) + The name to filter on. + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + :param str sort_order: (optional) + The optional order in which to sort the results. + + Allowed values are: "ASC", "DESC" + + :param str sort_by: (optional) + The optional field to sort the results by. + + Allowed values are: "ID", "NAME", "TIME_CREATED" + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.container_engine.models.ClusterSummary` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/clusters" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "lifecycle_state", + "name", + "limit", + "page", + "sort_order", + "sort_by", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_clusters got unknown kwargs: {!r}".format(extra_kwargs)) + + if 'lifecycle_state' in kwargs: + lifecycle_state_allowed_values = ["CREATING", "ACTIVE", "FAILED", "DELETING", "DELETED", "UPDATING"] + for lifecycle_state_item in kwargs['lifecycle_state']: + if lifecycle_state_item not in lifecycle_state_allowed_values: + raise ValueError( + "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) + ) + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) + ) + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["ID", "NAME", "TIME_CREATED"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) + ) + + query_params = { + "compartmentId": compartment_id, + "lifecycleState": self.base_client.generate_collection_format_param(kwargs.get("lifecycle_state", missing), 'multi'), + "name": kwargs.get("name", missing), + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing), + "sortOrder": kwargs.get("sort_order", missing), + "sortBy": kwargs.get("sort_by", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="list[ClusterSummary]") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="list[ClusterSummary]") + + def list_node_pools(self, compartment_id, **kwargs): + """ + List all node pools. + List all the node pools in a compartment, and optionally filter by cluster. + + + :param str compartment_id: (required) + The OCID of the compartment. + + :param str cluster_id: (optional) + The OCID of the cluster. + + :param str name: (optional) + The name to filter on. + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + :param str sort_order: (optional) + The optional order in which to sort the results. + + Allowed values are: "ASC", "DESC" + + :param str sort_by: (optional) + The optional field to sort the results by. + + Allowed values are: "ID", "NAME", "TIME_CREATED" + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.container_engine.models.NodePoolSummary` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/nodePools" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "cluster_id", + "name", + "limit", + "page", + "sort_order", + "sort_by", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_node_pools got unknown kwargs: {!r}".format(extra_kwargs)) + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) + ) + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["ID", "NAME", "TIME_CREATED"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) + ) + + query_params = { + "compartmentId": compartment_id, + "clusterId": kwargs.get("cluster_id", missing), + "name": kwargs.get("name", missing), + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing), + "sortOrder": kwargs.get("sort_order", missing), + "sortBy": kwargs.get("sort_by", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="list[NodePoolSummary]") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="list[NodePoolSummary]") + + def list_work_request_errors(self, compartment_id, work_request_id, **kwargs): + """ + Get work request errors. + Get the errors of a work request. + + + :param str compartment_id: (required) + The OCID of the compartment. + + :param str work_request_id: (required) + The OCID of the work request. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.container_engine.models.WorkRequestError` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/workRequests/{workRequestId}/errors" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_work_request_errors got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "workRequestId": work_request_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + query_params = { + "compartmentId": compartment_id + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="list[WorkRequestError]") + 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="list[WorkRequestError]") + + def list_work_request_logs(self, compartment_id, work_request_id, **kwargs): + """ + Get work request logs. + Get the logs of a work request. + + + :param str compartment_id: (required) + The OCID of the compartment. + + :param str work_request_id: (required) + The OCID of the work request. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.container_engine.models.WorkRequestLogEntry` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/workRequests/{workRequestId}/logs" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_work_request_logs got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "workRequestId": work_request_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + query_params = { + "compartmentId": compartment_id + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="list[WorkRequestLogEntry]") + 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="list[WorkRequestLogEntry]") + + def list_work_requests(self, compartment_id, **kwargs): + """ + List all work requests. + List all work requests in a compartment. + + + :param str compartment_id: (required) + The OCID of the compartment. + + :param str cluster_id: (optional) + The OCID of the cluster. + + :param str resource_id: (optional) + The OCID of the resource associated with a work request + + :param str resource_type: (optional) + Type of the resource associated with a work request + + Allowed values are: "CLUSTER", "NODEPOOL" + + :param list[str] status: (optional) + A work request status to filter on. Can have multiple parameters of this name. + + Allowed values are: "ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED" + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + :param str sort_order: (optional) + The optional order in which to sort the results. + + Allowed values are: "ASC", "DESC" + + :param str sort_by: (optional) + The optional field to sort the results by. + + Allowed values are: "ID", "OPERATION_TYPE", "STATUS", "TIME_ACCEPTED", "TIME_STARTED", "TIME_FINISHED" + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.container_engine.models.WorkRequestSummary` + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/workRequests" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "cluster_id", + "resource_id", + "resource_type", + "status", + "limit", + "page", + "sort_order", + "sort_by", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_work_requests got unknown kwargs: {!r}".format(extra_kwargs)) + + if 'resource_type' in kwargs: + resource_type_allowed_values = ["CLUSTER", "NODEPOOL"] + if kwargs['resource_type'] not in resource_type_allowed_values: + raise ValueError( + "Invalid value for `resource_type`, must be one of {0}".format(resource_type_allowed_values) + ) + + if 'status' in kwargs: + status_allowed_values = ["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"] + for status_item in kwargs['status']: + if status_item not in status_allowed_values: + raise ValueError( + "Invalid value for `status`, must be one of {0}".format(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( + "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) + ) + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["ID", "OPERATION_TYPE", "STATUS", "TIME_ACCEPTED", "TIME_STARTED", "TIME_FINISHED"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) + ) + + query_params = { + "compartmentId": compartment_id, + "clusterId": kwargs.get("cluster_id", missing), + "resourceId": kwargs.get("resource_id", missing), + "resourceType": kwargs.get("resource_type", missing), + "status": self.base_client.generate_collection_format_param(kwargs.get("status", missing), 'multi'), + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", 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.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="list[WorkRequestSummary]") + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="list[WorkRequestSummary]") + + def update_cluster(self, cluster_id, update_cluster_details, **kwargs): + """ + Update cluster details. + Update the details of a cluster. + + + :param str cluster_id: (required) + The OCID of the cluster. + + :param UpdateClusterDetails update_cluster_details: (required) + The details of the cluster to update. + + :param str if_match: (optional) + For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + parameter to the value of the etag from a previous GET or POST response for that resource. The resource + will be updated or deleted only if the etag you provide matches the resource's current etag value. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/clusters/{clusterId}" + method = "PUT" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "if_match", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "update_cluster got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "clusterId": cluster_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_cluster_details) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_cluster_details) + + def update_node_pool(self, node_pool_id, update_node_pool_details, **kwargs): + """ + Update node pool details. + Update the details of a node pool. + + + :param str node_pool_id: (required) + The OCID of the node pool. + + :param UpdateNodePoolDetails update_node_pool_details: (required) + The fields to update in a node pool. + + :param str if_match: (optional) + For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + parameter to the value of the etag from a previous GET or POST response for that resource. The resource + will be updated or deleted only if the etag you provide matches the resource's current etag value. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact + Oracle about a particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` + is also available. The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + """ + resource_path = "/nodePools/{nodePoolId}" + method = "PUT" + + # Don't accept unknown kwargs + expected_kwargs = [ + "retry_strategy", + "if_match", + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "update_node_pool got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "nodePoolId": node_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('Parameter {} cannot be None, whitespace or empty string'.format(k)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.retry_strategy + if kwargs.get('retry_strategy'): + retry_strategy = kwargs.get('retry_strategy') + + if retry_strategy: + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_node_pool_details) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_node_pool_details) diff --git a/src/oci/container_engine/container_engine_client_composite_operations.py b/src/oci/container_engine/container_engine_client_composite_operations.py new file mode 100644 index 0000000000..1379a693b0 --- /dev/null +++ b/src/oci/container_engine/container_engine_client_composite_operations.py @@ -0,0 +1,256 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +import oci # noqa: F401 + + +class ContainerEngineClientCompositeOperations(object): + """ + This class provides a wrapper around :py:class:`~oci.container_engine.ContainerEngineClient` 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 ContainerEngineClientCompositeOperations object + + :param ContainerEngineClient client: + The service client which will be wrapped by this object + """ + self.client = client + + def create_cluster_and_wait_for_state(self, create_cluster_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.container_engine.ContainerEngineClient.create_cluster` and waits for the :py:class:`~oci.container_engine.models.WorkRequest` + to enter the given state(s). + + :param CreateClusterDetails create_cluster_details: (required) + The details of the cluster to create. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.container_engine.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.container_engine.ContainerEngineClient.create_cluster` + + :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_cluster(create_cluster_details, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.headers['opc-work-request-id'] + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_work_request(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def create_node_pool_and_wait_for_state(self, create_node_pool_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.container_engine.ContainerEngineClient.create_node_pool` and waits for the :py:class:`~oci.container_engine.models.WorkRequest` + to enter the given state(s). + + :param CreateNodePoolDetails create_node_pool_details: (required) + The details of the node 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.container_engine.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.container_engine.ContainerEngineClient.create_node_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_node_pool(create_node_pool_details, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.headers['opc-work-request-id'] + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_work_request(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def delete_cluster_and_wait_for_state(self, cluster_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.container_engine.ContainerEngineClient.delete_cluster` and waits for the :py:class:`~oci.container_engine.models.WorkRequest` + to enter the given state(s). + + :param str cluster_id: (required) + The OCID of the cluster. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.container_engine.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.container_engine.ContainerEngineClient.delete_cluster` + + :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.delete_cluster(cluster_id, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.headers['opc-work-request-id'] + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_work_request(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def delete_node_pool_and_wait_for_state(self, node_pool_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.container_engine.ContainerEngineClient.delete_node_pool` and waits for the :py:class:`~oci.container_engine.models.WorkRequest` + to enter the given state(s). + + :param str node_pool_id: (required) + The OCID of the node pool. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.container_engine.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.container_engine.ContainerEngineClient.delete_node_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.delete_node_pool(node_pool_id, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.headers['opc-work-request-id'] + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_work_request(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def update_cluster_and_wait_for_state(self, cluster_id, update_cluster_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.container_engine.ContainerEngineClient.update_cluster` and waits for the :py:class:`~oci.container_engine.models.WorkRequest` + to enter the given state(s). + + :param str cluster_id: (required) + The OCID of the cluster. + + :param UpdateClusterDetails update_cluster_details: (required) + The details of the cluster to update. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.container_engine.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.container_engine.ContainerEngineClient.update_cluster` + + :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_cluster(cluster_id, update_cluster_details, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.headers['opc-work-request-id'] + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_work_request(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def update_node_pool_and_wait_for_state(self, node_pool_id, update_node_pool_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.container_engine.ContainerEngineClient.update_node_pool` and waits for the :py:class:`~oci.container_engine.models.WorkRequest` + to enter the given state(s). + + :param str node_pool_id: (required) + The OCID of the node pool. + + :param UpdateNodePoolDetails update_node_pool_details: (required) + The fields to update in a node pool. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.container_engine.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.container_engine.ContainerEngineClient.update_node_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_node_pool(node_pool_id, update_node_pool_details, **operation_kwargs) + if not wait_for_states: + return operation_result + + lowered_wait_for_states = [w.lower() for w in wait_for_states] + wait_for_resource_id = operation_result.headers['opc-work-request-id'] + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_work_request(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) diff --git a/src/oci/container_engine/models/__init__.py b/src/oci/container_engine/models/__init__.py new file mode 100644 index 0000000000..770dcd33cc --- /dev/null +++ b/src/oci/container_engine/models/__init__.py @@ -0,0 +1,57 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + +from __future__ import absolute_import + +from .add_on_options import AddOnOptions +from .cluster import Cluster +from .cluster_create_options import ClusterCreateOptions +from .cluster_endpoints import ClusterEndpoints +from .cluster_metadata import ClusterMetadata +from .cluster_options import ClusterOptions +from .cluster_summary import ClusterSummary +from .create_cluster_details import CreateClusterDetails +from .create_cluster_kubeconfig_content_details import CreateClusterKubeconfigContentDetails +from .create_node_pool_details import CreateNodePoolDetails +from .key_value import KeyValue +from .kubernetes_network_config import KubernetesNetworkConfig +from .node import Node +from .node_error import NodeError +from .node_pool import NodePool +from .node_pool_options import NodePoolOptions +from .node_pool_summary import NodePoolSummary +from .update_cluster_details import UpdateClusterDetails +from .update_node_pool_details import UpdateNodePoolDetails +from .work_request import WorkRequest +from .work_request_error import WorkRequestError +from .work_request_log_entry import WorkRequestLogEntry +from .work_request_resource import WorkRequestResource +from .work_request_summary import WorkRequestSummary + +# Maps type names to classes for container_engine services. +container_engine_type_mapping = { + "AddOnOptions": AddOnOptions, + "Cluster": Cluster, + "ClusterCreateOptions": ClusterCreateOptions, + "ClusterEndpoints": ClusterEndpoints, + "ClusterMetadata": ClusterMetadata, + "ClusterOptions": ClusterOptions, + "ClusterSummary": ClusterSummary, + "CreateClusterDetails": CreateClusterDetails, + "CreateClusterKubeconfigContentDetails": CreateClusterKubeconfigContentDetails, + "CreateNodePoolDetails": CreateNodePoolDetails, + "KeyValue": KeyValue, + "KubernetesNetworkConfig": KubernetesNetworkConfig, + "Node": Node, + "NodeError": NodeError, + "NodePool": NodePool, + "NodePoolOptions": NodePoolOptions, + "NodePoolSummary": NodePoolSummary, + "UpdateClusterDetails": UpdateClusterDetails, + "UpdateNodePoolDetails": UpdateNodePoolDetails, + "WorkRequest": WorkRequest, + "WorkRequestError": WorkRequestError, + "WorkRequestLogEntry": WorkRequestLogEntry, + "WorkRequestResource": WorkRequestResource, + "WorkRequestSummary": WorkRequestSummary +} diff --git a/src/oci/container_engine/models/add_on_options.py b/src/oci/container_engine/models/add_on_options.py new file mode 100644 index 0000000000..b96f6ee1bd --- /dev/null +++ b/src/oci/container_engine/models/add_on_options.py @@ -0,0 +1,100 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 AddOnOptions(object): + """ + The properties that define options for supported add-ons. + """ + + def __init__(self, **kwargs): + """ + Initializes a new AddOnOptions object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param is_kubernetes_dashboard_enabled: + The value to assign to the is_kubernetes_dashboard_enabled property of this AddOnOptions. + :type is_kubernetes_dashboard_enabled: bool + + :param is_tiller_enabled: + The value to assign to the is_tiller_enabled property of this AddOnOptions. + :type is_tiller_enabled: bool + + """ + self.swagger_types = { + 'is_kubernetes_dashboard_enabled': 'bool', + 'is_tiller_enabled': 'bool' + } + + self.attribute_map = { + 'is_kubernetes_dashboard_enabled': 'isKubernetesDashboardEnabled', + 'is_tiller_enabled': 'isTillerEnabled' + } + + self._is_kubernetes_dashboard_enabled = None + self._is_tiller_enabled = None + + @property + def is_kubernetes_dashboard_enabled(self): + """ + Gets the is_kubernetes_dashboard_enabled of this AddOnOptions. + Whether or not to enable the Kubernetes Dashboard add-on. + + + :return: The is_kubernetes_dashboard_enabled of this AddOnOptions. + :rtype: bool + """ + return self._is_kubernetes_dashboard_enabled + + @is_kubernetes_dashboard_enabled.setter + def is_kubernetes_dashboard_enabled(self, is_kubernetes_dashboard_enabled): + """ + Sets the is_kubernetes_dashboard_enabled of this AddOnOptions. + Whether or not to enable the Kubernetes Dashboard add-on. + + + :param is_kubernetes_dashboard_enabled: The is_kubernetes_dashboard_enabled of this AddOnOptions. + :type: bool + """ + self._is_kubernetes_dashboard_enabled = is_kubernetes_dashboard_enabled + + @property + def is_tiller_enabled(self): + """ + Gets the is_tiller_enabled of this AddOnOptions. + Whether or not to enable the Tiller add-on. + + + :return: The is_tiller_enabled of this AddOnOptions. + :rtype: bool + """ + return self._is_tiller_enabled + + @is_tiller_enabled.setter + def is_tiller_enabled(self, is_tiller_enabled): + """ + Sets the is_tiller_enabled of this AddOnOptions. + Whether or not to enable the Tiller add-on. + + + :param is_tiller_enabled: The is_tiller_enabled of this AddOnOptions. + :type: bool + """ + self._is_tiller_enabled = is_tiller_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/container_engine/models/cluster.py b/src/oci/container_engine/models/cluster.py new file mode 100644 index 0000000000..0ff1508966 --- /dev/null +++ b/src/oci/container_engine/models/cluster.py @@ -0,0 +1,411 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 Cluster(object): + """ + A Kubernetes cluster. + """ + + #: A constant which can be used with the lifecycle_state property of a Cluster. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the lifecycle_state property of a Cluster. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a Cluster. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a Cluster. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a Cluster. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a Cluster. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + def __init__(self, **kwargs): + """ + Initializes a new Cluster 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 Cluster. + :type id: str + + :param name: + The value to assign to the name property of this Cluster. + :type name: str + + :param compartment_id: + The value to assign to the compartment_id property of this Cluster. + :type compartment_id: str + + :param vcn_id: + The value to assign to the vcn_id property of this Cluster. + :type vcn_id: str + + :param kubernetes_version: + The value to assign to the kubernetes_version property of this Cluster. + :type kubernetes_version: str + + :param options: + The value to assign to the options property of this Cluster. + :type options: ClusterCreateOptions + + :param metadata: + The value to assign to the metadata property of this Cluster. + :type metadata: ClusterMetadata + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this Cluster. + Allowed values for this property are: "CREATING", "ACTIVE", "FAILED", "DELETING", "DELETED", "UPDATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param lifecycle_details: + The value to assign to the lifecycle_details property of this Cluster. + :type lifecycle_details: str + + :param endpoints: + The value to assign to the endpoints property of this Cluster. + :type endpoints: ClusterEndpoints + + :param available_kubernetes_upgrades: + The value to assign to the available_kubernetes_upgrades property of this Cluster. + :type available_kubernetes_upgrades: list[str] + + """ + self.swagger_types = { + 'id': 'str', + 'name': 'str', + 'compartment_id': 'str', + 'vcn_id': 'str', + 'kubernetes_version': 'str', + 'options': 'ClusterCreateOptions', + 'metadata': 'ClusterMetadata', + 'lifecycle_state': 'str', + 'lifecycle_details': 'str', + 'endpoints': 'ClusterEndpoints', + 'available_kubernetes_upgrades': 'list[str]' + } + + self.attribute_map = { + 'id': 'id', + 'name': 'name', + 'compartment_id': 'compartmentId', + 'vcn_id': 'vcnId', + 'kubernetes_version': 'kubernetesVersion', + 'options': 'options', + 'metadata': 'metadata', + 'lifecycle_state': 'lifecycleState', + 'lifecycle_details': 'lifecycleDetails', + 'endpoints': 'endpoints', + 'available_kubernetes_upgrades': 'availableKubernetesUpgrades' + } + + self._id = None + self._name = None + self._compartment_id = None + self._vcn_id = None + self._kubernetes_version = None + self._options = None + self._metadata = None + self._lifecycle_state = None + self._lifecycle_details = None + self._endpoints = None + self._available_kubernetes_upgrades = None + + @property + def id(self): + """ + Gets the id of this Cluster. + The OCID of the cluster. + + + :return: The id of this Cluster. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this Cluster. + The OCID of the cluster. + + + :param id: The id of this Cluster. + :type: str + """ + self._id = id + + @property + def name(self): + """ + Gets the name of this Cluster. + The name of the cluster. + + + :return: The name of this Cluster. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this Cluster. + The name of the cluster. + + + :param name: The name of this Cluster. + :type: str + """ + self._name = name + + @property + def compartment_id(self): + """ + Gets the compartment_id of this Cluster. + The OCID of the compartment in which the cluster exists. + + + :return: The compartment_id of this Cluster. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this Cluster. + The OCID of the compartment in which the cluster exists. + + + :param compartment_id: The compartment_id of this Cluster. + :type: str + """ + self._compartment_id = compartment_id + + @property + def vcn_id(self): + """ + Gets the vcn_id of this Cluster. + The OCID of the virtual cloud network (VCN) in which the cluster exists. + + + :return: The vcn_id of this Cluster. + :rtype: str + """ + return self._vcn_id + + @vcn_id.setter + def vcn_id(self, vcn_id): + """ + Sets the vcn_id of this Cluster. + The OCID of the virtual cloud network (VCN) in which the cluster exists. + + + :param vcn_id: The vcn_id of this Cluster. + :type: str + """ + self._vcn_id = vcn_id + + @property + def kubernetes_version(self): + """ + Gets the kubernetes_version of this Cluster. + The version of Kubernetes running on the cluster masters. + + + :return: The kubernetes_version of this Cluster. + :rtype: str + """ + return self._kubernetes_version + + @kubernetes_version.setter + def kubernetes_version(self, kubernetes_version): + """ + Sets the kubernetes_version of this Cluster. + The version of Kubernetes running on the cluster masters. + + + :param kubernetes_version: The kubernetes_version of this Cluster. + :type: str + """ + self._kubernetes_version = kubernetes_version + + @property + def options(self): + """ + Gets the options of this Cluster. + Optional attributes for the cluster. + + + :return: The options of this Cluster. + :rtype: ClusterCreateOptions + """ + return self._options + + @options.setter + def options(self, options): + """ + Sets the options of this Cluster. + Optional attributes for the cluster. + + + :param options: The options of this Cluster. + :type: ClusterCreateOptions + """ + self._options = options + + @property + def metadata(self): + """ + Gets the metadata of this Cluster. + Metadata about the cluster. + + + :return: The metadata of this Cluster. + :rtype: ClusterMetadata + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """ + Sets the metadata of this Cluster. + Metadata about the cluster. + + + :param metadata: The metadata of this Cluster. + :type: ClusterMetadata + """ + self._metadata = metadata + + @property + def lifecycle_state(self): + """ + Gets the lifecycle_state of this Cluster. + The state of the cluster masters. + + Allowed values for this property are: "CREATING", "ACTIVE", "FAILED", "DELETING", "DELETED", "UPDATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this Cluster. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this Cluster. + The state of the cluster masters. + + + :param lifecycle_state: The lifecycle_state of this Cluster. + :type: str + """ + allowed_values = ["CREATING", "ACTIVE", "FAILED", "DELETING", "DELETED", "UPDATING"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def lifecycle_details(self): + """ + Gets the lifecycle_details of this Cluster. + Details about the state of the cluster masters. + + + :return: The lifecycle_details of this Cluster. + :rtype: str + """ + return self._lifecycle_details + + @lifecycle_details.setter + def lifecycle_details(self, lifecycle_details): + """ + Sets the lifecycle_details of this Cluster. + Details about the state of the cluster masters. + + + :param lifecycle_details: The lifecycle_details of this Cluster. + :type: str + """ + self._lifecycle_details = lifecycle_details + + @property + def endpoints(self): + """ + Gets the endpoints of this Cluster. + Endpoints served up by the cluster masters. + + + :return: The endpoints of this Cluster. + :rtype: ClusterEndpoints + """ + return self._endpoints + + @endpoints.setter + def endpoints(self, endpoints): + """ + Sets the endpoints of this Cluster. + Endpoints served up by the cluster masters. + + + :param endpoints: The endpoints of this Cluster. + :type: ClusterEndpoints + """ + self._endpoints = endpoints + + @property + def available_kubernetes_upgrades(self): + """ + Gets the available_kubernetes_upgrades of this Cluster. + Available Kubernetes versions to which the clusters masters may be upgraded. + + + :return: The available_kubernetes_upgrades of this Cluster. + :rtype: list[str] + """ + return self._available_kubernetes_upgrades + + @available_kubernetes_upgrades.setter + def available_kubernetes_upgrades(self, available_kubernetes_upgrades): + """ + Sets the available_kubernetes_upgrades of this Cluster. + Available Kubernetes versions to which the clusters masters may be upgraded. + + + :param available_kubernetes_upgrades: The available_kubernetes_upgrades of this Cluster. + :type: list[str] + """ + self._available_kubernetes_upgrades = available_kubernetes_upgrades + + 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/container_engine/models/cluster_create_options.py b/src/oci/container_engine/models/cluster_create_options.py new file mode 100644 index 0000000000..51f9a00e2f --- /dev/null +++ b/src/oci/container_engine/models/cluster_create_options.py @@ -0,0 +1,131 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 ClusterCreateOptions(object): + """ + The properties that define extra options for a cluster. + """ + + def __init__(self, **kwargs): + """ + Initializes a new ClusterCreateOptions object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param service_lb_subnet_ids: + The value to assign to the service_lb_subnet_ids property of this ClusterCreateOptions. + :type service_lb_subnet_ids: list[str] + + :param kubernetes_network_config: + The value to assign to the kubernetes_network_config property of this ClusterCreateOptions. + :type kubernetes_network_config: KubernetesNetworkConfig + + :param add_ons: + The value to assign to the add_ons property of this ClusterCreateOptions. + :type add_ons: AddOnOptions + + """ + self.swagger_types = { + 'service_lb_subnet_ids': 'list[str]', + 'kubernetes_network_config': 'KubernetesNetworkConfig', + 'add_ons': 'AddOnOptions' + } + + self.attribute_map = { + 'service_lb_subnet_ids': 'serviceLbSubnetIds', + 'kubernetes_network_config': 'kubernetesNetworkConfig', + 'add_ons': 'addOns' + } + + self._service_lb_subnet_ids = None + self._kubernetes_network_config = None + self._add_ons = None + + @property + def service_lb_subnet_ids(self): + """ + Gets the service_lb_subnet_ids of this ClusterCreateOptions. + The OCIDs of the subnets used for Kubernetes services load balancers. + + + :return: The service_lb_subnet_ids of this ClusterCreateOptions. + :rtype: list[str] + """ + return self._service_lb_subnet_ids + + @service_lb_subnet_ids.setter + def service_lb_subnet_ids(self, service_lb_subnet_ids): + """ + Sets the service_lb_subnet_ids of this ClusterCreateOptions. + The OCIDs of the subnets used for Kubernetes services load balancers. + + + :param service_lb_subnet_ids: The service_lb_subnet_ids of this ClusterCreateOptions. + :type: list[str] + """ + self._service_lb_subnet_ids = service_lb_subnet_ids + + @property + def kubernetes_network_config(self): + """ + Gets the kubernetes_network_config of this ClusterCreateOptions. + Network configuration for Kubernetes. + + + :return: The kubernetes_network_config of this ClusterCreateOptions. + :rtype: KubernetesNetworkConfig + """ + return self._kubernetes_network_config + + @kubernetes_network_config.setter + def kubernetes_network_config(self, kubernetes_network_config): + """ + Sets the kubernetes_network_config of this ClusterCreateOptions. + Network configuration for Kubernetes. + + + :param kubernetes_network_config: The kubernetes_network_config of this ClusterCreateOptions. + :type: KubernetesNetworkConfig + """ + self._kubernetes_network_config = kubernetes_network_config + + @property + def add_ons(self): + """ + Gets the add_ons of this ClusterCreateOptions. + Configurable cluster add-ons + + + :return: The add_ons of this ClusterCreateOptions. + :rtype: AddOnOptions + """ + return self._add_ons + + @add_ons.setter + def add_ons(self, add_ons): + """ + Sets the add_ons of this ClusterCreateOptions. + Configurable cluster add-ons + + + :param add_ons: The add_ons of this ClusterCreateOptions. + :type: AddOnOptions + """ + self._add_ons = add_ons + + 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/container_engine/models/cluster_endpoints.py b/src/oci/container_engine/models/cluster_endpoints.py new file mode 100644 index 0000000000..7d4c7ebc7f --- /dev/null +++ b/src/oci/container_engine/models/cluster_endpoints.py @@ -0,0 +1,69 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 ClusterEndpoints(object): + """ + The properties that define endpoints for a cluster. + """ + + def __init__(self, **kwargs): + """ + Initializes a new ClusterEndpoints object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param kubernetes: + The value to assign to the kubernetes property of this ClusterEndpoints. + :type kubernetes: str + + """ + self.swagger_types = { + 'kubernetes': 'str' + } + + self.attribute_map = { + 'kubernetes': 'kubernetes' + } + + self._kubernetes = None + + @property + def kubernetes(self): + """ + Gets the kubernetes of this ClusterEndpoints. + The Kubernetes API server endpoint. + + + :return: The kubernetes of this ClusterEndpoints. + :rtype: str + """ + return self._kubernetes + + @kubernetes.setter + def kubernetes(self, kubernetes): + """ + Sets the kubernetes of this ClusterEndpoints. + The Kubernetes API server endpoint. + + + :param kubernetes: The kubernetes of this ClusterEndpoints. + :type: str + """ + self._kubernetes = kubernetes + + 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/container_engine/models/cluster_metadata.py b/src/oci/container_engine/models/cluster_metadata.py new file mode 100644 index 0000000000..794297bae3 --- /dev/null +++ b/src/oci/container_engine/models/cluster_metadata.py @@ -0,0 +1,317 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 ClusterMetadata(object): + """ + The properties that define meta data for a cluster. + """ + + def __init__(self, **kwargs): + """ + Initializes a new ClusterMetadata object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param time_created: + The value to assign to the time_created property of this ClusterMetadata. + :type time_created: datetime + + :param created_by_user_id: + The value to assign to the created_by_user_id property of this ClusterMetadata. + :type created_by_user_id: str + + :param created_by_work_request_id: + The value to assign to the created_by_work_request_id property of this ClusterMetadata. + :type created_by_work_request_id: str + + :param time_deleted: + The value to assign to the time_deleted property of this ClusterMetadata. + :type time_deleted: datetime + + :param deleted_by_user_id: + The value to assign to the deleted_by_user_id property of this ClusterMetadata. + :type deleted_by_user_id: str + + :param deleted_by_work_request_id: + The value to assign to the deleted_by_work_request_id property of this ClusterMetadata. + :type deleted_by_work_request_id: str + + :param time_updated: + The value to assign to the time_updated property of this ClusterMetadata. + :type time_updated: datetime + + :param updated_by_user_id: + The value to assign to the updated_by_user_id property of this ClusterMetadata. + :type updated_by_user_id: str + + :param updated_by_work_request_id: + The value to assign to the updated_by_work_request_id property of this ClusterMetadata. + :type updated_by_work_request_id: str + + """ + self.swagger_types = { + 'time_created': 'datetime', + 'created_by_user_id': 'str', + 'created_by_work_request_id': 'str', + 'time_deleted': 'datetime', + 'deleted_by_user_id': 'str', + 'deleted_by_work_request_id': 'str', + 'time_updated': 'datetime', + 'updated_by_user_id': 'str', + 'updated_by_work_request_id': 'str' + } + + self.attribute_map = { + 'time_created': 'timeCreated', + 'created_by_user_id': 'createdByUserId', + 'created_by_work_request_id': 'createdByWorkRequestId', + 'time_deleted': 'timeDeleted', + 'deleted_by_user_id': 'deletedByUserId', + 'deleted_by_work_request_id': 'deletedByWorkRequestId', + 'time_updated': 'timeUpdated', + 'updated_by_user_id': 'updatedByUserId', + 'updated_by_work_request_id': 'updatedByWorkRequestId' + } + + self._time_created = None + self._created_by_user_id = None + self._created_by_work_request_id = None + self._time_deleted = None + self._deleted_by_user_id = None + self._deleted_by_work_request_id = None + self._time_updated = None + self._updated_by_user_id = None + self._updated_by_work_request_id = None + + @property + def time_created(self): + """ + Gets the time_created of this ClusterMetadata. + The time the cluster was created. + + + :return: The time_created of this ClusterMetadata. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this ClusterMetadata. + The time the cluster was created. + + + :param time_created: The time_created of this ClusterMetadata. + :type: datetime + """ + self._time_created = time_created + + @property + def created_by_user_id(self): + """ + Gets the created_by_user_id of this ClusterMetadata. + The user who created the cluster. + + + :return: The created_by_user_id of this ClusterMetadata. + :rtype: str + """ + return self._created_by_user_id + + @created_by_user_id.setter + def created_by_user_id(self, created_by_user_id): + """ + Sets the created_by_user_id of this ClusterMetadata. + The user who created the cluster. + + + :param created_by_user_id: The created_by_user_id of this ClusterMetadata. + :type: str + """ + self._created_by_user_id = created_by_user_id + + @property + def created_by_work_request_id(self): + """ + Gets the created_by_work_request_id of this ClusterMetadata. + The OCID of the work request which created the cluster. + + + :return: The created_by_work_request_id of this ClusterMetadata. + :rtype: str + """ + return self._created_by_work_request_id + + @created_by_work_request_id.setter + def created_by_work_request_id(self, created_by_work_request_id): + """ + Sets the created_by_work_request_id of this ClusterMetadata. + The OCID of the work request which created the cluster. + + + :param created_by_work_request_id: The created_by_work_request_id of this ClusterMetadata. + :type: str + """ + self._created_by_work_request_id = created_by_work_request_id + + @property + def time_deleted(self): + """ + Gets the time_deleted of this ClusterMetadata. + The time the cluster was deleted. + + + :return: The time_deleted of this ClusterMetadata. + :rtype: datetime + """ + return self._time_deleted + + @time_deleted.setter + def time_deleted(self, time_deleted): + """ + Sets the time_deleted of this ClusterMetadata. + The time the cluster was deleted. + + + :param time_deleted: The time_deleted of this ClusterMetadata. + :type: datetime + """ + self._time_deleted = time_deleted + + @property + def deleted_by_user_id(self): + """ + Gets the deleted_by_user_id of this ClusterMetadata. + The user who deleted the cluster. + + + :return: The deleted_by_user_id of this ClusterMetadata. + :rtype: str + """ + return self._deleted_by_user_id + + @deleted_by_user_id.setter + def deleted_by_user_id(self, deleted_by_user_id): + """ + Sets the deleted_by_user_id of this ClusterMetadata. + The user who deleted the cluster. + + + :param deleted_by_user_id: The deleted_by_user_id of this ClusterMetadata. + :type: str + """ + self._deleted_by_user_id = deleted_by_user_id + + @property + def deleted_by_work_request_id(self): + """ + Gets the deleted_by_work_request_id of this ClusterMetadata. + The OCID of the work request which deleted the cluster. + + + :return: The deleted_by_work_request_id of this ClusterMetadata. + :rtype: str + """ + return self._deleted_by_work_request_id + + @deleted_by_work_request_id.setter + def deleted_by_work_request_id(self, deleted_by_work_request_id): + """ + Sets the deleted_by_work_request_id of this ClusterMetadata. + The OCID of the work request which deleted the cluster. + + + :param deleted_by_work_request_id: The deleted_by_work_request_id of this ClusterMetadata. + :type: str + """ + self._deleted_by_work_request_id = deleted_by_work_request_id + + @property + def time_updated(self): + """ + Gets the time_updated of this ClusterMetadata. + The time the cluster was updated. + + + :return: The time_updated of this ClusterMetadata. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this ClusterMetadata. + The time the cluster was updated. + + + :param time_updated: The time_updated of this ClusterMetadata. + :type: datetime + """ + self._time_updated = time_updated + + @property + def updated_by_user_id(self): + """ + Gets the updated_by_user_id of this ClusterMetadata. + The user who updated the cluster. + + + :return: The updated_by_user_id of this ClusterMetadata. + :rtype: str + """ + return self._updated_by_user_id + + @updated_by_user_id.setter + def updated_by_user_id(self, updated_by_user_id): + """ + Sets the updated_by_user_id of this ClusterMetadata. + The user who updated the cluster. + + + :param updated_by_user_id: The updated_by_user_id of this ClusterMetadata. + :type: str + """ + self._updated_by_user_id = updated_by_user_id + + @property + def updated_by_work_request_id(self): + """ + Gets the updated_by_work_request_id of this ClusterMetadata. + The OCID of the work request which updated the cluster. + + + :return: The updated_by_work_request_id of this ClusterMetadata. + :rtype: str + """ + return self._updated_by_work_request_id + + @updated_by_work_request_id.setter + def updated_by_work_request_id(self, updated_by_work_request_id): + """ + Sets the updated_by_work_request_id of this ClusterMetadata. + The OCID of the work request which updated the cluster. + + + :param updated_by_work_request_id: The updated_by_work_request_id of this ClusterMetadata. + :type: str + """ + self._updated_by_work_request_id = updated_by_work_request_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/container_engine/models/cluster_options.py b/src/oci/container_engine/models/cluster_options.py new file mode 100644 index 0000000000..c4fdef5b82 --- /dev/null +++ b/src/oci/container_engine/models/cluster_options.py @@ -0,0 +1,69 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 ClusterOptions(object): + """ + Options for creating or updating clusters. + """ + + def __init__(self, **kwargs): + """ + Initializes a new ClusterOptions object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param kubernetes_versions: + The value to assign to the kubernetes_versions property of this ClusterOptions. + :type kubernetes_versions: list[str] + + """ + self.swagger_types = { + 'kubernetes_versions': 'list[str]' + } + + self.attribute_map = { + 'kubernetes_versions': 'kubernetesVersions' + } + + self._kubernetes_versions = None + + @property + def kubernetes_versions(self): + """ + Gets the kubernetes_versions of this ClusterOptions. + Available Kubernetes versions. + + + :return: The kubernetes_versions of this ClusterOptions. + :rtype: list[str] + """ + return self._kubernetes_versions + + @kubernetes_versions.setter + def kubernetes_versions(self, kubernetes_versions): + """ + Sets the kubernetes_versions of this ClusterOptions. + Available Kubernetes versions. + + + :param kubernetes_versions: The kubernetes_versions of this ClusterOptions. + :type: list[str] + """ + self._kubernetes_versions = kubernetes_versions + + 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/container_engine/models/cluster_summary.py b/src/oci/container_engine/models/cluster_summary.py new file mode 100644 index 0000000000..a5b1e48d38 --- /dev/null +++ b/src/oci/container_engine/models/cluster_summary.py @@ -0,0 +1,411 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 ClusterSummary(object): + """ + The properties that define a cluster summary. + """ + + #: A constant which can be used with the lifecycle_state property of a ClusterSummary. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the lifecycle_state property of a ClusterSummary. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a ClusterSummary. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a ClusterSummary. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a ClusterSummary. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a ClusterSummary. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + def __init__(self, **kwargs): + """ + Initializes a new ClusterSummary 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 ClusterSummary. + :type id: str + + :param name: + The value to assign to the name property of this ClusterSummary. + :type name: str + + :param compartment_id: + The value to assign to the compartment_id property of this ClusterSummary. + :type compartment_id: str + + :param vcn_id: + The value to assign to the vcn_id property of this ClusterSummary. + :type vcn_id: str + + :param kubernetes_version: + The value to assign to the kubernetes_version property of this ClusterSummary. + :type kubernetes_version: str + + :param options: + The value to assign to the options property of this ClusterSummary. + :type options: ClusterCreateOptions + + :param metadata: + The value to assign to the metadata property of this ClusterSummary. + :type metadata: ClusterMetadata + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this ClusterSummary. + Allowed values for this property are: "CREATING", "ACTIVE", "FAILED", "DELETING", "DELETED", "UPDATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param lifecycle_details: + The value to assign to the lifecycle_details property of this ClusterSummary. + :type lifecycle_details: str + + :param endpoints: + The value to assign to the endpoints property of this ClusterSummary. + :type endpoints: ClusterEndpoints + + :param available_kubernetes_upgrades: + The value to assign to the available_kubernetes_upgrades property of this ClusterSummary. + :type available_kubernetes_upgrades: list[str] + + """ + self.swagger_types = { + 'id': 'str', + 'name': 'str', + 'compartment_id': 'str', + 'vcn_id': 'str', + 'kubernetes_version': 'str', + 'options': 'ClusterCreateOptions', + 'metadata': 'ClusterMetadata', + 'lifecycle_state': 'str', + 'lifecycle_details': 'str', + 'endpoints': 'ClusterEndpoints', + 'available_kubernetes_upgrades': 'list[str]' + } + + self.attribute_map = { + 'id': 'id', + 'name': 'name', + 'compartment_id': 'compartmentId', + 'vcn_id': 'vcnId', + 'kubernetes_version': 'kubernetesVersion', + 'options': 'options', + 'metadata': 'metadata', + 'lifecycle_state': 'lifecycleState', + 'lifecycle_details': 'lifecycleDetails', + 'endpoints': 'endpoints', + 'available_kubernetes_upgrades': 'availableKubernetesUpgrades' + } + + self._id = None + self._name = None + self._compartment_id = None + self._vcn_id = None + self._kubernetes_version = None + self._options = None + self._metadata = None + self._lifecycle_state = None + self._lifecycle_details = None + self._endpoints = None + self._available_kubernetes_upgrades = None + + @property + def id(self): + """ + Gets the id of this ClusterSummary. + The OCID of the cluster. + + + :return: The id of this ClusterSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this ClusterSummary. + The OCID of the cluster. + + + :param id: The id of this ClusterSummary. + :type: str + """ + self._id = id + + @property + def name(self): + """ + Gets the name of this ClusterSummary. + The name of the cluster. + + + :return: The name of this ClusterSummary. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this ClusterSummary. + The name of the cluster. + + + :param name: The name of this ClusterSummary. + :type: str + """ + self._name = name + + @property + def compartment_id(self): + """ + Gets the compartment_id of this ClusterSummary. + The OCID of the compartment in which the cluster exists. + + + :return: The compartment_id of this ClusterSummary. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this ClusterSummary. + The OCID of the compartment in which the cluster exists. + + + :param compartment_id: The compartment_id of this ClusterSummary. + :type: str + """ + self._compartment_id = compartment_id + + @property + def vcn_id(self): + """ + Gets the vcn_id of this ClusterSummary. + The OCID of the virtual cloud network (VCN) in which the cluster exists + + + :return: The vcn_id of this ClusterSummary. + :rtype: str + """ + return self._vcn_id + + @vcn_id.setter + def vcn_id(self, vcn_id): + """ + Sets the vcn_id of this ClusterSummary. + The OCID of the virtual cloud network (VCN) in which the cluster exists + + + :param vcn_id: The vcn_id of this ClusterSummary. + :type: str + """ + self._vcn_id = vcn_id + + @property + def kubernetes_version(self): + """ + Gets the kubernetes_version of this ClusterSummary. + The version of Kubernetes running on the cluster masters. + + + :return: The kubernetes_version of this ClusterSummary. + :rtype: str + """ + return self._kubernetes_version + + @kubernetes_version.setter + def kubernetes_version(self, kubernetes_version): + """ + Sets the kubernetes_version of this ClusterSummary. + The version of Kubernetes running on the cluster masters. + + + :param kubernetes_version: The kubernetes_version of this ClusterSummary. + :type: str + """ + self._kubernetes_version = kubernetes_version + + @property + def options(self): + """ + Gets the options of this ClusterSummary. + Optional attributes for the cluster. + + + :return: The options of this ClusterSummary. + :rtype: ClusterCreateOptions + """ + return self._options + + @options.setter + def options(self, options): + """ + Sets the options of this ClusterSummary. + Optional attributes for the cluster. + + + :param options: The options of this ClusterSummary. + :type: ClusterCreateOptions + """ + self._options = options + + @property + def metadata(self): + """ + Gets the metadata of this ClusterSummary. + Metadata about the cluster. + + + :return: The metadata of this ClusterSummary. + :rtype: ClusterMetadata + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """ + Sets the metadata of this ClusterSummary. + Metadata about the cluster. + + + :param metadata: The metadata of this ClusterSummary. + :type: ClusterMetadata + """ + self._metadata = metadata + + @property + def lifecycle_state(self): + """ + Gets the lifecycle_state of this ClusterSummary. + The state of the cluster masters. + + Allowed values for this property are: "CREATING", "ACTIVE", "FAILED", "DELETING", "DELETED", "UPDATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this ClusterSummary. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this ClusterSummary. + The state of the cluster masters. + + + :param lifecycle_state: The lifecycle_state of this ClusterSummary. + :type: str + """ + allowed_values = ["CREATING", "ACTIVE", "FAILED", "DELETING", "DELETED", "UPDATING"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def lifecycle_details(self): + """ + Gets the lifecycle_details of this ClusterSummary. + Details about the state of the cluster masters. + + + :return: The lifecycle_details of this ClusterSummary. + :rtype: str + """ + return self._lifecycle_details + + @lifecycle_details.setter + def lifecycle_details(self, lifecycle_details): + """ + Sets the lifecycle_details of this ClusterSummary. + Details about the state of the cluster masters. + + + :param lifecycle_details: The lifecycle_details of this ClusterSummary. + :type: str + """ + self._lifecycle_details = lifecycle_details + + @property + def endpoints(self): + """ + Gets the endpoints of this ClusterSummary. + Endpoints served up by the cluster masters. + + + :return: The endpoints of this ClusterSummary. + :rtype: ClusterEndpoints + """ + return self._endpoints + + @endpoints.setter + def endpoints(self, endpoints): + """ + Sets the endpoints of this ClusterSummary. + Endpoints served up by the cluster masters. + + + :param endpoints: The endpoints of this ClusterSummary. + :type: ClusterEndpoints + """ + self._endpoints = endpoints + + @property + def available_kubernetes_upgrades(self): + """ + Gets the available_kubernetes_upgrades of this ClusterSummary. + Available Kubernetes versions to which the clusters masters may be upgraded. + + + :return: The available_kubernetes_upgrades of this ClusterSummary. + :rtype: list[str] + """ + return self._available_kubernetes_upgrades + + @available_kubernetes_upgrades.setter + def available_kubernetes_upgrades(self, available_kubernetes_upgrades): + """ + Sets the available_kubernetes_upgrades of this ClusterSummary. + Available Kubernetes versions to which the clusters masters may be upgraded. + + + :param available_kubernetes_upgrades: The available_kubernetes_upgrades of this ClusterSummary. + :type: list[str] + """ + self._available_kubernetes_upgrades = available_kubernetes_upgrades + + 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/container_engine/models/create_cluster_details.py b/src/oci/container_engine/models/create_cluster_details.py new file mode 100644 index 0000000000..d9ad79ba64 --- /dev/null +++ b/src/oci/container_engine/models/create_cluster_details.py @@ -0,0 +1,193 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 CreateClusterDetails(object): + """ + The properties that define a request to create a cluster. + """ + + def __init__(self, **kwargs): + """ + Initializes a new CreateClusterDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param name: + The value to assign to the name property of this CreateClusterDetails. + :type name: str + + :param compartment_id: + The value to assign to the compartment_id property of this CreateClusterDetails. + :type compartment_id: str + + :param vcn_id: + The value to assign to the vcn_id property of this CreateClusterDetails. + :type vcn_id: str + + :param kubernetes_version: + The value to assign to the kubernetes_version property of this CreateClusterDetails. + :type kubernetes_version: str + + :param options: + The value to assign to the options property of this CreateClusterDetails. + :type options: ClusterCreateOptions + + """ + self.swagger_types = { + 'name': 'str', + 'compartment_id': 'str', + 'vcn_id': 'str', + 'kubernetes_version': 'str', + 'options': 'ClusterCreateOptions' + } + + self.attribute_map = { + 'name': 'name', + 'compartment_id': 'compartmentId', + 'vcn_id': 'vcnId', + 'kubernetes_version': 'kubernetesVersion', + 'options': 'options' + } + + self._name = None + self._compartment_id = None + self._vcn_id = None + self._kubernetes_version = None + self._options = None + + @property + def name(self): + """ + **[Required]** Gets the name of this CreateClusterDetails. + The name of the cluster. Avoid entering confidential information. + + + :return: The name of this CreateClusterDetails. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this CreateClusterDetails. + The name of the cluster. Avoid entering confidential information. + + + :param name: The name of this CreateClusterDetails. + :type: str + """ + self._name = name + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this CreateClusterDetails. + The OCID of the compartment in which to create the cluster. + + + :return: The compartment_id of this CreateClusterDetails. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this CreateClusterDetails. + The OCID of the compartment in which to create the cluster. + + + :param compartment_id: The compartment_id of this CreateClusterDetails. + :type: str + """ + self._compartment_id = compartment_id + + @property + def vcn_id(self): + """ + **[Required]** Gets the vcn_id of this CreateClusterDetails. + The OCID of the virtual cloud network (VCN) in which to create the cluster. + + + :return: The vcn_id of this CreateClusterDetails. + :rtype: str + """ + return self._vcn_id + + @vcn_id.setter + def vcn_id(self, vcn_id): + """ + Sets the vcn_id of this CreateClusterDetails. + The OCID of the virtual cloud network (VCN) in which to create the cluster. + + + :param vcn_id: The vcn_id of this CreateClusterDetails. + :type: str + """ + self._vcn_id = vcn_id + + @property + def kubernetes_version(self): + """ + **[Required]** Gets the kubernetes_version of this CreateClusterDetails. + The version of Kubernetes to install into the cluster masters. + + + :return: The kubernetes_version of this CreateClusterDetails. + :rtype: str + """ + return self._kubernetes_version + + @kubernetes_version.setter + def kubernetes_version(self, kubernetes_version): + """ + Sets the kubernetes_version of this CreateClusterDetails. + The version of Kubernetes to install into the cluster masters. + + + :param kubernetes_version: The kubernetes_version of this CreateClusterDetails. + :type: str + """ + self._kubernetes_version = kubernetes_version + + @property + def options(self): + """ + Gets the options of this CreateClusterDetails. + Optional attributes for the cluster. + + + :return: The options of this CreateClusterDetails. + :rtype: ClusterCreateOptions + """ + return self._options + + @options.setter + def options(self, options): + """ + Sets the options of this CreateClusterDetails. + Optional attributes for the cluster. + + + :param options: The options of this CreateClusterDetails. + :type: ClusterCreateOptions + """ + self._options = options + + 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/container_engine/models/create_cluster_kubeconfig_content_details.py b/src/oci/container_engine/models/create_cluster_kubeconfig_content_details.py new file mode 100644 index 0000000000..6a0f3d3ad4 --- /dev/null +++ b/src/oci/container_engine/models/create_cluster_kubeconfig_content_details.py @@ -0,0 +1,100 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 CreateClusterKubeconfigContentDetails(object): + """ + The properties that define a request to create a cluster kubeconfig. + """ + + def __init__(self, **kwargs): + """ + Initializes a new CreateClusterKubeconfigContentDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param token_version: + The value to assign to the token_version property of this CreateClusterKubeconfigContentDetails. + :type token_version: str + + :param expiration: + The value to assign to the expiration property of this CreateClusterKubeconfigContentDetails. + :type expiration: int + + """ + self.swagger_types = { + 'token_version': 'str', + 'expiration': 'int' + } + + self.attribute_map = { + 'token_version': 'tokenVersion', + 'expiration': 'expiration' + } + + self._token_version = None + self._expiration = None + + @property + def token_version(self): + """ + Gets the token_version of this CreateClusterKubeconfigContentDetails. + The version of the kubeconfig token. + + + :return: The token_version of this CreateClusterKubeconfigContentDetails. + :rtype: str + """ + return self._token_version + + @token_version.setter + def token_version(self, token_version): + """ + Sets the token_version of this CreateClusterKubeconfigContentDetails. + The version of the kubeconfig token. + + + :param token_version: The token_version of this CreateClusterKubeconfigContentDetails. + :type: str + """ + self._token_version = token_version + + @property + def expiration(self): + """ + Gets the expiration of this CreateClusterKubeconfigContentDetails. + The desired expiration, in seconds, to use for the kubeconfig token. + + + :return: The expiration of this CreateClusterKubeconfigContentDetails. + :rtype: int + """ + return self._expiration + + @expiration.setter + def expiration(self, expiration): + """ + Sets the expiration of this CreateClusterKubeconfigContentDetails. + The desired expiration, in seconds, to use for the kubeconfig token. + + + :param expiration: The expiration of this CreateClusterKubeconfigContentDetails. + :type: int + """ + self._expiration = expiration + + 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/container_engine/models/create_node_pool_details.py b/src/oci/container_engine/models/create_node_pool_details.py new file mode 100644 index 0000000000..6f99efacb3 --- /dev/null +++ b/src/oci/container_engine/models/create_node_pool_details.py @@ -0,0 +1,348 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 CreateNodePoolDetails(object): + """ + The properties that define a request to create a node pool. + """ + + def __init__(self, **kwargs): + """ + Initializes a new CreateNodePoolDetails 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 CreateNodePoolDetails. + :type compartment_id: str + + :param cluster_id: + The value to assign to the cluster_id property of this CreateNodePoolDetails. + :type cluster_id: str + + :param name: + The value to assign to the name property of this CreateNodePoolDetails. + :type name: str + + :param kubernetes_version: + The value to assign to the kubernetes_version property of this CreateNodePoolDetails. + :type kubernetes_version: str + + :param node_image_name: + The value to assign to the node_image_name property of this CreateNodePoolDetails. + :type node_image_name: str + + :param node_shape: + The value to assign to the node_shape property of this CreateNodePoolDetails. + :type node_shape: str + + :param initial_node_labels: + The value to assign to the initial_node_labels property of this CreateNodePoolDetails. + :type initial_node_labels: list[KeyValue] + + :param ssh_public_key: + The value to assign to the ssh_public_key property of this CreateNodePoolDetails. + :type ssh_public_key: str + + :param quantity_per_subnet: + The value to assign to the quantity_per_subnet property of this CreateNodePoolDetails. + :type quantity_per_subnet: int + + :param subnet_ids: + The value to assign to the subnet_ids property of this CreateNodePoolDetails. + :type subnet_ids: list[str] + + """ + self.swagger_types = { + 'compartment_id': 'str', + 'cluster_id': 'str', + 'name': 'str', + 'kubernetes_version': 'str', + 'node_image_name': 'str', + 'node_shape': 'str', + 'initial_node_labels': 'list[KeyValue]', + 'ssh_public_key': 'str', + 'quantity_per_subnet': 'int', + 'subnet_ids': 'list[str]' + } + + self.attribute_map = { + 'compartment_id': 'compartmentId', + 'cluster_id': 'clusterId', + 'name': 'name', + 'kubernetes_version': 'kubernetesVersion', + 'node_image_name': 'nodeImageName', + 'node_shape': 'nodeShape', + 'initial_node_labels': 'initialNodeLabels', + 'ssh_public_key': 'sshPublicKey', + 'quantity_per_subnet': 'quantityPerSubnet', + 'subnet_ids': 'subnetIds' + } + + self._compartment_id = None + self._cluster_id = None + self._name = None + self._kubernetes_version = None + self._node_image_name = None + self._node_shape = None + self._initial_node_labels = None + self._ssh_public_key = None + self._quantity_per_subnet = None + self._subnet_ids = None + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this CreateNodePoolDetails. + The OCID of the compartment in which the node pool exists. + + + :return: The compartment_id of this CreateNodePoolDetails. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this CreateNodePoolDetails. + The OCID of the compartment in which the node pool exists. + + + :param compartment_id: The compartment_id of this CreateNodePoolDetails. + :type: str + """ + self._compartment_id = compartment_id + + @property + def cluster_id(self): + """ + **[Required]** Gets the cluster_id of this CreateNodePoolDetails. + The OCID of the cluster to which this node pool is attached. + + + :return: The cluster_id of this CreateNodePoolDetails. + :rtype: str + """ + return self._cluster_id + + @cluster_id.setter + def cluster_id(self, cluster_id): + """ + Sets the cluster_id of this CreateNodePoolDetails. + The OCID of the cluster to which this node pool is attached. + + + :param cluster_id: The cluster_id of this CreateNodePoolDetails. + :type: str + """ + self._cluster_id = cluster_id + + @property + def name(self): + """ + **[Required]** Gets the name of this CreateNodePoolDetails. + The name of the node pool. Avoid entering confidential information. + + + :return: The name of this CreateNodePoolDetails. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this CreateNodePoolDetails. + The name of the node pool. Avoid entering confidential information. + + + :param name: The name of this CreateNodePoolDetails. + :type: str + """ + self._name = name + + @property + def kubernetes_version(self): + """ + **[Required]** Gets the kubernetes_version of this CreateNodePoolDetails. + The version of Kubernetes to install on the nodes in the node pool. + + + :return: The kubernetes_version of this CreateNodePoolDetails. + :rtype: str + """ + return self._kubernetes_version + + @kubernetes_version.setter + def kubernetes_version(self, kubernetes_version): + """ + Sets the kubernetes_version of this CreateNodePoolDetails. + The version of Kubernetes to install on the nodes in the node pool. + + + :param kubernetes_version: The kubernetes_version of this CreateNodePoolDetails. + :type: str + """ + self._kubernetes_version = kubernetes_version + + @property + def node_image_name(self): + """ + **[Required]** Gets the node_image_name of this CreateNodePoolDetails. + The name of the image running on the nodes in the node pool. + + + :return: The node_image_name of this CreateNodePoolDetails. + :rtype: str + """ + return self._node_image_name + + @node_image_name.setter + def node_image_name(self, node_image_name): + """ + Sets the node_image_name of this CreateNodePoolDetails. + The name of the image running on the nodes in the node pool. + + + :param node_image_name: The node_image_name of this CreateNodePoolDetails. + :type: str + """ + self._node_image_name = node_image_name + + @property + def node_shape(self): + """ + **[Required]** Gets the node_shape of this CreateNodePoolDetails. + The name of the node shape of the nodes in the node pool. + + + :return: The node_shape of this CreateNodePoolDetails. + :rtype: str + """ + return self._node_shape + + @node_shape.setter + def node_shape(self, node_shape): + """ + Sets the node_shape of this CreateNodePoolDetails. + The name of the node shape of the nodes in the node pool. + + + :param node_shape: The node_shape of this CreateNodePoolDetails. + :type: str + """ + self._node_shape = node_shape + + @property + def initial_node_labels(self): + """ + Gets the initial_node_labels of this CreateNodePoolDetails. + A list of key/value pairs to add to nodes after they join the Kubernetes cluster. + + + :return: The initial_node_labels of this CreateNodePoolDetails. + :rtype: list[KeyValue] + """ + return self._initial_node_labels + + @initial_node_labels.setter + def initial_node_labels(self, initial_node_labels): + """ + Sets the initial_node_labels of this CreateNodePoolDetails. + A list of key/value pairs to add to nodes after they join the Kubernetes cluster. + + + :param initial_node_labels: The initial_node_labels of this CreateNodePoolDetails. + :type: list[KeyValue] + """ + self._initial_node_labels = initial_node_labels + + @property + def ssh_public_key(self): + """ + Gets the ssh_public_key of this CreateNodePoolDetails. + The SSH public key to add to each node in the node pool. + + + :return: The ssh_public_key of this CreateNodePoolDetails. + :rtype: str + """ + return self._ssh_public_key + + @ssh_public_key.setter + def ssh_public_key(self, ssh_public_key): + """ + Sets the ssh_public_key of this CreateNodePoolDetails. + The SSH public key to add to each node in the node pool. + + + :param ssh_public_key: The ssh_public_key of this CreateNodePoolDetails. + :type: str + """ + self._ssh_public_key = ssh_public_key + + @property + def quantity_per_subnet(self): + """ + Gets the quantity_per_subnet of this CreateNodePoolDetails. + The number of nodes to create in each subnet. + + + :return: The quantity_per_subnet of this CreateNodePoolDetails. + :rtype: int + """ + return self._quantity_per_subnet + + @quantity_per_subnet.setter + def quantity_per_subnet(self, quantity_per_subnet): + """ + Sets the quantity_per_subnet of this CreateNodePoolDetails. + The number of nodes to create in each subnet. + + + :param quantity_per_subnet: The quantity_per_subnet of this CreateNodePoolDetails. + :type: int + """ + self._quantity_per_subnet = quantity_per_subnet + + @property + def subnet_ids(self): + """ + **[Required]** Gets the subnet_ids of this CreateNodePoolDetails. + The OCIDs of the subnets in which to place nodes for this node pool. + + + :return: The subnet_ids of this CreateNodePoolDetails. + :rtype: list[str] + """ + return self._subnet_ids + + @subnet_ids.setter + def subnet_ids(self, subnet_ids): + """ + Sets the subnet_ids of this CreateNodePoolDetails. + The OCIDs of the subnets in which to place nodes for this node pool. + + + :param subnet_ids: The subnet_ids of this CreateNodePoolDetails. + :type: list[str] + """ + self._subnet_ids = subnet_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/container_engine/models/key_value.py b/src/oci/container_engine/models/key_value.py new file mode 100644 index 0000000000..c2ec172e88 --- /dev/null +++ b/src/oci/container_engine/models/key_value.py @@ -0,0 +1,100 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 KeyValue(object): + """ + The properties that define a key value pair. + """ + + def __init__(self, **kwargs): + """ + Initializes a new KeyValue object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param key: + The value to assign to the key property of this KeyValue. + :type key: str + + :param value: + The value to assign to the value property of this KeyValue. + :type value: str + + """ + self.swagger_types = { + 'key': 'str', + 'value': 'str' + } + + self.attribute_map = { + 'key': 'key', + 'value': 'value' + } + + self._key = None + self._value = None + + @property + def key(self): + """ + Gets the key of this KeyValue. + The key of the pair. + + + :return: The key of this KeyValue. + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """ + Sets the key of this KeyValue. + The key of the pair. + + + :param key: The key of this KeyValue. + :type: str + """ + self._key = key + + @property + def value(self): + """ + Gets the value of this KeyValue. + The value of the pair. + + + :return: The value of this KeyValue. + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """ + Sets the value of this KeyValue. + The value of the pair. + + + :param value: The value of this KeyValue. + :type: str + """ + self._value = value + + 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/container_engine/models/kubernetes_network_config.py b/src/oci/container_engine/models/kubernetes_network_config.py new file mode 100644 index 0000000000..6d7975618c --- /dev/null +++ b/src/oci/container_engine/models/kubernetes_network_config.py @@ -0,0 +1,100 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 KubernetesNetworkConfig(object): + """ + The properties that define the network configuration for Kubernetes. + """ + + def __init__(self, **kwargs): + """ + Initializes a new KubernetesNetworkConfig object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param pods_cidr: + The value to assign to the pods_cidr property of this KubernetesNetworkConfig. + :type pods_cidr: str + + :param services_cidr: + The value to assign to the services_cidr property of this KubernetesNetworkConfig. + :type services_cidr: str + + """ + self.swagger_types = { + 'pods_cidr': 'str', + 'services_cidr': 'str' + } + + self.attribute_map = { + 'pods_cidr': 'podsCidr', + 'services_cidr': 'servicesCidr' + } + + self._pods_cidr = None + self._services_cidr = None + + @property + def pods_cidr(self): + """ + Gets the pods_cidr of this KubernetesNetworkConfig. + The CIDR block for Kubernetes pods. + + + :return: The pods_cidr of this KubernetesNetworkConfig. + :rtype: str + """ + return self._pods_cidr + + @pods_cidr.setter + def pods_cidr(self, pods_cidr): + """ + Sets the pods_cidr of this KubernetesNetworkConfig. + The CIDR block for Kubernetes pods. + + + :param pods_cidr: The pods_cidr of this KubernetesNetworkConfig. + :type: str + """ + self._pods_cidr = pods_cidr + + @property + def services_cidr(self): + """ + Gets the services_cidr of this KubernetesNetworkConfig. + The CIDR block for Kubernetes services. + + + :return: The services_cidr of this KubernetesNetworkConfig. + :rtype: str + """ + return self._services_cidr + + @services_cidr.setter + def services_cidr(self, services_cidr): + """ + Sets the services_cidr of this KubernetesNetworkConfig. + The CIDR block for Kubernetes services. + + + :param services_cidr: The services_cidr of this KubernetesNetworkConfig. + :type: str + """ + self._services_cidr = services_cidr + + 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/container_engine/models/node.py b/src/oci/container_engine/models/node.py new file mode 100644 index 0000000000..f3a53913e7 --- /dev/null +++ b/src/oci/container_engine/models/node.py @@ -0,0 +1,353 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 Node(object): + """ + The properties that define a node. + """ + + #: A constant which can be used with the lifecycle_state property of a Node. + #: This constant has a value of "CREATING" + LIFECYCLE_STATE_CREATING = "CREATING" + + #: A constant which can be used with the lifecycle_state property of a Node. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a Node. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the lifecycle_state property of a Node. + #: This constant has a value of "DELETING" + LIFECYCLE_STATE_DELETING = "DELETING" + + #: A constant which can be used with the lifecycle_state property of a Node. + #: This constant has a value of "DELETED" + LIFECYCLE_STATE_DELETED = "DELETED" + + #: A constant which can be used with the lifecycle_state property of a Node. + #: This constant has a value of "FAILING" + LIFECYCLE_STATE_FAILING = "FAILING" + + #: A constant which can be used with the lifecycle_state property of a Node. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + def __init__(self, **kwargs): + """ + Initializes a new Node 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 Node. + :type id: str + + :param name: + The value to assign to the name property of this Node. + :type name: str + + :param availability_domain: + The value to assign to the availability_domain property of this Node. + :type availability_domain: str + + :param subnet_id: + The value to assign to the subnet_id property of this Node. + :type subnet_id: str + + :param node_pool_id: + The value to assign to the node_pool_id property of this Node. + :type node_pool_id: str + + :param public_ip: + The value to assign to the public_ip property of this Node. + :type public_ip: str + + :param node_error: + The value to assign to the node_error property of this Node. + :type node_error: NodeError + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this Node. + Allowed values for this property are: "CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILING", "INACTIVE", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param lifecycle_details: + The value to assign to the lifecycle_details property of this Node. + :type lifecycle_details: str + + """ + self.swagger_types = { + 'id': 'str', + 'name': 'str', + 'availability_domain': 'str', + 'subnet_id': 'str', + 'node_pool_id': 'str', + 'public_ip': 'str', + 'node_error': 'NodeError', + 'lifecycle_state': 'str', + 'lifecycle_details': 'str' + } + + self.attribute_map = { + 'id': 'id', + 'name': 'name', + 'availability_domain': 'availabilityDomain', + 'subnet_id': 'subnetId', + 'node_pool_id': 'nodePoolId', + 'public_ip': 'publicIp', + 'node_error': 'nodeError', + 'lifecycle_state': 'lifecycleState', + 'lifecycle_details': 'lifecycleDetails' + } + + self._id = None + self._name = None + self._availability_domain = None + self._subnet_id = None + self._node_pool_id = None + self._public_ip = None + self._node_error = None + self._lifecycle_state = None + self._lifecycle_details = None + + @property + def id(self): + """ + Gets the id of this Node. + The OCID of the compute instance backing this node. + + + :return: The id of this Node. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this Node. + The OCID of the compute instance backing this node. + + + :param id: The id of this Node. + :type: str + """ + self._id = id + + @property + def name(self): + """ + Gets the name of this Node. + The name of the node. + + + :return: The name of this Node. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this Node. + The name of the node. + + + :param name: The name of this Node. + :type: str + """ + self._name = name + + @property + def availability_domain(self): + """ + Gets the availability_domain of this Node. + The name of the availability domain in which this node is placed. + + + :return: The availability_domain of this Node. + :rtype: str + """ + return self._availability_domain + + @availability_domain.setter + def availability_domain(self, availability_domain): + """ + Sets the availability_domain of this Node. + The name of the availability domain in which this node is placed. + + + :param availability_domain: The availability_domain of this Node. + :type: str + """ + self._availability_domain = availability_domain + + @property + def subnet_id(self): + """ + Gets the subnet_id of this Node. + The OCID of the subnet in which this node is placed. + + + :return: The subnet_id of this Node. + :rtype: str + """ + return self._subnet_id + + @subnet_id.setter + def subnet_id(self, subnet_id): + """ + Sets the subnet_id of this Node. + The OCID of the subnet in which this node is placed. + + + :param subnet_id: The subnet_id of this Node. + :type: str + """ + self._subnet_id = subnet_id + + @property + def node_pool_id(self): + """ + Gets the node_pool_id of this Node. + The OCID of the node pool to which this node belongs. + + + :return: The node_pool_id of this Node. + :rtype: str + """ + return self._node_pool_id + + @node_pool_id.setter + def node_pool_id(self, node_pool_id): + """ + Sets the node_pool_id of this Node. + The OCID of the node pool to which this node belongs. + + + :param node_pool_id: The node_pool_id of this Node. + :type: str + """ + self._node_pool_id = node_pool_id + + @property + def public_ip(self): + """ + Gets the public_ip of this Node. + The public IP address of this node. + + + :return: The public_ip of this Node. + :rtype: str + """ + return self._public_ip + + @public_ip.setter + def public_ip(self, public_ip): + """ + Sets the public_ip of this Node. + The public IP address of this node. + + + :param public_ip: The public_ip of this Node. + :type: str + """ + self._public_ip = public_ip + + @property + def node_error(self): + """ + Gets the node_error of this Node. + An error that may be associated with the node. + + + :return: The node_error of this Node. + :rtype: NodeError + """ + return self._node_error + + @node_error.setter + def node_error(self, node_error): + """ + Sets the node_error of this Node. + An error that may be associated with the node. + + + :param node_error: The node_error of this Node. + :type: NodeError + """ + self._node_error = node_error + + @property + def lifecycle_state(self): + """ + Gets the lifecycle_state of this Node. + The state of the node. + + Allowed values for this property are: "CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILING", "INACTIVE", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this Node. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this Node. + The state of the node. + + + :param lifecycle_state: The lifecycle_state of this Node. + :type: str + """ + allowed_values = ["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILING", "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 lifecycle_details(self): + """ + Gets the lifecycle_details of this Node. + Details about the state of the node. + + + :return: The lifecycle_details of this Node. + :rtype: str + """ + return self._lifecycle_details + + @lifecycle_details.setter + def lifecycle_details(self, lifecycle_details): + """ + Sets the lifecycle_details of this Node. + Details about the state of the node. + + + :param lifecycle_details: The lifecycle_details of this Node. + :type: str + """ + self._lifecycle_details = lifecycle_details + + 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/container_engine/models/node_error.py b/src/oci/container_engine/models/node_error.py new file mode 100644 index 0000000000..419394e437 --- /dev/null +++ b/src/oci/container_engine/models/node_error.py @@ -0,0 +1,166 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 NodeError(object): + """ + The properties that define an upstream error while managing a node. + """ + + def __init__(self, **kwargs): + """ + Initializes a new NodeError 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 NodeError. + :type code: str + + :param message: + The value to assign to the message property of this NodeError. + :type message: str + + :param status: + The value to assign to the status property of this NodeError. + :type status: str + + :param opc_request_id: + The value to assign to the opc_request_id property of this NodeError. + :type opc_request_id: str + + """ + self.swagger_types = { + 'code': 'str', + 'message': 'str', + 'status': 'str', + 'opc_request_id': 'str' + } + + self.attribute_map = { + 'code': 'code', + 'message': 'message', + 'status': 'status', + 'opc_request_id': 'opc-request-id' + } + + self._code = None + self._message = None + self._status = None + self._opc_request_id = None + + @property + def code(self): + """ + **[Required]** Gets the code of this NodeError. + A short error code that defines the upstream error, meant for programmatic parsing. See `API Errors`__. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm + + + :return: The code of this NodeError. + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """ + Sets the code of this NodeError. + A short error code that defines the upstream error, meant for programmatic parsing. See `API Errors`__. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm + + + :param code: The code of this NodeError. + :type: str + """ + self._code = code + + @property + def message(self): + """ + **[Required]** Gets the message of this NodeError. + A human-readable error string of the upstream error. + + + :return: The message of this NodeError. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """ + Sets the message of this NodeError. + A human-readable error string of the upstream error. + + + :param message: The message of this NodeError. + :type: str + """ + self._message = message + + @property + def status(self): + """ + Gets the status of this NodeError. + The status of the HTTP response encountered in the upstream error. + + + :return: The status of this NodeError. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this NodeError. + The status of the HTTP response encountered in the upstream error. + + + :param status: The status of this NodeError. + :type: str + """ + self._status = status + + @property + def opc_request_id(self): + """ + Gets the opc_request_id of this NodeError. + Unique Oracle-assigned identifier for the upstream request. If you need to contact Oracle about a particular upstream request, please provide the request ID. + + + :return: The opc_request_id of this NodeError. + :rtype: str + """ + return self._opc_request_id + + @opc_request_id.setter + def opc_request_id(self, opc_request_id): + """ + Sets the opc_request_id of this NodeError. + Unique Oracle-assigned identifier for the upstream request. If you need to contact Oracle about a particular upstream request, please provide the request ID. + + + :param opc_request_id: The opc_request_id of this NodeError. + :type: str + """ + self._opc_request_id = opc_request_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/container_engine/models/node_pool.py b/src/oci/container_engine/models/node_pool.py new file mode 100644 index 0000000000..ec3447c7ac --- /dev/null +++ b/src/oci/container_engine/models/node_pool.py @@ -0,0 +1,441 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 NodePool(object): + """ + A pool of compute nodes attached to a cluster. + """ + + def __init__(self, **kwargs): + """ + Initializes a new NodePool 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 NodePool. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this NodePool. + :type compartment_id: str + + :param cluster_id: + The value to assign to the cluster_id property of this NodePool. + :type cluster_id: str + + :param name: + The value to assign to the name property of this NodePool. + :type name: str + + :param kubernetes_version: + The value to assign to the kubernetes_version property of this NodePool. + :type kubernetes_version: str + + :param node_image_id: + The value to assign to the node_image_id property of this NodePool. + :type node_image_id: str + + :param node_image_name: + The value to assign to the node_image_name property of this NodePool. + :type node_image_name: str + + :param node_shape: + The value to assign to the node_shape property of this NodePool. + :type node_shape: str + + :param initial_node_labels: + The value to assign to the initial_node_labels property of this NodePool. + :type initial_node_labels: list[KeyValue] + + :param ssh_public_key: + The value to assign to the ssh_public_key property of this NodePool. + :type ssh_public_key: str + + :param quantity_per_subnet: + The value to assign to the quantity_per_subnet property of this NodePool. + :type quantity_per_subnet: int + + :param subnet_ids: + The value to assign to the subnet_ids property of this NodePool. + :type subnet_ids: list[str] + + :param nodes: + The value to assign to the nodes property of this NodePool. + :type nodes: list[Node] + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'cluster_id': 'str', + 'name': 'str', + 'kubernetes_version': 'str', + 'node_image_id': 'str', + 'node_image_name': 'str', + 'node_shape': 'str', + 'initial_node_labels': 'list[KeyValue]', + 'ssh_public_key': 'str', + 'quantity_per_subnet': 'int', + 'subnet_ids': 'list[str]', + 'nodes': 'list[Node]' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'cluster_id': 'clusterId', + 'name': 'name', + 'kubernetes_version': 'kubernetesVersion', + 'node_image_id': 'nodeImageId', + 'node_image_name': 'nodeImageName', + 'node_shape': 'nodeShape', + 'initial_node_labels': 'initialNodeLabels', + 'ssh_public_key': 'sshPublicKey', + 'quantity_per_subnet': 'quantityPerSubnet', + 'subnet_ids': 'subnetIds', + 'nodes': 'nodes' + } + + self._id = None + self._compartment_id = None + self._cluster_id = None + self._name = None + self._kubernetes_version = None + self._node_image_id = None + self._node_image_name = None + self._node_shape = None + self._initial_node_labels = None + self._ssh_public_key = None + self._quantity_per_subnet = None + self._subnet_ids = None + self._nodes = None + + @property + def id(self): + """ + Gets the id of this NodePool. + The OCID of the node pool. + + + :return: The id of this NodePool. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this NodePool. + The OCID of the node pool. + + + :param id: The id of this NodePool. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + Gets the compartment_id of this NodePool. + The OCID of the compartment in which the node pool exists. + + + :return: The compartment_id of this NodePool. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this NodePool. + The OCID of the compartment in which the node pool exists. + + + :param compartment_id: The compartment_id of this NodePool. + :type: str + """ + self._compartment_id = compartment_id + + @property + def cluster_id(self): + """ + Gets the cluster_id of this NodePool. + The OCID of the cluster to which this node pool is attached. + + + :return: The cluster_id of this NodePool. + :rtype: str + """ + return self._cluster_id + + @cluster_id.setter + def cluster_id(self, cluster_id): + """ + Sets the cluster_id of this NodePool. + The OCID of the cluster to which this node pool is attached. + + + :param cluster_id: The cluster_id of this NodePool. + :type: str + """ + self._cluster_id = cluster_id + + @property + def name(self): + """ + Gets the name of this NodePool. + The name of the node pool. + + + :return: The name of this NodePool. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this NodePool. + The name of the node pool. + + + :param name: The name of this NodePool. + :type: str + """ + self._name = name + + @property + def kubernetes_version(self): + """ + Gets the kubernetes_version of this NodePool. + The version of Kubernetes running on the nodes in the node pool. + + + :return: The kubernetes_version of this NodePool. + :rtype: str + """ + return self._kubernetes_version + + @kubernetes_version.setter + def kubernetes_version(self, kubernetes_version): + """ + Sets the kubernetes_version of this NodePool. + The version of Kubernetes running on the nodes in the node pool. + + + :param kubernetes_version: The kubernetes_version of this NodePool. + :type: str + """ + self._kubernetes_version = kubernetes_version + + @property + def node_image_id(self): + """ + Gets the node_image_id of this NodePool. + The OCID of the image running on the nodes in the node pool. + + + :return: The node_image_id of this NodePool. + :rtype: str + """ + return self._node_image_id + + @node_image_id.setter + def node_image_id(self, node_image_id): + """ + Sets the node_image_id of this NodePool. + The OCID of the image running on the nodes in the node pool. + + + :param node_image_id: The node_image_id of this NodePool. + :type: str + """ + self._node_image_id = node_image_id + + @property + def node_image_name(self): + """ + Gets the node_image_name of this NodePool. + The name of the image running on the nodes in the node pool. + + + :return: The node_image_name of this NodePool. + :rtype: str + """ + return self._node_image_name + + @node_image_name.setter + def node_image_name(self, node_image_name): + """ + Sets the node_image_name of this NodePool. + The name of the image running on the nodes in the node pool. + + + :param node_image_name: The node_image_name of this NodePool. + :type: str + """ + self._node_image_name = node_image_name + + @property + def node_shape(self): + """ + Gets the node_shape of this NodePool. + The name of the node shape of the nodes in the node pool. + + + :return: The node_shape of this NodePool. + :rtype: str + """ + return self._node_shape + + @node_shape.setter + def node_shape(self, node_shape): + """ + Sets the node_shape of this NodePool. + The name of the node shape of the nodes in the node pool. + + + :param node_shape: The node_shape of this NodePool. + :type: str + """ + self._node_shape = node_shape + + @property + def initial_node_labels(self): + """ + Gets the initial_node_labels of this NodePool. + A list of key/value pairs to add to nodes after they join the Kubernetes cluster. + + + :return: The initial_node_labels of this NodePool. + :rtype: list[KeyValue] + """ + return self._initial_node_labels + + @initial_node_labels.setter + def initial_node_labels(self, initial_node_labels): + """ + Sets the initial_node_labels of this NodePool. + A list of key/value pairs to add to nodes after they join the Kubernetes cluster. + + + :param initial_node_labels: The initial_node_labels of this NodePool. + :type: list[KeyValue] + """ + self._initial_node_labels = initial_node_labels + + @property + def ssh_public_key(self): + """ + Gets the ssh_public_key of this NodePool. + The SSH public key on each node in the node pool. + + + :return: The ssh_public_key of this NodePool. + :rtype: str + """ + return self._ssh_public_key + + @ssh_public_key.setter + def ssh_public_key(self, ssh_public_key): + """ + Sets the ssh_public_key of this NodePool. + The SSH public key on each node in the node pool. + + + :param ssh_public_key: The ssh_public_key of this NodePool. + :type: str + """ + self._ssh_public_key = ssh_public_key + + @property + def quantity_per_subnet(self): + """ + Gets the quantity_per_subnet of this NodePool. + The number of nodes in each subnet. + + + :return: The quantity_per_subnet of this NodePool. + :rtype: int + """ + return self._quantity_per_subnet + + @quantity_per_subnet.setter + def quantity_per_subnet(self, quantity_per_subnet): + """ + Sets the quantity_per_subnet of this NodePool. + The number of nodes in each subnet. + + + :param quantity_per_subnet: The quantity_per_subnet of this NodePool. + :type: int + """ + self._quantity_per_subnet = quantity_per_subnet + + @property + def subnet_ids(self): + """ + Gets the subnet_ids of this NodePool. + The OCIDs of the subnets in which to place nodes for this node pool. + + + :return: The subnet_ids of this NodePool. + :rtype: list[str] + """ + return self._subnet_ids + + @subnet_ids.setter + def subnet_ids(self, subnet_ids): + """ + Sets the subnet_ids of this NodePool. + The OCIDs of the subnets in which to place nodes for this node pool. + + + :param subnet_ids: The subnet_ids of this NodePool. + :type: list[str] + """ + self._subnet_ids = subnet_ids + + @property + def nodes(self): + """ + Gets the nodes of this NodePool. + The nodes in the node pool. + + + :return: The nodes of this NodePool. + :rtype: list[Node] + """ + return self._nodes + + @nodes.setter + def nodes(self, nodes): + """ + Sets the nodes of this NodePool. + The nodes in the node pool. + + + :param nodes: The nodes of this NodePool. + :type: list[Node] + """ + self._nodes = nodes + + 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/container_engine/models/node_pool_options.py b/src/oci/container_engine/models/node_pool_options.py new file mode 100644 index 0000000000..e56979331b --- /dev/null +++ b/src/oci/container_engine/models/node_pool_options.py @@ -0,0 +1,131 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 NodePoolOptions(object): + """ + Options for creating or updating node pools. + """ + + def __init__(self, **kwargs): + """ + Initializes a new NodePoolOptions object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param kubernetes_versions: + The value to assign to the kubernetes_versions property of this NodePoolOptions. + :type kubernetes_versions: list[str] + + :param images: + The value to assign to the images property of this NodePoolOptions. + :type images: list[str] + + :param shapes: + The value to assign to the shapes property of this NodePoolOptions. + :type shapes: list[str] + + """ + self.swagger_types = { + 'kubernetes_versions': 'list[str]', + 'images': 'list[str]', + 'shapes': 'list[str]' + } + + self.attribute_map = { + 'kubernetes_versions': 'kubernetesVersions', + 'images': 'images', + 'shapes': 'shapes' + } + + self._kubernetes_versions = None + self._images = None + self._shapes = None + + @property + def kubernetes_versions(self): + """ + Gets the kubernetes_versions of this NodePoolOptions. + Available Kubernetes versions. + + + :return: The kubernetes_versions of this NodePoolOptions. + :rtype: list[str] + """ + return self._kubernetes_versions + + @kubernetes_versions.setter + def kubernetes_versions(self, kubernetes_versions): + """ + Sets the kubernetes_versions of this NodePoolOptions. + Available Kubernetes versions. + + + :param kubernetes_versions: The kubernetes_versions of this NodePoolOptions. + :type: list[str] + """ + self._kubernetes_versions = kubernetes_versions + + @property + def images(self): + """ + Gets the images of this NodePoolOptions. + Available Kubernetes versions. + + + :return: The images of this NodePoolOptions. + :rtype: list[str] + """ + return self._images + + @images.setter + def images(self, images): + """ + Sets the images of this NodePoolOptions. + Available Kubernetes versions. + + + :param images: The images of this NodePoolOptions. + :type: list[str] + """ + self._images = images + + @property + def shapes(self): + """ + Gets the shapes of this NodePoolOptions. + Available shapes for nodes. + + + :return: The shapes of this NodePoolOptions. + :rtype: list[str] + """ + return self._shapes + + @shapes.setter + def shapes(self, shapes): + """ + Sets the shapes of this NodePoolOptions. + Available shapes for nodes. + + + :param shapes: The shapes of this NodePoolOptions. + :type: list[str] + """ + self._shapes = shapes + + 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/container_engine/models/node_pool_summary.py b/src/oci/container_engine/models/node_pool_summary.py new file mode 100644 index 0000000000..b9947be208 --- /dev/null +++ b/src/oci/container_engine/models/node_pool_summary.py @@ -0,0 +1,410 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 NodePoolSummary(object): + """ + The properties that define a node pool summary. + """ + + def __init__(self, **kwargs): + """ + Initializes a new NodePoolSummary 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 NodePoolSummary. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this NodePoolSummary. + :type compartment_id: str + + :param cluster_id: + The value to assign to the cluster_id property of this NodePoolSummary. + :type cluster_id: str + + :param name: + The value to assign to the name property of this NodePoolSummary. + :type name: str + + :param kubernetes_version: + The value to assign to the kubernetes_version property of this NodePoolSummary. + :type kubernetes_version: str + + :param node_image_id: + The value to assign to the node_image_id property of this NodePoolSummary. + :type node_image_id: str + + :param node_image_name: + The value to assign to the node_image_name property of this NodePoolSummary. + :type node_image_name: str + + :param node_shape: + The value to assign to the node_shape property of this NodePoolSummary. + :type node_shape: str + + :param initial_node_labels: + The value to assign to the initial_node_labels property of this NodePoolSummary. + :type initial_node_labels: list[KeyValue] + + :param ssh_public_key: + The value to assign to the ssh_public_key property of this NodePoolSummary. + :type ssh_public_key: str + + :param quantity_per_subnet: + The value to assign to the quantity_per_subnet property of this NodePoolSummary. + :type quantity_per_subnet: int + + :param subnet_ids: + The value to assign to the subnet_ids property of this NodePoolSummary. + :type subnet_ids: list[str] + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'cluster_id': 'str', + 'name': 'str', + 'kubernetes_version': 'str', + 'node_image_id': 'str', + 'node_image_name': 'str', + 'node_shape': 'str', + 'initial_node_labels': 'list[KeyValue]', + 'ssh_public_key': 'str', + 'quantity_per_subnet': 'int', + 'subnet_ids': 'list[str]' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'cluster_id': 'clusterId', + 'name': 'name', + 'kubernetes_version': 'kubernetesVersion', + 'node_image_id': 'nodeImageId', + 'node_image_name': 'nodeImageName', + 'node_shape': 'nodeShape', + 'initial_node_labels': 'initialNodeLabels', + 'ssh_public_key': 'sshPublicKey', + 'quantity_per_subnet': 'quantityPerSubnet', + 'subnet_ids': 'subnetIds' + } + + self._id = None + self._compartment_id = None + self._cluster_id = None + self._name = None + self._kubernetes_version = None + self._node_image_id = None + self._node_image_name = None + self._node_shape = None + self._initial_node_labels = None + self._ssh_public_key = None + self._quantity_per_subnet = None + self._subnet_ids = None + + @property + def id(self): + """ + Gets the id of this NodePoolSummary. + The OCID of the node pool. + + + :return: The id of this NodePoolSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this NodePoolSummary. + The OCID of the node pool. + + + :param id: The id of this NodePoolSummary. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + Gets the compartment_id of this NodePoolSummary. + The OCID of the compartment in which the node pool exists. + + + :return: The compartment_id of this NodePoolSummary. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this NodePoolSummary. + The OCID of the compartment in which the node pool exists. + + + :param compartment_id: The compartment_id of this NodePoolSummary. + :type: str + """ + self._compartment_id = compartment_id + + @property + def cluster_id(self): + """ + Gets the cluster_id of this NodePoolSummary. + The OCID of the cluster to which this node pool is attached. + + + :return: The cluster_id of this NodePoolSummary. + :rtype: str + """ + return self._cluster_id + + @cluster_id.setter + def cluster_id(self, cluster_id): + """ + Sets the cluster_id of this NodePoolSummary. + The OCID of the cluster to which this node pool is attached. + + + :param cluster_id: The cluster_id of this NodePoolSummary. + :type: str + """ + self._cluster_id = cluster_id + + @property + def name(self): + """ + Gets the name of this NodePoolSummary. + The name of the node pool. + + + :return: The name of this NodePoolSummary. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this NodePoolSummary. + The name of the node pool. + + + :param name: The name of this NodePoolSummary. + :type: str + """ + self._name = name + + @property + def kubernetes_version(self): + """ + Gets the kubernetes_version of this NodePoolSummary. + The version of Kubernetes running on the nodes in the node pool. + + + :return: The kubernetes_version of this NodePoolSummary. + :rtype: str + """ + return self._kubernetes_version + + @kubernetes_version.setter + def kubernetes_version(self, kubernetes_version): + """ + Sets the kubernetes_version of this NodePoolSummary. + The version of Kubernetes running on the nodes in the node pool. + + + :param kubernetes_version: The kubernetes_version of this NodePoolSummary. + :type: str + """ + self._kubernetes_version = kubernetes_version + + @property + def node_image_id(self): + """ + Gets the node_image_id of this NodePoolSummary. + The OCID of the image running on the nodes in the node pool. + + + :return: The node_image_id of this NodePoolSummary. + :rtype: str + """ + return self._node_image_id + + @node_image_id.setter + def node_image_id(self, node_image_id): + """ + Sets the node_image_id of this NodePoolSummary. + The OCID of the image running on the nodes in the node pool. + + + :param node_image_id: The node_image_id of this NodePoolSummary. + :type: str + """ + self._node_image_id = node_image_id + + @property + def node_image_name(self): + """ + Gets the node_image_name of this NodePoolSummary. + The name of the image running on the nodes in the node pool. + + + :return: The node_image_name of this NodePoolSummary. + :rtype: str + """ + return self._node_image_name + + @node_image_name.setter + def node_image_name(self, node_image_name): + """ + Sets the node_image_name of this NodePoolSummary. + The name of the image running on the nodes in the node pool. + + + :param node_image_name: The node_image_name of this NodePoolSummary. + :type: str + """ + self._node_image_name = node_image_name + + @property + def node_shape(self): + """ + Gets the node_shape of this NodePoolSummary. + The name of the node shape of the nodes in the node pool. + + + :return: The node_shape of this NodePoolSummary. + :rtype: str + """ + return self._node_shape + + @node_shape.setter + def node_shape(self, node_shape): + """ + Sets the node_shape of this NodePoolSummary. + The name of the node shape of the nodes in the node pool. + + + :param node_shape: The node_shape of this NodePoolSummary. + :type: str + """ + self._node_shape = node_shape + + @property + def initial_node_labels(self): + """ + Gets the initial_node_labels of this NodePoolSummary. + A list of key/value pairs to add to nodes after they join the Kubernetes cluster. + + + :return: The initial_node_labels of this NodePoolSummary. + :rtype: list[KeyValue] + """ + return self._initial_node_labels + + @initial_node_labels.setter + def initial_node_labels(self, initial_node_labels): + """ + Sets the initial_node_labels of this NodePoolSummary. + A list of key/value pairs to add to nodes after they join the Kubernetes cluster. + + + :param initial_node_labels: The initial_node_labels of this NodePoolSummary. + :type: list[KeyValue] + """ + self._initial_node_labels = initial_node_labels + + @property + def ssh_public_key(self): + """ + Gets the ssh_public_key of this NodePoolSummary. + The SSH public key on each node in the node pool. + + + :return: The ssh_public_key of this NodePoolSummary. + :rtype: str + """ + return self._ssh_public_key + + @ssh_public_key.setter + def ssh_public_key(self, ssh_public_key): + """ + Sets the ssh_public_key of this NodePoolSummary. + The SSH public key on each node in the node pool. + + + :param ssh_public_key: The ssh_public_key of this NodePoolSummary. + :type: str + """ + self._ssh_public_key = ssh_public_key + + @property + def quantity_per_subnet(self): + """ + Gets the quantity_per_subnet of this NodePoolSummary. + The number of nodes in each subnet. + + + :return: The quantity_per_subnet of this NodePoolSummary. + :rtype: int + """ + return self._quantity_per_subnet + + @quantity_per_subnet.setter + def quantity_per_subnet(self, quantity_per_subnet): + """ + Sets the quantity_per_subnet of this NodePoolSummary. + The number of nodes in each subnet. + + + :param quantity_per_subnet: The quantity_per_subnet of this NodePoolSummary. + :type: int + """ + self._quantity_per_subnet = quantity_per_subnet + + @property + def subnet_ids(self): + """ + Gets the subnet_ids of this NodePoolSummary. + The OCIDs of the subnets in which to place nodes for this node pool. + + + :return: The subnet_ids of this NodePoolSummary. + :rtype: list[str] + """ + return self._subnet_ids + + @subnet_ids.setter + def subnet_ids(self, subnet_ids): + """ + Sets the subnet_ids of this NodePoolSummary. + The OCIDs of the subnets in which to place nodes for this node pool. + + + :param subnet_ids: The subnet_ids of this NodePoolSummary. + :type: list[str] + """ + self._subnet_ids = subnet_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/container_engine/models/update_cluster_details.py b/src/oci/container_engine/models/update_cluster_details.py new file mode 100644 index 0000000000..abfa6524cd --- /dev/null +++ b/src/oci/container_engine/models/update_cluster_details.py @@ -0,0 +1,100 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 UpdateClusterDetails(object): + """ + The properties that define a request to update a cluster. + """ + + def __init__(self, **kwargs): + """ + Initializes a new UpdateClusterDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param name: + The value to assign to the name property of this UpdateClusterDetails. + :type name: str + + :param kubernetes_version: + The value to assign to the kubernetes_version property of this UpdateClusterDetails. + :type kubernetes_version: str + + """ + self.swagger_types = { + 'name': 'str', + 'kubernetes_version': 'str' + } + + self.attribute_map = { + 'name': 'name', + 'kubernetes_version': 'kubernetesVersion' + } + + self._name = None + self._kubernetes_version = None + + @property + def name(self): + """ + Gets the name of this UpdateClusterDetails. + The new name for the cluster. Avoid entering confidential information. + + + :return: The name of this UpdateClusterDetails. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this UpdateClusterDetails. + The new name for the cluster. Avoid entering confidential information. + + + :param name: The name of this UpdateClusterDetails. + :type: str + """ + self._name = name + + @property + def kubernetes_version(self): + """ + Gets the kubernetes_version of this UpdateClusterDetails. + The version of Kubernetes to which the cluster masters should be upgraded. + + + :return: The kubernetes_version of this UpdateClusterDetails. + :rtype: str + """ + return self._kubernetes_version + + @kubernetes_version.setter + def kubernetes_version(self, kubernetes_version): + """ + Sets the kubernetes_version of this UpdateClusterDetails. + The version of Kubernetes to which the cluster masters should be upgraded. + + + :param kubernetes_version: The kubernetes_version of this UpdateClusterDetails. + :type: str + """ + self._kubernetes_version = kubernetes_version + + 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/container_engine/models/update_node_pool_details.py b/src/oci/container_engine/models/update_node_pool_details.py new file mode 100644 index 0000000000..e2c7754a87 --- /dev/null +++ b/src/oci/container_engine/models/update_node_pool_details.py @@ -0,0 +1,193 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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 UpdateNodePoolDetails(object): + """ + The properties that define a request to update a node pool. + """ + + def __init__(self, **kwargs): + """ + Initializes a new UpdateNodePoolDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param name: + The value to assign to the name property of this UpdateNodePoolDetails. + :type name: str + + :param kubernetes_version: + The value to assign to the kubernetes_version property of this UpdateNodePoolDetails. + :type kubernetes_version: str + + :param quantity_per_subnet: + The value to assign to the quantity_per_subnet property of this UpdateNodePoolDetails. + :type quantity_per_subnet: int + + :param initial_node_labels: + The value to assign to the initial_node_labels property of this UpdateNodePoolDetails. + :type initial_node_labels: list[KeyValue] + + :param subnet_ids: + The value to assign to the subnet_ids property of this UpdateNodePoolDetails. + :type subnet_ids: list[str] + + """ + self.swagger_types = { + 'name': 'str', + 'kubernetes_version': 'str', + 'quantity_per_subnet': 'int', + 'initial_node_labels': 'list[KeyValue]', + 'subnet_ids': 'list[str]' + } + + self.attribute_map = { + 'name': 'name', + 'kubernetes_version': 'kubernetesVersion', + 'quantity_per_subnet': 'quantityPerSubnet', + 'initial_node_labels': 'initialNodeLabels', + 'subnet_ids': 'subnetIds' + } + + self._name = None + self._kubernetes_version = None + self._quantity_per_subnet = None + self._initial_node_labels = None + self._subnet_ids = None + + @property + def name(self): + """ + Gets the name of this UpdateNodePoolDetails. + The new name for the cluster. Avoid entering confidential information. + + + :return: The name of this UpdateNodePoolDetails. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this UpdateNodePoolDetails. + The new name for the cluster. Avoid entering confidential information. + + + :param name: The name of this UpdateNodePoolDetails. + :type: str + """ + self._name = name + + @property + def kubernetes_version(self): + """ + Gets the kubernetes_version of this UpdateNodePoolDetails. + The version of Kubernetes to which the nodes in the node pool should be upgraded. + + + :return: The kubernetes_version of this UpdateNodePoolDetails. + :rtype: str + """ + return self._kubernetes_version + + @kubernetes_version.setter + def kubernetes_version(self, kubernetes_version): + """ + Sets the kubernetes_version of this UpdateNodePoolDetails. + The version of Kubernetes to which the nodes in the node pool should be upgraded. + + + :param kubernetes_version: The kubernetes_version of this UpdateNodePoolDetails. + :type: str + """ + self._kubernetes_version = kubernetes_version + + @property + def quantity_per_subnet(self): + """ + Gets the quantity_per_subnet of this UpdateNodePoolDetails. + The number of nodes to ensure in each subnet. + + + :return: The quantity_per_subnet of this UpdateNodePoolDetails. + :rtype: int + """ + return self._quantity_per_subnet + + @quantity_per_subnet.setter + def quantity_per_subnet(self, quantity_per_subnet): + """ + Sets the quantity_per_subnet of this UpdateNodePoolDetails. + The number of nodes to ensure in each subnet. + + + :param quantity_per_subnet: The quantity_per_subnet of this UpdateNodePoolDetails. + :type: int + """ + self._quantity_per_subnet = quantity_per_subnet + + @property + def initial_node_labels(self): + """ + Gets the initial_node_labels of this UpdateNodePoolDetails. + A list of key/value pairs to add to nodes after they join the Kubernetes cluster. + + + :return: The initial_node_labels of this UpdateNodePoolDetails. + :rtype: list[KeyValue] + """ + return self._initial_node_labels + + @initial_node_labels.setter + def initial_node_labels(self, initial_node_labels): + """ + Sets the initial_node_labels of this UpdateNodePoolDetails. + A list of key/value pairs to add to nodes after they join the Kubernetes cluster. + + + :param initial_node_labels: The initial_node_labels of this UpdateNodePoolDetails. + :type: list[KeyValue] + """ + self._initial_node_labels = initial_node_labels + + @property + def subnet_ids(self): + """ + Gets the subnet_ids of this UpdateNodePoolDetails. + The OCIDs of the subnets in which to place nodes for this node pool. + + + :return: The subnet_ids of this UpdateNodePoolDetails. + :rtype: list[str] + """ + return self._subnet_ids + + @subnet_ids.setter + def subnet_ids(self, subnet_ids): + """ + Sets the subnet_ids of this UpdateNodePoolDetails. + The OCIDs of the subnets in which to place nodes for this node pool. + + + :param subnet_ids: The subnet_ids of this UpdateNodePoolDetails. + :type: list[str] + """ + self._subnet_ids = subnet_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/container_engine/models/work_request.py b/src/oci/container_engine/models/work_request.py new file mode 100644 index 0000000000..d072a2e5a7 --- /dev/null +++ b/src/oci/container_engine/models/work_request.py @@ -0,0 +1,354 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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): + """ + An asynchronous work request. + """ + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "CLUSTER_CREATE" + OPERATION_TYPE_CLUSTER_CREATE = "CLUSTER_CREATE" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "CLUSTER_UPDATE" + OPERATION_TYPE_CLUSTER_UPDATE = "CLUSTER_UPDATE" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "CLUSTER_DELETE" + OPERATION_TYPE_CLUSTER_DELETE = "CLUSTER_DELETE" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "NODEPOOL_CREATE" + OPERATION_TYPE_NODEPOOL_CREATE = "NODEPOOL_CREATE" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "NODEPOOL_UPDATE" + OPERATION_TYPE_NODEPOOL_UPDATE = "NODEPOOL_UPDATE" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "NODEPOOL_DELETE" + OPERATION_TYPE_NODEPOOL_DELETE = "NODEPOOL_DELETE" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "WORKREQUEST_CANCEL" + OPERATION_TYPE_WORKREQUEST_CANCEL = "WORKREQUEST_CANCEL" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "ACCEPTED" + STATUS_ACCEPTED = "ACCEPTED" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "IN_PROGRESS" + STATUS_IN_PROGRESS = "IN_PROGRESS" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "FAILED" + STATUS_FAILED = "FAILED" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "SUCCEEDED" + STATUS_SUCCEEDED = "SUCCEEDED" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "CANCELING" + STATUS_CANCELING = "CANCELING" + + #: A constant which can be used with the status property of a WorkRequest. + #: This constant has a value of "CANCELED" + STATUS_CANCELED = "CANCELED" + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequest object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this WorkRequest. + :type id: str + + :param operation_type: + The value to assign to the operation_type property of this WorkRequest. + Allowed values for this property are: "CLUSTER_CREATE", "CLUSTER_UPDATE", "CLUSTER_DELETE", "NODEPOOL_CREATE", "NODEPOOL_UPDATE", "NODEPOOL_DELETE", "WORKREQUEST_CANCEL", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type operation_type: str + + :param status: + The value to assign to the status property of this WorkRequest. + Allowed values for this property are: "ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param compartment_id: + The value to assign to the compartment_id property of this WorkRequest. + :type compartment_id: str + + :param resources: + The value to assign to the resources property of this WorkRequest. + :type resources: list[WorkRequestResource] + + :param 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 = { + 'id': 'str', + 'operation_type': 'str', + 'status': 'str', + 'compartment_id': 'str', + 'resources': 'list[WorkRequestResource]', + 'time_accepted': 'datetime', + 'time_started': 'datetime', + 'time_finished': 'datetime' + } + + self.attribute_map = { + 'id': 'id', + 'operation_type': 'operationType', + 'status': 'status', + 'compartment_id': 'compartmentId', + 'resources': 'resources', + 'time_accepted': 'timeAccepted', + 'time_started': 'timeStarted', + 'time_finished': 'timeFinished' + } + + self._id = None + self._operation_type = None + self._status = None + self._compartment_id = None + self._resources = None + self._time_accepted = None + self._time_started = None + self._time_finished = None + + @property + def id(self): + """ + Gets the id of this WorkRequest. + The OCID of the work request. + + + :return: The id of this WorkRequest. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this WorkRequest. + The OCID of the work request. + + + :param id: The id of this WorkRequest. + :type: str + """ + self._id = id + + @property + def operation_type(self): + """ + Gets the operation_type of this WorkRequest. + The type of work the work request is doing. + + Allowed values for this property are: "CLUSTER_CREATE", "CLUSTER_UPDATE", "CLUSTER_DELETE", "NODEPOOL_CREATE", "NODEPOOL_UPDATE", "NODEPOOL_DELETE", "WORKREQUEST_CANCEL", '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. + The type of work the work request is doing. + + + :param operation_type: The operation_type of this WorkRequest. + :type: str + """ + allowed_values = ["CLUSTER_CREATE", "CLUSTER_UPDATE", "CLUSTER_DELETE", "NODEPOOL_CREATE", "NODEPOOL_UPDATE", "NODEPOOL_DELETE", "WORKREQUEST_CANCEL"] + 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): + """ + Gets the status of this WorkRequest. + The current status of the work request. + + Allowed values for this property are: "ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this WorkRequest. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this WorkRequest. + The current status of the work request. + + + :param status: The status of this WorkRequest. + :type: str + """ + allowed_values = ["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def compartment_id(self): + """ + Gets the compartment_id of this WorkRequest. + The OCID of the compartment in which the work request exists. + + + :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 in which the work request exists. + + + :param compartment_id: The compartment_id of this WorkRequest. + :type: str + """ + self._compartment_id = compartment_id + + @property + def resources(self): + """ + Gets the resources of this WorkRequest. + The resources this work request affects. + + + :return: The resources of this WorkRequest. + :rtype: list[WorkRequestResource] + """ + return self._resources + + @resources.setter + def resources(self, resources): + """ + Sets the resources of this WorkRequest. + The resources this work request affects. + + + :param resources: The resources of this WorkRequest. + :type: list[WorkRequestResource] + """ + self._resources = resources + + @property + def time_accepted(self): + """ + Gets the time_accepted of this WorkRequest. + The time the work request was accepted. + + + :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 time the work request was accepted. + + + :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 time the work request was started. + + + :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 time the work request was started. + + + :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 time the work request was finished. + + + :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 time the work request was finished. + + + :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/container_engine/models/work_request_error.py b/src/oci/container_engine/models/work_request_error.py new file mode 100644 index 0000000000..f699f14b09 --- /dev/null +++ b/src/oci/container_engine/models/work_request_error.py @@ -0,0 +1,135 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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): + """ + Errors related to a specific 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 short error code that defines the error, meant for programmatic parsing. See `API Errors`__. + + __ https://docs.us-phoenix-1.oraclecloud.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 short error code that defines the error, meant for programmatic parsing. See `API Errors`__. + + __ https://docs.us-phoenix-1.oraclecloud.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 error string. + + + :return: The message of this WorkRequestError. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """ + Sets the message of this WorkRequestError. + A human-readable error string. + + + :param message: The message of this WorkRequestError. + :type: str + """ + self._message = message + + @property + def timestamp(self): + """ + **[Required]** Gets the timestamp of this WorkRequestError. + The date and time the error occurred. + + + :return: The timestamp of this WorkRequestError. + :rtype: datetime + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """ + Sets the timestamp of this WorkRequestError. + The date and time the error occurred. + + + :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/container_engine/models/work_request_log_entry.py b/src/oci/container_engine/models/work_request_log_entry.py new file mode 100644 index 0000000000..67eeced9a3 --- /dev/null +++ b/src/oci/container_engine/models/work_request_log_entry.py @@ -0,0 +1,100 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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): + """ + Log entries related to a specific 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: str + + """ + self.swagger_types = { + 'message': 'str', + 'timestamp': 'str' + } + + self.attribute_map = { + 'message': 'message', + 'timestamp': 'timestamp' + } + + self._message = None + self._timestamp = None + + @property + def message(self): + """ + Gets the message of this WorkRequestLogEntry. + The description of an action that occurred. + + + :return: The message of this WorkRequestLogEntry. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """ + Sets the message of this WorkRequestLogEntry. + The description of an action that occurred. + + + :param message: The message of this WorkRequestLogEntry. + :type: str + """ + self._message = message + + @property + def timestamp(self): + """ + Gets the timestamp of this WorkRequestLogEntry. + The date and time the log entry occurred. + + + :return: The timestamp of this WorkRequestLogEntry. + :rtype: str + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """ + Sets the timestamp of this WorkRequestLogEntry. + The date and time the log entry occurred. + + + :param timestamp: The timestamp of this WorkRequestLogEntry. + :type: str + """ + 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/container_engine/models/work_request_resource.py b/src/oci/container_engine/models/work_request_resource.py new file mode 100644 index 0000000000..7afedab883 --- /dev/null +++ b/src/oci/container_engine/models/work_request_resource.py @@ -0,0 +1,194 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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): + """ + The properties that define a work request resource. + """ + + #: 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 "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 "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 "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 action_type: + The value to assign to the action_type property of this WorkRequestResource. + Allowed values for this property are: "CREATED", "UPDATED", "DELETED", "RELATED", "IN_PROGRESS", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type action_type: str + + :param entity_type: + The value to assign to the entity_type property of this WorkRequestResource. + :type entity_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 = { + 'action_type': 'str', + 'entity_type': 'str', + 'identifier': 'str', + 'entity_uri': 'str' + } + + self.attribute_map = { + 'action_type': 'actionType', + 'entity_type': 'entityType', + 'identifier': 'identifier', + 'entity_uri': 'entityUri' + } + + self._action_type = None + self._entity_type = None + self._identifier = None + self._entity_uri = None + + @property + def action_type(self): + """ + Gets the action_type of this WorkRequestResource. + The way in which this resource was affected by the work tracked by the work request. + + Allowed values for this property are: "CREATED", "UPDATED", "DELETED", "RELATED", "IN_PROGRESS", "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 was affected by the work tracked by the work request. + + + :param action_type: The action_type of this WorkRequestResource. + :type: str + """ + allowed_values = ["CREATED", "UPDATED", "DELETED", "RELATED", "IN_PROGRESS", "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 entity_type(self): + """ + 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 identifier(self): + """ + Gets the identifier of this WorkRequestResource. + The OCID 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 OCID 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 on which the user can issue a GET request 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 on which the user can issue a GET request 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/container_engine/models/work_request_summary.py b/src/oci/container_engine/models/work_request_summary.py new file mode 100644 index 0000000000..3654dd097e --- /dev/null +++ b/src/oci/container_engine/models/work_request_summary.py @@ -0,0 +1,354 @@ +# coding: utf-8 +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + + +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): + """ + The properties that define a work request summary. + """ + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "CLUSTER_CREATE" + OPERATION_TYPE_CLUSTER_CREATE = "CLUSTER_CREATE" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "CLUSTER_UPDATE" + OPERATION_TYPE_CLUSTER_UPDATE = "CLUSTER_UPDATE" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "CLUSTER_DELETE" + OPERATION_TYPE_CLUSTER_DELETE = "CLUSTER_DELETE" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "NODEPOOL_CREATE" + OPERATION_TYPE_NODEPOOL_CREATE = "NODEPOOL_CREATE" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "NODEPOOL_UPDATE" + OPERATION_TYPE_NODEPOOL_UPDATE = "NODEPOOL_UPDATE" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "NODEPOOL_DELETE" + OPERATION_TYPE_NODEPOOL_DELETE = "NODEPOOL_DELETE" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "WORKREQUEST_CANCEL" + OPERATION_TYPE_WORKREQUEST_CANCEL = "WORKREQUEST_CANCEL" + + #: A constant which can be used with the status property of a WorkRequestSummary. + #: This constant has a value of "ACCEPTED" + STATUS_ACCEPTED = "ACCEPTED" + + #: A constant which can be used with the status property of a WorkRequestSummary. + #: This constant has a value of "IN_PROGRESS" + STATUS_IN_PROGRESS = "IN_PROGRESS" + + #: A constant which can be used with the status property of a WorkRequestSummary. + #: This constant has a value of "FAILED" + STATUS_FAILED = "FAILED" + + #: A constant which can be used with the status property of a WorkRequestSummary. + #: This constant has a value of "SUCCEEDED" + STATUS_SUCCEEDED = "SUCCEEDED" + + #: A constant which can be used with the status property of a WorkRequestSummary. + #: This constant has a value of "CANCELING" + STATUS_CANCELING = "CANCELING" + + #: A constant which can be used with the status property of a WorkRequestSummary. + #: This constant has a value of "CANCELED" + STATUS_CANCELED = "CANCELED" + + def __init__(self, **kwargs): + """ + Initializes a new WorkRequestSummary object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this WorkRequestSummary. + :type id: str + + :param operation_type: + The value to assign to the operation_type property of this WorkRequestSummary. + Allowed values for this property are: "CLUSTER_CREATE", "CLUSTER_UPDATE", "CLUSTER_DELETE", "NODEPOOL_CREATE", "NODEPOOL_UPDATE", "NODEPOOL_DELETE", "WORKREQUEST_CANCEL", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type operation_type: str + + :param status: + The value to assign to the status property of this WorkRequestSummary. + Allowed values for this property are: "ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type status: str + + :param compartment_id: + The value to assign to the compartment_id property of this WorkRequestSummary. + :type compartment_id: str + + :param resources: + The value to assign to the resources property of this WorkRequestSummary. + :type resources: list[WorkRequestResource] + + :param 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 = { + 'id': 'str', + 'operation_type': 'str', + 'status': 'str', + 'compartment_id': 'str', + 'resources': 'list[WorkRequestResource]', + 'time_accepted': 'datetime', + 'time_started': 'datetime', + 'time_finished': 'datetime' + } + + self.attribute_map = { + 'id': 'id', + 'operation_type': 'operationType', + 'status': 'status', + 'compartment_id': 'compartmentId', + 'resources': 'resources', + 'time_accepted': 'timeAccepted', + 'time_started': 'timeStarted', + 'time_finished': 'timeFinished' + } + + self._id = None + self._operation_type = None + self._status = None + self._compartment_id = None + self._resources = None + self._time_accepted = None + self._time_started = None + self._time_finished = None + + @property + def id(self): + """ + Gets the id of this WorkRequestSummary. + The OCID 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 OCID of the work request. + + + :param id: The id of this WorkRequestSummary. + :type: str + """ + self._id = id + + @property + def operation_type(self): + """ + Gets the operation_type of this WorkRequestSummary. + The type of work the work request is doing. + + Allowed values for this property are: "CLUSTER_CREATE", "CLUSTER_UPDATE", "CLUSTER_DELETE", "NODEPOOL_CREATE", "NODEPOOL_UPDATE", "NODEPOOL_DELETE", "WORKREQUEST_CANCEL", '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. + The type of work the work request is doing. + + + :param operation_type: The operation_type of this WorkRequestSummary. + :type: str + """ + allowed_values = ["CLUSTER_CREATE", "CLUSTER_UPDATE", "CLUSTER_DELETE", "NODEPOOL_CREATE", "NODEPOOL_UPDATE", "NODEPOOL_DELETE", "WORKREQUEST_CANCEL"] + 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): + """ + Gets the status of this WorkRequestSummary. + The current status of the work request. + + Allowed values for this property are: "ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The status of this WorkRequestSummary. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this WorkRequestSummary. + The current status of the work request. + + + :param status: The status of this WorkRequestSummary. + :type: str + """ + allowed_values = ["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"] + if not value_allowed_none_or_none_sentinel(status, allowed_values): + status = 'UNKNOWN_ENUM_VALUE' + self._status = status + + @property + def compartment_id(self): + """ + Gets the compartment_id of this WorkRequestSummary. + The OCID of the compartment in which the work request exists. + + + :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 in which the work request exists. + + + :param compartment_id: The compartment_id of this WorkRequestSummary. + :type: str + """ + self._compartment_id = compartment_id + + @property + def resources(self): + """ + Gets the resources of this WorkRequestSummary. + The resources this work request affects. + + + :return: The resources of this WorkRequestSummary. + :rtype: list[WorkRequestResource] + """ + return self._resources + + @resources.setter + def resources(self, resources): + """ + Sets the resources of this WorkRequestSummary. + The resources this work request affects. + + + :param resources: The resources of this WorkRequestSummary. + :type: list[WorkRequestResource] + """ + self._resources = resources + + @property + def time_accepted(self): + """ + Gets the time_accepted of this WorkRequestSummary. + The time the work request was accepted. + + + :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 time the work request was accepted. + + + :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 time the work request was started. + + + :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 time the work request was started. + + + :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 time the work request was finished. + + + :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 time the work request was finished. + + + :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/service_endpoints.py b/src/oci/service_endpoints.py index 18ab5fad28..84477bf917 100644 --- a/src/oci/service_endpoints.py +++ b/src/oci/service_endpoints.py @@ -3,6 +3,7 @@ SERVICE_ENDPOINTS = { "audit": "https://audit.{domain}/20160918", + "container_engine": "https://containerengine.{domain}", "blockstorage": "https://iaas.{domain}/20160918", "compute": "https://iaas.{domain}/20160918", "virtual_network": "https://iaas.{domain}/20160918", diff --git a/src/oci/version.py b/src/oci/version.py index d74530f2a4..5cbaa0100e 100644 --- a/src/oci/version.py +++ b/src/oci/version.py @@ -1,4 +1,4 @@ # coding: utf-8 # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. -__version__ = "1.4.1" +__version__ = "1.4.3" diff --git a/tests/conftest.py b/tests/conftest.py index ac6cdd7538..394260b90c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -90,6 +90,13 @@ def compute(config): return client +@pytest.fixture +def container_engine(config): + client = oci.container_engine.ContainerEngineClient(config) + add_retries_to_service_operations(client) + return client + + @pytest.fixture def virtual_network(config): client = oci.core.VirtualNetworkClient(config)