Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove snapshot get check and update documentation #5916

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions ibm/service/power/resource_ibm_pi_instance_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,6 @@ func resourceIBMPIInstanceSnapshotDelete(ctx context.Context, d *schema.Resource
}

client := instance.NewIBMPISnapshotClient(ctx, sess, cloudInstanceID)
snapshot, err := client.Get(snapshotID)
if err != nil {
// snapshot does not exist
d.SetId("")
return nil
}

log.Printf("The snapshot to be deleted is in the following state .. %s", snapshot.Status)

err = client.Delete(snapshotID)
if err != nil {
return diag.FromErr(err)
Expand Down
12 changes: 9 additions & 3 deletions website/docs/d/pi_instance_snapshot.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,27 @@ description: |-
---

# ibm_pi_instance_snapshot

Retrieve information about a Power Systems Virtual Server instance snapshot. For more information, about Power Virtual Server instance snapshot, see [getting started with IBM Power Systems Virtual Servers](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-getting-started).

## Example usage

```terraform
data "ibm_pi_instance_snapshot" "ds_instance_snapshot" {
pi_cloud_instance_id = "49fba6c9-23f8-40bc-9899-aca322ee7d5b"
pi_snapshot_id = "2ce22124-4c32-6456-bfce-803e0658ab12"
}
```

**Notes**
### Notes

- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints.
- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows:
- `region` - `lon`
- `zone` - `lon04`

Example usage:

```terraform
provider "ibm" {
region = "lon"
Expand All @@ -32,13 +36,15 @@ Example usage:
```

## Argument reference
Review the argument references that you can specify for your data source.

Review the argument references that you can specify for your data source.

- `pi_cloud_instance_id` - (Required, String) The GUID of the service instance associated with an account.
- `pi_snapshot_id` - (Required, String) The unique identifier of the Power Systems Virtual Machine instance snapshot.

## Attribute reference
In addition to all argument reference list, you can access the following attribute references after your data source is created.

In addition to all argument reference list, you can access the following attribute references after your data source is created.

- `action` - (String) Action performed on the instance snapshot.
- `creation_date` - (String) Date of snapshot creation.
Expand Down
12 changes: 9 additions & 3 deletions website/docs/d/pi_instance_snapshots.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,26 @@ description: |-
---

# ibm_pi_instance_snapshots

Retrieve information about a Power Systems Virtual Server instance snapshots. For more information, about Power Virtual Server instance snapshots, see [getting started with IBM Power Systems Virtual Servers](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-getting-started).

## Example usage

```terraform
data "ibm_pi_instance_snapshots" "ds_instance_snapshots" {
pi_cloud_instance_id = "49fba6c9-23f8-40bc-9899-aca322ee7d5b"
}
```

**Notes**
### Notes

- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints.
- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows:
- `region` - `lon`
- `zone` - `lon04`

Example usage:

```terraform
provider "ibm" {
region = "lon"
Expand All @@ -31,12 +35,14 @@ Example usage:
```

## Argument reference
Review the argument references that you can specify for your data source.

Review the argument references that you can specify for your data source.

- `pi_cloud_instance_id` - (Required, String) The GUID of the service instance associated with an account.

## Attribute reference
In addition to all argument reference list, you can access the following attribute references after your data source is created.

In addition to all argument reference list, you can access the following attribute references after your data source is created.

- `instance_snapshots` - (List) List of Power Virtual Machine instance snapshots within the given cloud instance.

Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/pi_instance_snapshot.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Review the argument references that you can specify for your resource.
- `pi_instance_name` - (Required, String) The name of the instance you want to take a snapshot of.
- `pi_snapshot_name` - (Required, String) The unique name of the snapshot.
- `pi_user_tags` - (Optional, List) The user tags attached to this resource.
- `pi_volume_ids` - (Optional, String) A list of volume IDs of the instance that will be part of the snapshot. If none are provided, then all the volumes of the instance will be part of the snapshot.
- `pi_volume_ids` - (Optional, List) A list of volume IDs of the instance that will be part of the snapshot. If none are provided, then all the volumes of the instance will be part of the snapshot.

## Attribute reference

Expand All @@ -69,7 +69,7 @@ In addition to all argument reference list, you can access the following attribu
- `last_update_date` - (String) The last updated date of the snapshot.
- `snapshot_id` - (String) ID of the PVM instance snapshot.
- `status` - (String) Status of the PVM instance snapshot.
- `volume_snapshots` - (String) A map of volume snapshots included in the PVM instance snapshot.
- `volume_snapshots` - (Map) A map of volume snapshots included in the PVM instance snapshot.

## Import

Expand Down
Loading