Skip to content

Commit 5b5cdd6

Browse files
committed
[PCAPI] Fix DescribeClusterResponse by replacing the field 'failureReason' with 'failures' and importing CloudFormationResourceStatus in modules init.
Signed-off-by: Giacomo Marciani <mgiacomo@amazon.com>
1 parent fe15721 commit 5b5cdd6

File tree

5 files changed

+36
-11
lines changed

5 files changed

+36
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ CHANGELOG
1717
- Allow ParallelCluster Custom Resource to suppress validators using `PclusterCluster/SuppressValidators`.
1818
- Removing `/etc/profile.d/pcluster.sh` so that it's not executed at every user login and
1919
`cfn_bootstrap_virtualenv` is not added in PATH environment variable.
20+
- Fix ParallelCluster API spec by replacing in `DescribeCluster` response the field `failureReason` with `failures`.
2021

2122
**CHANGES**
2223
- CentOS 7 is no longer supported.

cli/src/pcluster/api/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from pcluster.api.models.build_image_request_content import BuildImageRequestContent
2121
from pcluster.api.models.build_image_response_content import BuildImageResponseContent
2222
from pcluster.api.models.change import Change
23+
from pcluster.api.models.cloud_formation_resource_status import CloudFormationResourceStatus
2324
from pcluster.api.models.cloud_formation_stack_status import CloudFormationStackStatus
2425
from pcluster.api.models.cluster_configuration_structure import ClusterConfigurationStructure
2526
from pcluster.api.models.cluster_info_summary import ClusterInfoSummary

cli/src/pcluster/api/models/describe_cluster_response_content.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def __init__(
8080
:type scheduler: Scheduler
8181
:param login_nodes: The login_nodes of this DescribeClusterResponseContent. # noqa: E501
8282
:type login_nodes: LoginNodesPool
83+
:param failures: The failures of this DescribeClusterResponseContent. # noqa: E501
8384
:type failures: List[Failure]
8485
"""
8586
self.openapi_types = {
@@ -487,7 +488,7 @@ def login_nodes(self, login_nodes):
487488
def failures(self):
488489
"""Gets the failures of this DescribeClusterResponseContent.
489490
490-
Failures reason and code when the stack is in CREATE_FAILED status. # noqa: E501
491+
Failures array containing failures reason and code when the stack is in CREATE_FAILED status. # noqa: E501
491492
492493
:return: The failures of this DescribeClusterResponseContent.
493494
:rtype: List[Failure]
@@ -498,7 +499,7 @@ def failures(self):
498499
def failures(self, failures):
499500
"""Sets the failures of this DescribeClusterResponseContent.
500501
501-
Failures reason and code when the stack is in CREATE_FAILED status. # noqa: E501
502+
Failures array containing failures reason and code when the stack is in CREATE_FAILED status. # noqa: E501
502503
503504
:param failures: The failures of this DescribeClusterResponseContent.
504505
:type failures: List[Failure]

cli/src/pcluster/api/models/failure.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def from_dict(cls, dikt) -> "Failure":
4545
def failure_code(self):
4646
"""Gets the failure_code of this Failure.
4747
48-
Failure code # noqa: E501
48+
Failure code when the cluster stack is in CREATE_FAILED status. # noqa: E501
4949
5050
:return: The failure_code of this Failure.
5151
:rtype: str
@@ -56,7 +56,7 @@ def failure_code(self):
5656
def failure_code(self, failure_code):
5757
"""Sets the failure_code of this Failure.
5858
59-
Failure code # noqa: E501
59+
Failure code when the cluster stack is in CREATE_FAILED status. # noqa: E501
6060
6161
:param failure_code: The failure_code of this Failure.
6262
:type failure_code: str
@@ -68,7 +68,7 @@ def failure_code(self, failure_code):
6868
def failure_reason(self):
6969
"""Gets the failure_reason of this Failure.
7070
71-
Failure reason # noqa: E501
71+
Failure reason when the cluster stack is in CREATE_FAILED status. # noqa: E501
7272
7373
:return: The failure_reason of this Failure.
7474
:rtype: str
@@ -79,7 +79,7 @@ def failure_reason(self):
7979
def failure_reason(self, failure_reason):
8080
"""Sets the failure_reason of this Failure.
8181
82-
Failure reason # noqa: E501
82+
Failure reason when the cluster stack is in CREATE_FAILED status. # noqa: E501
8383
8484
:param failure_reason: The failure_reason of this Failure.
8585
:type failure_reason: str

cli/src/pcluster/api/openapi/openapi.yaml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,6 +2348,11 @@ components:
23482348
type: object
23492349
DescribeClusterResponseContent:
23502350
example:
2351+
failures:
2352+
- failureCode: failureCode
2353+
failureReason: failureReason
2354+
- failureCode: failureCode
2355+
failureReason: failureReason
23512356
creationTime: 2000-01-23T04:56:07.000+00:00
23522357
loginNodes:
23532358
unhealthyNodes: 6
@@ -2431,11 +2436,13 @@ components:
24312436
$ref: '#/components/schemas/EC2Instance'
24322437
loginNodes:
24332438
$ref: '#/components/schemas/LoginNodesPool'
2434-
failureReason:
2435-
description: "Reason of the failure when the stack is in CREATE_FAILED,\
2436-
\ UPDATE_FAILED or DELETE_FAILED status."
2437-
title: failureReason
2438-
type: string
2439+
failures:
2440+
description: Failures array containing failures reason and code when the
2441+
stack is in CREATE_FAILED status.
2442+
items:
2443+
$ref: '#/components/schemas/Failure'
2444+
title: failures
2445+
type: array
24392446
required:
24402447
- cloudFormationStackStatus
24412448
- cloudformationStackArn
@@ -2682,6 +2689,21 @@ components:
26822689
- ERROR
26832690
title: Ec2AmiState
26842691
type: string
2692+
Failure:
2693+
example:
2694+
failureCode: failureCode
2695+
failureReason: failureReason
2696+
properties:
2697+
failureCode:
2698+
description: Failure code when the cluster stack is in CREATE_FAILED status.
2699+
title: failureCode
2700+
type: string
2701+
failureReason:
2702+
description: Failure reason when the cluster stack is in CREATE_FAILED status.
2703+
title: failureReason
2704+
type: string
2705+
title: Failure
2706+
type: object
26852707
GetClusterLogEventsResponseContent:
26862708
example:
26872709
nextToken: nextToken

0 commit comments

Comments
 (0)