Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into viraj-fetch-machine…
Browse files Browse the repository at this point in the history
…-details
  • Loading branch information
virajindasrao committed Jun 25, 2018
2 parents 7bd4d8f + 17cf09c commit 6dc3544
Show file tree
Hide file tree
Showing 4 changed files with 354 additions and 95 deletions.
2 changes: 1 addition & 1 deletion vrealize/action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func TestPowerOffAction(t *testing.T) {
"resourceId":"4f58732f-62c7-4d38-a78b-b2cf34ee45df","actionId":"b37c071e-06ce-4842-b194-0f64a829908f","description":null,
"data":{}}`))

templateResources, errTemplate := client.GetResourceViews(catalogItemId)
templateResources, errTemplate := client.GetDeploymentState(catalogItemId)
if errTemplate != nil {
t.Errorf("Failed to get the template resources %v", errTemplate)
}
Expand Down
12 changes: 6 additions & 6 deletions vrealize/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type ActionTemplate struct {
}

//GetActionTemplate - set call for read template/blueprint
func (c *APIClient) GetActionTemplate(resourceViewsTemplate *ResourceViewsTemplate, actionURLString string) (*ActionTemplate, *ResourceViewsTemplate, error) {
func (c *APIClient) GetActionTemplate(resourceViewsTemplate *ResourceView, actionURLString string) (*ActionTemplate, *ResourceView, error) {
//Fetch an action URL from given template
actionURL := getactionURL(resourceViewsTemplate, actionURLString)

Expand All @@ -47,7 +47,7 @@ func (c *APIClient) GetActionTemplate(resourceViewsTemplate *ResourceViewsTempla
}

//getactionURL - Read action URL from provided template of resource item
func getactionURL(template *ResourceViewsTemplate, relationVal string) (templateactionURL string) {
func getactionURL(template *ResourceView, relationVal string) (templateactionURL string) {
var actionURL string
l := len(template.Content)
//Loop to iterate over the action URLs
Expand All @@ -70,17 +70,17 @@ func getactionURL(template *ResourceViewsTemplate, relationVal string) (template
}

//GetPowerOffActionTemplate - To read power-off action template from provided resource configuration
func (c *APIClient) GetPowerOffActionTemplate(resourceViewsTemplate *ResourceViewsTemplate) (*ActionTemplate, *ResourceViewsTemplate, error) {
func (c *APIClient) GetPowerOffActionTemplate(resourceData *ResourceView) (*ActionTemplate, *ResourceView, error) {
//Set resource power-off URL label
actionURL := "GET Template: {com.vmware.csp.component.iaas.proxy.provider@resource.action.name.machine.PowerOff}"
//Set get action URL function call
return c.GetActionTemplate(resourceViewsTemplate, actionURL)
return c.GetActionTemplate(resourceData, actionURL)
}

//GetDestroyActionTemplate - To read destroy resource action template from provided resource configuration
func (c *APIClient) GetDestroyActionTemplate(resourceViewsTemplate *ResourceViewsTemplate) (*ActionTemplate, *ResourceViewsTemplate, error) {
func (c *APIClient) GetDestroyActionTemplate(resourceData *ResourceView) (*ActionTemplate, *ResourceView, error) {
//Set destroy resource URL label
actionURL := "GET Template: {com.vmware.csp.component.cafe.composition@resource.action.deployment.destroy.name}"
//Set get action URL function call
return c.GetActionTemplate(resourceViewsTemplate, actionURL)
return c.GetActionTemplate(resourceData, actionURL)
}
Loading

0 comments on commit 6dc3544

Please sign in to comment.