public abstract class OsConfigZonalServiceClient
OsConfigZonalService client wrapper, for convenient use.
Inheritance
System.Object > OsConfigZonalServiceClientDerived Types
Namespace
Google.Cloud.OsConfig.V1Assembly
Google.Cloud.OsConfig.V1.dll
Remarks
Zonal OS Config API
The OS Config service is the server-side component that allows users to manage package installations and patch jobs for Compute Engine VM instances.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the OsConfigZonalService service, which is a host of "osconfig.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
System.String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default OsConfigZonalService scopes.
Property Value | |
---|---|
Type | Description |
System.Collections.Generic.IReadOnlyList<System.String> |
The default OsConfigZonalService scopes are:
GrpcClient
public virtual OsConfigZonalService.OsConfigZonalServiceClient GrpcClient { get; }
The underlying gRPC OsConfigZonalService client
Property Value | |
---|---|
Type | Description |
OsConfigZonalService.OsConfigZonalServiceClient |
Methods
Create()
public static OsConfigZonalServiceClient Create()
Synchronously creates a OsConfigZonalServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use OsConfigZonalServiceClientBuilder.
Returns | |
---|---|
Type | Description |
OsConfigZonalServiceClient | The created OsConfigZonalServiceClient. |
CreateAsync(CancellationToken)
public static Task<OsConfigZonalServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a OsConfigZonalServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use OsConfigZonalServiceClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | System.Threading.CancellationToken The System.Threading.CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<OsConfigZonalServiceClient> | The task representing the created OsConfigZonalServiceClient. |
GetInventory(GetInventoryRequest, CallSettings)
public virtual Inventory GetInventory(GetInventoryRequest request, CallSettings callSettings = null)
Get inventory data for the specified VM instance. If the VM has no
associated inventory, the message NOT_FOUND
is returned.
Parameters | |
---|---|
Name | Description |
request | GetInventoryRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Inventory | The RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
GetInventoryRequest request = new GetInventoryRequest
{
InventoryName = InventoryName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
View = InventoryView.Unspecified,
};
// Make the request
Inventory response = osConfigZonalServiceClient.GetInventory(request);
GetInventory(InventoryName, CallSettings)
public virtual Inventory GetInventory(InventoryName name, CallSettings callSettings = null)
Get inventory data for the specified VM instance. If the VM has no
associated inventory, the message NOT_FOUND
is returned.
Parameters | |
---|---|
Name | Description |
name | InventoryName Required. API resource name for inventory resource. Format:
For |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Inventory | The RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
InventoryName name = InventoryName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
Inventory response = osConfigZonalServiceClient.GetInventory(name);
GetInventory(String, CallSettings)
public virtual Inventory GetInventory(string name, CallSettings callSettings = null)
Get inventory data for the specified VM instance. If the VM has no
associated inventory, the message NOT_FOUND
is returned.
Parameters | |
---|---|
Name | Description |
name | System.String Required. API resource name for inventory resource. Format:
For |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Inventory | The RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]/inventory";
// Make the request
Inventory response = osConfigZonalServiceClient.GetInventory(name);
GetInventoryAsync(GetInventoryRequest, CallSettings)
public virtual Task<Inventory> GetInventoryAsync(GetInventoryRequest request, CallSettings callSettings = null)
Get inventory data for the specified VM instance. If the VM has no
associated inventory, the message NOT_FOUND
is returned.
Parameters | |
---|---|
Name | Description |
request | GetInventoryRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Inventory> | A Task containing the RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
GetInventoryRequest request = new GetInventoryRequest
{
InventoryName = InventoryName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
View = InventoryView.Unspecified,
};
// Make the request
Inventory response = await osConfigZonalServiceClient.GetInventoryAsync(request);
GetInventoryAsync(GetInventoryRequest, CancellationToken)
public virtual Task<Inventory> GetInventoryAsync(GetInventoryRequest request, CancellationToken cancellationToken)
Get inventory data for the specified VM instance. If the VM has no
associated inventory, the message NOT_FOUND
is returned.
Parameters | |
---|---|
Name | Description |
request | GetInventoryRequest The request object containing all of the parameters for the API call. |
cancellationToken | System.Threading.CancellationToken A System.Threading.CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Inventory> | A Task containing the RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
GetInventoryRequest request = new GetInventoryRequest
{
InventoryName = InventoryName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
View = InventoryView.Unspecified,
};
// Make the request
Inventory response = await osConfigZonalServiceClient.GetInventoryAsync(request);
GetInventoryAsync(InventoryName, CallSettings)
public virtual Task<Inventory> GetInventoryAsync(InventoryName name, CallSettings callSettings = null)
Get inventory data for the specified VM instance. If the VM has no
associated inventory, the message NOT_FOUND
is returned.
Parameters | |
---|---|
Name | Description |
name | InventoryName Required. API resource name for inventory resource. Format:
For |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Inventory> | A Task containing the RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
InventoryName name = InventoryName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
Inventory response = await osConfigZonalServiceClient.GetInventoryAsync(name);
GetInventoryAsync(InventoryName, CancellationToken)
public virtual Task<Inventory> GetInventoryAsync(InventoryName name, CancellationToken cancellationToken)
Get inventory data for the specified VM instance. If the VM has no
associated inventory, the message NOT_FOUND
is returned.
Parameters | |
---|---|
Name | Description |
name | InventoryName Required. API resource name for inventory resource. Format:
For |
cancellationToken | System.Threading.CancellationToken A System.Threading.CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Inventory> | A Task containing the RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
InventoryName name = InventoryName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
Inventory response = await osConfigZonalServiceClient.GetInventoryAsync(name);
GetInventoryAsync(String, CallSettings)
public virtual Task<Inventory> GetInventoryAsync(string name, CallSettings callSettings = null)
Get inventory data for the specified VM instance. If the VM has no
associated inventory, the message NOT_FOUND
is returned.
Parameters | |
---|---|
Name | Description |
name | System.String Required. API resource name for inventory resource. Format:
For |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Inventory> | A Task containing the RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]/inventory";
// Make the request
Inventory response = await osConfigZonalServiceClient.GetInventoryAsync(name);
GetInventoryAsync(String, CancellationToken)
public virtual Task<Inventory> GetInventoryAsync(string name, CancellationToken cancellationToken)
Get inventory data for the specified VM instance. If the VM has no
associated inventory, the message NOT_FOUND
is returned.
Parameters | |
---|---|
Name | Description |
name | System.String Required. API resource name for inventory resource. Format:
For |
cancellationToken | System.Threading.CancellationToken A System.Threading.CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Inventory> | A Task containing the RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]/inventory";
// Make the request
Inventory response = await osConfigZonalServiceClient.GetInventoryAsync(name);
GetVulnerabilityReport(GetVulnerabilityReportRequest, CallSettings)
public virtual VulnerabilityReport GetVulnerabilityReport(GetVulnerabilityReportRequest request, CallSettings callSettings = null)
Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have vulnerability reports associated with them.
Parameters | |
---|---|
Name | Description |
request | GetVulnerabilityReportRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
VulnerabilityReport | The RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
GetVulnerabilityReportRequest request = new GetVulnerabilityReportRequest
{
VulnerabilityReportName = VulnerabilityReportName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
};
// Make the request
VulnerabilityReport response = osConfigZonalServiceClient.GetVulnerabilityReport(request);
GetVulnerabilityReport(VulnerabilityReportName, CallSettings)
public virtual VulnerabilityReport GetVulnerabilityReport(VulnerabilityReportName name, CallSettings callSettings = null)
Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have vulnerability reports associated with them.
Parameters | |
---|---|
Name | Description |
name | VulnerabilityReportName Required. API resource name for vulnerability resource. Format:
For |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
VulnerabilityReport | The RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
VulnerabilityReportName name = VulnerabilityReportName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
VulnerabilityReport response = osConfigZonalServiceClient.GetVulnerabilityReport(name);
GetVulnerabilityReport(String, CallSettings)
public virtual VulnerabilityReport GetVulnerabilityReport(string name, CallSettings callSettings = null)
Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have vulnerability reports associated with them.
Parameters | |
---|---|
Name | Description |
name | System.String Required. API resource name for vulnerability resource. Format:
For |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
VulnerabilityReport | The RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]/vulnerabilityReport";
// Make the request
VulnerabilityReport response = osConfigZonalServiceClient.GetVulnerabilityReport(name);
GetVulnerabilityReportAsync(GetVulnerabilityReportRequest, CallSettings)
public virtual Task<VulnerabilityReport> GetVulnerabilityReportAsync(GetVulnerabilityReportRequest request, CallSettings callSettings = null)
Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have vulnerability reports associated with them.
Parameters | |
---|---|
Name | Description |
request | GetVulnerabilityReportRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<VulnerabilityReport> | A Task containing the RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
GetVulnerabilityReportRequest request = new GetVulnerabilityReportRequest
{
VulnerabilityReportName = VulnerabilityReportName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
};
// Make the request
VulnerabilityReport response = await osConfigZonalServiceClient.GetVulnerabilityReportAsync(request);
GetVulnerabilityReportAsync(GetVulnerabilityReportRequest, CancellationToken)
public virtual Task<VulnerabilityReport> GetVulnerabilityReportAsync(GetVulnerabilityReportRequest request, CancellationToken cancellationToken)
Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have vulnerability reports associated with them.
Parameters | |
---|---|
Name | Description |
request | GetVulnerabilityReportRequest The request object containing all of the parameters for the API call. |
cancellationToken | System.Threading.CancellationToken A System.Threading.CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<VulnerabilityReport> | A Task containing the RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
GetVulnerabilityReportRequest request = new GetVulnerabilityReportRequest
{
VulnerabilityReportName = VulnerabilityReportName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
};
// Make the request
VulnerabilityReport response = await osConfigZonalServiceClient.GetVulnerabilityReportAsync(request);
GetVulnerabilityReportAsync(VulnerabilityReportName, CallSettings)
public virtual Task<VulnerabilityReport> GetVulnerabilityReportAsync(VulnerabilityReportName name, CallSettings callSettings = null)
Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have vulnerability reports associated with them.
Parameters | |
---|---|
Name | Description |
name | VulnerabilityReportName Required. API resource name for vulnerability resource. Format:
For |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<VulnerabilityReport> | A Task containing the RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
VulnerabilityReportName name = VulnerabilityReportName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
VulnerabilityReport response = await osConfigZonalServiceClient.GetVulnerabilityReportAsync(name);
GetVulnerabilityReportAsync(VulnerabilityReportName, CancellationToken)
public virtual Task<VulnerabilityReport> GetVulnerabilityReportAsync(VulnerabilityReportName name, CancellationToken cancellationToken)
Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have vulnerability reports associated with them.
Parameters | |
---|---|
Name | Description |
name | VulnerabilityReportName Required. API resource name for vulnerability resource. Format:
For |
cancellationToken | System.Threading.CancellationToken A System.Threading.CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<VulnerabilityReport> | A Task containing the RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
VulnerabilityReportName name = VulnerabilityReportName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
VulnerabilityReport response = await osConfigZonalServiceClient.GetVulnerabilityReportAsync(name);
GetVulnerabilityReportAsync(String, CallSettings)
public virtual Task<VulnerabilityReport> GetVulnerabilityReportAsync(string name, CallSettings callSettings = null)
Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have vulnerability reports associated with them.
Parameters | |
---|---|
Name | Description |
name | System.String Required. API resource name for vulnerability resource. Format:
For |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<VulnerabilityReport> | A Task containing the RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]/vulnerabilityReport";
// Make the request
VulnerabilityReport response = await osConfigZonalServiceClient.GetVulnerabilityReportAsync(name);
GetVulnerabilityReportAsync(String, CancellationToken)
public virtual Task<VulnerabilityReport> GetVulnerabilityReportAsync(string name, CancellationToken cancellationToken)
Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have vulnerability reports associated with them.
Parameters | |
---|---|
Name | Description |
name | System.String Required. API resource name for vulnerability resource. Format:
For |
cancellationToken | System.Threading.CancellationToken A System.Threading.CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<VulnerabilityReport> | A Task containing the RPC response. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]/vulnerabilityReport";
// Make the request
VulnerabilityReport response = await osConfigZonalServiceClient.GetVulnerabilityReportAsync(name);
ListInventories(InstanceName, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListInventoriesResponse, Inventory> ListInventories(InstanceName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
List inventory data for all VM instances in the specified zone.
Parameters | |
---|---|
Name | Description |
parent | InstanceName Required. The parent resource name. Format: For |
pageToken | System.String The token returned from the previous request. A value of |
pageSize | System.Nullable<System.Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListInventoriesResponse, Inventory> | A pageable sequence of Inventory resources. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
InstanceName parent = InstanceName.FromProjectZoneInstance("[PROJECT]", "[ZONE]", "[INSTANCE]");
// Make the request
PagedEnumerable<ListInventoriesResponse, Inventory> response = osConfigZonalServiceClient.ListInventories(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Inventory item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListInventoriesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Inventory item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Inventory> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Inventory item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInventories(ListInventoriesRequest, CallSettings)
public virtual PagedEnumerable<ListInventoriesResponse, Inventory> ListInventories(ListInventoriesRequest request, CallSettings callSettings = null)
List inventory data for all VM instances in the specified zone.
Parameters | |
---|---|
Name | Description |
request | ListInventoriesRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListInventoriesResponse, Inventory> | A pageable sequence of Inventory resources. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
ListInventoriesRequest request = new ListInventoriesRequest
{
ParentAsInstanceName = InstanceName.FromProjectZoneInstance("[PROJECT]", "[ZONE]", "[INSTANCE]"),
View = InventoryView.Unspecified,
Filter = "",
};
// Make the request
PagedEnumerable<ListInventoriesResponse, Inventory> response = osConfigZonalServiceClient.ListInventories(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Inventory item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListInventoriesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Inventory item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Inventory> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Inventory item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInventories(String, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListInventoriesResponse, Inventory> ListInventories(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
List inventory data for all VM instances in the specified zone.
Parameters | |
---|---|
Name | Description |
parent | System.String Required. The parent resource name. Format: For |
pageToken | System.String The token returned from the previous request. A value of |
pageSize | System.Nullable<System.Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListInventoriesResponse, Inventory> | A pageable sequence of Inventory resources. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/zones/[ZONE]/instances/[INSTANCE]";
// Make the request
PagedEnumerable<ListInventoriesResponse, Inventory> response = osConfigZonalServiceClient.ListInventories(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Inventory item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListInventoriesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Inventory item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Inventory> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Inventory item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInventoriesAsync(InstanceName, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListInventoriesResponse, Inventory> ListInventoriesAsync(InstanceName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
List inventory data for all VM instances in the specified zone.
Parameters | |
---|---|
Name | Description |
parent | InstanceName Required. The parent resource name. Format: For |
pageToken | System.String The token returned from the previous request. A value of |
pageSize | System.Nullable<System.Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListInventoriesResponse, Inventory> | A pageable asynchronous sequence of Inventory resources. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
InstanceName parent = InstanceName.FromProjectZoneInstance("[PROJECT]", "[ZONE]", "[INSTANCE]");
// Make the request
PagedAsyncEnumerable<ListInventoriesResponse, Inventory> response = osConfigZonalServiceClient.ListInventoriesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Inventory item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListInventoriesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Inventory item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Inventory> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Inventory item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInventoriesAsync(ListInventoriesRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListInventoriesResponse, Inventory> ListInventoriesAsync(ListInventoriesRequest request, CallSettings callSettings = null)
List inventory data for all VM instances in the specified zone.
Parameters | |
---|---|
Name | Description |
request | ListInventoriesRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListInventoriesResponse, Inventory> | A pageable asynchronous sequence of Inventory resources. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
ListInventoriesRequest request = new ListInventoriesRequest
{
ParentAsInstanceName = InstanceName.FromProjectZoneInstance("[PROJECT]", "[ZONE]", "[INSTANCE]"),
View = InventoryView.Unspecified,
Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListInventoriesResponse, Inventory> response = osConfigZonalServiceClient.ListInventoriesAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Inventory item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListInventoriesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Inventory item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Inventory> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Inventory item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInventoriesAsync(String, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListInventoriesResponse, Inventory> ListInventoriesAsync(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
List inventory data for all VM instances in the specified zone.
Parameters | |
---|---|
Name | Description |
parent | System.String Required. The parent resource name. Format: For |
pageToken | System.String The token returned from the previous request. A value of |
pageSize | System.Nullable<System.Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListInventoriesResponse, Inventory> | A pageable asynchronous sequence of Inventory resources. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/zones/[ZONE]/instances/[INSTANCE]";
// Make the request
PagedAsyncEnumerable<ListInventoriesResponse, Inventory> response = osConfigZonalServiceClient.ListInventoriesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Inventory item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListInventoriesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Inventory item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Inventory> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Inventory item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListVulnerabilityReports(InstanceName, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> ListVulnerabilityReports(InstanceName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
List vulnerability reports for all VM instances in the specified zone.
Parameters | |
---|---|
Name | Description |
parent | InstanceName Required. The parent resource name. Format: For |
pageToken | System.String The token returned from the previous request. A value of |
pageSize | System.Nullable<System.Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> | A pageable sequence of VulnerabilityReport resources. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
InstanceName parent = InstanceName.FromProjectZoneInstance("[PROJECT]", "[ZONE]", "[INSTANCE]");
// Make the request
PagedEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> response = osConfigZonalServiceClient.ListVulnerabilityReports(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (VulnerabilityReport item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListVulnerabilityReportsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (VulnerabilityReport item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<VulnerabilityReport> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (VulnerabilityReport item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListVulnerabilityReports(ListVulnerabilityReportsRequest, CallSettings)
public virtual PagedEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> ListVulnerabilityReports(ListVulnerabilityReportsRequest request, CallSettings callSettings = null)
List vulnerability reports for all VM instances in the specified zone.
Parameters | |
---|---|
Name | Description |
request | ListVulnerabilityReportsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> | A pageable sequence of VulnerabilityReport resources. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
ListVulnerabilityReportsRequest request = new ListVulnerabilityReportsRequest
{
ParentAsInstanceName = InstanceName.FromProjectZoneInstance("[PROJECT]", "[ZONE]", "[INSTANCE]"),
Filter = "",
};
// Make the request
PagedEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> response = osConfigZonalServiceClient.ListVulnerabilityReports(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (VulnerabilityReport item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListVulnerabilityReportsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (VulnerabilityReport item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<VulnerabilityReport> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (VulnerabilityReport item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListVulnerabilityReports(String, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> ListVulnerabilityReports(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
List vulnerability reports for all VM instances in the specified zone.
Parameters | |
---|---|
Name | Description |
parent | System.String Required. The parent resource name. Format: For |
pageToken | System.String The token returned from the previous request. A value of |
pageSize | System.Nullable<System.Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> | A pageable sequence of VulnerabilityReport resources. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = OsConfigZonalServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/zones/[ZONE]/instances/[INSTANCE]";
// Make the request
PagedEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> response = osConfigZonalServiceClient.ListVulnerabilityReports(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (VulnerabilityReport item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListVulnerabilityReportsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (VulnerabilityReport item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<VulnerabilityReport> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (VulnerabilityReport item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListVulnerabilityReportsAsync(InstanceName, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> ListVulnerabilityReportsAsync(InstanceName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
List vulnerability reports for all VM instances in the specified zone.
Parameters | |
---|---|
Name | Description |
parent | InstanceName Required. The parent resource name. Format: For |
pageToken | System.String The token returned from the previous request. A value of |
pageSize | System.Nullable<System.Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> | A pageable asynchronous sequence of VulnerabilityReport resources. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
InstanceName parent = InstanceName.FromProjectZoneInstance("[PROJECT]", "[ZONE]", "[INSTANCE]");
// Make the request
PagedAsyncEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> response = osConfigZonalServiceClient.ListVulnerabilityReportsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((VulnerabilityReport item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListVulnerabilityReportsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (VulnerabilityReport item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<VulnerabilityReport> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (VulnerabilityReport item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListVulnerabilityReportsAsync(ListVulnerabilityReportsRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> ListVulnerabilityReportsAsync(ListVulnerabilityReportsRequest request, CallSettings callSettings = null)
List vulnerability reports for all VM instances in the specified zone.
Parameters | |
---|---|
Name | Description |
request | ListVulnerabilityReportsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> | A pageable asynchronous sequence of VulnerabilityReport resources. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
ListVulnerabilityReportsRequest request = new ListVulnerabilityReportsRequest
{
ParentAsInstanceName = InstanceName.FromProjectZoneInstance("[PROJECT]", "[ZONE]", "[INSTANCE]"),
Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> response = osConfigZonalServiceClient.ListVulnerabilityReportsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((VulnerabilityReport item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListVulnerabilityReportsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (VulnerabilityReport item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<VulnerabilityReport> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (VulnerabilityReport item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListVulnerabilityReportsAsync(String, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> ListVulnerabilityReportsAsync(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
List vulnerability reports for all VM instances in the specified zone.
Parameters | |
---|---|
Name | Description |
parent | System.String Required. The parent resource name. Format: For |
pageToken | System.String The token returned from the previous request. A value of |
pageSize | System.Nullable<System.Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> | A pageable asynchronous sequence of VulnerabilityReport resources. |
// Create client
OsConfigZonalServiceClient osConfigZonalServiceClient = await OsConfigZonalServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/zones/[ZONE]/instances/[INSTANCE]";
// Make the request
PagedAsyncEnumerable<ListVulnerabilityReportsResponse, VulnerabilityReport> response = osConfigZonalServiceClient.ListVulnerabilityReportsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((VulnerabilityReport item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListVulnerabilityReportsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (VulnerabilityReport item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<VulnerabilityReport> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (VulnerabilityReport item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ShutdownDefaultChannelsAsync()
public static Task ShutdownDefaultChannelsAsync()
Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task | A task representing the asynchronous shutdown operation. |
After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.