Skip to content

Commit

Permalink
Update fluid python sdk to v1.0.3
Browse files Browse the repository at this point in the history
Signed-off-by: trafalgarzzz <[email protected]>
  • Loading branch information
TrafalgarZZZ committed Nov 8, 2024
1 parent 07e8110 commit e089b77
Show file tree
Hide file tree
Showing 23 changed files with 759 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/AffinityStrategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**depend_on** | [**ObjectRef**](ObjectRef.md) | | [optional]
**policy** | **str** | Policy one of: \&quot;\&quot;, \&quot;Require\&quot;, \&quot;Prefer\&quot; | [optional]
**prefers** | [**list[Prefer]**](Prefer.md) | | [optional]
**requires** | [**list[Require]**](Require.md) | | [optional]
Expand Down
11 changes: 11 additions & 0 deletions docs/ClientMetrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ClientMetrics

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enabled** | **bool** | Enabled decides whether to expose client metrics. | [optional]
**scrape_target** | **str** | ScrapeTarget decides which fuse component will be scraped by Prometheus. It is a list separated by comma where supported items are [MountPod, Sidecar, All (indicates MountPod and Sidecar), None]. Defaults to None when it is not explicitly set. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


1 change: 1 addition & 0 deletions docs/JindoCompTemplateSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**disabled** | **bool** | If disable JindoFS master or worker | [optional]
**env** | **dict(str, str)** | Environment variables that will be used by Jindo component. &lt;br&gt; | [optional]
**image_pull_secrets** | [**list[V1LocalObjectReference]**](V1LocalObjectReference.md) | ImagePullSecrets that will be used to pull images | [optional]
**labels** | **dict(str, str)** | Labels will be added on JindoFS Master or Worker pods. DEPRECATED: This is a deprecated field. Please use PodMetadata instead. Note: this field is set to be exclusive with PodMetadata.Labels | [optional]
**node_selector** | **dict(str, str)** | NodeSelector is a selector which must be true for the master to fit on a node | [optional]
**pod_metadata** | [**PodMetadata**](PodMetadata.md) | | [optional]
Expand Down
2 changes: 2 additions & 0 deletions docs/JindoFuseSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ Name | Type | Description | Notes
**env** | **dict(str, str)** | Environment variables that will be used by Jindo Fuse | [optional]
**image** | **str** | Image for Jindo Fuse(e.g. jindo/jindo-fuse) | [optional]
**image_pull_policy** | **str** | One of the three policies: &#x60;Always&#x60;, &#x60;IfNotPresent&#x60;, &#x60;Never&#x60; | [optional]
**image_pull_secrets** | [**list[V1LocalObjectReference]**](V1LocalObjectReference.md) | ImagePullSecrets that will be used to pull images | [optional]
**image_tag** | **str** | Image Tag for Jindo Fuse(e.g. 2.3.0-SNAPSHOT) | [optional]
**labels** | **dict(str, str)** | Labels will be added on all the JindoFS pods. DEPRECATED: this is a deprecated field. Please use PodMetadata.Labels instead. Note: this field is set to be exclusive with PodMetadata.Labels | [optional]
**log_config** | **dict(str, str)** | | [optional]
**metrics** | [**ClientMetrics**](ClientMetrics.md) | | [optional]
**node_selector** | **dict(str, str)** | NodeSelector is a selector which must be true for the fuse client to fit on a node, this option only effect when global is enabled | [optional]
**pod_metadata** | [**PodMetadata**](PodMetadata.md) | | [optional]
**properties** | **dict(str, str)** | Configurable properties for Jindo System. &lt;br&gt; | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/JindoRuntimeSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Name | Type | Description | Notes
**clean_cache_policy** | [**CleanCachePolicy**](CleanCachePolicy.md) | | [optional]
**fuse** | [**JindoFuseSpec**](JindoFuseSpec.md) | | [optional]
**hadoop_config** | **str** | Name of the configMap used to support HDFS configurations when using HDFS as Jindo&#39;s UFS. The configMap must be in the same namespace with the JindoRuntime. The configMap should contain user-specific HDFS conf files in it. For now, only \&quot;hdfs-site.xml\&quot; and \&quot;core-site.xml\&quot; are supported. It must take the filename of the conf file as the key and content of the file as the value. | [optional]
**image_pull_secrets** | [**list[V1LocalObjectReference]**](V1LocalObjectReference.md) | ImagePullSecrets that will be used to pull images | [optional]
**jindo_version** | [**VersionSpec**](VersionSpec.md) | | [optional]
**labels** | **dict(str, str)** | Labels will be added on all the JindoFS pods. DEPRECATED: this is a deprecated field. Please use PodMetadata.Labels instead. Note: this field is set to be exclusive with PodMetadata.Labels | [optional]
**log_config** | **dict(str, str)** | | [optional]
Expand Down
13 changes: 13 additions & 0 deletions docs/ObjectRef.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ObjectRef

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**api_version** | **str** | API version of the referent operation | [optional]
**kind** | **str** | Kind specifies the type of the referent operation | [default to '']
**name** | **str** | Name specifies the name of the referent operation | [default to '']
**namespace** | **str** | Namespace specifies the namespace of the referent operation. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


