Skip to content

Commit

Permalink
update api
Browse files Browse the repository at this point in the history
  • Loading branch information
hanwen-pcluste authored and github-actions[bot] committed Aug 15, 2024
1 parent defe473 commit e235a7d
Show file tree
Hide file tree
Showing 83 changed files with 479 additions and 557 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
from typing import Dict, Tuple, Union

import connexion
import six
from typing import Dict
from typing import Tuple
from typing import Union

from pcluster.api import util
from pcluster.api.models.bad_request_exception_response_content import BadRequestExceptionResponseContent # noqa: E501
from pcluster.api.models.describe_compute_fleet_response_content import ( # noqa: E501
DescribeComputeFleetResponseContent,
)
from pcluster.api.models.internal_service_exception_response_content import ( # noqa: E501
InternalServiceExceptionResponseContent,
)
from pcluster.api.models.limit_exceeded_exception_response_content import ( # noqa: E501
LimitExceededExceptionResponseContent,
)
from pcluster.api.models.describe_compute_fleet_response_content import DescribeComputeFleetResponseContent # noqa: E501
from pcluster.api.models.internal_service_exception_response_content import InternalServiceExceptionResponseContent # noqa: E501
from pcluster.api.models.limit_exceeded_exception_response_content import LimitExceededExceptionResponseContent # noqa: E501
from pcluster.api.models.not_found_exception_response_content import NotFoundExceptionResponseContent # noqa: E501
from pcluster.api.models.unauthorized_client_error_response_content import ( # noqa: E501
UnauthorizedClientErrorResponseContent,
)
from pcluster.api.models.unauthorized_client_error_response_content import UnauthorizedClientErrorResponseContent # noqa: E501
from pcluster.api.models.update_compute_fleet_request_content import UpdateComputeFleetRequestContent # noqa: E501
from pcluster.api.models.update_compute_fleet_response_content import UpdateComputeFleetResponseContent # noqa: E501
from pcluster.api import util


