Class NativeDashboardServiceClient (0.31.0)

GitHub RepositoryProduct Reference

Service Description: A service providing functionality for managing native dashboards.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   NativeDashboard nativeDashboard = NativeDashboard.newBuilder().build();
   NativeDashboard response =
       nativeDashboardServiceClient.createNativeDashboard(parent, nativeDashboard);
 }
 

Note: close() needs to be called on the NativeDashboardServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

CreateNativeDashboard

Create a dashboard.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createNativeDashboard(CreateNativeDashboardRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createNativeDashboard(InstanceName parent, NativeDashboard nativeDashboard)

  • createNativeDashboard(String parent, NativeDashboard nativeDashboard)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createNativeDashboardCallable()

GetNativeDashboard

Get a dashboard.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getNativeDashboard(GetNativeDashboardRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getNativeDashboard(NativeDashboardName name)

  • getNativeDashboard(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getNativeDashboardCallable()

ListNativeDashboards

List all dashboards.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listNativeDashboards(ListNativeDashboardsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listNativeDashboards(InstanceName parent)

  • listNativeDashboards(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listNativeDashboardsPagedCallable()

  • listNativeDashboardsCallable()

UpdateNativeDashboard

Update a dashboard.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateNativeDashboard(UpdateNativeDashboardRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateNativeDashboard(NativeDashboard nativeDashboard, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateNativeDashboardCallable()

DuplicateNativeDashboard

Duplicate a dashboard.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • duplicateNativeDashboard(DuplicateNativeDashboardRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • duplicateNativeDashboard(NativeDashboardName name, NativeDashboard nativeDashboard)

  • duplicateNativeDashboard(String name, NativeDashboard nativeDashboard)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • duplicateNativeDashboardCallable()

DeleteNativeDashboard

Delete a dashboard.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteNativeDashboard(DeleteNativeDashboardRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteNativeDashboard(NativeDashboardName name)

  • deleteNativeDashboard(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteNativeDashboardCallable()

AddChart

Add chart in a dashboard.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • addChart(AddChartRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • addChart(NativeDashboardName name, DashboardQuery dashboardQuery, DashboardChart dashboardChart)

  • addChart(String name, DashboardQuery dashboardQuery, DashboardChart dashboardChart)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • addChartCallable()

RemoveChart

Remove chart from a dashboard.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • removeChart(RemoveChartRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • removeChart(NativeDashboardName name)

  • removeChart(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • removeChartCallable()

EditChart

Edit chart in a dashboard.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • editChart(EditChartRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • editChart(NativeDashboardName name, DashboardQuery dashboardQuery, DashboardChart dashboardChart, FieldMask editMask)

  • editChart(String name, DashboardQuery dashboardQuery, DashboardChart dashboardChart, FieldMask editMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • editChartCallable()

DuplicateChart

Duplicate chart in a dashboard.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • duplicateChart(DuplicateChartRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • duplicateChart(NativeDashboardName name)

  • duplicateChart(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • duplicateChartCallable()

ExportNativeDashboards

Exports the dashboards.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • exportNativeDashboards(ExportNativeDashboardsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • exportNativeDashboards(InstanceName parent, List<String> names)

  • exportNativeDashboards(String parent, List<String> names)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • exportNativeDashboardsCallable()

ImportNativeDashboards

Imports the dashboards.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • importNativeDashboards(ImportNativeDashboardsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • importNativeDashboards(InstanceName parent, ImportNativeDashboardsInlineSource source)

  • importNativeDashboards(String parent, ImportNativeDashboardsInlineSource source)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • importNativeDashboardsCallable()

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of NativeDashboardServiceSettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 NativeDashboardServiceSettings nativeDashboardServiceSettings =
     NativeDashboardServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create(nativeDashboardServiceSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 NativeDashboardServiceSettings nativeDashboardServiceSettings =
     NativeDashboardServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create(nativeDashboardServiceSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 NativeDashboardServiceSettings nativeDashboardServiceSettings =
     NativeDashboardServiceSettings.newHttpJsonBuilder().build();
 NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create(nativeDashboardServiceSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > NativeDashboardServiceClient

Static Methods

create()

public static final NativeDashboardServiceClient create()

Constructs an instance of NativeDashboardServiceClient with default settings.

Returns
Type Description
NativeDashboardServiceClient
Exceptions
Type Description
IOException

create(NativeDashboardServiceSettings settings)

public static final NativeDashboardServiceClient create(NativeDashboardServiceSettings settings)

Constructs an instance of NativeDashboardServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
Name Description
settings NativeDashboardServiceSettings
Returns
Type Description
NativeDashboardServiceClient
Exceptions
Type Description
IOException

create(NativeDashboardServiceStub stub)

public static final NativeDashboardServiceClient create(NativeDashboardServiceStub stub)

Constructs an instance of NativeDashboardServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(NativeDashboardServiceSettings).

Parameter
Name Description
stub NativeDashboardServiceStub
Returns
Type Description
NativeDashboardServiceClient

Constructors

NativeDashboardServiceClient(NativeDashboardServiceSettings settings)

protected NativeDashboardServiceClient(NativeDashboardServiceSettings settings)

Constructs an instance of NativeDashboardServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
Name Description
settings NativeDashboardServiceSettings

NativeDashboardServiceClient(NativeDashboardServiceStub stub)

protected NativeDashboardServiceClient(NativeDashboardServiceStub stub)
Parameter
Name Description
stub NativeDashboardServiceStub

Methods

addChart(AddChartRequest request)

public final AddChartResponse addChart(AddChartRequest request)

Add chart in a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   AddChartRequest request =
       AddChartRequest.newBuilder()
           .setName(
               NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]")
                   .toString())
           .setDashboardQuery(DashboardQuery.newBuilder().build())
           .setDashboardChart(DashboardChart.newBuilder().build())
           .setChartLayout(DashboardDefinition.ChartConfig.ChartLayout.newBuilder().build())
           .build();
   AddChartResponse response = nativeDashboardServiceClient.addChart(request);
 }
 
Parameter
Name Description
request AddChartRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AddChartResponse

addChart(NativeDashboardName name, DashboardQuery dashboardQuery, DashboardChart dashboardChart)

public final AddChartResponse addChart(NativeDashboardName name, DashboardQuery dashboardQuery, DashboardChart dashboardChart)

Add chart in a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   NativeDashboardName name =
       NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]");
   DashboardQuery dashboardQuery = DashboardQuery.newBuilder().build();
   DashboardChart dashboardChart = DashboardChart.newBuilder().build();
   AddChartResponse response =
       nativeDashboardServiceClient.addChart(name, dashboardQuery, dashboardChart);
 }
 
Parameters
Name Description
name NativeDashboardName

Required. The dashboard name to add chart in. Format: projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}

dashboardQuery DashboardQuery

Optional. Query used to create the chart.

dashboardChart DashboardChart

Required. Chart to be added to the dashboard.

Returns
Type Description
AddChartResponse

addChart(String name, DashboardQuery dashboardQuery, DashboardChart dashboardChart)

public final AddChartResponse addChart(String name, DashboardQuery dashboardQuery, DashboardChart dashboardChart)

Add chart in a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   String name =
       NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]").toString();
   DashboardQuery dashboardQuery = DashboardQuery.newBuilder().build();
   DashboardChart dashboardChart = DashboardChart.newBuilder().build();
   AddChartResponse response =
       nativeDashboardServiceClient.addChart(name, dashboardQuery, dashboardChart);
 }
 
Parameters
Name Description
name String

Required. The dashboard name to add chart in. Format: projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}

dashboardQuery DashboardQuery

Optional. Query used to create the chart.

dashboardChart DashboardChart

Required. Chart to be added to the dashboard.

Returns
Type Description
AddChartResponse

addChartCallable()

public final UnaryCallable<AddChartRequest,AddChartResponse> addChartCallable()

Add chart in a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   AddChartRequest request =
       AddChartRequest.newBuilder()
           .setName(
               NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]")
                   .toString())
           .setDashboardQuery(DashboardQuery.newBuilder().build())
           .setDashboardChart(DashboardChart.newBuilder().build())
           .setChartLayout(DashboardDefinition.ChartConfig.ChartLayout.newBuilder().build())
           .build();
   ApiFuture<AddChartResponse> future =
       nativeDashboardServiceClient.addChartCallable().futureCall(request);
   // Do something.
   AddChartResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<AddChartRequest,AddChartResponse>

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

public final void close()

createNativeDashboard(CreateNativeDashboardRequest request)

public final NativeDashboard createNativeDashboard(CreateNativeDashboardRequest request)

Create a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   CreateNativeDashboardRequest request =
       CreateNativeDashboardRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setNativeDashboard(NativeDashboard.newBuilder().build())
           .build();
   NativeDashboard response = nativeDashboardServiceClient.createNativeDashboard(request);
 }
 
Parameter
Name Description
request CreateNativeDashboardRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
NativeDashboard

createNativeDashboard(InstanceName parent, NativeDashboard nativeDashboard)

public final NativeDashboard createNativeDashboard(InstanceName parent, NativeDashboard nativeDashboard)

Create a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   NativeDashboard nativeDashboard = NativeDashboard.newBuilder().build();
   NativeDashboard response =
       nativeDashboardServiceClient.createNativeDashboard(parent, nativeDashboard);
 }
 
Parameters
Name Description
parent InstanceName

Required. The parent resource where this dashboard will be created. Format: projects/{project}/locations/{location}/instances/{instance}

nativeDashboard NativeDashboard

Required. The dashboard to create.

Returns
Type Description
NativeDashboard

createNativeDashboard(String parent, NativeDashboard nativeDashboard)

public final NativeDashboard createNativeDashboard(String parent, NativeDashboard nativeDashboard)

Create a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   NativeDashboard nativeDashboard = NativeDashboard.newBuilder().build();
   NativeDashboard response =
       nativeDashboardServiceClient.createNativeDashboard(parent, nativeDashboard);
 }
 
Parameters
Name Description
parent String

Required. The parent resource where this dashboard will be created. Format: projects/{project}/locations/{location}/instances/{instance}

nativeDashboard NativeDashboard

Required. The dashboard to create.

Returns
Type Description
NativeDashboard

createNativeDashboardCallable()

public final UnaryCallable<CreateNativeDashboardRequest,NativeDashboard> createNativeDashboardCallable()

Create a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   CreateNativeDashboardRequest request =
       CreateNativeDashboardRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setNativeDashboard(NativeDashboard.newBuilder().build())
           .build();
   ApiFuture<NativeDashboard> future =
       nativeDashboardServiceClient.createNativeDashboardCallable().futureCall(request);
   // Do something.
   NativeDashboard response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateNativeDashboardRequest,NativeDashboard>

deleteNativeDashboard(DeleteNativeDashboardRequest request)

public final void deleteNativeDashboard(DeleteNativeDashboardRequest request)

Delete a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   DeleteNativeDashboardRequest request =
       DeleteNativeDashboardRequest.newBuilder()
           .setName(
               NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]")
                   .toString())
           .build();
   nativeDashboardServiceClient.deleteNativeDashboard(request);
 }
 
Parameter
Name Description
request DeleteNativeDashboardRequest

The request object containing all of the parameters for the API call.

deleteNativeDashboard(NativeDashboardName name)

public final void deleteNativeDashboard(NativeDashboardName name)

Delete a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   NativeDashboardName name =
       NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]");
   nativeDashboardServiceClient.deleteNativeDashboard(name);
 }
 
Parameter
Name Description
name NativeDashboardName

Required. The dashboard name to delete. Format: projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}

deleteNativeDashboard(String name)

public final void deleteNativeDashboard(String name)

Delete a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   String name =
       NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]").toString();
   nativeDashboardServiceClient.deleteNativeDashboard(name);
 }
 
Parameter
Name Description
name String

Required. The dashboard name to delete. Format: projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}

deleteNativeDashboardCallable()

public final UnaryCallable<DeleteNativeDashboardRequest,Empty> deleteNativeDashboardCallable()

Delete a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   DeleteNativeDashboardRequest request =
       DeleteNativeDashboardRequest.newBuilder()
           .setName(
               NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]")
                   .toString())
           .build();
   ApiFuture<Empty> future =
       nativeDashboardServiceClient.deleteNativeDashboardCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteNativeDashboardRequest,Empty>

duplicateChart(DuplicateChartRequest request)

public final DuplicateChartResponse duplicateChart(DuplicateChartRequest request)

Duplicate chart in a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   DuplicateChartRequest request =
       DuplicateChartRequest.newBuilder()
           .setName(
               NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]")
                   .toString())
           .setDashboardChart(
               DashboardChartName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[CHART]")
                   .toString())
           .build();
   DuplicateChartResponse response = nativeDashboardServiceClient.duplicateChart(request);
 }
 
