github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/rts/v1/softwaredeployment/doc.go (about) 1 /* 2 Package softwaredeployment enables management and retrieval of Software Deployments 3 4 Example to List Software Deployments 5 6 listOpts := softwaredeployment.ListOpts{} 7 allDeployments, err := softwaredeployment.List(client,listOpts) 8 if err != nil { 9 panic(err) 10 } 11 12 for _, deployment := range allDeployments { 13 fmt.Printf("%+v\n", allDeployments) 14 } 15 16 Example to Get Software Deployment 17 18 deploymentID:="bd7d48a5-6e33-4b95-aa28-d0d3af46c635" 19 20 deployments,err:=softwaredeployment.Get(client,deploymentID).Extract() 21 22 if err != nil { 23 panic(err) 24 } 25 26 Example to Create a Software Deployments 27 28 input:=map[string]interface{}{"name":"foo"} 29 30 createOpts := softwaredeployment.CreateOpts{ 31 Status:"IN_PROGRESS", 32 ServerId:"f274ac7d-334d-41ff-83bd-1de669f7781b", 33 ConfigId:"a6ff3598-f2e0-4111-81b0-aa3e1cac2529", 34 InputValues:input, 35 TenantId:"17fbda95add24720a4038ba4b1c705ed", 36 Action:"CREATE" 37 } 38 39 deployment, err := softwaredeployment.Create(client, createOpts).Extract() 40 if err != nil { 41 panic(err) 42 } 43 44 Example to Update a Software Deployments 45 deploymentID:="bd7d48a5-6e33-4b95-aa28-d0d3af46c635" 46 47 ouput:=map[string]interface{}{"deploy_stdout":"Writing to /tmp/baaaaa\nWritten to /tmp/baaaaa\n","deploy_stderr":"+ echo Writing to /tmp/baaaaa\n+ echo fooooo\n+ cat /tmp/baaaaa\n+ echo -n The file /tmp/baaaaa contains fooooo for server ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5 during CREATE\n+ echo Written to /tmp/baaaaa\n+ echo Output to stderr\nOutput to stderr\n", 48 "deploy_status_code":0,"result":"The file /tmp/baaaaa contains fooooo for server ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5 during CREATE"} 49 50 updateOpts := softwaredeployment.UpdateOpts{ 51 Status:"COMPLETE", 52 ConfigId:"a6ff3598-f2e0-4111-81b0-aa3e1cac2529", 53 OutputValues:ouput, 54 StatusReason:"Outputs received"} 55 56 deployment, err := softwaredeployment.Update(client, deploymentID, updateOpts).Extract() 57 if err != nil { 58 panic(err) 59 } 60 61 62 Example to Delete a Software Deployments 63 64 deploymentID:="bd7d48a5-6e33-4b95-aa28-d0d3af46c635" 65 del:=softwaredeployment.Delete(client,deploymentID).ExtractErr() 66 if err != nil { 67 panic(err) 68 } 69 */ 70 package softwaredeployment