From 0926bc0c07fee4eee5f454a243f04b3a8a1f6edf Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 2 Oct 2017 12:33:04 -0400 Subject: [PATCH] Bump version, regen modules --- openshift/README.md | 3 +- openshift/__init__.py | 2 +- openshift/client/__init__.py | 1 + openshift/client/models/__init__.py | 1 + openshift/client/models/v1_cluster_network.py | 34 +++- .../client/models/v1_cluster_network_entry.py | 147 ++++++++++++++++++ openshift/client/models/v1_host_subnet.py | 30 +++- openshift/client/models/v1_net_namespace.py | 28 +++- openshift/docs/V1ClusterNetwork.md | 5 +- openshift/docs/V1ClusterNetworkEntry.md | 11 ++ openshift/docs/V1HostSubnet.md | 1 + openshift/docs/V1NetNamespace.md | 1 + .../test/test_v1_cluster_network_entry.py | 42 +++++ scripts/constants.py | 4 +- scripts/swagger.json | 47 +++++- setup.py | 3 +- 16 files changed, 342 insertions(+), 18 deletions(-) create mode 100644 openshift/client/models/v1_cluster_network_entry.py create mode 100644 openshift/docs/V1ClusterNetworkEntry.md create mode 100644 openshift/test/test_v1_cluster_network_entry.py diff --git a/openshift/README.md b/openshift/README.md index 2f791fc0..552ff4d8 100644 --- a/openshift/README.md +++ b/openshift/README.md @@ -4,7 +4,7 @@ OpenShift provides builds, application lifecycle, image content management, and This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: latest -- Package version: 0.3.0 +- Package version: 0.3.1 - Build package: io.swagger.codegen.languages.PythonClientCodegen ## Requirements. @@ -1270,6 +1270,7 @@ Class | Method | HTTP request | Description - [V1CephFSVolumeSource](docs/V1CephFSVolumeSource.md) - [V1CinderVolumeSource](docs/V1CinderVolumeSource.md) - [V1ClusterNetwork](docs/V1ClusterNetwork.md) + - [V1ClusterNetworkEntry](docs/V1ClusterNetworkEntry.md) - [V1ClusterNetworkList](docs/V1ClusterNetworkList.md) - [V1ClusterResourceQuota](docs/V1ClusterResourceQuota.md) - [V1ClusterResourceQuotaList](docs/V1ClusterResourceQuotaList.md) diff --git a/openshift/__init__.py b/openshift/__init__.py index ab6a3269..f975f72c 100644 --- a/openshift/__init__.py +++ b/openshift/__init__.py @@ -18,5 +18,5 @@ # Do not edit these constants. They will be updated automatically # by scripts/update-client.sh. -__version__ = "0.3.0" +__version__ = "0.3.1" __k8s_client_version__ = "3.0.0" diff --git a/openshift/client/__init__.py b/openshift/client/__init__.py index 1ee027f2..f146252e 100644 --- a/openshift/client/__init__.py +++ b/openshift/client/__init__.py @@ -41,6 +41,7 @@ from .models.v1_build_trigger_cause import V1BuildTriggerCause from .models.v1_build_trigger_policy import V1BuildTriggerPolicy from .models.v1_cluster_network import V1ClusterNetwork +from .models.v1_cluster_network_entry import V1ClusterNetworkEntry from .models.v1_cluster_network_list import V1ClusterNetworkList from .models.v1_cluster_resource_quota import V1ClusterResourceQuota from .models.v1_cluster_resource_quota_list import V1ClusterResourceQuotaList diff --git a/openshift/client/models/__init__.py b/openshift/client/models/__init__.py index bcf2005b..0aca449e 100644 --- a/openshift/client/models/__init__.py +++ b/openshift/client/models/__init__.py @@ -41,6 +41,7 @@ from .v1_build_trigger_cause import V1BuildTriggerCause from .v1_build_trigger_policy import V1BuildTriggerPolicy from .v1_cluster_network import V1ClusterNetwork +from .v1_cluster_network_entry import V1ClusterNetworkEntry from .v1_cluster_network_list import V1ClusterNetworkList from .v1_cluster_resource_quota import V1ClusterResourceQuota from .v1_cluster_resource_quota_list import V1ClusterResourceQuotaList diff --git a/openshift/client/models/v1_cluster_network.py b/openshift/client/models/v1_cluster_network.py index 4bbce263..82aa38c3 100644 --- a/openshift/client/models/v1_cluster_network.py +++ b/openshift/client/models/v1_cluster_network.py @@ -21,7 +21,7 @@ class V1ClusterNetwork(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - def __init__(self, api_version=None, hostsubnetlength=None, kind=None, metadata=None, network=None, plugin_name=None, service_network=None): + def __init__(self, api_version=None, cluster_networks=None, hostsubnetlength=None, kind=None, metadata=None, network=None, plugin_name=None, service_network=None): """ V1ClusterNetwork - a model defined in Swagger @@ -32,6 +32,7 @@ def __init__(self, api_version=None, hostsubnetlength=None, kind=None, metadata= """ self.swagger_types = { 'api_version': 'str', + 'cluster_networks': 'list[V1ClusterNetworkEntry]', 'hostsubnetlength': 'int', 'kind': 'str', 'metadata': 'V1ObjectMeta', @@ -42,6 +43,7 @@ def __init__(self, api_version=None, hostsubnetlength=None, kind=None, metadata= self.attribute_map = { 'api_version': 'apiVersion', + 'cluster_networks': 'clusterNetworks', 'hostsubnetlength': 'hostsubnetlength', 'kind': 'kind', 'metadata': 'metadata', @@ -51,6 +53,7 @@ def __init__(self, api_version=None, hostsubnetlength=None, kind=None, metadata= } self._api_version = api_version + self._cluster_networks = cluster_networks self._hostsubnetlength = hostsubnetlength self._kind = kind self._metadata = metadata @@ -81,6 +84,31 @@ def api_version(self, api_version): self._api_version = api_version + @property + def cluster_networks(self): + """ + Gets the cluster_networks of this V1ClusterNetwork. + ClusterNetworks is a list of ClusterNetwork objects that defines the global overlay network's L3 space by specifying a set of CIDR and netmasks that the SDN can allocate addressed from. + + :return: The cluster_networks of this V1ClusterNetwork. + :rtype: list[V1ClusterNetworkEntry] + """ + return self._cluster_networks + + @cluster_networks.setter + def cluster_networks(self, cluster_networks): + """ + Sets the cluster_networks of this V1ClusterNetwork. + ClusterNetworks is a list of ClusterNetwork objects that defines the global overlay network's L3 space by specifying a set of CIDR and netmasks that the SDN can allocate addressed from. + + :param cluster_networks: The cluster_networks of this V1ClusterNetwork. + :type: list[V1ClusterNetworkEntry] + """ + if cluster_networks is None: + raise ValueError("Invalid value for `cluster_networks`, must not be `None`") + + self._cluster_networks = cluster_networks + @property def hostsubnetlength(self): """ @@ -101,8 +129,6 @@ def hostsubnetlength(self, hostsubnetlength): :param hostsubnetlength: The hostsubnetlength of this V1ClusterNetwork. :type: int """ - if hostsubnetlength is None: - raise ValueError("Invalid value for `hostsubnetlength`, must not be `None`") self._hostsubnetlength = hostsubnetlength @@ -172,8 +198,6 @@ def network(self, network): :param network: The network of this V1ClusterNetwork. :type: str """ - if network is None: - raise ValueError("Invalid value for `network`, must not be `None`") self._network = network diff --git a/openshift/client/models/v1_cluster_network_entry.py b/openshift/client/models/v1_cluster_network_entry.py new file mode 100644 index 00000000..05b830e8 --- /dev/null +++ b/openshift/client/models/v1_cluster_network_entry.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + OpenShift API (with Kubernetes) + + OpenShift provides builds, application lifecycle, image content management, and administrative policy on top of Kubernetes. The API allows consistent management of those objects. All API operations are authenticated via an Authorization bearer token that is provided for service accounts as a generated secret (in JWT form) or via the native OAuth endpoint located at /oauth/authorize. Core infrastructure components may use client certificates that require no authentication. All API operations return a 'resourceVersion' string that represents the version of the object in the underlying storage. The standard LIST operation performs a snapshot read of the underlying objects, returning a resourceVersion representing a consistent version of the listed objects. The WATCH operation allows all updates to a set of objects after the provided resourceVersion to be observed by a client. By listing and beginning a watch from the returned resourceVersion, clients may observe a consistent view of the state of one or more objects. Note that WATCH always returns the update after the provided resourceVersion. Watch may be extended a limited time in the past - using etcd 2 the watch window is 1000 events (which on a large cluster may only be a few tens of seconds) so clients must explicitly handle the \"watch to old error\" by re-listing. Objects are divided into two rough categories - those that have a lifecycle and must reflect the state of the cluster, and those that have no state. Objects with lifecycle typically have three main sections: * 'metadata' common to all objects * a 'spec' that represents the desired state * a 'status' that represents how much of the desired state is reflected on the cluster at the current time Objects that have no state have 'metadata' but may lack a 'spec' or 'status' section. Objects are divided into those that are namespace scoped (only exist inside of a namespace) and those that are cluster scoped (exist outside of a namespace). A namespace scoped resource will be deleted when the namespace is deleted and cannot be created if the namespace has not yet been created or is in the process of deletion. Cluster scoped resources are typically only accessible to admins - resources like nodes, persistent volumes, and cluster policy. All objects have a schema that is a combination of the 'kind' and 'apiVersion' fields. This schema is additive only for any given version - no backwards incompatible changes are allowed without incrementing the apiVersion. The server will return and accept a number of standard responses that share a common schema - for instance, the common error type is 'metav1.Status' (described below) and will be returned on any error from the API server. The API is available in multiple serialization formats - the default is JSON (Accept: application/json and Content-Type: application/json) but clients may also use YAML (application/yaml) or the native Protobuf schema (application/vnd.kubernetes.protobuf). Note that the format of the WATCH API call is slightly different - for JSON it returns newline delimited objects while for Protobuf it returns length-delimited frames (4 bytes in network-order) that contain a 'versioned.Watch' Protobuf object. See the OpenShift documentation at https://docs.openshift.org for more information. + + OpenAPI spec version: latest + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class V1ClusterNetworkEntry(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + def __init__(self, cidr=None, host_subnet_length=None): + """ + V1ClusterNetworkEntry - a model defined in Swagger + + :param dict swaggerTypes: The key is attribute name + and the value is attribute type. + :param dict attributeMap: The key is attribute name + and the value is json key in definition. + """ + self.swagger_types = { + 'cidr': 'str', + 'host_subnet_length': 'int' + } + + self.attribute_map = { + 'cidr': 'CIDR', + 'host_subnet_length': 'hostSubnetLength' + } + + self._cidr = cidr + self._host_subnet_length = host_subnet_length + + @property + def cidr(self): + """ + Gets the cidr of this V1ClusterNetworkEntry. + CIDR defines the total range of a cluster networks address space. + + :return: The cidr of this V1ClusterNetworkEntry. + :rtype: str + """ + return self._cidr + + @cidr.setter + def cidr(self, cidr): + """ + Sets the cidr of this V1ClusterNetworkEntry. + CIDR defines the total range of a cluster networks address space. + + :param cidr: The cidr of this V1ClusterNetworkEntry. + :type: str + """ + if cidr is None: + raise ValueError("Invalid value for `cidr`, must not be `None`") + + self._cidr = cidr + + @property + def host_subnet_length(self): + """ + Gets the host_subnet_length of this V1ClusterNetworkEntry. + HostSubnetLength is the number of bits of the accompanying CIDR address to allocate to each node. eg, 8 would mean that each node would have a /24 slice of the overlay network for its pods. + + :return: The host_subnet_length of this V1ClusterNetworkEntry. + :rtype: int + """ + return self._host_subnet_length + + @host_subnet_length.setter + def host_subnet_length(self, host_subnet_length): + """ + Sets the host_subnet_length of this V1ClusterNetworkEntry. + HostSubnetLength is the number of bits of the accompanying CIDR address to allocate to each node. eg, 8 would mean that each node would have a /24 slice of the overlay network for its pods. + + :param host_subnet_length: The host_subnet_length of this V1ClusterNetworkEntry. + :type: int + """ + if host_subnet_length is None: + raise ValueError("Invalid value for `host_subnet_length`, must not be `None`") + + self._host_subnet_length = host_subnet_length + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, V1ClusterNetworkEntry): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/openshift/client/models/v1_host_subnet.py b/openshift/client/models/v1_host_subnet.py index 52ef8fd7..64371ac6 100644 --- a/openshift/client/models/v1_host_subnet.py +++ b/openshift/client/models/v1_host_subnet.py @@ -21,7 +21,7 @@ class V1HostSubnet(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - def __init__(self, api_version=None, host=None, host_ip=None, kind=None, metadata=None, subnet=None): + def __init__(self, api_version=None, egress_i_ps=None, host=None, host_ip=None, kind=None, metadata=None, subnet=None): """ V1HostSubnet - a model defined in Swagger @@ -32,6 +32,7 @@ def __init__(self, api_version=None, host=None, host_ip=None, kind=None, metadat """ self.swagger_types = { 'api_version': 'str', + 'egress_i_ps': 'list[str]', 'host': 'str', 'host_ip': 'str', 'kind': 'str', @@ -41,6 +42,7 @@ def __init__(self, api_version=None, host=None, host_ip=None, kind=None, metadat self.attribute_map = { 'api_version': 'apiVersion', + 'egress_i_ps': 'egressIPs', 'host': 'host', 'host_ip': 'hostIP', 'kind': 'kind', @@ -49,6 +51,7 @@ def __init__(self, api_version=None, host=None, host_ip=None, kind=None, metadat } self._api_version = api_version + self._egress_i_ps = egress_i_ps self._host = host self._host_ip = host_ip self._kind = kind @@ -78,6 +81,31 @@ def api_version(self, api_version): self._api_version = api_version + @property + def egress_i_ps(self): + """ + Gets the egress_i_ps of this V1HostSubnet. + EgressIPs is the list of automatic egress IP addresses currently hosted by this node + + :return: The egress_i_ps of this V1HostSubnet. + :rtype: list[str] + """ + return self._egress_i_ps + + @egress_i_ps.setter + def egress_i_ps(self, egress_i_ps): + """ + Sets the egress_i_ps of this V1HostSubnet. + EgressIPs is the list of automatic egress IP addresses currently hosted by this node + + :param egress_i_ps: The egress_i_ps of this V1HostSubnet. + :type: list[str] + """ + if egress_i_ps is None: + raise ValueError("Invalid value for `egress_i_ps`, must not be `None`") + + self._egress_i_ps = egress_i_ps + @property def host(self): """ diff --git a/openshift/client/models/v1_net_namespace.py b/openshift/client/models/v1_net_namespace.py index 15c6369e..c397100d 100644 --- a/openshift/client/models/v1_net_namespace.py +++ b/openshift/client/models/v1_net_namespace.py @@ -21,7 +21,7 @@ class V1NetNamespace(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - def __init__(self, api_version=None, kind=None, metadata=None, netid=None, netname=None): + def __init__(self, api_version=None, egress_i_ps=None, kind=None, metadata=None, netid=None, netname=None): """ V1NetNamespace - a model defined in Swagger @@ -32,6 +32,7 @@ def __init__(self, api_version=None, kind=None, metadata=None, netid=None, netna """ self.swagger_types = { 'api_version': 'str', + 'egress_i_ps': 'list[str]', 'kind': 'str', 'metadata': 'V1ObjectMeta', 'netid': 'int', @@ -40,6 +41,7 @@ def __init__(self, api_version=None, kind=None, metadata=None, netid=None, netna self.attribute_map = { 'api_version': 'apiVersion', + 'egress_i_ps': 'egressIPs', 'kind': 'kind', 'metadata': 'metadata', 'netid': 'netid', @@ -47,6 +49,7 @@ def __init__(self, api_version=None, kind=None, metadata=None, netid=None, netna } self._api_version = api_version + self._egress_i_ps = egress_i_ps self._kind = kind self._metadata = metadata self._netid = netid @@ -75,6 +78,29 @@ def api_version(self, api_version): self._api_version = api_version + @property + def egress_i_ps(self): + """ + Gets the egress_i_ps of this V1NetNamespace. + EgressIPs is a list of reserved IPs that will be used as the source for external traffic coming from pods in this namespace. (If empty, external traffic will be masqueraded to Node IPs.) + + :return: The egress_i_ps of this V1NetNamespace. + :rtype: list[str] + """ + return self._egress_i_ps + + @egress_i_ps.setter + def egress_i_ps(self, egress_i_ps): + """ + Sets the egress_i_ps of this V1NetNamespace. + EgressIPs is a list of reserved IPs that will be used as the source for external traffic coming from pods in this namespace. (If empty, external traffic will be masqueraded to Node IPs.) + + :param egress_i_ps: The egress_i_ps of this V1NetNamespace. + :type: list[str] + """ + + self._egress_i_ps = egress_i_ps + @property def kind(self): """ diff --git a/openshift/docs/V1ClusterNetwork.md b/openshift/docs/V1ClusterNetwork.md index 2eadd6fc..f6f3119d 100644 --- a/openshift/docs/V1ClusterNetwork.md +++ b/openshift/docs/V1ClusterNetwork.md @@ -4,10 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_version** | **str** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources | [optional] -**hostsubnetlength** | **int** | HostSubnetLength is the number of bits of network to allocate to each node. eg, 8 would mean that each node would have a /24 slice of the overlay network for its pods | +**cluster_networks** | [**list[V1ClusterNetworkEntry]**](V1ClusterNetworkEntry.md) | ClusterNetworks is a list of ClusterNetwork objects that defines the global overlay network's L3 space by specifying a set of CIDR and netmasks that the SDN can allocate addressed from. | +**hostsubnetlength** | **int** | HostSubnetLength is the number of bits of network to allocate to each node. eg, 8 would mean that each node would have a /24 slice of the overlay network for its pods | [optional] **kind** | **str** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the openshift.client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds | [optional] **metadata** | [**V1ObjectMeta**](V1ObjectMeta.md) | Standard object's metadata. | [optional] -**network** | **str** | Network is a CIDR string specifying the global overlay network's L3 space | +**network** | **str** | Network is a CIDR string specifying the global overlay network's L3 space | [optional] **plugin_name** | **str** | PluginName is the name of the network plugin being used | [optional] **service_network** | **str** | ServiceNetwork is the CIDR range that Service IP addresses are allocated from | diff --git a/openshift/docs/V1ClusterNetworkEntry.md b/openshift/docs/V1ClusterNetworkEntry.md new file mode 100644 index 00000000..56845a89 --- /dev/null +++ b/openshift/docs/V1ClusterNetworkEntry.md @@ -0,0 +1,11 @@ +# V1ClusterNetworkEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cidr** | **str** | CIDR defines the total range of a cluster networks address space. | +**host_subnet_length** | **int** | HostSubnetLength is the number of bits of the accompanying CIDR address to allocate to each node. eg, 8 would mean that each node would have a /24 slice of the overlay network for its pods. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/openshift/docs/V1HostSubnet.md b/openshift/docs/V1HostSubnet.md index 5636d20f..dbb486a6 100644 --- a/openshift/docs/V1HostSubnet.md +++ b/openshift/docs/V1HostSubnet.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_version** | **str** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources | [optional] +**egress_i_ps** | **list[str]** | EgressIPs is the list of automatic egress IP addresses currently hosted by this node | **host** | **str** | Host is the name of the node. (This is the same as the object's name, but both fields must be set.) | **host_ip** | **str** | HostIP is the IP address to be used as a VTEP by other nodes in the overlay network | **kind** | **str** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the openshift.client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds | [optional] diff --git a/openshift/docs/V1NetNamespace.md b/openshift/docs/V1NetNamespace.md index b5bd28d4..e9c99661 100644 --- a/openshift/docs/V1NetNamespace.md +++ b/openshift/docs/V1NetNamespace.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_version** | **str** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources | [optional] +**egress_i_ps** | **list[str]** | EgressIPs is a list of reserved IPs that will be used as the source for external traffic coming from pods in this namespace. (If empty, external traffic will be masqueraded to Node IPs.) | [optional] **kind** | **str** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the openshift.client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds | [optional] **metadata** | [**V1ObjectMeta**](V1ObjectMeta.md) | Standard object's metadata. | [optional] **netid** | **int** | NetID is the network identifier of the network namespace assigned to each overlay network packet. This can be manipulated with the \"oc adm pod-network\" commands. | diff --git a/openshift/test/test_v1_cluster_network_entry.py b/openshift/test/test_v1_cluster_network_entry.py new file mode 100644 index 00000000..1e1e788a --- /dev/null +++ b/openshift/test/test_v1_cluster_network_entry.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + OpenShift API (with Kubernetes) + + OpenShift provides builds, application lifecycle, image content management, and administrative policy on top of Kubernetes. The API allows consistent management of those objects. All API operations are authenticated via an Authorization bearer token that is provided for service accounts as a generated secret (in JWT form) or via the native OAuth endpoint located at /oauth/authorize. Core infrastructure components may use openshift.client certificates that require no authentication. All API operations return a 'resourceVersion' string that represents the version of the object in the underlying storage. The standard LIST operation performs a snapshot read of the underlying objects, returning a resourceVersion representing a consistent version of the listed objects. The WATCH operation allows all updates to a set of objects after the provided resourceVersion to be observed by a openshift.client. By listing and beginning a watch from the returned resourceVersion, openshift.clients may observe a consistent view of the state of one or more objects. Note that WATCH always returns the update after the provided resourceVersion. Watch may be extended a limited time in the past - using etcd 2 the watch window is 1000 events (which on a large cluster may only be a few tens of seconds) so openshift.clients must explicitly handle the \"watch to old error\" by re-listing. Objects are divided into two rough categories - those that have a lifecycle and must reflect the state of the cluster, and those that have no state. Objects with lifecycle typically have three main sections: * 'metadata' common to all objects * a 'spec' that represents the desired state * a 'status' that represents how much of the desired state is reflected on the cluster at the current time Objects that have no state have 'metadata' but may lack a 'spec' or 'status' section. Objects are divided into those that are namespace scoped (only exist inside of a namespace) and those that are cluster scoped (exist outside of a namespace). A namespace scoped resource will be deleted when the namespace is deleted and cannot be created if the namespace has not yet been created or is in the process of deletion. Cluster scoped resources are typically only accessible to admins - resources like nodes, persistent volumes, and cluster policy. All objects have a schema that is a combination of the 'kind' and 'apiVersion' fields. This schema is additive only for any given version - no backwards incompatible changes are allowed without incrementing the apiVersion. The server will return and accept a number of standard responses that share a common schema - for instance, the common error type is 'metav1.Status' (described below) and will be returned on any error from the API server. The API is available in multiple serialization formats - the default is JSON (Accept: application/json and Content-Type: application/json) but openshift.clients may also use YAML (application/yaml) or the native Protobuf schema (application/vnd.kubernetes.protobuf). Note that the format of the WATCH API call is slightly different - for JSON it returns newline delimited objects while for Protobuf it returns length-delimited frames (4 bytes in network-order) that contain a 'versioned.Watch' Protobuf object. See the OpenShift documentation at https://docs.openshift.org for more information. + + OpenAPI spec version: latest + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import openshift.client +from kubernetes.client.rest import ApiException +from openshift.client.models.v1_cluster_network_entry import V1ClusterNetworkEntry + + +class TestV1ClusterNetworkEntry(unittest.TestCase): + """ V1ClusterNetworkEntry unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testV1ClusterNetworkEntry(self): + """ + Test V1ClusterNetworkEntry + """ + model = openshift.client.models.v1_cluster_network_entry.V1ClusterNetworkEntry() + + +if __name__ == '__main__': + unittest.main() diff --git a/scripts/constants.py b/scripts/constants.py index 7deb8d37..915495c3 100644 --- a/scripts/constants.py +++ b/scripts/constants.py @@ -19,11 +19,11 @@ # Spec version will be set in downloaded spec and all # generated code will refer to it. -SPEC_VERSION = "v3.6.0" +SPEC_VERSION = "v3.7.0" # client version for packaging and releasing. It can # be different than SPEC_VERSION. -CLIENT_VERSION = "0.3.0" +CLIENT_VERSION = "0.3.1" KUBERNETES_CLIENT_VERSION = "3.0.0" # Name of the release package diff --git a/scripts/swagger.json b/scripts/swagger.json index d9d4a0df..6cf928e1 100644 --- a/scripts/swagger.json +++ b/scripts/swagger.json @@ -80245,6 +80245,24 @@ } ] }, + "v1.ClusterNetworkEntry": { + "description": "ClusterNetworkEntry defines an individual cluster network. The CIDRs cannot overlap with other cluster network CIDRs, CIDRs reserved for external ips, CIDRs reserved for service networks, and CIDRs reserved for ingress ips.", + "required": [ + "CIDR", + "hostSubnetLength" + ], + "properties": { + "CIDR": { + "description": "CIDR defines the total range of a cluster networks address space.", + "type": "string" + }, + "hostSubnetLength": { + "description": "HostSubnetLength is the number of bits of the accompanying CIDR address to allocate to each node. eg, 8 would mean that each node would have a /24 slice of the overlay network for its pods.", + "type": "integer", + "format": "int64" + } + } + }, "v1.EgressNetworkPolicyPeer": { "description": "EgressNetworkPolicyPeer specifies a target to apply egress network policy to", "properties": { @@ -81144,13 +81162,21 @@ "required": [ "host", "hostIP", - "subnet" + "subnet", + "egressIPs" ], "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", "type": "string" }, + "egressIPs": { + "description": "EgressIPs is the list of automatic egress IP addresses currently hosted by this node", + "type": "array", + "items": { + "type": "string" + } + }, "host": { "description": "Host is the name of the node. (This is the same as the object's name, but both fields must be set.)", "type": "string" @@ -81359,6 +81385,13 @@ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", "type": "string" }, + "egressIPs": { + "description": "EgressIPs is a list of reserved IPs that will be used as the source for external traffic coming from pods in this namespace. (If empty, external traffic will be masqueraded to Node IPs.)", + "type": "array", + "items": { + "type": "string" + } + }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", "type": "string" @@ -84228,15 +84261,21 @@ "v1.ClusterNetwork": { "description": "ClusterNetwork describes the cluster network. There is normally only one object of this type, named \"default\", which is created by the SDN network plugin based on the master configuration when the cluster is brought up for the first time.", "required": [ - "network", - "hostsubnetlength", - "serviceNetwork" + "serviceNetwork", + "clusterNetworks" ], "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", "type": "string" }, + "clusterNetworks": { + "description": "ClusterNetworks is a list of ClusterNetwork objects that defines the global overlay network's L3 space by specifying a set of CIDR and netmasks that the SDN can allocate addressed from.", + "type": "array", + "items": { + "$ref": "#/definitions/v1.ClusterNetworkEntry" + } + }, "hostsubnetlength": { "description": "HostSubnetLength is the number of bits of network to allocate to each node. eg, 8 would mean that each node would have a /24 slice of the overlay network for its pods", "type": "integer", diff --git a/setup.py b/setup.py index baba99d2..ef236a0a 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ # Do not edit these constants. They will be updated automatically # by scripts/update-client.sh. -CLIENT_VERSION = "0.3.0" +CLIENT_VERSION = "0.3.1" PACKAGE_NAME = "openshift" DEVELOPMENT_STATUS = "3 - Alpha" @@ -49,6 +49,7 @@ def extract_requirements(filename): install_requires=extract_requirements('requirements.txt'), packages=find_packages(include='openshift.*'), include_package_data=True, + data_files=[('requirements.txt', ['requirements.txt'])], long_description='Python client for OpenShift http://openshift.redhat.com/', classifiers=[ "Development Status :: %s" % DEVELOPMENT_STATUS,