Parameter
Name Description
request DuplicateChartRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
DuplicateChartResponse

duplicateChart(NativeDashboardName name)

public final DuplicateChartResponse duplicateChart(NativeDashboardName name)

Duplicate chart in a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   NativeDashboardName name =
       NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]");
   DuplicateChartResponse response = nativeDashboardServiceClient.duplicateChart(name);
 }
 
Parameter
Name Description
name NativeDashboardName

Required. The dashboard name that involves chart duplication. Format: projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}

Returns
Type Description
DuplicateChartResponse

duplicateChart(String name)

public final DuplicateChartResponse duplicateChart(String name)

Duplicate chart in a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   String name =
       NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]").toString();
   DuplicateChartResponse response = nativeDashboardServiceClient.duplicateChart(name);
 }
 
Parameter
Name Description
name String

Required. The dashboard name that involves chart duplication. Format: projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}

Returns
Type Description
DuplicateChartResponse

duplicateChartCallable()

public final UnaryCallable<DuplicateChartRequest,DuplicateChartResponse> duplicateChartCallable()

Duplicate chart in a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   DuplicateChartRequest request =
       DuplicateChartRequest.newBuilder()
           .setName(
               NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]")
                   .toString())
           .setDashboardChart(
               DashboardChartName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[CHART]")
                   .toString())
           .build();
   ApiFuture<DuplicateChartResponse> future =
       nativeDashboardServiceClient.duplicateChartCallable().futureCall(request);
   // Do something.
   DuplicateChartResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<DuplicateChartRequest,DuplicateChartResponse>