def describe_compute_fleet(cluster_name, region=None): # noqa: E501
Expand All @@ -34,15 +27,15 @@ def describe_compute_fleet(cluster_name, region=None): # noqa: E501
:rtype: Union[DescribeComputeFleetResponseContent, Tuple[DescribeComputeFleetResponseContent, int], Tuple[DescribeComputeFleetResponseContent, int, Dict[str, str]]
"""
return "do some magic!"
return 'do some magic!'


def update_compute_fleet(update_compute_fleet_request_content, cluster_name, region=None): # noqa: E501
"""update_compute_fleet
Update the status of the cluster compute fleet. # noqa: E501
:param update_compute_fleet_request_content:
:param update_compute_fleet_request_content:
:type update_compute_fleet_request_content: dict | bytes
:param cluster_name: Name of the cluster
:type cluster_name: str
Expand All @@ -52,7 +45,5 @@ def update_compute_fleet(update_compute_fleet_request_content, cluster_name, reg
:rtype: Union[UpdateComputeFleetResponseContent, Tuple[UpdateComputeFleetResponseContent, int], Tuple[UpdateComputeFleetResponseContent, int, Dict[str, str]]
"""
if connexion.request.is_json:
update_compute_fleet_request_content = UpdateComputeFleetRequestContent.from_dict(
connexion.request.get_json()
) # noqa: E501
return "do some magic!"
update_compute_fleet_request_content = UpdateComputeFleetRequestContent.from_dict(connexion.request.get_json()) # noqa: E501
return 'do some magic!'
33 changes: 12 additions & 21 deletions cli/src/pcluster/api/controllers/cluster_instances_controller.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
from typing import Dict, Tuple, Union

import connexion
import six
from typing import Dict
from typing import Tuple
from typing import Union

from pcluster.api import util
from pcluster.api.models.bad_request_exception_response_content import BadRequestExceptionResponseContent # noqa: E501
from pcluster.api.models.describe_cluster_instances_response_content import ( # noqa: E501
DescribeClusterInstancesResponseContent,
)
from pcluster.api.models.internal_service_exception_response_content import ( # noqa: E501
InternalServiceExceptionResponseContent,
)
from pcluster.api.models.limit_exceeded_exception_response_content import ( # noqa: E501
LimitExceededExceptionResponseContent,
)
from pcluster.api.models.describe_cluster_instances_response_content import DescribeClusterInstancesResponseContent # noqa: E501
from pcluster.api.models.internal_service_exception_response_content import InternalServiceExceptionResponseContent # noqa: E501
from pcluster.api.models.limit_exceeded_exception_response_content import LimitExceededExceptionResponseContent # noqa: E501
from pcluster.api.models.node_type import NodeType # noqa: E501
from pcluster.api.models.not_found_exception_response_content import NotFoundExceptionResponseContent # noqa: E501
from pcluster.api.models.unauthorized_client_error_response_content import ( # noqa: E501
UnauthorizedClientErrorResponseContent,
)
from pcluster.api.models.unauthorized_client_error_response_content import UnauthorizedClientErrorResponseContent # noqa: E501
from pcluster.api import util


def delete_cluster_instances(cluster_name, region=None, force=None): # noqa: E501
Expand All @@ -35,12 +28,10 @@ def delete_cluster_instances(cluster_name, region=None, force=None): # noqa: E5
:rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]]
"""
return "do some magic!"
return 'do some magic!'


def describe_cluster_instances(
cluster_name, region=None, next_token=None, node_type=None, queue_name=None
): # noqa: E501
def describe_cluster_instances(cluster_name, region=None, next_token=None, node_type=None, queue_name=None): # noqa: E501
"""describe_cluster_instances
Describe the instances belonging to a given cluster. # noqa: E501
Expand All @@ -59,5 +50,5 @@ def describe_cluster_instances(
:rtype: Union[DescribeClusterInstancesResponseContent, Tuple[DescribeClusterInstancesResponseContent, int], Tuple[DescribeClusterInstancesResponseContent, int, Dict[str, str]]
"""
if connexion.request.is_json:
node_type = NodeType.from_dict(connexion.request.get_json()) # noqa: E501
return "do some magic!"
node_type = NodeType.from_dict(connexion.request.get_json()) # noqa: E501
return 'do some magic!'
48 changes: 15 additions & 33 deletions cli/src/pcluster/api/controllers/cluster_logs_controller.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,21 @@
from typing import Dict, Tuple, Union

import connexion
import six
from typing import Dict
from typing import Tuple
from typing import Union

from pcluster.api import util
from pcluster.api.models.bad_request_exception_response_content import BadRequestExceptionResponseContent # noqa: E501
from pcluster.api.models.get_cluster_log_events_response_content import GetClusterLogEventsResponseContent # noqa: E501
from pcluster.api.models.get_cluster_stack_events_response_content import ( # noqa: E501
GetClusterStackEventsResponseContent,
)
from pcluster.api.models.internal_service_exception_response_content import ( # noqa: E501
InternalServiceExceptionResponseContent,
)
from pcluster.api.models.limit_exceeded_exception_response_content import ( # noqa: E501
LimitExceededExceptionResponseContent,
)
from pcluster.api.models.list_cluster_log_streams_response_content import ( # noqa: E501
ListClusterLogStreamsResponseContent,
)
from pcluster.api.models.get_cluster_stack_events_response_content import GetClusterStackEventsResponseContent # noqa: E501
from pcluster.api.models.internal_service_exception_response_content import InternalServiceExceptionResponseContent # noqa: E501
from pcluster.api.models.limit_exceeded_exception_response_content import LimitExceededExceptionResponseContent # noqa: E501
from pcluster.api.models.list_cluster_log_streams_response_content import ListClusterLogStreamsResponseContent # noqa: E501
from pcluster.api.models.not_found_exception_response_content import NotFoundExceptionResponseContent # noqa: E501
from pcluster.api.models.unauthorized_client_error_response_content import ( # noqa: E501
UnauthorizedClientErrorResponseContent,
)


def get_cluster_log_events(
cluster_name,
log_stream_name,
region=None,
next_token=None,
start_from_head=None,
limit=None,
start_time=None,
end_time=None,
): # noqa: E501
from pcluster.api.models.unauthorized_client_error_response_content import UnauthorizedClientErrorResponseContent # noqa: E501
from pcluster.api import util


def get_cluster_log_events(cluster_name, log_stream_name, region=None, next_token=None, start_from_head=None, limit=None, start_time=None, end_time=None): # noqa: E501
"""get_cluster_log_events
Retrieve the events associated with a log stream. # noqa: E501
Expand All @@ -59,7 +41,7 @@ def get_cluster_log_events(
"""
start_time = util.deserialize_datetime(start_time)
end_time = util.deserialize_datetime(end_time)
return "do some magic!"
return 'do some magic!'


def get_cluster_stack_events(cluster_name, region=None, next_token=None): # noqa: E501
Expand All @@ -76,7 +58,7 @@ def get_cluster_stack_events(cluster_name, region=None, next_token=None): # noq
:rtype: Union[GetClusterStackEventsResponseContent, Tuple[GetClusterStackEventsResponseContent, int], Tuple[GetClusterStackEventsResponseContent, int, Dict[str, str]]
"""
return "do some magic!"
return 'do some magic!'


def list_cluster_log_streams(cluster_name, region=None, filters=None, next_token=None): # noqa: E501
Expand All @@ -95,4 +77,4 @@ def list_cluster_log_streams(cluster_name, region=None, filters=None, next_token
:rtype: Union[ListClusterLogStreamsResponseContent, Tuple[ListClusterLogStreamsResponseContent, int], Tuple[ListClusterLogStreamsResponseContent, int, Dict[str, str]]
"""
return "do some magic!"
return 'do some magic!'
80 changes: 25 additions & 55 deletions cli/src/pcluster/api/controllers/cluster_operations_controller.py
Original file line number Diff line number Diff line change
@@ -1,54 +1,36 @@
from typing import Dict, Tuple, Union

import connexion
import six
from typing import Dict
from typing import Tuple
from typing import Union

from pcluster.api import util
from pcluster.api.models.bad_request_exception_response_content import BadRequestExceptionResponseContent # noqa: E501
from pcluster.api.models.cluster_status_filtering_option import ClusterStatusFilteringOption # noqa: E501
from pcluster.api.models.conflict_exception_response_content import ConflictExceptionResponseContent # noqa: E501
from pcluster.api.models.create_cluster_bad_request_exception_response_content import ( # noqa: E501
CreateClusterBadRequestExceptionResponseContent,
)
from pcluster.api.models.create_cluster_bad_request_exception_response_content import CreateClusterBadRequestExceptionResponseContent # noqa: E501
from pcluster.api.models.create_cluster_request_content import CreateClusterRequestContent # noqa: E501
from pcluster.api.models.create_cluster_response_content import CreateClusterResponseContent # noqa: E501
from pcluster.api.models.delete_cluster_response_content import DeleteClusterResponseContent # noqa: E501
from pcluster.api.models.describe_cluster_response_content import DescribeClusterResponseContent # noqa: E501
from pcluster.api.models.dryrun_operation_exception_response_content import ( # noqa: E501
DryrunOperationExceptionResponseContent,
)
from pcluster.api.models.internal_service_exception_response_content import ( # noqa: E501
InternalServiceExceptionResponseContent,
)
from pcluster.api.models.limit_exceeded_exception_response_content import ( # noqa: E501
LimitExceededExceptionResponseContent,
)
from pcluster.api.models.dryrun_operation_exception_response_content import DryrunOperationExceptionResponseContent # noqa: E501
from pcluster.api.models.internal_service_exception_response_content import InternalServiceExceptionResponseContent # noqa: E501
from pcluster.api.models.limit_exceeded_exception_response_content import LimitExceededExceptionResponseContent # noqa: E501
from pcluster.api.models.list_clusters_response_content import ListClustersResponseContent # noqa: E501
from pcluster.api.models.not_found_exception_response_content import NotFoundExceptionResponseContent # noqa: E501
from pcluster.api.models.unauthorized_client_error_response_content import ( # noqa: E501
UnauthorizedClientErrorResponseContent,
)
from pcluster.api.models.update_cluster_bad_request_exception_response_content import ( # noqa: E501
UpdateClusterBadRequestExceptionResponseContent,
)
from pcluster.api.models.unauthorized_client_error_response_content import UnauthorizedClientErrorResponseContent # noqa: E501
from pcluster.api.models.update_cluster_bad_request_exception_response_content import UpdateClusterBadRequestExceptionResponseContent # noqa: E501
from pcluster.api.models.update_cluster_request_content import UpdateClusterRequestContent # noqa: E501
from pcluster.api.models.update_cluster_response_content import UpdateClusterResponseContent # noqa: E501
from pcluster.api.models.validation_level import ValidationLevel # noqa: E501
from pcluster.api import util


def create_cluster(
create_cluster_request_content,
region=None,
suppress_validators=None,
validation_failure_level=None,
dryrun=None,
rollback_on_failure=None,
): # noqa: E501
def create_cluster(create_cluster_request_content, region=None, suppress_validators=None, validation_failure_level=None, dryrun=None, rollback_on_failure=None): # noqa: E501
"""create_cluster
Create a managed cluster in a given region. # noqa: E501
:param create_cluster_request_content:
:param create_cluster_request_content:
:type create_cluster_request_content: dict | bytes
:param region: AWS Region that the operation corresponds to.
:type region: str
Expand All @@ -64,12 +46,10 @@ def create_cluster(
:rtype: Union[CreateClusterResponseContent, Tuple[CreateClusterResponseContent, int], Tuple[CreateClusterResponseContent, int, Dict[str, str]]
"""
if connexion.request.is_json:
create_cluster_request_content = CreateClusterRequestContent.from_dict(
connexion.request.get_json()
) # noqa: E501
create_cluster_request_content = CreateClusterRequestContent.from_dict(connexion.request.get_json()) # noqa: E501
if connexion.request.is_json:
validation_failure_level = ValidationLevel.from_dict(connexion.request.get_json()) # noqa: E501
return "do some magic!"
validation_failure_level = ValidationLevel.from_dict(connexion.request.get_json()) # noqa: E501
return 'do some magic!'


def delete_cluster(cluster_name, region=None): # noqa: E501
Expand All @@ -84,7 +64,7 @@ def delete_cluster(cluster_name, region=None): # noqa: E501
:rtype: Union[DeleteClusterResponseContent, Tuple[DeleteClusterResponseContent, int], Tuple[DeleteClusterResponseContent, int, Dict[str, str]]
"""
return "do some magic!"
return 'do some magic!'


def describe_cluster(cluster_name, region=None): # noqa: E501
Expand All @@ -99,7 +79,7 @@ def describe_cluster(cluster_name, region=None): # noqa: E501
:rtype: Union[DescribeClusterResponseContent, Tuple[DescribeClusterResponseContent, int], Tuple[DescribeClusterResponseContent, int, Dict[str, str]]
"""
return "do some magic!"
return 'do some magic!'


def list_clusters(region=None, next_token=None, cluster_status=None): # noqa: E501
Expand All @@ -118,23 +98,15 @@ def list_clusters(region=None, next_token=None, cluster_status=None): # noqa: E
"""
if connexion.request.is_json:
cluster_status = [ClusterStatusFilteringOption.from_dict(d) for d in connexion.request.get_json()] # noqa: E501
return "do some magic!"


def update_cluster(
update_cluster_request_content,
cluster_name,
suppress_validators=None,
validation_failure_level=None,
region=None,
dryrun=None,
force_update=None,
): # noqa: E501
return 'do some magic!'


def update_cluster(update_cluster_request_content, cluster_name, suppress_validators=None, validation_failure_level=None, region=None, dryrun=None, force_update=None): # noqa: E501
"""update_cluster
Update a cluster managed in a given region. # noqa: E501
:param update_cluster_request_content:
:param update_cluster_request_content:
:type update_cluster_request_content: dict | bytes
:param cluster_name: Name of the cluster
:type cluster_name: str
Expand All @@ -152,9 +124,7 @@ def update_cluster(
:rtype: Union[UpdateClusterResponseContent, Tuple[UpdateClusterResponseContent, int], Tuple[UpdateClusterResponseContent, int, Dict[str, str]]
"""
if connexion.request.is_json:
update_cluster_request_content = UpdateClusterRequestContent.from_dict(
connexion.request.get_json()
) # noqa: E501
update_cluster_request_content = UpdateClusterRequestContent.from_dict(connexion.request.get_json()) # noqa: E501
if connexion.request.is_json:
validation_failure_level = ValidationLevel.from_dict(connexion.request.get_json()) # noqa: E501
return "do some magic!"
validation_failure_level = ValidationLevel.from_dict(connexion.request.get_json()) # noqa: E501
return 'do some magic!'
Loading

0 comments on commit e235a7d

Please sign in to comment.