Skip to content

Commit

Permalink
Merge pull request #38 from vmware/update-catalog-8.4.1-swagger
Browse files Browse the repository at this point in the history
Update catalog deployment swagger to 8.4.1
  • Loading branch information
frodenas authored Jul 14, 2021
2 parents d4dcabb + 29a153c commit 4e88142
Show file tree
Hide file tree
Showing 88 changed files with 9,564 additions and 1,471 deletions.
19 changes: 19 additions & 0 deletions hack/fix_catalog_deployment_swagger
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,23 @@ def rename_deployment_models(swagger):
replace_value(swagger, "$ref", oldRef, newRef)


def remove_global_security(swagger):
if 'securityDefinitions' in swagger:
del swagger['securityDefinitions']


# See https://jira.eng.vmware.com/browse/TCS-4017 for context
def remove_security(swagger):
for p in swagger['paths']:
param_list = swagger['paths'][p]
for method in param_list:
if 'security' in swagger['paths'][p][method]:
del swagger['paths'][p][method]['security']


if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--omit-security', action='store_false')
args = parser.parse_args()

# read in the swagger spec
Expand All @@ -66,6 +81,10 @@ if __name__ == "__main__":
add_apiVersion(swagger)
rename_deployment_models(swagger)

if args.omit_security:
remove_global_security(swagger)
remove_security(swagger)

# Overwrite the swagger spec
f = open(new_filename, "w")
f.write(json.dumps(swagger, sort_keys=False, indent=2))
Expand Down
15 changes: 15 additions & 0 deletions hack/fix_vra_swagger
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,20 @@ def add_400_bad_request(swagger):
"description": "Bad Request",
}

def add_409_conflict(swagger):
# List of paths and operations to add a 409 conflict
paths = [
# This needs to be removed after the bug https://jira.eng.vmware.com/browse/TDS-2733 is fixed
('/deployment/api/deployments/{deploymentId}', 'delete'),
]

# Update the needed paths
for (p, op) in paths:
responses = swagger['paths'][p][op]['responses']
if '409' not in responses:
responses['409'] = {
"description": "Conflict",
}

def add_default_value_to_boolean_properties(swagger):
# Update following definition properties of type boolean with specified default value.
Expand Down Expand Up @@ -339,6 +353,7 @@ if __name__ == "__main__":
get_blockdevices_add_dollar_filter(swagger)
add_404_not_found(swagger)
add_400_bad_request(swagger)
add_409_conflict(swagger)

add_default_value_to_boolean_properties(swagger)
# change_response_code(swagger)
Expand Down
4 changes: 2 additions & 2 deletions pkg/client/catalog_sources/catalog_sources_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 6 additions & 48 deletions pkg/client/deployment_actions/deployment_actions_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4e88142

Please sign in to comment.