duplicateNativeDashboard(DuplicateNativeDashboardRequest request)

public final NativeDashboard duplicateNativeDashboard(DuplicateNativeDashboardRequest request)

Duplicate a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   DuplicateNativeDashboardRequest request =
       DuplicateNativeDashboardRequest.newBuilder()
           .setName(
               NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]")
                   .toString())
           .setNativeDashboard(NativeDashboard.newBuilder().build())
           .build();
   NativeDashboard response = nativeDashboardServiceClient.duplicateNativeDashboard(request);
 }
 
Parameter
Name Description
request DuplicateNativeDashboardRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
NativeDashboard

duplicateNativeDashboard(NativeDashboardName name, NativeDashboard nativeDashboard)

public final NativeDashboard duplicateNativeDashboard(NativeDashboardName name, NativeDashboard nativeDashboard)

Duplicate a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   NativeDashboardName name =
       NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]");
   NativeDashboard nativeDashboard = NativeDashboard.newBuilder().build();
   NativeDashboard response =
       nativeDashboardServiceClient.duplicateNativeDashboard(name, nativeDashboard);
 }
 
Parameters
Name Description
name NativeDashboardName

Required. The dashboard name to duplicate. Format: projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}

nativeDashboard NativeDashboard

Required. Any fields that need modification can be passed through this like name, description etc.

