Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rel1.8 - API changes for advance reservations #58

Merged
merged 4 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .swagger-codegen/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.54
3.0.63
2 changes: 1 addition & 1 deletion docs/MetricsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Method | HTTP request | Description

Control Framework metrics overview

Control Framework metrics overview
Control Framework metrics overview

### Example
```python
Expand Down
6 changes: 4 additions & 2 deletions docs/SlicesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,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_creates_post**
> Slivers slices_creates_post(body, name, lease_start_time=lease_start_time, lease_end_time=lease_end_time)
> Slivers slices_creates_post(body, name, lifetime=lifetime, lease_start_time=lease_start_time, lease_end_time=lease_end_time)

Create slice

Expand All @@ -101,12 +101,13 @@ configuration.api_key['Authorization'] = 'YOUR_API_KEY'
api_instance = SlicesApi(ApiClient(configuration))
body = SlicesPost() # SlicesPost | Create new Slice
name = 'name_example' # str | Slice Name
lifetime = 24 # int | Lifetime of the slice requested in hours. (optional) (default to 24)
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_start_time=lease_start_time, lease_end_time=lease_end_time)
api_response = api_instance.slices_creates_post(body, name, lifetime=lifetime, 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)
Expand All @@ -118,6 +119,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**SlicesPost**](SlicesPost.md)| Create new Slice |
**name** | **str**| Slice Name |
**lifetime** | **int**| Lifetime of the slice requested in hours. | [optional] [default to 24]
**lease_start_time** | **str**| Lease End Time for the Slice | [optional]
**lease_end_time** | **str**| Lease End Time for the Slice | [optional]

Expand Down
2 changes: 1 addition & 1 deletion fabric_cf/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.7.3"
__version__ = "1.8.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 @@ -138,7 +138,7 @@ def __set_tokens(self, *, token: str):

def create(self, *, token: str, slice_name: str, ssh_key: Union[str, List[str]],
topology: ExperimentTopology = None, slice_graph: str = None, lease_start_time: str = None,
lease_end_time: str = None) -> Tuple[Status, Union[Exception, List[Sliver]]]:
lease_end_time: str = None, lifetime: int = 24) -> Tuple[Status, Union[Exception, List[Sliver]]]:
"""
Create a slice
@param token fabric token
Expand All @@ -148,6 +148,7 @@ def create(self, *, token: str, slice_name: str, ssh_key: Union[str, List[str]],
@param slice_graph Slice Graph string
@param lease_start_time Lease Start Time
@param lease_end_time Lease End Time
@param slice lifetime in hours
@return Tuple containing Status and Exception/Json containing slivers created
"""
if token is None:
Expand Down Expand Up @@ -190,7 +191,8 @@ def create(self, *, token: str, slice_name: str, ssh_key: Union[str, List[str]],
body = SlicesPost(graph_model=slice_graph, ssh_keys=ssh_keys)
slivers = self.slices_api.slices_creates_post(name=slice_name, body=body,
lease_end_time=lease_end_time,
lease_start_time=lease_start_time)
lease_start_time=lease_start_time,
lifetime=lifetime)
return Status.OK, slivers.data if slivers.data is not None else []
except Exception as e:
return Status.FAILURE, e
Expand Down
6 changes: 5 additions & 1 deletion fabric_cf/orchestrator/swagger_client/api/slices_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ 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 int lifetime: Lifetime of the slice requested in hours.
:param str lease_start_time: Lease End Time for the Slice
:param str lease_end_time: Lease End Time for the Slice
:return: Slivers
Expand All @@ -186,14 +187,15 @@ 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 int lifetime: Lifetime of the slice requested in hours.
: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_start_time', 'lease_end_time'] # noqa: E501
all_params = ['body', 'name', 'lifetime', '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')
Expand Down Expand Up @@ -224,6 +226,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 'lifetime' in params:
query_params.append(('lifetime', params['lifetime'])) # 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:
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.7.2",
"fabric-fim==1.8.0",
]

[project.optional-dependencies]
Expand Down
Loading