Skip to content

Commit

Permalink
Merge pull request #51 from fabric-testbed/rel1.6
Browse files Browse the repository at this point in the history
Rel1.6 changes
  • Loading branch information
kthare10 authored Jan 2, 2024
2 parents 4f13644 + f8cc445 commit 5858fe9
Show file tree
Hide file tree
Showing 13 changed files with 197 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .swagger-codegen/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.44
3.0.46
1 change: 1 addition & 0 deletions docs/PoaPostData.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**vcpu_cpu_map** | [**list[PoaPostDataVcpuCpuMap]**](PoaPostDataVcpuCpuMap.md) | | [optional]
**node_set** | **list[str]** | | [optional]
**keys** | [**list[PoaPostDataKeys]**](PoaPostDataKeys.md) | | [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)

10 changes: 10 additions & 0 deletions docs/PoaPostDataKeys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# PoaPostDataKeys

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**key** | **str** | |
**comment** | **str** | |

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

4 changes: 2 additions & 2 deletions docs/PoaPostDataVcpuCpuMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**vcpu** | **str** | | [optional]
**cpu** | **str** | | [optional]
**vcpu** | **str** | |
**cpu** | **str** | |

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

2 changes: 1 addition & 1 deletion fabric_cf/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.5.4"
__version__ = "1.6.0"
6 changes: 4 additions & 2 deletions fabric_cf/orchestrator/orchestrator_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,14 +467,15 @@ def renew(self, *, token: str, slice_id: str,
return Status.FAILURE, e

def poa(self, *, token: str, sliver_id: str, operation: str, vcpu_cpu_map: List[Dict[str, str]] = None,
node_set: List[str] = None) -> Tuple[Status, Union[Exception, List[PoaData]]]:
node_set: List[str] = None, keys: List[Dict[str, str]]) -> Tuple[Status, Union[Exception, List[PoaData]]]:
"""
Modify a slice
@param token fabric token
@param sliver_id Sliver Id
@param operation POA operation
@param vcpu_cpu_map vCPU to physical CPU Map
@param node_set List of Numa nodes
@param keys list of keys to add/remove
@return Tuple containing Status and Exception/Json containing poa info created
"""
if token is None:
Expand All @@ -489,10 +490,11 @@ def poa(self, *, token: str, sliver_id: str, operation: str, vcpu_cpu_map: List[
self.__set_tokens(token=token)

body = PoaPost(operation=operation)
if vcpu_cpu_map is not None or node_set is not None:
if vcpu_cpu_map is not None or node_set is not None or keys is not None:
post_data = PoaPostData()
post_data.vcpu_cpu_map = vcpu_cpu_map
post_data.node_set = node_set
post_data.keys = keys
body.data = post_data

poa_data = self.poas_api.poas_create_sliver_id_post(sliver_id=sliver_id, body=body)
Expand Down
1 change: 1 addition & 0 deletions fabric_cf/orchestrator/swagger_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from fabric_cf.orchestrator.swagger_client.models.poa_data import PoaData
from fabric_cf.orchestrator.swagger_client.models.poa_post import PoaPost
from fabric_cf.orchestrator.swagger_client.models.poa_post_data import PoaPostData
from fabric_cf.orchestrator.swagger_client.models.poa_post_data_keys import PoaPostDataKeys
from fabric_cf.orchestrator.swagger_client.models.poa_post_data_vcpu_cpu_map import PoaPostDataVcpuCpuMap
from fabric_cf.orchestrator.swagger_client.models.resource import Resource
from fabric_cf.orchestrator.swagger_client.models.resources import Resources
Expand Down
4 changes: 2 additions & 2 deletions fabric_cf/orchestrator/swagger_client/api/poas_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, api_client=None):
def poas_create_sliver_id_post(self, body, sliver_id, **kwargs): # noqa: E501
"""Perform an operational action on a sliver. # noqa: E501
Request to perform an operation action on a sliver. Supported actions include - reboot a VM sliver, get cpu info, get numa info, pin vCPUs, pin memory to a numa node etc. # noqa: E501
Request to perform an operation action on a sliver. Supported actions include - reboot a VM sliver, get cpu info, get numa info, pin vCPUs, pin memory to a numa node etc, add/remove ssh keys. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.poas_create_sliver_id_post(body, sliver_id, async_req=True)
Expand All @@ -58,7 +58,7 @@ def poas_create_sliver_id_post(self, body, sliver_id, **kwargs): # noqa: E501
def poas_create_sliver_id_post_with_http_info(self, body, sliver_id, **kwargs): # noqa: E501
"""Perform an operational action on a sliver. # noqa: E501
Request to perform an operation action on a sliver. Supported actions include - reboot a VM sliver, get cpu info, get numa info, pin vCPUs, pin memory to a numa node etc. # noqa: E501
Request to perform an operation action on a sliver. Supported actions include - reboot a VM sliver, get cpu info, get numa info, pin vCPUs, pin memory to a numa node etc, add/remove ssh keys. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.poas_create_sliver_id_post_with_http_info(body, sliver_id, async_req=True)
Expand Down
2 changes: 1 addition & 1 deletion fabric_cf/orchestrator/swagger_client/models/poa_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def operation(self, operation):
"""
if operation is None:
raise ValueError("Invalid value for `operation`, must not be `None`") # noqa: E501
allowed_values = ["cpuinfo", "numainfo", "cpupin", "numatune", "reboot"] # noqa: E501
allowed_values = ["cpuinfo", "numainfo", "cpupin", "numatune", "reboot", "addkey", "removekey"] # noqa: E501
if operation not in allowed_values:
raise ValueError(
"Invalid value for `operation` ({0}), must be one of {1}" # noqa: E501
Expand Down
32 changes: 29 additions & 3 deletions fabric_cf/orchestrator/swagger_client/models/poa_post_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,28 @@ class PoaPostData(object):
"""
swagger_types = {
'vcpu_cpu_map': 'list[PoaPostDataVcpuCpuMap]',
'node_set': 'list[str]'
'node_set': 'list[str]',
'keys': 'list[PoaPostDataKeys]'
}

attribute_map = {
'vcpu_cpu_map': 'vcpu_cpu_map',
'node_set': 'node_set'
'node_set': 'node_set',
'keys': 'keys'
}

def __init__(self, vcpu_cpu_map=None, node_set=None): # noqa: E501
def __init__(self, vcpu_cpu_map=None, node_set=None, keys=None): # noqa: E501
"""PoaPostData - a model defined in Swagger""" # noqa: E501
self._vcpu_cpu_map = None
self._node_set = None
self._keys = None
self.discriminator = None
if vcpu_cpu_map is not None:
self.vcpu_cpu_map = vcpu_cpu_map
if node_set is not None:
self.node_set = node_set
if keys is not None:
self.keys = keys

@property
def vcpu_cpu_map(self):
Expand Down Expand Up @@ -89,6 +94,27 @@ def node_set(self, node_set):

self._node_set = node_set

@property
def keys(self):
"""Gets the keys of this PoaPostData. # noqa: E501
:return: The keys of this PoaPostData. # noqa: E501
:rtype: list[PoaPostDataKeys]
"""
return self._keys

@keys.setter
def keys(self, keys):
"""Sets the keys of this PoaPostData.
:param keys: The keys of this PoaPostData. # noqa: E501
:type: list[PoaPostDataKeys]
"""

self._keys = keys

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
Expand Down
138 changes: 138 additions & 0 deletions fabric_cf/orchestrator/swagger_client/models/poa_post_data_keys.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# coding: utf-8

"""
Fabric Orchestrator API
This is Fabric Orchestrator API # noqa: E501
OpenAPI spec version: 1.0.1
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re # noqa: F401

import six

class PoaPostDataKeys(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_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.
"""
swagger_types = {
'key': 'str',
'comment': 'str'
}

attribute_map = {
'key': 'key',
'comment': 'comment'
}

def __init__(self, key=None, comment=None): # noqa: E501
"""PoaPostDataKeys - a model defined in Swagger""" # noqa: E501
self._key = None
self._comment = None
self.discriminator = None
self.key = key
self.comment = comment

@property
def key(self):
"""Gets the key of this PoaPostDataKeys. # noqa: E501
:return: The key of this PoaPostDataKeys. # noqa: E501
:rtype: str
"""
return self._key

@key.setter
def key(self, key):
"""Sets the key of this PoaPostDataKeys.
:param key: The key of this PoaPostDataKeys. # noqa: E501
:type: str
"""
if key is None:
raise ValueError("Invalid value for `key`, must not be `None`") # noqa: E501

self._key = key

@property
def comment(self):
"""Gets the comment of this PoaPostDataKeys. # noqa: E501
:return: The comment of this PoaPostDataKeys. # noqa: E501
:rtype: str
"""
return self._comment

@comment.setter
def comment(self, comment):
"""Sets the comment of this PoaPostDataKeys.
:param comment: The comment of this PoaPostDataKeys. # noqa: E501
:type: str
"""
if comment is None:
raise ValueError("Invalid value for `comment`, must not be `None`") # noqa: E501

self._comment = comment

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

for attr, _ in six.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
if issubclass(PoaPostDataKeys, dict):
for key, value in self.items():
result[key] = 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, PoaPostDataKeys):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ def __init__(self, vcpu=None, cpu=None): # noqa: E501
self._vcpu = None
self._cpu = None
self.discriminator = None
if vcpu is not None:
self.vcpu = vcpu
if cpu is not None:
self.cpu = cpu
self.vcpu = vcpu
self.cpu = cpu

@property
def vcpu(self):
Expand All @@ -65,6 +63,8 @@ def vcpu(self, vcpu):
:param vcpu: The vcpu of this PoaPostDataVcpuCpuMap. # noqa: E501
:type: str
"""
if vcpu is None:
raise ValueError("Invalid value for `vcpu`, must not be `None`") # noqa: E501

self._vcpu = vcpu

Expand All @@ -86,6 +86,8 @@ def cpu(self, cpu):
:param cpu: The cpu of this PoaPostDataVcpuCpuMap. # noqa: E501
:type: str
"""
if cpu is None:
raise ValueError("Invalid value for `cpu`, must not be `None`") # noqa: E501

self._cpu = cpu

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies = [
"six >= 1.10",
"python_dateutil >= 2.5.3",
"requests>=2.28.1",
"fabric-fim==1.5.5",
"fabric-fim==1.6.0",
]

[project.optional-dependencies]
Expand Down

0 comments on commit 5858fe9

Please sign in to comment.