Returns
Type Description
NativeDashboard

duplicateNativeDashboard(String name, NativeDashboard nativeDashboard)

public final NativeDashboard duplicateNativeDashboard(String name, NativeDashboard nativeDashboard)

Duplicate a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   String name =
       NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]").toString();
   NativeDashboard nativeDashboard = NativeDashboard.newBuilder().build();
   NativeDashboard response =
       nativeDashboardServiceClient.duplicateNativeDashboard(name, nativeDashboard);
 }
 
Parameters
Name Description
name String

Required. The dashboard name to duplicate. Format: projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}

nativeDashboard NativeDashboard

Required. Any fields that need modification can be passed through this like name, description etc.

Returns
Type Description
NativeDashboard

duplicateNativeDashboardCallable()

public final UnaryCallable<DuplicateNativeDashboardRequest,NativeDashboard> duplicateNativeDashboardCallable()

Duplicate a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   DuplicateNativeDashboardRequest request =
       DuplicateNativeDashboardRequest.newBuilder()
           .setName(
               NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]")
                   .toString())
           .setNativeDashboard(NativeDashboard.newBuilder().build())
           .build();
   ApiFuture<NativeDashboard> future =
       nativeDashboardServiceClient.duplicateNativeDashboardCallable().futureCall(request);
   // Do something.
   NativeDashboard response = future.get();
 }
 
Returns
Type Description
UnaryCallable<DuplicateNativeDashboardRequest,NativeDashboard>

editChart(EditChartRequest request)

public final EditChartResponse editChart(EditChartRequest request)

Edit chart in a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   EditChartRequest request =
       EditChartRequest.newBuilder()
           .setName(
               NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]")
                   .toString())
           .setDashboardQuery(DashboardQuery.newBuilder().build())
           .setDashboardChart(DashboardChart.newBuilder().build())
           .setEditMask(FieldMask.newBuilder().build())
           .addAllLanguageFeatures(new ArrayList<LanguageFeature>())
           .build();
   EditChartResponse response = nativeDashboardServiceClient.editChart(request);
 }
 
