Skip to content

Commit

Permalink
Update csi_storage_capacity class constructor and documentation (#1488)
Browse files Browse the repository at this point in the history
  • Loading branch information
oharan2 authored Nov 6, 2023
1 parent 01b3c03 commit 980e46c
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions ocp_resources/csi_storage_capacity.py
Original file line number Diff line number Diff line change
@@ -1,57 +1,32 @@
from ocp_resources.constants import TIMEOUT_4MINUTES
from ocp_resources.resource import NamespacedResource


class CSIStorageCapacity(NamespacedResource):
"""
CSIStorageCapacity object. API reference:
https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/csi-storage-capacity-v1/#CSIStorageCapacity
"""

api_group = NamespacedResource.ApiGroup.STORAGE_K8S_IO

def __init__(
self,
name=None,
namespace=None,
client=None,
capacity=None,
maximum_volume_size=None,
node_topology=None,
storage_class_name=None,
teardown=True,
privileged_client=None,
yaml_file=None,
delete_timeout=TIMEOUT_4MINUTES,
**kwargs,
):
"""
Args:
name (str): Name of the CSIStorageCapacity resource
namespace (str): Namespace of CSIStorageCapacity resource
client: (DynamicClient): DynamicClient for api calls
capacity (str, optional): value reported by the csi driver
maximum_volume_size (str, optional): maximum volume size reported by csi driver
storage_class_name (str): storage class name
node_topology (dict, optional): defines which node has access to the storage for which capacity
was reported
Example:
node_topology: {'matchLabels': {'topology.hostpath.csi/node': 'c01-dbn-413-4c48b-worker-0-pmtv8'}}
teardown (bool): Indicates if the resource should be torn down at the end
privileged_client (DynamicClient): Privileged client for api calls
yaml_file (str): yaml file for the resource.
delete_timeout (int): timeout associated with delete action
"""
super().__init__(
name=name,
namespace=namespace,
client=client,
teardown=teardown,
privileged_client=privileged_client,
yaml_file=yaml_file,
delete_timeout=delete_timeout,
**kwargs,
)
super().__init__(**kwargs)
self.capacity = capacity
self.node_topology = node_topology
self.storage_class_name = storage_class_name
Expand Down

0 comments on commit 980e46c

Please sign in to comment.