Class DisksResource
The "disks" collection of methods.
Inheritance
Inherited Members
Namespace: Google.Apis.Compute.v1
Assembly: Google.Apis.Compute.v1.dll
Syntax
public class DisksResource
Constructors
DisksResource(IClientService)
Constructs a new resource.
Declaration
public DisksResource(IClientService service)
Parameters
| Type | Name | Description |
|---|---|---|
| IClientService | service |
Methods
AddResourcePolicies(DisksAddResourcePoliciesRequest, String, String, String)
Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.
Declaration
public virtual DisksResource.AddResourcePoliciesRequest AddResourcePolicies(DisksAddResourcePoliciesRequest body, string project, string zone, string disk)
Parameters
| Type | Name | Description |
|---|---|---|
| DisksAddResourcePoliciesRequest | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | disk | The disk name for this request. |
Returns
| Type | Description |
|---|---|
| DisksResource.AddResourcePoliciesRequest |
AggregatedList(String)
Retrieves an aggregated list of persistent disks.
Declaration
public virtual DisksResource.AggregatedListRequest AggregatedList(string project)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
Returns
| Type | Description |
|---|---|
| DisksResource.AggregatedListRequest |
CreateSnapshot(Snapshot, String, String, String)
Creates a snapshot of a specified persistent disk.
Declaration
public virtual DisksResource.CreateSnapshotRequest CreateSnapshot(Snapshot body, string project, string zone, string disk)
Parameters
| Type | Name | Description |
|---|---|---|
| Snapshot | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | disk | Name of the persistent disk to snapshot. |
Returns
| Type | Description |
|---|---|
| DisksResource.CreateSnapshotRequest |
Delete(String, String, String)
Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.
Declaration
public virtual DisksResource.DeleteRequest Delete(string project, string zone, string disk)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | disk | Name of the persistent disk to delete. |
Returns
| Type | Description |
|---|---|
| DisksResource.DeleteRequest |
Get(String, String, String)
Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.
Declaration
public virtual DisksResource.GetRequest Get(string project, string zone, string disk)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | disk | Name of the persistent disk to return. |
Returns
| Type | Description |
|---|---|
| DisksResource.GetRequest |
GetIamPolicy(String, String, String)
Gets the access control policy for a resource. May be empty if no such policy or resource exists.
Declaration
public virtual DisksResource.GetIamPolicyRequest GetIamPolicy(string project, string zone, string resource)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | resource | Name or id of the resource for this request. |
Returns
| Type | Description |
|---|---|
| DisksResource.GetIamPolicyRequest |
Insert(Disk, String, String)
Creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property.
Declaration
public virtual DisksResource.InsertRequest Insert(Disk body, string project, string zone)
Parameters
| Type | Name | Description |
|---|---|---|
| Disk | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
Returns
| Type | Description |
|---|---|
| DisksResource.InsertRequest |
List(String, String)
Retrieves a list of persistent disks contained within the specified zone.
Declaration
public virtual DisksResource.ListRequest List(string project, string zone)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
Returns
| Type | Description |
|---|---|
| DisksResource.ListRequest |
RemoveResourcePolicies(DisksRemoveResourcePoliciesRequest, String, String, String)
Removes resource policies from a disk.
Declaration
public virtual DisksResource.RemoveResourcePoliciesRequest RemoveResourcePolicies(DisksRemoveResourcePoliciesRequest body, string project, string zone, string disk)
Parameters
| Type | Name | Description |
|---|---|---|
| DisksRemoveResourcePoliciesRequest | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | disk | The disk name for this request. |
Returns
| Type | Description |
|---|---|
| DisksResource.RemoveResourcePoliciesRequest |
Resize(DisksResizeRequest, String, String, String)
Resizes the specified persistent disk. You can only increase the size of the disk.
Declaration
public virtual DisksResource.ResizeRequest Resize(DisksResizeRequest body, string project, string zone, string disk)
Parameters
| Type | Name | Description |
|---|---|---|
| DisksResizeRequest | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | disk | The name of the persistent disk. |
Returns
| Type | Description |
|---|---|
| DisksResource.ResizeRequest |
SetIamPolicy(ZoneSetPolicyRequest, String, String, String)
Sets the access control policy on the specified resource. Replaces any existing policy.
Declaration
public virtual DisksResource.SetIamPolicyRequest SetIamPolicy(ZoneSetPolicyRequest body, string project, string zone, string resource)
Parameters
| Type | Name | Description |
|---|---|---|
| ZoneSetPolicyRequest | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | resource | Name or id of the resource for this request. |
Returns
| Type | Description |
|---|---|
| DisksResource.SetIamPolicyRequest |
SetLabels(ZoneSetLabelsRequest, String, String, String)
Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.
Declaration
public virtual DisksResource.SetLabelsRequest SetLabels(ZoneSetLabelsRequest body, string project, string zone, string resource)
Parameters
| Type | Name | Description |
|---|---|---|
| ZoneSetLabelsRequest | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | resource | Name or id of the resource for this request. |
Returns
| Type | Description |
|---|---|
| DisksResource.SetLabelsRequest |
TestIamPermissions(TestPermissionsRequest, String, String, String)
Returns permissions that a caller has on the specified resource.
Declaration
public virtual DisksResource.TestIamPermissionsRequest TestIamPermissions(TestPermissionsRequest body, string project, string zone, string resource)
Parameters
| Type | Name | Description |
|---|---|---|
| TestPermissionsRequest | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | resource | Name or id of the resource for this request. |
Returns
| Type | Description |
|---|---|
| DisksResource.TestIamPermissionsRequest |