Parameter
Name Description
request EditChartRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
EditChartResponse

editChart(NativeDashboardName name, DashboardQuery dashboardQuery, DashboardChart dashboardChart, FieldMask editMask)

public final EditChartResponse editChart(NativeDashboardName name, DashboardQuery dashboardQuery, DashboardChart dashboardChart, FieldMask editMask)

Edit chart in a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   NativeDashboardName name =
       NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]");
   DashboardQuery dashboardQuery = DashboardQuery.newBuilder().build();
   DashboardChart dashboardChart = DashboardChart.newBuilder().build();
   FieldMask editMask = FieldMask.newBuilder().build();
   EditChartResponse response =
       nativeDashboardServiceClient.editChart(name, dashboardQuery, dashboardChart, editMask);
 }
 
Parameters
Name Description
name NativeDashboardName

Required. The dashboard name to edit chart in. Format: projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}

dashboardQuery DashboardQuery

Optional. Query for the edited chart.

dashboardChart DashboardChart

Optional. Edited chart.

editMask FieldMask

Required. The list of fields to edit for chart and query. Supported paths in chart are - dashboard_chart.display_name dashboard_chart.description dashboard_chart.chart_datasource.data_sources dashboard_chart.visualization dashboard_chart.visualization.button dashboard_chart.visualization.markdown dashboard_chart.drill_down_config Supported paths in query are - dashboard_query.query dashboard_query.input

Returns
Type Description
EditChartResponse

editChart(String name, DashboardQuery dashboardQuery, DashboardChart dashboardChart, FieldMask editMask)

public final EditChartResponse editChart(String name, DashboardQuery dashboardQuery, DashboardChart dashboardChart, FieldMask editMask)

Edit chart in a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   String name =
       NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]").toString();
   DashboardQuery dashboardQuery = DashboardQuery.newBuilder().build();
   DashboardChart dashboardChart = DashboardChart.newBuilder().build();
   FieldMask editMask = FieldMask.newBuilder().build();
   EditChartResponse response =
       nativeDashboardServiceClient.editChart(name, dashboardQuery, dashboardChart, editMask);
 }
 
Parameters
Name Description
name String

Required. The dashboard name to edit chart in. Format: projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}

dashboardQuery DashboardQuery

Optional. Query for the edited chart.

dashboardChart DashboardChart

Optional. Edited chart.

editMask FieldMask

Required. The list of fields to edit for chart and query. Supported paths in chart are - dashboard_chart.display_name dashboard_chart.description dashboard_chart.chart_datasource.data_sources dashboard_chart.visualization dashboard_chart.visualization.button dashboard_chart.visualization.markdown dashboard_chart.drill_down_config Supported paths in query are - dashboard_query.query dashboard_query.input

Returns
Type Description
EditChartResponse

editChartCallable()

public final UnaryCallable<EditChartRequest,EditChartResponse> editChartCallable()

Edit chart in a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   EditChartRequest request =
       EditChartRequest.newBuilder()
           .setName(
               NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]")
                   .toString())
           .setDashboardQuery(DashboardQuery.newBuilder().build())
           .setDashboardChart(DashboardChart.newBuilder().build())
           .setEditMask(FieldMask.newBuilder().build())
           .addAllLanguageFeatures(new ArrayList<LanguageFeature>())
           .build();
   ApiFuture<EditChartResponse> future =
       nativeDashboardServiceClient.editChartCallable().futureCall(request);
   // Do something.
   EditChartResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<EditChartRequest,EditChartResponse>

exportNativeDashboards(ExportNativeDashboardsRequest request)

public final ExportNativeDashboardsResponse exportNativeDashboards(ExportNativeDashboardsRequest request)

Exports the dashboards.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   ExportNativeDashboardsRequest request =
       ExportNativeDashboardsRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .addAllNames(new ArrayList<String>())
           .build();
   ExportNativeDashboardsResponse response =
       nativeDashboardServiceClient.exportNativeDashboards(request);
 }
 
Parameter
Name Description
request ExportNativeDashboardsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ExportNativeDashboardsResponse

exportNativeDashboards(InstanceName parent, List<String> names)

public final ExportNativeDashboardsResponse exportNativeDashboards(InstanceName parent, List<String> names)

Exports the dashboards.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   List<String> names = new ArrayList<>();
   ExportNativeDashboardsResponse response =
       nativeDashboardServiceClient.exportNativeDashboards(parent, names);
 }
 
Parameters
Name Description
parent InstanceName

Required. The parent resource that the dashboards to be exported belong to. Format: projects/{project}/locations/{location}/instances/{instance}

names List<String>

Required. The resource names of the dashboards to export.

Returns
Type Description
ExportNativeDashboardsResponse

exportNativeDashboards(String parent, List<String> names)

public final ExportNativeDashboardsResponse exportNativeDashboards(String parent, List<String> names)

Exports the dashboards.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   List<String> names = new ArrayList<>();
   ExportNativeDashboardsResponse response =
       nativeDashboardServiceClient.exportNativeDashboards(parent, names);
 }
 
Parameters
Name Description
parent String

Required. The parent resource that the dashboards to be exported belong to. Format: projects/{project}/locations/{location}/instances/{instance}

names List<String>

Required. The resource names of the dashboards to export.

Returns
Type Description
ExportNativeDashboardsResponse

exportNativeDashboardsCallable()

public final UnaryCallable<ExportNativeDashboardsRequest,ExportNativeDashboardsResponse> exportNativeDashboardsCallable()

Exports the dashboards.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   ExportNativeDashboardsRequest request =
       ExportNativeDashboardsRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .addAllNames(new ArrayList<String>())
           .build();
   ApiFuture<ExportNativeDashboardsResponse> future =
       nativeDashboardServiceClient.exportNativeDashboardsCallable().futureCall(request);
   // Do something.
   ExportNativeDashboardsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<ExportNativeDashboardsRequest,ExportNativeDashboardsResponse>

getNativeDashboard(GetNativeDashboardRequest request)

public final NativeDashboard getNativeDashboard(GetNativeDashboardRequest request)

Get a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   GetNativeDashboardRequest request =
       GetNativeDashboardRequest.newBuilder()
           .setName(
               NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]")
                   .toString())
           .setView(NativeDashboardView.forNumber(0))
           .build();
   NativeDashboard response = nativeDashboardServiceClient.getNativeDashboard(request);
 }
 
Parameter
Name Description
request GetNativeDashboardRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
NativeDashboard

getNativeDashboard(NativeDashboardName name)

public final NativeDashboard getNativeDashboard(NativeDashboardName name)

Get a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   NativeDashboardName name =
       NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]");
   NativeDashboard response = nativeDashboardServiceClient.getNativeDashboard(name);
 }
 
Parameter
Name Description
name NativeDashboardName

Required. The dashboard name to fetch. Format: projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}

Returns
Type Description
NativeDashboard

getNativeDashboard(String name)

public final NativeDashboard getNativeDashboard(String name)

Get a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   String name =
       NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]").toString();
   NativeDashboard response = nativeDashboardServiceClient.getNativeDashboard(name);
 }
 
Parameter
Name Description
name String

Required. The dashboard name to fetch. Format: projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}

Returns
Type Description
NativeDashboard

getNativeDashboardCallable()

public final UnaryCallable<GetNativeDashboardRequest,NativeDashboard> getNativeDashboardCallable()

Get a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   GetNativeDashboardRequest request =
       GetNativeDashboardRequest.newBuilder()
           .setName(
               NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]")
                   .toString())
           .setView(NativeDashboardView.forNumber(0))
           .build();
   ApiFuture<NativeDashboard> future =
       nativeDashboardServiceClient.getNativeDashboardCallable().futureCall(request);
   // Do something.
   NativeDashboard response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetNativeDashboardRequest,NativeDashboard>

getSettings()

public final NativeDashboardServiceSettings getSettings()
Returns
Type Description
NativeDashboardServiceSettings

getStub()

public NativeDashboardServiceStub getStub()
Returns
Type Description
NativeDashboardServiceStub

importNativeDashboards(ImportNativeDashboardsRequest request)

public final ImportNativeDashboardsResponse importNativeDashboards(ImportNativeDashboardsRequest request)

Imports the dashboards.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   ImportNativeDashboardsRequest request =
       ImportNativeDashboardsRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setSource(ImportNativeDashboardsInlineSource.newBuilder().build())
           .build();
   ImportNativeDashboardsResponse response =
       nativeDashboardServiceClient.importNativeDashboards(request);
 }
 
Parameter
Name Description
request ImportNativeDashboardsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ImportNativeDashboardsResponse

importNativeDashboards(InstanceName parent, ImportNativeDashboardsInlineSource source)

public final ImportNativeDashboardsResponse importNativeDashboards(InstanceName parent, ImportNativeDashboardsInlineSource source)

Imports the dashboards.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   ImportNativeDashboardsInlineSource source =
       ImportNativeDashboardsInlineSource.newBuilder().build();
   ImportNativeDashboardsResponse response =
       nativeDashboardServiceClient.importNativeDashboards(parent, source);
 }
 
Parameters
Name Description
parent InstanceName

Required. The parent resource where this dashboard will be created. Format: projects/{project}/locations/{location}/instances/{instance}

source ImportNativeDashboardsInlineSource

Required. The data will imported from this proto.

Returns
Type Description
ImportNativeDashboardsResponse

importNativeDashboards(String parent, ImportNativeDashboardsInlineSource source)

public final ImportNativeDashboardsResponse importNativeDashboards(String parent, ImportNativeDashboardsInlineSource source)

Imports the dashboards.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   ImportNativeDashboardsInlineSource source =
       ImportNativeDashboardsInlineSource.newBuilder().build();
   ImportNativeDashboardsResponse response =
       nativeDashboardServiceClient.importNativeDashboards(parent, source);
 }
 
Parameters
Name Description
parent String

Required. The parent resource where this dashboard will be created. Format: projects/{project}/locations/{location}/instances/{instance}

source ImportNativeDashboardsInlineSource

Required. The data will imported from this proto.

Returns
Type Description
ImportNativeDashboardsResponse

importNativeDashboardsCallable()

public final UnaryCallable<ImportNativeDashboardsRequest,ImportNativeDashboardsResponse> importNativeDashboardsCallable()

Imports the dashboards.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   ImportNativeDashboardsRequest request =
       ImportNativeDashboardsRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setSource(ImportNativeDashboardsInlineSource.newBuilder().build())
           .build();
   ApiFuture<ImportNativeDashboardsResponse> future =
       nativeDashboardServiceClient.importNativeDashboardsCallable().futureCall(request);
   // Do something.
   ImportNativeDashboardsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<ImportNativeDashboardsRequest,ImportNativeDashboardsResponse>

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listNativeDashboards(InstanceName parent)

public final NativeDashboardServiceClient.ListNativeDashboardsPagedResponse listNativeDashboards(InstanceName parent)

