MCPcopy Create free account
hub / github.com/apache/cloudstack-terraform-provider / setProjectid

Function setProjectid

cloudstack/resources.go:147–157  ·  view source on GitHub ↗

If there is a project supplied, we retrieve and set the project id

(p cloudstack.ProjectIDSetter, cs *cloudstack.CloudStackClient, d *schema.ResourceData)

Source from the content-addressed store, hash-verified

145
146// If there is a project supplied, we retrieve and set the project id
147func setProjectid(p cloudstack.ProjectIDSetter, cs *cloudstack.CloudStackClient, d *schema.ResourceData) error {
148 if project, ok := d.GetOk("project"); ok {
149 projectid, e := retrieveID(cs, "project", project.(string))
150 if e != nil {
151 return e.Error()
152 }
153 p.SetProjectid(projectid)
154 }
155
156 return nil
157}
158
159// importStatePassthrough is a generic importer with project support.
160func importStatePassthrough(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {

Calls 2

retrieveIDFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected