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

Allow work with CSE on user-mode (issue #36) #41

Merged
merged 3 commits into from
May 6, 2020

Conversation

pcantera
Copy link
Contributor

@pcantera pcantera commented Apr 15, 2020

Description

New Cloud Specific Extension commands:
imagen

cio cloud-specific-extensions templates :
imagen

  • list > Lists List CSE templates
    GET /v2/cse/templates

  • show -> Shows CSE template
    GET /v2/cse/templates/:template_id

  • import -> Imports a CSE template
    POST /v2/cse/templates

  • update -> Updates an existing CSE template identified by the given id
    PUT /v2/cse/templates/:template_id

  • list-deployments -> List CSE deployments of a CSE template
    GET /v2/cse/templates/:template_id/deployments

  • delete -> Deletes a CSE template
    DELETE /v2/cse/templates/:template_id

cio cloud-specific-extensions deployments :
imagen

  • list > Lists List CSE deployments
    GET /v2/cse/deployments

  • show -> Shows CSE deployment
    GET /v2/cse/deployments/:deployment_id

  • deploy -> Deploys a new CSE deployment from CSE template
    POST /v2/cse/templates/:template_id/deployments

  • update -> Updates an existing CSE deployment identified by the given id
    PUT /v2/cse/deployments/:deployment_id

  • delete -> Deletes a CSE deployment
    DELETE /v2/cse/deployments/:deployment_id

Description

Related Issue

Closes #36

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@pcantera pcantera requested a review from pbanos April 15, 2020 14:36
@pcantera pcantera self-assigned this Apr 15, 2020
Copy link
Contributor

@pbanos pbanos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, just minor changes requested!

Comment on lines 108 to 120
func (csets *CloudSpecificExtensionDeploymentService) DeleteDeployment(deploymentID string) (err error) {
log.Debug("DeleteDeployment")

data, status, err := csets.concertoService.Delete(fmt.Sprintf("/cse/deployments/%s", deploymentID))
if err != nil {
return err
}

if err = utils.CheckStandardStatus(status, data); err != nil {
return err
}

return nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting a CSE deployment just starts the undeploy process: you should return here a representation parsed from the response

}

// CreateTemplate creates a cloud specific extension template
func (csets *CloudSpecificExtensionTemplateService) CreateTemplate(templateVector *map[string]interface{}) (template *types.CloudSpecificExtensionTemplate, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

templateVector is a bad name, what about templateParams?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, additionally this should be done in more cases (added a note at issue #31 ).

Comment on lines 156 to 173
func CloudSpecificExtensionDeploymentDelete(c *cli.Context) error {
debugCmdFuncInfo(c)
svc, formatter := WireUpCloudSpecificExtensionDeployment(c)

checkRequiredFlags(c, []string{"id"}, formatter)
err := svc.DeleteDeployment(c.String("id"))
if err != nil {
formatter.PrintFatal("Couldn't delete CSE deployment", err)
}
return nil
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably show here the CSED as decommissioning

@pcantera pcantera force-pushed the feature/36-allow-work-cse branch from 2766a92 to c9b9681 Compare May 4, 2020 11:28
Copy link
Contributor

@lttito lttito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link

@sjpatino sjpatino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@pcantera pcantera merged commit dddc73e into develop May 6, 2020
@pcantera pcantera deleted the feature/36-allow-work-cse branch June 5, 2020 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow work with CSE on user-mode
5 participants