diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION index d99c5ed..5025f67 100644 --- a/.swagger-codegen/VERSION +++ b/.swagger-codegen/VERSION @@ -1 +1 @@ -3.0.46 +3.0.54 diff --git a/README.md b/README.md index 652a917..37cf2f0 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,7 @@ Class | Method | HTTP request | Description *ResourcesApi* | [**portalresources_get**](docs/ResourcesApi.md#portalresources_get) | **GET** /portalresources | Retrieve a listing and description of available resources for portal *ResourcesApi* | [**resources_get**](docs/ResourcesApi.md#resources_get) | **GET** /resources | Retrieve a listing and description of available resources. By default, a cached available resource information is returned. User can force to request the current available resources. *SlicesApi* | [**slices_create_post**](docs/SlicesApi.md#slices_create_post) | **POST** /slices/create | Create slice +*SlicesApi* | [**slices_creates_post**](docs/SlicesApi.md#slices_creates_post) | **POST** /slices/creates | Create slice *SlicesApi* | [**slices_delete_delete**](docs/SlicesApi.md#slices_delete_delete) | **DELETE** /slices/delete | Delete all slices for a User within a project. *SlicesApi* | [**slices_delete_slice_id_delete**](docs/SlicesApi.md#slices_delete_slice_id_delete) | **DELETE** /slices/delete/{slice_id} | Delete slice. *SlicesApi* | [**slices_get**](docs/SlicesApi.md#slices_get) | **GET** /slices | Retrieve a listing of user slices @@ -128,6 +129,7 @@ Class | Method | HTTP request | Description - [PoaData](docs/PoaData.md) - [PoaPost](docs/PoaPost.md) - [PoaPostData](docs/PoaPostData.md) + - [PoaPostDataKeys](docs/PoaPostDataKeys.md) - [PoaPostDataVcpuCpuMap](docs/PoaPostDataVcpuCpuMap.md) - [Resource](docs/Resource.md) - [Resources](docs/Resources.md) diff --git a/docs/Metrics.md b/docs/Metrics.md new file mode 100644 index 0000000..043bcab --- /dev/null +++ b/docs/Metrics.md @@ -0,0 +1,9 @@ +# Metrics + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | **list[object]** | | [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) + diff --git a/docs/MetricsApi.md b/docs/MetricsApi.md new file mode 100644 index 0000000..ddca5e8 --- /dev/null +++ b/docs/MetricsApi.md @@ -0,0 +1,56 @@ +# swagger_client.MetricsApi + +All URIs are relative to *http://127.0.0.1:8700/* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**metrics_overview_get**](MetricsApi.md#metrics_overview_get) | **GET** /metrics/overview | Control Framework metrics overview + +# **metrics_overview_get** +> Metrics metrics_overview_get(excluded_projects=excluded_projects) + +Control Framework metrics overview + +Control Framework metrics overview + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.MetricsApi() +excluded_projects = ['excluded_projects_example'] # list[str] | List of projects to exclude from the metrics overview (optional) + +try: + # Control Framework metrics overview + api_response = api_instance.metrics_overview_get(excluded_projects=excluded_projects) + pprint(api_response) +except ApiException as e: + print("Exception when calling MetricsApi->metrics_overview_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **excluded_projects** | [**list[str]**](str.md)| List of projects to exclude from the metrics overview | [optional] + +### Return type + +[**Metrics**](Metrics.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/ResourcesApi.md b/docs/ResourcesApi.md index 258e94c..ffbb02f 100644 --- a/docs/ResourcesApi.md +++ b/docs/ResourcesApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description [**resources_get**](ResourcesApi.md#resources_get) | **GET** /resources | Retrieve a listing and description of available resources. By default, a cached available resource information is returned. User can force to request the current available resources. # **portalresources_get** -> Resources portalresources_get(graph_format) +> Resources portalresources_get(graph_format, level=level, force_refresh=force_refresh, start_date=start_date, end_date=end_date, includes=includes, excludes=excludes) Retrieve a listing and description of available resources for portal @@ -25,10 +25,16 @@ from pprint import pprint # create an instance of the API class api_instance = ResourcesApi() graph_format = 'GRAPHML' # str | graph format (default to GRAPHML) +level = 1 # int | Level of details (optional) (default to 1) +force_refresh = false # bool | Force to retrieve current available resource information. (optional) (default to false) +start_date = 'start_date_example' # str | starting date to check availability from (optional) +end_date = 'end_date_example' # str | end date to check availability until (optional) +includes = 'includes_example' # str | comma separated lists of sites to include (optional) +excludes = 'excludes_example' # str | comma separated lists of sites to exclude (optional) try: # Retrieve a listing and description of available resources for portal - api_response = api_instance.portalresources_get(graph_format) + api_response = api_instance.portalresources_get(graph_format, level=level, force_refresh=force_refresh, start_date=start_date, end_date=end_date, includes=includes, excludes=excludes) pprint(api_response) except ApiException as e: print("Exception when calling ResourcesApi->portalresources_get: %s\n" % e) @@ -39,6 +45,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **graph_format** | **str**| graph format | [default to GRAPHML] + **level** | **int**| Level of details | [optional] [default to 1] + **force_refresh** | **bool**| Force to retrieve current available resource information. | [optional] [default to false] + **start_date** | **str**| starting date to check availability from | [optional] + **end_date** | **str**| end date to check availability until | [optional] + **includes** | **str**| comma separated lists of sites to include | [optional] + **excludes** | **str**| comma separated lists of sites to exclude | [optional] ### Return type @@ -56,7 +68,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **resources_get** -> Resources resources_get(level, force_refresh) +> Resources resources_get(level, force_refresh, start_date=start_date, end_date=end_date, includes=includes, excludes=excludes) Retrieve a listing and description of available resources. By default, a cached available resource information is returned. User can force to request the current available resources. @@ -80,10 +92,14 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' api_instance = ResourcesApi(ApiClient(configuration)) level = 1 # int | Level of details (default to 1) force_refresh = False # bool | Force to retrieve current available resource information. (default to false) +start_date = 'start_date_example' # str | starting date to check availability from (optional) +end_date = 'end_date_example' # str | end date to check availability until (optional) +includes = 'includes_example' # str | comma separated lists of sites to include (optional) +excludes = 'excludes_example' # str | comma separated lists of sites to exclude (optional) try: # Retrieve a listing and description of available resources. By default, a cached available resource information is returned. User can force to request the current available resources. - api_response = api_instance.resources_get(level, force_refresh) + api_response = api_instance.resources_get(level, force_refresh, start_date=start_date, end_date=end_date, includes=includes, excludes=excludes) pprint(api_response) except ApiException as e: print("Exception when calling ResourcesApi->resources_get: %s\n" % e) @@ -95,6 +111,10 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **level** | **int**| Level of details | [default to 1] **force_refresh** | **bool**| Force to retrieve current available resource information. | [default to false] + **start_date** | **str**| starting date to check availability from | [optional] + **end_date** | **str**| end date to check availability until | [optional] + **includes** | **str**| comma separated lists of sites to include | [optional] + **excludes** | **str**| comma separated lists of sites to exclude | [optional] ### Return type diff --git a/docs/SlicesApi.md b/docs/SlicesApi.md index 594972f..9c7cf12 100644 --- a/docs/SlicesApi.md +++ b/docs/SlicesApi.md @@ -70,13 +70,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: text/plain + - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **slices_creates_post** -> Slivers slices_creates_post(body, name, lease_end_time=lease_end_time) +> Slivers slices_creates_post(body, name, lease_start_time=lease_start_time, lease_end_time=lease_end_time) Create slice @@ -101,11 +101,12 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' api_instance = SlicesApi(ApiClient(configuration)) body = SlicesPost() # SlicesPost | Create new Slice name = 'name_example' # str | Slice Name +lease_start_time = 'lease_start_time_example' # str | Lease End Time for the Slice (optional) lease_end_time = 'lease_end_time_example' # str | Lease End Time for the Slice (optional) try: # Create slice - api_response = api_instance.slices_creates_post(body, name, lease_end_time=lease_end_time) + api_response = api_instance.slices_creates_post(body, name, lease_start_time=lease_start_time, lease_end_time=lease_end_time) pprint(api_response) except ApiException as e: print("Exception when calling SlicesApi->slices_creates_post: %s\n" % e) @@ -117,6 +118,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**SlicesPost**](SlicesPost.md)| Create new Slice | **name** | **str**| Slice Name | + **lease_start_time** | **str**| Lease End Time for the Slice | [optional] **lease_end_time** | **str**| Lease End Time for the Slice | [optional] ### Return type @@ -240,7 +242,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **slices_get** -> Slices slices_get(name=name, as_self=as_self, states=states, limit=limit, offset=offset) +> Slices slices_get(name=name, search=search, exact_match=exact_match, as_self=as_self, states=states, limit=limit, offset=offset) Retrieve a listing of user slices @@ -263,6 +265,8 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = SlicesApi(ApiClient(configuration)) name = 'name_example' # str | Search for Slices with the name (optional) +search = 'search_example' # str | search term applied (optional) +exact_match = false # bool | Exact Match for Search term (optional) (default to false) as_self = true # bool | GET object as Self (optional) (default to true) states = ['states_example'] # list[str] | Search for Slices in the specified states (optional) limit = 5 # int | maximum number of results to return per page (1 or more) (optional) (default to 5) @@ -270,7 +274,7 @@ offset = 0 # int | number of items to skip before starting to collect the result try: # Retrieve a listing of user slices - api_response = api_instance.slices_get(name=name, as_self=as_self, states=states, limit=limit, offset=offset) + api_response = api_instance.slices_get(name=name, search=search, exact_match=exact_match, as_self=as_self, states=states, limit=limit, offset=offset) pprint(api_response) except ApiException as e: print("Exception when calling SlicesApi->slices_get: %s\n" % e) @@ -281,6 +285,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **name** | **str**| Search for Slices with the name | [optional] + **search** | **str**| search term applied | [optional] + **exact_match** | **bool**| Exact Match for Search term | [optional] [default to false] **as_self** | **bool**| GET object as Self | [optional] [default to true] **states** | [**list[str]**](str.md)| Search for Slices in the specified states | [optional] **limit** | **int**| maximum number of results to return per page (1 or more) | [optional] [default to 5] @@ -394,7 +400,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**str**](str.md)| | Modify a Slice + **body** | [**str**](str.md)| Modify a Slice | **slice_id** | **str**| Slice identified by universally unique identifier | ### Return type diff --git a/fabric_cf/.DS_Store b/fabric_cf/.DS_Store new file mode 100644 index 0000000..6323389 Binary files /dev/null and b/fabric_cf/.DS_Store differ diff --git a/fabric_cf/__init__.py b/fabric_cf/__init__.py index e4adfb8..14d9d2f 100644 --- a/fabric_cf/__init__.py +++ b/fabric_cf/__init__.py @@ -1 +1 @@ -__version__ = "1.6.0" +__version__ = "1.7.0" diff --git a/fabric_cf/orchestrator/orchestrator_proxy.py b/fabric_cf/orchestrator/orchestrator_proxy.py index f479796..1e0e96f 100644 --- a/fabric_cf/orchestrator/orchestrator_proxy.py +++ b/fabric_cf/orchestrator/orchestrator_proxy.py @@ -54,6 +54,8 @@ class SliceState(enum.Enum): Modifying = enum.auto() ModifyError = enum.auto() ModifyOK = enum.auto() + AllocatedError = enum.auto() + AllocatedOK = enum.auto() def __str__(self): return self.name @@ -123,6 +125,7 @@ def __init__(self, orchestrator_host: str): self.slivers_api = swagger_client.SliversApi(api_client=api_instance) self.resources_api = swagger_client.ResourcesApi(api_client=api_instance) self.poas_api = swagger_client.PoasApi(api_client=api_instance) + self.metrics_api = swagger_client.MetricsApi(api_client=api_instance) def __set_tokens(self, *, token: str): """ @@ -134,7 +137,7 @@ def __set_tokens(self, *, token: str): self.slices_api.api_client.configuration.api_key_prefix[self.PROP_AUTHORIZATION] = self.PROP_BEARER def create(self, *, token: str, slice_name: str, ssh_key: Union[str, List[str]], - topology: ExperimentTopology = None, slice_graph: str = None, + topology: ExperimentTopology = None, slice_graph: str = None, lease_start_time: str = None, lease_end_time: str = None) -> Tuple[Status, Union[Exception, List[Sliver]]]: """ Create a slice @@ -143,6 +146,7 @@ def create(self, *, token: str, slice_name: str, ssh_key: Union[str, List[str]], @param ssh_key SSH Key(s) @param topology Experiment topology @param slice_graph Slice Graph string + @param lease_start_time Lease Start Time @param lease_end_time Lease End Time @return Tuple containing Status and Exception/Json containing slivers created """ @@ -158,6 +162,13 @@ def create(self, *, token: str, slice_name: str, ssh_key: Union[str, List[str]], f"slice graph {slice_graph} must " f"be specified") + if lease_start_time is not None: + try: + datetime.strptime(lease_start_time, self.TIME_FORMAT) + except Exception as e: + return Status.INVALID_ARGUMENTS, OrchestratorProxyException( + f"Lease Stat Time {lease_start_time} should be in format: {self.TIME_FORMAT} e: {e}") + if lease_end_time is not None: try: datetime.strptime(lease_end_time, self.TIME_FORMAT) @@ -177,11 +188,9 @@ def create(self, *, token: str, slice_name: str, ssh_key: Union[str, List[str]], else: ssh_keys = ssh_key body = SlicesPost(graph_model=slice_graph, ssh_keys=ssh_keys) - if lease_end_time is not None: - slivers = self.slices_api.slices_creates_post(name=slice_name, body=body, lease_end_time=lease_end_time) - else: - slivers = self.slices_api.slices_creates_post(name=slice_name, body=body) - + slivers = self.slices_api.slices_creates_post(name=slice_name, body=body, + lease_end_time=lease_end_time, + lease_start_time=lease_start_time) return Status.OK, slivers.data if slivers.data is not None else [] except Exception as e: return Status.FAILURE, e @@ -278,7 +287,7 @@ def delete(self, *, token: str, slice_id: str = None) -> Tuple[Status, Union[Exc def slices(self, *, token: str, includes: List[SliceState] = None, excludes: List[SliceState] = None, name: str = None, limit: int = 20, offset: int = 0, slice_id: str = None, - as_self: bool = True) -> Tuple[Status, Union[Exception, List[Slice]]]: + as_self: bool = True, search: str = None, exact_match: bool = False) -> Tuple[Status, Union[Exception, List[Slice]]]: """ Get slices @param token fabric token @@ -288,7 +297,9 @@ def slices(self, *, token: str, includes: List[SliceState] = None, excludes: Lis @param limit maximum number of slices to return @param offset offset of the first slice to return @param slice_id Slice Id - @param as_self + @param as_self query as self + @param search search term + @param exact_match true if exact match @return Tuple containing Status and Exception/Json containing slices """ if token is None: @@ -300,7 +311,8 @@ def slices(self, *, token: str, includes: List[SliceState] = None, excludes: Lis states = [SliceState.StableError, SliceState.StableOK, SliceState.Nascent, SliceState.Configuring, SliceState.Closing, SliceState.Dead, - SliceState.ModifyError, SliceState.ModifyOK, SliceState.Modifying] + SliceState.ModifyError, SliceState.ModifyOK, SliceState.Modifying, + SliceState.AllocatedOK, SliceState.AllocatedError] if includes is not None: states = includes @@ -314,10 +326,12 @@ def slices(self, *, token: str, includes: List[SliceState] = None, excludes: Lis as_self=as_self) elif name is not None: slices = self.slices_api.slices_get(states=SliceState.state_list_to_str_list(states), name=name, - limit=limit, offset=offset, as_self=as_self) + limit=limit, offset=offset, as_self=as_self, + search=search, exact_match=exact_match) else: slices = self.slices_api.slices_get(states=SliceState.state_list_to_str_list(states), limit=limit, - offset=offset, as_self=as_self) + offset=offset, as_self=as_self, search=search, + exact_match=exact_match) return Status.OK, slices.data if slices.data is not None else [] except Exception as e: @@ -388,16 +402,20 @@ def slivers(self, *, token: str, slice_id: str, except Exception as e: return Status.FAILURE, e - def resources(self, *, token: str, level: int = 1, - force_refresh: bool = False) -> Tuple[Status, Union[Exception, AdvertizedTopology]]: + def resources(self, *, token: str, level: int = 1, force_refresh: bool = False, + start: datetime = None, end: datetime = None, + includes: List[str] = None, excludes: List[str] = None) -> Tuple[Status, Union[Exception, AdvertizedTopology]]: """ Get resources; by default cached resource information is returned. Cache is refreshed every 5 minutes. @param token fabric token @param level level @param force_refresh force current available resources + @param start start time + @param end end time + @param includes list of sites to include + @param excludes list of sites to exclude @return Tuple containing Status and Exception/Json containing Resources """ - if token is None: return Status.INVALID_ARGUMENTS, OrchestratorProxyException(f"Token {token} must be specified") @@ -405,7 +423,12 @@ def resources(self, *, token: str, level: int = 1, # Set the tokens self.__set_tokens(token=token) - resources = self.resources_api.resources_get(level=level, force_refresh=force_refresh) + start_date = start.strftime(self.TIME_FORMAT) if start else None + end_date = end.strftime(self.TIME_FORMAT) if end else None + resources = self.resources_api.resources_get(level=level, force_refresh=force_refresh, + start_date=start_date, end_date=end_date, + includes=', '.join(includes) if includes else None, + excludes=', '.join(excludes) if excludes else None) graph_string = resources.data[0].model substrate = None if graph_string is not None: @@ -534,4 +557,20 @@ def get_poas(self, *, token: str, sliver_id: str = None, return Status.OK, poa_data.data if poa_data.data is not None else None except Exception as e: - return Status.FAILURE, e \ No newline at end of file + return Status.FAILURE, e + + def get_metrics_overview(self, *, token: str = None, + excluded_projects: List[str] = None) -> Tuple[Status, Union[Exception, list]]: + """ + Modify a slice + @param token fabric token + @param excluded_projects list of project ids to exclude + @return Tuple containing Status and Exception/Json containing poa info created + """ + try: + # Set the tokens + self.__set_tokens(token=token) + result = self.metrics_api.metrics_overview_get(excluded_projects=excluded_projects) + return Status.OK, result.results + except Exception as e: + return Status.FAILURE, e diff --git a/fabric_cf/orchestrator/swagger_client/__init__.py b/fabric_cf/orchestrator/swagger_client/__init__.py index 0894b55..0e6f450 100644 --- a/fabric_cf/orchestrator/swagger_client/__init__.py +++ b/fabric_cf/orchestrator/swagger_client/__init__.py @@ -15,6 +15,7 @@ from __future__ import absolute_import # import apis into sdk package +from fabric_cf.orchestrator.swagger_client.api.metrics_api import MetricsApi from fabric_cf.orchestrator.swagger_client.api.poas_api import PoasApi from fabric_cf.orchestrator.swagger_client.api.resources_api import ResourcesApi from fabric_cf.orchestrator.swagger_client.api.slices_api import SlicesApi @@ -24,6 +25,7 @@ from fabric_cf.orchestrator.swagger_client.api_client import ApiClient from fabric_cf.orchestrator.swagger_client.configuration import Configuration # import models into sdk package +from fabric_cf.orchestrator.swagger_client.models.metrics import Metrics from fabric_cf.orchestrator.swagger_client.models.poa import Poa from fabric_cf.orchestrator.swagger_client.models.poa_data import PoaData from fabric_cf.orchestrator.swagger_client.models.poa_post import PoaPost diff --git a/fabric_cf/orchestrator/swagger_client/api/__init__.py b/fabric_cf/orchestrator/swagger_client/api/__init__.py index 245bbdb..236f67a 100644 --- a/fabric_cf/orchestrator/swagger_client/api/__init__.py +++ b/fabric_cf/orchestrator/swagger_client/api/__init__.py @@ -3,6 +3,7 @@ # flake8: noqa # import apis into api package +from fabric_cf.orchestrator.swagger_client.api.metrics_api import MetricsApi from fabric_cf.orchestrator.swagger_client.api.poas_api import PoasApi from fabric_cf.orchestrator.swagger_client.api.resources_api import ResourcesApi from fabric_cf.orchestrator.swagger_client.api.slices_api import SlicesApi diff --git a/fabric_cf/orchestrator/swagger_client/api/metrics_api.py b/fabric_cf/orchestrator/swagger_client/api/metrics_api.py new file mode 100644 index 0000000..120038b --- /dev/null +++ b/fabric_cf/orchestrator/swagger_client/api/metrics_api.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + Fabric Orchestrator API + + This is Fabric Orchestrator API # noqa: E501 + + OpenAPI spec version: 1.0.1 + Contact: kthare10@unc.edu + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from fabric_cf.orchestrator.swagger_client.api_client import ApiClient + + +class MetricsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def metrics_overview_get(self, **kwargs): # noqa: E501 + """Control Framework metrics overview # noqa: E501 + + Control Framework metrics overview # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.metrics_overview_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] excluded_projects: List of projects to exclude from the metrics overview + :return: Metrics + If the method is called asynchronously, + returns the request thread. + """ + kwargs = {key: value for key, value in kwargs.items() if value is not None} + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.metrics_overview_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.metrics_overview_get_with_http_info(**kwargs) # noqa: E501 + return data + + def metrics_overview_get_with_http_info(self, **kwargs): # noqa: E501 + """Control Framework metrics overview # noqa: E501 + + Control Framework metrics overview # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.metrics_overview_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] excluded_projects: List of projects to exclude from the metrics overview + :return: Metrics + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['excluded_projects'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method metrics_overview_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'excluded_projects' in params: + query_params.append(('excluded_projects', params['excluded_projects'])) # noqa: E501 + collection_formats['excluded_projects'] = 'multi' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/metrics/overview', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Metrics', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/fabric_cf/orchestrator/swagger_client/api/resources_api.py b/fabric_cf/orchestrator/swagger_client/api/resources_api.py index dcb15f2..74d6d9f 100644 --- a/fabric_cf/orchestrator/swagger_client/api/resources_api.py +++ b/fabric_cf/orchestrator/swagger_client/api/resources_api.py @@ -31,17 +31,27 @@ def __init__(self, api_client=None): def portalresources_get(self, graph_format, **kwargs): # noqa: E501 """Retrieve a listing and description of available resources for portal # noqa: E501 + Retrieve a listing and description of available resources for portal # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.portalresources_get(graph_format, async_req=True) >>> result = thread.get() + :param async_req bool :param str graph_format: graph format (required) + :param int level: Level of details + :param bool force_refresh: Force to retrieve current available resource information. + :param str start_date: starting date to check availability from + :param str end_date: end date to check availability until + :param str includes: comma separated lists of sites to include + :param str excludes: comma separated lists of sites to exclude :return: Resources If the method is called asynchronously, returns the request thread. """ + # Remove all arguments with None value from kwargs + kwargs = {key: value for key, value in kwargs.items() if value is not None} kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.portalresources_get_with_http_info(graph_format, **kwargs) # noqa: E501 @@ -51,19 +61,27 @@ def portalresources_get(self, graph_format, **kwargs): # noqa: E501 def portalresources_get_with_http_info(self, graph_format, **kwargs): # noqa: E501 """Retrieve a listing and description of available resources for portal # noqa: E501 + Retrieve a listing and description of available resources for portal # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.portalresources_get_with_http_info(graph_format, async_req=True) >>> result = thread.get() + :param async_req bool :param str graph_format: graph format (required) + :param int level: Level of details + :param bool force_refresh: Force to retrieve current available resource information. + :param str start_date: starting date to check availability from + :param str end_date: end date to check availability until + :param str includes: comma separated lists of sites to include + :param str excludes: comma separated lists of sites to exclude :return: Resources If the method is called asynchronously, returns the request thread. """ - all_params = ['graph_format'] # noqa: E501 + all_params = ['graph_format', 'level', 'force_refresh', 'start_date', 'end_date', 'includes', 'excludes'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -90,6 +108,18 @@ def portalresources_get_with_http_info(self, graph_format, **kwargs): # noqa: E query_params = [] if 'graph_format' in params: query_params.append(('graph_format', params['graph_format'])) # noqa: E501 + if 'level' in params: + query_params.append(('level', params['level'])) # noqa: E501 + if 'force_refresh' in params: + query_params.append(('force_refresh', params['force_refresh'])) # noqa: E501 + if 'start_date' in params: + query_params.append(('start_date', params['start_date'])) # noqa: E501 + if 'end_date' in params: + query_params.append(('end_date', params['end_date'])) # noqa: E501 + if 'includes' in params: + query_params.append(('includes', params['includes'])) # noqa: E501 + if 'excludes' in params: + query_params.append(('excludes', params['excludes'])) # noqa: E501 header_params = {} @@ -122,18 +152,26 @@ def portalresources_get_with_http_info(self, graph_format, **kwargs): # noqa: E def resources_get(self, level, force_refresh, **kwargs): # noqa: E501 """Retrieve a listing and description of available resources. By default, a cached available resource information is returned. User can force to request the current available resources. # noqa: E501 + Retrieve a listing and description of available resources. By default, a cached available resource information is returned. User can force to request the current available resources. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.resources_get(level, force_refresh, async_req=True) >>> result = thread.get() + :param async_req bool :param int level: Level of details (required) :param bool force_refresh: Force to retrieve current available resource information. (required) + :param str start_date: starting date to check availability from + :param str end_date: end date to check availability until + :param str includes: comma separated lists of sites to include + :param str excludes: comma separated lists of sites to exclude :return: Resources If the method is called asynchronously, returns the request thread. """ + # Remove all arguments with None value from kwargs + kwargs = {key: value for key, value in kwargs.items() if value is not None} kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.resources_get_with_http_info(level, force_refresh, **kwargs) # noqa: E501 @@ -151,12 +189,16 @@ def resources_get_with_http_info(self, level, force_refresh, **kwargs): # noqa: :param async_req bool :param int level: Level of details (required) :param bool force_refresh: Force to retrieve current available resource information. (required) + :param str start_date: starting date to check availability from + :param str end_date: end date to check availability until + :param str includes: comma separated lists of sites to include + :param str excludes: comma separated lists of sites to exclude :return: Resources If the method is called asynchronously, returns the request thread. """ - all_params = ['level', 'force_refresh'] # noqa: E501 + all_params = ['level', 'force_refresh', 'start_date', 'end_date', 'includes', 'excludes'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -189,6 +231,14 @@ def resources_get_with_http_info(self, level, force_refresh, **kwargs): # noqa: query_params.append(('level', params['level'])) # noqa: E501 if 'force_refresh' in params: query_params.append(('force_refresh', params['force_refresh'])) # noqa: E501 + if 'start_date' in params: + query_params.append(('start_date', params['start_date'])) # noqa: E501 + if 'end_date' in params: + query_params.append(('end_date', params['end_date'])) # noqa: E501 + if 'includes' in params: + query_params.append(('includes', params['includes'])) # noqa: E501 + if 'excludes' in params: + query_params.append(('excludes', params['excludes'])) # noqa: E501 header_params = {} @@ -217,4 +267,4 @@ def resources_get_with_http_info(self, level, force_refresh, **kwargs): # noqa: _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) \ No newline at end of file + collection_formats=collection_formats) diff --git a/fabric_cf/orchestrator/swagger_client/api/slices_api.py b/fabric_cf/orchestrator/swagger_client/api/slices_api.py index 67bbfba..53f4bc6 100644 --- a/fabric_cf/orchestrator/swagger_client/api/slices_api.py +++ b/fabric_cf/orchestrator/swagger_client/api/slices_api.py @@ -29,17 +29,17 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def slices_create_post(self, body, name, **kwargs): # noqa: E501 + def slices_create_post(self, body, name, ssh_key, **kwargs): # noqa: E501 """Create slice # noqa: E501 Request to create slice as described in the request. Request would be a graph ML describing the requested resources. Resources may be requested to be created now or in future. On success, one or more slivers are allocated, containing resources satisfying the request, and assigned to the given slice. This API returns list and description of the resources reserved for the slice in the form of Graph ML. Orchestrator would also trigger provisioning of these resources asynchronously on the appropriate sites either now or in the future as requested. Experimenter can invoke get slice API to get the latest state of the requested resources. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.slices_create_post(body, name, async_req=True) + >>> thread = api.slices_create_post(body, name, ssh_key, async_req=True) >>> result = thread.get() :param async_req bool - :param SlicesPost body: Create new Slice (required) + :param str body: (required) :param str name: Slice Name (required) :param str ssh_key: User SSH Key (required) :param str lease_end_time: Lease End Time for the Slice @@ -49,22 +49,22 @@ def slices_create_post(self, body, name, **kwargs): # noqa: E501 """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.slices_create_post_with_http_info(body, name, **kwargs) # noqa: E501 + return self.slices_create_post_with_http_info(body, name, ssh_key, **kwargs) # noqa: E501 else: - (data) = self.slices_create_post_with_http_info(body, name, **kwargs) # noqa: E501 + (data) = self.slices_create_post_with_http_info(body, name, ssh_key, **kwargs) # noqa: E501 return data - def slices_create_post_with_http_info(self, body, name, **kwargs): # noqa: E501 + def slices_create_post_with_http_info(self, body, name, ssh_key, **kwargs): # noqa: E501 """Create slice # noqa: E501 Request to create slice as described in the request. Request would be a graph ML describing the requested resources. Resources may be requested to be created now or in future. On success, one or more slivers are allocated, containing resources satisfying the request, and assigned to the given slice. This API returns list and description of the resources reserved for the slice in the form of Graph ML. Orchestrator would also trigger provisioning of these resources asynchronously on the appropriate sites either now or in the future as requested. Experimenter can invoke get slice API to get the latest state of the requested resources. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.slices_create_post_with_http_info(body, name, async_req=True) + >>> thread = api.slices_create_post_with_http_info(body, name, ssh_key, async_req=True) >>> result = thread.get() :param async_req bool - :param SlicesPost body: Create new Slice (required) + :param str body: (required) :param str name: Slice Name (required) :param str ssh_key: User SSH Key (required) :param str lease_end_time: Lease End Time for the Slice @@ -73,7 +73,7 @@ def slices_create_post_with_http_info(self, body, name, **kwargs): # noqa: E501 returns the request thread. """ - all_params = ['body', 'name', 'lease_end_time'] # noqa: E501 + all_params = ['body', 'name', 'ssh_key', 'lease_end_time'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -96,6 +96,10 @@ def slices_create_post_with_http_info(self, body, name, **kwargs): # noqa: E501 if ('name' not in params or params['name'] is None): raise ValueError("Missing the required parameter `name` when calling `slices_create_post`") # noqa: E501 + # verify the required parameter 'ssh_key' is set + if ('ssh_key' not in params or + params['ssh_key'] is None): + raise ValueError("Missing the required parameter `ssh_key` when calling `slices_create_post`") # noqa: E501 collection_formats = {} @@ -104,6 +108,8 @@ def slices_create_post_with_http_info(self, body, name, **kwargs): # noqa: E501 query_params = [] if 'name' in params: query_params.append(('name', params['name'])) # noqa: E501 + if 'ssh_key' in params: + query_params.append(('ssh_key', params['ssh_key'])) # noqa: E501 if 'lease_end_time' in params: query_params.append(('lease_end_time', params['lease_end_time'])) # noqa: E501 @@ -154,11 +160,13 @@ def slices_creates_post(self, body, name, **kwargs): # noqa: E501 :param async_req bool :param SlicesPost body: Create new Slice (required) :param str name: Slice Name (required) + :param str lease_start_time: Lease End Time for the Slice :param str lease_end_time: Lease End Time for the Slice :return: Slivers If the method is called asynchronously, returns the request thread. """ + kwargs = {key: value for key, value in kwargs.items() if value is not None} kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.slices_creates_post_with_http_info(body, name, **kwargs) # noqa: E501 @@ -178,13 +186,14 @@ def slices_creates_post_with_http_info(self, body, name, **kwargs): # noqa: E50 :param async_req bool :param SlicesPost body: Create new Slice (required) :param str name: Slice Name (required) + :param str lease_start_time: Lease End Time for the Slice :param str lease_end_time: Lease End Time for the Slice :return: Slivers If the method is called asynchronously, returns the request thread. """ - all_params = ['body', 'name', 'lease_end_time'] # noqa: E501 + all_params = ['body', 'name', 'lease_start_time', 'lease_end_time'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -215,6 +224,8 @@ def slices_creates_post_with_http_info(self, body, name, **kwargs): # noqa: E50 query_params = [] if 'name' in params: query_params.append(('name', params['name'])) # noqa: E501 + if 'lease_start_time' in params: + query_params.append(('lease_start_time', params['lease_start_time'])) # noqa: E501 if 'lease_end_time' in params: query_params.append(('lease_end_time', params['lease_end_time'])) # noqa: E501 @@ -446,6 +457,8 @@ def slices_get(self, **kwargs): # noqa: E501 :param async_req bool :param str name: Search for Slices with the name + :param str search: search term applied + :param bool exact_match: Exact Match for Search term :param bool as_self: GET object as Self :param list[str] states: Search for Slices in the specified states :param int limit: maximum number of results to return per page (1 or more) @@ -472,6 +485,8 @@ def slices_get_with_http_info(self, **kwargs): # noqa: E501 :param async_req bool :param str name: Search for Slices with the name + :param str search: search term applied + :param bool exact_match: Exact Match for Search term :param bool as_self: GET object as Self :param list[str] states: Search for Slices in the specified states :param int limit: maximum number of results to return per page (1 or more) @@ -481,7 +496,7 @@ def slices_get_with_http_info(self, **kwargs): # noqa: E501 returns the request thread. """ - all_params = ['name', 'as_self', 'states', 'limit', 'offset'] # noqa: E501 + all_params = ['name', 'search', 'exact_match', 'as_self', 'states', 'limit', 'offset'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -504,6 +519,10 @@ def slices_get_with_http_info(self, **kwargs): # noqa: E501 query_params = [] if 'name' in params: query_params.append(('name', params['name'])) # noqa: E501 + if 'search' in params: + query_params.append(('search', params['search'])) # noqa: E501 + if 'exact_match' in params: + query_params.append(('exact_match', params['exact_match'])) # noqa: E501 if 'as_self' in params: query_params.append(('as_self', params['as_self'])) # noqa: E501 if 'states' in params: diff --git a/fabric_cf/orchestrator/swagger_client/models/__init__.py b/fabric_cf/orchestrator/swagger_client/models/__init__.py index 253ae40..c40d95b 100644 --- a/fabric_cf/orchestrator/swagger_client/models/__init__.py +++ b/fabric_cf/orchestrator/swagger_client/models/__init__.py @@ -14,10 +14,12 @@ from __future__ import absolute_import # import models into model package +from fabric_cf.orchestrator.swagger_client.models.metrics import Metrics from fabric_cf.orchestrator.swagger_client.models.poa import Poa 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 diff --git a/fabric_cf/orchestrator/swagger_client/models/metrics.py b/fabric_cf/orchestrator/swagger_client/models/metrics.py new file mode 100644 index 0000000..348f588 --- /dev/null +++ b/fabric_cf/orchestrator/swagger_client/models/metrics.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Fabric Orchestrator API + + This is Fabric Orchestrator API # noqa: E501 + + OpenAPI spec version: 1.0.1 + Contact: kthare10@unc.edu + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from fabric_cf.orchestrator.swagger_client.models.status200_ok_single import Status200OkSingle # noqa: F401,E501 + + +class Metrics(Status200OkSingle): + """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 = { + 'results': 'list[object]' + } + if hasattr(Status200OkSingle, "swagger_types"): + swagger_types.update(Status200OkSingle.swagger_types) + + attribute_map = { + 'results': 'results' + } + if hasattr(Status200OkSingle, "attribute_map"): + attribute_map.update(Status200OkSingle.attribute_map) + + def __init__(self, results=None, *args, **kwargs): # noqa: E501 + """Metrics - a model defined in Swagger""" # noqa: E501 + Status200OkSingle.__init__(self, *args, **kwargs) + self._results = None + self.discriminator = None + if results is not None: + self.results = results + + @property + def results(self): + """Gets the results of this Metrics. # noqa: E501 + + + :return: The results of this Metrics. # noqa: E501 + :rtype: list[object] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this Metrics. + + + :param results: The results of this Metrics. # noqa: E501 + :type: list[object] + """ + + self._results = results + + 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(Metrics, 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, Metrics): + 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/fabric_cf/orchestrator/swagger_client/models/poa.py b/fabric_cf/orchestrator/swagger_client/models/poa.py index 6ad3be3..6d07bdf 100644 --- a/fabric_cf/orchestrator/swagger_client/models/poa.py +++ b/fabric_cf/orchestrator/swagger_client/models/poa.py @@ -47,7 +47,6 @@ def __init__(self, data=None, *args, **kwargs): # noqa: E501 self.discriminator = None if data is not None: self.data = data - Status200OkSingle.__init__(self, *args, **kwargs) @property def data(self): diff --git a/fabric_cf/orchestrator/swagger_client/models/slice.py b/fabric_cf/orchestrator/swagger_client/models/slice.py index fb1bc88..4899406 100644 --- a/fabric_cf/orchestrator/swagger_client/models/slice.py +++ b/fabric_cf/orchestrator/swagger_client/models/slice.py @@ -36,7 +36,9 @@ class Slice(object): 'project_name': 'str', 'graph_id': 'str', 'name': 'str', - 'slice_id': 'str' + 'slice_id': 'str', + 'owner_user_id': 'str', + 'owner_email': 'str' } attribute_map = { @@ -48,10 +50,12 @@ class Slice(object): 'project_name': 'project_name', 'graph_id': 'graph_id', 'name': 'name', - 'slice_id': 'slice_id' + 'slice_id': 'slice_id', + 'owner_user_id': 'owner_user_id', + 'owner_email': 'owner_email' } - def __init__(self, model=None, lease_start_time=None, lease_end_time=None, state=None, project_id=None, project_name=None, graph_id=None, name=None, slice_id=None): # noqa: E501 + def __init__(self, model=None, lease_start_time=None, lease_end_time=None, state=None, project_id=None, project_name=None, graph_id=None, name=None, slice_id=None, owner_user_id=None, owner_email=None): # noqa: E501 """Slice - a model defined in Swagger""" # noqa: E501 self._model = None self._lease_start_time = None @@ -62,6 +66,8 @@ def __init__(self, model=None, lease_start_time=None, lease_end_time=None, state self._graph_id = None self._name = None self._slice_id = None + self._owner_user_id = None + self._owner_email = None self.discriminator = None if model is not None: self.model = model @@ -78,6 +84,10 @@ def __init__(self, model=None, lease_start_time=None, lease_end_time=None, state self.graph_id = graph_id self.name = name self.slice_id = slice_id + if owner_user_id is not None: + self.owner_user_id = owner_user_id + if owner_email is not None: + self.owner_email = owner_email @property def model(self): @@ -274,6 +284,48 @@ def slice_id(self, slice_id): self._slice_id = slice_id + @property + def owner_user_id(self): + """Gets the owner_user_id of this Slice. # noqa: E501 + + + :return: The owner_user_id of this Slice. # noqa: E501 + :rtype: str + """ + return self._owner_user_id + + @owner_user_id.setter + def owner_user_id(self, owner_user_id): + """Sets the owner_user_id of this Slice. + + + :param owner_user_id: The owner_user_id of this Slice. # noqa: E501 + :type: str + """ + + self._owner_user_id = owner_user_id + + @property + def owner_email(self): + """Gets the owner_email of this Slice. # noqa: E501 + + + :return: The owner_email of this Slice. # noqa: E501 + :rtype: str + """ + return self._owner_email + + @owner_email.setter + def owner_email(self, owner_email): + """Sets the owner_email of this Slice. + + + :param owner_email: The owner_email of this Slice. # noqa: E501 + :type: str + """ + + self._owner_email = owner_email + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/fabric_cf/orchestrator/swagger_client/models/slice_details.py b/fabric_cf/orchestrator/swagger_client/models/slice_details.py index 056118c..5feef85 100644 --- a/fabric_cf/orchestrator/swagger_client/models/slice_details.py +++ b/fabric_cf/orchestrator/swagger_client/models/slice_details.py @@ -42,12 +42,11 @@ class SliceDetails(Status200OkSingle): def __init__(self, data=None, *args, **kwargs): # noqa: E501 """SliceDetails - a model defined in Swagger""" # noqa: E501 + Status200OkSingle.__init__(self, *args, **kwargs) self._data = None self.discriminator = None if data is not None: self.data = data - Status200OkSingle.__init__(self, *args, **kwargs) - @property def data(self): diff --git a/fabric_cf/orchestrator/swagger_client/models/sliver.py b/fabric_cf/orchestrator/swagger_client/models/sliver.py index 3fdc070..ab7026b 100644 --- a/fabric_cf/orchestrator/swagger_client/models/sliver.py +++ b/fabric_cf/orchestrator/swagger_client/models/sliver.py @@ -43,7 +43,9 @@ class Sliver(object): 'join_state': 'str', 'graph_node_id': 'str', 'slice_id': 'str', - 'sliver_id': 'str' + 'sliver_id': 'str', + 'owner_user_id': 'str', + 'owner_email': 'str' } attribute_map = { @@ -57,10 +59,12 @@ class Sliver(object): 'join_state': 'join_state', 'graph_node_id': 'graph_node_id', 'slice_id': 'slice_id', - 'sliver_id': 'sliver_id' + 'sliver_id': 'sliver_id', + 'owner_user_id': 'owner_user_id', + 'owner_email': 'owner_email' } - def __init__(self, notice=None, sliver_type=None, sliver=None, lease_start_time=None, lease_end_time=None, state=None, pending_state=None, join_state=None, graph_node_id=None, slice_id=None, sliver_id=None): # noqa: E501 + def __init__(self, notice=None, sliver_type=None, sliver=None, lease_start_time=None, lease_end_time=None, state=None, pending_state=None, join_state=None, graph_node_id=None, slice_id=None, sliver_id=None, owner_user_id=None, owner_email=None): # noqa: E501 """Sliver - a model defined in Swagger""" # noqa: E501 self._notice = None self._sliver_type = None @@ -73,6 +77,8 @@ def __init__(self, notice=None, sliver_type=None, sliver=None, lease_start_time= self._graph_node_id = None self._slice_id = None self._sliver_id = None + self._owner_user_id = None + self._owner_email = None self.discriminator = None if notice is not None: self.notice = notice @@ -93,6 +99,10 @@ def __init__(self, notice=None, sliver_type=None, sliver=None, lease_start_time= self.graph_node_id = graph_node_id self.slice_id = slice_id self.sliver_id = sliver_id + if owner_user_id is not None: + self.owner_user_id = owner_user_id + if owner_email is not None: + self.owner_email = owner_email @property def notice(self): @@ -331,6 +341,48 @@ def sliver_id(self, sliver_id): self._sliver_id = sliver_id + @property + def owner_user_id(self): + """Gets the owner_user_id of this Sliver. # noqa: E501 + + + :return: The owner_user_id of this Sliver. # noqa: E501 + :rtype: str + """ + return self._owner_user_id + + @owner_user_id.setter + def owner_user_id(self, owner_user_id): + """Sets the owner_user_id of this Sliver. + + + :param owner_user_id: The owner_user_id of this Sliver. # noqa: E501 + :type: str + """ + + self._owner_user_id = owner_user_id + + @property + def owner_email(self): + """Gets the owner_email of this Sliver. # noqa: E501 + + + :return: The owner_email of this Sliver. # noqa: E501 + :rtype: str + """ + return self._owner_email + + @owner_email.setter + def owner_email(self, owner_email): + """Sets the owner_email of this Sliver. + + + :param owner_email: The owner_email of this Sliver. # noqa: E501 + :type: str + """ + + self._owner_email = owner_email + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/fabric_cf/orchestrator/swagger_client/rest.py b/fabric_cf/orchestrator/swagger_client/rest.py index 32b150b..30ddf02 100644 --- a/fabric_cf/orchestrator/swagger_client/rest.py +++ b/fabric_cf/orchestrator/swagger_client/rest.py @@ -42,11 +42,11 @@ def __init__(self, resp): def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() + return self.urllib3_response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) + return self.urllib3_response.headers.get(name, default) class RESTClientObject(object): diff --git a/pyproject.toml b/pyproject.toml index eccddde..3f5c2cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ dependencies = [ "six >= 1.10", "python_dateutil >= 2.5.3", "requests>=2.28.1", - "fabric-fim==1.6.0", + "fabric-fim==1.7.0", ] [project.optional-dependencies] diff --git a/test/test_metrics.py b/test/test_metrics.py new file mode 100644 index 0000000..83a4dd1 --- /dev/null +++ b/test/test_metrics.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Fabric Orchestrator API + + This is Fabric Orchestrator API # noqa: E501 + + OpenAPI spec version: 1.0.1 + Contact: kthare10@unc.edu + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.models.metrics import Metrics # noqa: E501 +from swagger_client.rest import ApiException + + +class TestMetrics(unittest.TestCase): + """Metrics unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMetrics(self): + """Test Metrics""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.metrics.Metrics() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_metrics_api.py b/test/test_metrics_api.py new file mode 100644 index 0000000..a22756a --- /dev/null +++ b/test/test_metrics_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Fabric Orchestrator API + + This is Fabric Orchestrator API # noqa: E501 + + OpenAPI spec version: 1.0.1 + Contact: kthare10@unc.edu + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.api.metrics_api import MetricsApi # noqa: E501 +from swagger_client.rest import ApiException + + +class TestMetricsApi(unittest.TestCase): + """MetricsApi unit test stubs""" + + def setUp(self): + self.api = MetricsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_metrics_overview_get(self): + """Test case for metrics_overview_get + + Control Framework metrics overview # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main()