provider/cloudstack: small doc update

This commit is contained in:
Sander van Harmelen 2016-02-26 23:44:53 +01:00
parent 7cbc9e3c07
commit 5525772a74
3 changed files with 12 additions and 4 deletions

View File

@ -62,9 +62,11 @@ func resourceCloudStackSSHKeyPairCreate(d *schema.ResourceData, meta interface{}
}
p := cs.SSH.NewRegisterSSHKeyPairParams(name, string(key))
if err := setProjectid(p, cs, d); err != nil {
return err
}
_, err = cs.SSH.RegisterSSHKeyPair(p)
if err != nil {
return err
@ -72,9 +74,11 @@ func resourceCloudStackSSHKeyPairCreate(d *schema.ResourceData, meta interface{}
} else {
// No key supplied, must create one and return the private key
p := cs.SSH.NewCreateSSHKeyPairParams(name)
if err := setProjectid(p, cs, d); err != nil {
return err
}
r, err := cs.SSH.CreateSSHKeyPair(p)
if err != nil {
return err
@ -95,6 +99,7 @@ func resourceCloudStackSSHKeyPairRead(d *schema.ResourceData, meta interface{})
p := cs.SSH.NewListSSHKeyPairsParams()
p.SetName(d.Id())
if err := setProjectid(p, cs, d); err != nil {
return err
}
@ -121,6 +126,7 @@ func resourceCloudStackSSHKeyPairDelete(d *schema.ResourceData, meta interface{}
// Create a new parameter struct
p := cs.SSH.NewDeleteSSHKeyPairParams(d.Id())
if err := setProjectid(p, cs, d); err != nil {
return err
}

View File

@ -196,5 +196,6 @@ func setProjectid(p projectidSetter, cs *cloudstack.CloudStackClient, d *schema.
}
p.SetProjectid(projectid)
}
return nil
}

View File

@ -28,10 +28,11 @@ The following arguments are supported:
within a CloudStack account. Changing this forces a new resource to be
created.
* `public_key` - (Optional) The public key in OpenSSH
`authorized_keys` format. If this is omitted, CloudStack will
generate a new key pair. Changing this forces a new resource to be
created.
* `public_key` - (Optional) The public key to register with CloudStack. If
this is omitted, CloudStack will generate a new key pair. The key can
be loaded from a file on disk using the [`file()` interpolation
function](/docs/configuration/interpolation.html#file_path_). Changing
this forces a new resource to be created.
* `project` - (Optional) The name or ID of the project to register this
key to. Changing this forces a new resource to be created.