1 change: 1 addition & 0 deletions docs/ThinCompTemplateSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Name | Type | Description | Notes
**env** | [**list[V1EnvVar]**](V1EnvVar.md) | Environment variables that will be used by thinRuntime component. | [optional]
**image** | **str** | Image for thinRuntime fuse | [optional]
**image_pull_policy** | **str** | One of the three policies: &#x60;Always&#x60;, &#x60;IfNotPresent&#x60;, &#x60;Never&#x60; | [optional]
**image_pull_secrets** | [**list[V1LocalObjectReference]**](V1LocalObjectReference.md) | ImagePullSecrets that will be used to pull images | [optional]
**image_tag** | **str** | Image for thinRuntime fuse | [optional]
**liveness_probe** | [**V1Probe**](V1Probe.md) | | [optional]
**network_mode** | **str** | Whether to use hostnetwork or not | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/ThinFuseSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Name | Type | Description | Notes
**env** | [**list[V1EnvVar]**](V1EnvVar.md) | Environment variables that will be used by thinRuntime Fuse | [optional]
**image** | **str** | Image for thinRuntime fuse | [optional]
**image_pull_policy** | **str** | One of the three policies: &#x60;Always&#x60;, &#x60;IfNotPresent&#x60;, &#x60;Never&#x60; | [optional]
**image_pull_secrets** | [**list[V1LocalObjectReference]**](V1LocalObjectReference.md) | ImagePullSecrets that will be used to pull images | [optional]
**image_tag** | **str** | Image for thinRuntime fuse | [optional]
**liveness_probe** | [**V1Probe**](V1Probe.md) | | [optional]
**network_mode** | **str** | Whether to use hostnetwork or not | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/ThinRuntimeProfileSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**file_system_type** | **str** | file system of thinRuntime | [default to '']
**fuse** | [**ThinFuseSpec**](ThinFuseSpec.md) | | [optional]
**image_pull_secrets** | [**list[V1LocalObjectReference]**](V1LocalObjectReference.md) | ImagePullSecrets that will be used to pull images | [optional]
**node_publish_secret_policy** | **str** | NodePublishSecretPolicy describes the policy to decide which to do with node publish secret when mounting an existing persistent volume. | [optional]
**volumes** | [**list[V1Volume]**](V1Volume.md) | Volumes is the list of Kubernetes volumes that can be mounted by runtime components and/or fuses. | [optional]
**worker** | [**ThinCompTemplateSpec**](ThinCompTemplateSpec.md) | | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/ThinRuntimeSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**disable_prometheus** | **bool** | Disable monitoring for Runtime Prometheus is enabled by default | [optional]
**fuse** | [**ThinFuseSpec**](ThinFuseSpec.md) | | [optional]
**image_pull_secrets** | [**list[V1LocalObjectReference]**](V1LocalObjectReference.md) | ImagePullSecrets that will be used to pull images | [optional]
**management** | [**RuntimeManagement**](RuntimeManagement.md) | | [optional]
**profile_name** | **str** | The specific runtime profile name, empty value is used for handling datasets which mount another dataset | [optional]
**replicas** | **int** | The replicas of the worker, need to be specified | [optional]
Expand Down
2 changes: 2 additions & 0 deletions fluid/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from fluid.models.alluxio_runtime_spec import AlluxioRuntimeSpec
from fluid.models.cacheable_node_affinity import CacheableNodeAffinity
from fluid.models.clean_cache_policy import CleanCachePolicy
from fluid.models.client_metrics import ClientMetrics
from fluid.models.condition import Condition
from fluid.models.data import Data
from fluid.models.data_backup import DataBackup
Expand Down Expand Up @@ -82,6 +83,7 @@
from fluid.models.metadata_sync_policy import MetadataSyncPolicy
from fluid.models.mount import Mount
from fluid.models.os_advise import OSAdvise
from fluid.models.object_ref import ObjectRef
from fluid.models.operation_ref import OperationRef
from fluid.models.operation_status import OperationStatus
from fluid.models.pod_metadata import PodMetadata
Expand Down
28 changes: 27 additions & 1 deletion fluid/models/affinity_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,61 @@ class AffinityStrategy(object):
and the value is json key in definition.
"""
openapi_types = {
'depend_on': 'ObjectRef',
'policy': 'str',
'prefers': 'list[Prefer]',
'requires': 'list[Require]'
}

attribute_map = {
'depend_on': 'dependOn',
'policy': 'policy',
'prefers': 'prefers',
'requires': 'requires'
}

def __init__(self, policy=None, prefers=None, requires=None, local_vars_configuration=None): # noqa: E501
def __init__(self, depend_on=None, policy=None, prefers=None, requires=None, local_vars_configuration=None): # noqa: E501
"""AffinityStrategy - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration

self._depend_on = None
self._policy = None
self._prefers = None
self._requires = None
self.discriminator = None

if depend_on is not None:
self.depend_on = depend_on
if policy is not None:
self.policy = policy
if prefers is not None:
self.prefers = prefers
if requires is not None:
self.requires = requires

@property
def depend_on(self):
"""Gets the depend_on of this AffinityStrategy. # noqa: E501
:return: The depend_on of this AffinityStrategy. # noqa: E501
:rtype: ObjectRef
"""
return self._depend_on

@depend_on.setter
def depend_on(self, depend_on):
"""Sets the depend_on of this AffinityStrategy.
:param depend_on: The depend_on of this AffinityStrategy. # noqa: E501
:type: ObjectRef
"""

self._depend_on = depend_on

@property
def policy(self):
"""Gets the policy of this AffinityStrategy. # noqa: E501
Expand Down
150 changes: 150 additions & 0 deletions fluid/models/client_metrics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# coding: utf-8

"""
fluid
client for fluid # noqa: E501
The version of the OpenAPI document: v0.1
Generated by: https://openapi-generator.tech
"""


import pprint
import re # noqa: F401

import six

from fluid.configuration import Configuration


class ClientMetrics(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""

"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
openapi_types = {
'enabled': 'bool',
'scrape_target': 'str'
}

attribute_map = {
'enabled': 'enabled',
'scrape_target': 'scrapeTarget'
}

def __init__(self, enabled=None, scrape_target=None, local_vars_configuration=None): # noqa: E501
"""ClientMetrics - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration

self._enabled = None
self._scrape_target = None
self.discriminator = None

if enabled is not None:
self.enabled = enabled
if scrape_target is not None:
self.scrape_target = scrape_target

@property
def enabled(self):
"""Gets the enabled of this ClientMetrics. # noqa: E501
Enabled decides whether to expose client metrics. # noqa: E501
:return: The enabled of this ClientMetrics. # noqa: E501
:rtype: bool
"""
return self._enabled

@enabled.setter
def enabled(self, enabled):
"""Sets the enabled of this ClientMetrics.
Enabled decides whether to expose client metrics. # noqa: E501
:param enabled: The enabled of this ClientMetrics. # noqa: E501
:type: bool
"""

self._enabled = enabled

@property
def scrape_target(self):
"""Gets the scrape_target of this ClientMetrics. # noqa: E501
ScrapeTarget decides which fuse component will be scraped by Prometheus. It is a list separated by comma where supported items are [MountPod, Sidecar, All (indicates MountPod and Sidecar), None]. Defaults to None when it is not explicitly set. # noqa: E501
:return: The scrape_target of this ClientMetrics. # noqa: E501
:rtype: str
"""
return self._scrape_target

@scrape_target.setter
def scrape_target(self, scrape_target):
"""Sets the scrape_target of this ClientMetrics.
ScrapeTarget decides which fuse component will be scraped by Prometheus. It is a list separated by comma where supported items are [MountPod, Sidecar, All (indicates MountPod and Sidecar), None]. Defaults to None when it is not explicitly set. # noqa: E501
:param scrape_target: The scrape_target of this ClientMetrics. # noqa: E501
:type: str
"""

self._scrape_target = scrape_target

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.openapi_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 pprint.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, ClientMetrics):
return False

return self.to_dict() == other.to_dict()

def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, ClientMetrics):
return True

return self.to_dict() != other.to_dict()
30 changes: 29 additions & 1 deletion fluid/models/jindo_comp_template_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class JindoCompTemplateSpec(object):
openapi_types = {
'disabled': 'bool',
'env': 'dict(str, str)',
'image_pull_secrets': 'list[V1LocalObjectReference]',
'labels': 'dict(str, str)',
'node_selector': 'dict(str, str)',
'pod_metadata': 'PodMetadata',
Expand All @@ -49,6 +50,7 @@ class JindoCompTemplateSpec(object):
attribute_map = {
'disabled': 'disabled',
'env': 'env',
'image_pull_secrets': 'imagePullSecrets',
'labels': 'labels',
'node_selector': 'nodeSelector',
'pod_metadata': 'podMetadata',
Expand All @@ -60,14 +62,15 @@ class JindoCompTemplateSpec(object):
'volume_mounts': 'volumeMounts'
}

def __init__(self, disabled=None, env=None, labels=None, node_selector=None, pod_metadata=None, ports=None, properties=None, replicas=None, resources=None, tolerations=None, volume_mounts=None, local_vars_configuration=None): # noqa: E501
def __init__(self, disabled=None, env=None, image_pull_secrets=None, labels=None, node_selector=None, pod_metadata=None, ports=None, properties=None, replicas=None, resources=None, tolerations=None, volume_mounts=None, local_vars_configuration=None): # noqa: E501
"""JindoCompTemplateSpec - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration

self._disabled = None
self._env = None
self._image_pull_secrets = None
self._labels = None
self._node_selector = None
self._pod_metadata = None
Expand All @@ -83,6 +86,8 @@ def __init__(self, disabled=None, env=None, labels=None, node_selector=None, pod
self.disabled = disabled
if env is not None:
self.env = env
if image_pull_secrets is not None:
self.image_pull_secrets = image_pull_secrets
if labels is not None:
self.labels = labels
if node_selector is not None:
Expand Down Expand Up @@ -148,6 +153,29 @@ def env(self, env):

self._env = env

@property
def image_pull_secrets(self):
"""Gets the image_pull_secrets of this JindoCompTemplateSpec. # noqa: E501
ImagePullSecrets that will be used to pull images # noqa: E501
:return: The image_pull_secrets of this JindoCompTemplateSpec. # noqa: E501
:rtype: list[V1LocalObjectReference]
"""
return self._image_pull_secrets

@image_pull_secrets.setter
def image_pull_secrets(self, image_pull_secrets):
"""Sets the image_pull_secrets of this JindoCompTemplateSpec.
ImagePullSecrets that will be used to pull images # noqa: E501
:param image_pull_secrets: The image_pull_secrets of this JindoCompTemplateSpec. # noqa: E501
:type: list[V1LocalObjectReference]
"""

self._image_pull_secrets = image_pull_secrets

@property
def labels(self):
"""Gets the labels of this JindoCompTemplateSpec. # noqa: E501
Expand Down
Loading

0 comments on commit e089b77

Please sign in to comment.