Merge pull request #5351 from svanharmelen/f-cloudstack
provider/cloudstack: small doc update
This commit is contained in:
commit
cbc4ddad03
|
@ -62,9 +62,11 @@ func resourceCloudStackSSHKeyPairCreate(d *schema.ResourceData, meta interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
p := cs.SSH.NewRegisterSSHKeyPairParams(name, string(key))
|
p := cs.SSH.NewRegisterSSHKeyPairParams(name, string(key))
|
||||||
|
|
||||||
if err := setProjectid(p, cs, d); err != nil {
|
if err := setProjectid(p, cs, d); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = cs.SSH.RegisterSSHKeyPair(p)
|
_, err = cs.SSH.RegisterSSHKeyPair(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -72,9 +74,11 @@ func resourceCloudStackSSHKeyPairCreate(d *schema.ResourceData, meta interface{}
|
||||||
} else {
|
} else {
|
||||||
// No key supplied, must create one and return the private key
|
// No key supplied, must create one and return the private key
|
||||||
p := cs.SSH.NewCreateSSHKeyPairParams(name)
|
p := cs.SSH.NewCreateSSHKeyPairParams(name)
|
||||||
|
|
||||||
if err := setProjectid(p, cs, d); err != nil {
|
if err := setProjectid(p, cs, d); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
r, err := cs.SSH.CreateSSHKeyPair(p)
|
r, err := cs.SSH.CreateSSHKeyPair(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -95,6 +99,7 @@ func resourceCloudStackSSHKeyPairRead(d *schema.ResourceData, meta interface{})
|
||||||
|
|
||||||
p := cs.SSH.NewListSSHKeyPairsParams()
|
p := cs.SSH.NewListSSHKeyPairsParams()
|
||||||
p.SetName(d.Id())
|
p.SetName(d.Id())
|
||||||
|
|
||||||
if err := setProjectid(p, cs, d); err != nil {
|
if err := setProjectid(p, cs, d); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -121,6 +126,7 @@ func resourceCloudStackSSHKeyPairDelete(d *schema.ResourceData, meta interface{}
|
||||||
|
|
||||||
// Create a new parameter struct
|
// Create a new parameter struct
|
||||||
p := cs.SSH.NewDeleteSSHKeyPairParams(d.Id())
|
p := cs.SSH.NewDeleteSSHKeyPairParams(d.Id())
|
||||||
|
|
||||||
if err := setProjectid(p, cs, d); err != nil {
|
if err := setProjectid(p, cs, d); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,5 +196,6 @@ func setProjectid(p projectidSetter, cs *cloudstack.CloudStackClient, d *schema.
|
||||||
}
|
}
|
||||||
p.SetProjectid(projectid)
|
p.SetProjectid(projectid)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,10 +28,11 @@ The following arguments are supported:
|
||||||
within a CloudStack account. Changing this forces a new resource to be
|
within a CloudStack account. Changing this forces a new resource to be
|
||||||
created.
|
created.
|
||||||
|
|
||||||
* `public_key` - (Optional) The public key in OpenSSH
|
* `public_key` - (Optional) The public key to register with CloudStack. If
|
||||||
`authorized_keys` format. If this is omitted, CloudStack will
|
this is omitted, CloudStack will generate a new key pair. The key can
|
||||||
generate a new key pair. Changing this forces a new resource to be
|
be loaded from a file on disk using the [`file()` interpolation
|
||||||
created.
|
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
|
* `project` - (Optional) The name or ID of the project to register this
|
||||||
key to. Changing this forces a new resource to be created.
|
key to. Changing this forces a new resource to be created.
|
||||||
|
|
Loading…
Reference in New Issue