List all dashboards.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   for (NativeDashboard element :
       nativeDashboardServiceClient.listNativeDashboards(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent InstanceName

Required. The parent owning this dashboard collection. Format: projects/{project}/locations/{location}/instances/{instance}

Returns
Type Description
NativeDashboardServiceClient.ListNativeDashboardsPagedResponse

listNativeDashboards(ListNativeDashboardsRequest request)

public final NativeDashboardServiceClient.ListNativeDashboardsPagedResponse listNativeDashboards(ListNativeDashboardsRequest request)

List all dashboards.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   ListNativeDashboardsRequest request =
       ListNativeDashboardsRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setView(NativeDashboardView.forNumber(0))
           .build();
   for (NativeDashboard element :
       nativeDashboardServiceClient.listNativeDashboards(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListNativeDashboardsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
NativeDashboardServiceClient.ListNativeDashboardsPagedResponse

listNativeDashboards(String parent)

public final NativeDashboardServiceClient.ListNativeDashboardsPagedResponse listNativeDashboards(String parent)

List all dashboards.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   for (NativeDashboard element :
       nativeDashboardServiceClient.listNativeDashboards(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent owning this dashboard collection. Format: projects/{project}/locations/{location}/instances/{instance}

Returns
Type Description
NativeDashboardServiceClient.ListNativeDashboardsPagedResponse

listNativeDashboardsCallable()

public final UnaryCallable<ListNativeDashboardsRequest,ListNativeDashboardsResponse> listNativeDashboardsCallable()

List all dashboards.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   ListNativeDashboardsRequest request =
       ListNativeDashboardsRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setView(NativeDashboardView.forNumber(0))
           .build();
   while (true) {
     ListNativeDashboardsResponse response =
         nativeDashboardServiceClient.listNativeDashboardsCallable().call(request);
     for (NativeDashboard element : response.getNativeDashboardsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListNativeDashboardsRequest,ListNativeDashboardsResponse>

listNativeDashboardsPagedCallable()

public final UnaryCallable<ListNativeDashboardsRequest,NativeDashboardServiceClient.ListNativeDashboardsPagedResponse> listNativeDashboardsPagedCallable()

List all dashboards.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   ListNativeDashboardsRequest request =
       ListNativeDashboardsRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setView(NativeDashboardView.forNumber(0))
           .build();
   ApiFuture<NativeDashboard> future =
       nativeDashboardServiceClient.listNativeDashboardsPagedCallable().futureCall(request);
   // Do something.
   for (NativeDashboard element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListNativeDashboardsRequest,ListNativeDashboardsPagedResponse>

removeChart(NativeDashboardName name)

public final NativeDashboard removeChart(NativeDashboardName name)

Remove chart from a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   NativeDashboardName name =
       NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]");
   NativeDashboard response = nativeDashboardServiceClient.removeChart(name);
 }
 
Parameter
Name Description
name NativeDashboardName

Required. The dashboard name to remove chart from. Format: projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}

Returns
Type Description
NativeDashboard

removeChart(RemoveChartRequest request)

public final NativeDashboard removeChart(RemoveChartRequest request)

Remove chart from a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   RemoveChartRequest request =
       RemoveChartRequest.newBuilder()
           .setName(
               NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]")
                   .toString())
           .setDashboardChart(
               DashboardChartName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[CHART]")
                   .toString())
           .build();
   NativeDashboard response = nativeDashboardServiceClient.removeChart(request);
 }
 
Parameter
Name Description
request RemoveChartRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
NativeDashboard

removeChart(String name)

public final NativeDashboard removeChart(String name)

Remove chart from a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   String name =
       NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]").toString();
   NativeDashboard response = nativeDashboardServiceClient.removeChart(name);
 }
 
Parameter
Name Description
name String

Required. The dashboard name to remove chart from. Format: projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}

Returns
Type Description
NativeDashboard

removeChartCallable()

public final UnaryCallable<RemoveChartRequest,NativeDashboard> removeChartCallable()

Remove chart from a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   RemoveChartRequest request =
       RemoveChartRequest.newBuilder()
           .setName(
               NativeDashboardName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[DASHBOARD]")
                   .toString())
           .setDashboardChart(
               DashboardChartName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[CHART]")
                   .toString())
           .build();
   ApiFuture<NativeDashboard> future =
       nativeDashboardServiceClient.removeChartCallable().futureCall(request);
   // Do something.
   NativeDashboard response = future.get();
 }
 
Returns
Type Description
UnaryCallable<RemoveChartRequest,NativeDashboard>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateNativeDashboard(NativeDashboard nativeDashboard, FieldMask updateMask)

public final NativeDashboard updateNativeDashboard(NativeDashboard nativeDashboard, FieldMask updateMask)

Update a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   NativeDashboard nativeDashboard = NativeDashboard.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   NativeDashboard response =
       nativeDashboardServiceClient.updateNativeDashboard(nativeDashboard, updateMask);
 }
 
Parameters
Name Description
nativeDashboard NativeDashboard

Required. The dashboard to update.

The dashboard's name field is used to identify the dashboard to update. Format: projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{dashboard}

updateMask FieldMask

Required. LINT.IfChange(update_mask_values) The list of fields to update. Supported paths are - display_name description definition.filters definition.charts type access dashboard_user_data.is_pinned

Returns
Type Description
NativeDashboard

updateNativeDashboard(UpdateNativeDashboardRequest request)

public final NativeDashboard updateNativeDashboard(UpdateNativeDashboardRequest request)

Update a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   UpdateNativeDashboardRequest request =
       UpdateNativeDashboardRequest.newBuilder()
           .setNativeDashboard(NativeDashboard.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   NativeDashboard response = nativeDashboardServiceClient.updateNativeDashboard(request);
 }
 
Parameter
Name Description
request UpdateNativeDashboardRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
NativeDashboard

updateNativeDashboardCallable()

public final UnaryCallable<UpdateNativeDashboardRequest,NativeDashboard> updateNativeDashboardCallable()

Update a dashboard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (NativeDashboardServiceClient nativeDashboardServiceClient =
     NativeDashboardServiceClient.create()) {
   UpdateNativeDashboardRequest request =
       UpdateNativeDashboardRequest.newBuilder()
           .setNativeDashboard(NativeDashboard.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<NativeDashboard> future =
       nativeDashboardServiceClient.updateNativeDashboardCallable().futureCall(request);
   // Do something.
   NativeDashboard response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateNativeDashboardRequest,NativeDashboard>