Service allows existing Cloud Profiler customers to export their profile data out of Google Cloud. v2
Package
@google-cloud/cloudprofilerConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of ExportServiceClient.
Parameters | |
---|---|
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
Properties
apiEndpoint
get apiEndpoint(): string;
The DNS address for this API service.
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath.
auth
auth: gax.GoogleAuth;
descriptors
descriptors: Descriptors;
exportServiceStub
exportServiceStub?: Promise<{
[name: string]: Function;
}>;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};
port
static get port(): number;
The port for this API service.
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;
The DNS address for this API service.
universeDomain
get universeDomain(): string;
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
close()
close(): Promise<void>;
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns | |
---|---|
Type | Description |
Promise<void> | {Promise} A promise that resolves when the client is closed. |
getProjectId()
getProjectId(): Promise<string>;
Returns | |
---|---|
Type | Description |
Promise<string> |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter | |
---|---|
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Returns | |
---|---|
Type | Description |
void |
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns | |
---|---|
Type | Description |
Promise<{
[name: string]: Function;
}> | {Promise} A promise that resolves to an authenticated service stub. |
listProfiles(request, options)
listProfiles(request?: protos.google.devtools.cloudprofiler.v2.IListProfilesRequest, options?: CallOptions): Promise<[
protos.google.devtools.cloudprofiler.v2.IProfile[],
protos.google.devtools.cloudprofiler.v2.IListProfilesRequest | null,
protos.google.devtools.cloudprofiler.v2.IListProfilesResponse
]>;
Lists profiles which have been collected so far and for which the caller has permission to view.
Parameters | |
---|---|
Name | Description |
request |
IListProfilesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.devtools.cloudprofiler.v2.IProfile[],
protos.google.devtools.cloudprofiler.v2.IListProfilesRequest | null,
protos.google.devtools.cloudprofiler.v2.IListProfilesResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of Profile. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listProfiles(request, options, callback)
listProfiles(request: protos.google.devtools.cloudprofiler.v2.IListProfilesRequest, options: CallOptions, callback: PaginationCallback<protos.google.devtools.cloudprofiler.v2.IListProfilesRequest, protos.google.devtools.cloudprofiler.v2.IListProfilesResponse | null | undefined, protos.google.devtools.cloudprofiler.v2.IProfile>): void;
Parameters | |
---|---|
Name | Description |
request |
IListProfilesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.devtools.cloudprofiler.v2.IListProfilesRequest, protos.google.devtools.cloudprofiler.v2.IListProfilesResponse | null | undefined, protos.google.devtools.cloudprofiler.v2.IProfile>
|
Returns | |
---|---|
Type | Description |
void |
listProfiles(request, callback)
listProfiles(request: protos.google.devtools.cloudprofiler.v2.IListProfilesRequest, callback: PaginationCallback<protos.google.devtools.cloudprofiler.v2.IListProfilesRequest, protos.google.devtools.cloudprofiler.v2.IListProfilesResponse | null | undefined, protos.google.devtools.cloudprofiler.v2.IProfile>): void;
Parameters | |
---|---|
Name | Description |
request |
IListProfilesRequest
|
callback |
PaginationCallback<protos.google.devtools.cloudprofiler.v2.IListProfilesRequest, protos.google.devtools.cloudprofiler.v2.IListProfilesResponse | null | undefined, protos.google.devtools.cloudprofiler.v2.IProfile>
|
Returns | |
---|---|
Type | Description |
void |
listProfilesAsync(request, options)
listProfilesAsync(request?: protos.google.devtools.cloudprofiler.v2.IListProfilesRequest, options?: CallOptions): AsyncIterable<protos.google.devtools.cloudprofiler.v2.IProfile>;
Equivalent to listProfiles
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListProfilesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.devtools.cloudprofiler.v2.IProfile> | {Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Profile. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
/**
* 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent, which owns this collection of profiles.
* Format: projects/{user_project_id}
*/
// const parent = 'abc123'
/**
* The maximum number of items to return.
* Default page_size is 1000.
* Max limit is 1000.
*/
// const pageSize = 1234
/**
* The token to continue pagination and get profiles from a particular page.
* When paginating, all other parameters provided to `ListProfiles` must match
* the call that provided the page token.
*/
// const pageToken = 'abc123'
// Imports the Cloudprofiler library
const {ExportServiceClient} = require('@google-cloud/cloudprofiler').v2;
// Instantiates a client
const cloudprofilerClient = new ExportServiceClient();
async function callListProfiles() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = cloudprofilerClient.listProfilesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListProfiles();
listProfilesStream(request, options)
listProfilesStream(request?: protos.google.devtools.cloudprofiler.v2.IListProfilesRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListProfilesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing Profile on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
matchProfileFromProfileName(profileName)
matchProfileFromProfileName(profileName: string): string | number;
Parse the profile from Profile resource.
Parameter | |
---|---|
Name | Description |
profileName |
string
A fully-qualified path representing Profile resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the profile. |
matchProjectFromProfileName(profileName)
matchProjectFromProfileName(profileName: string): string | number;
Parse the project from Profile resource.
Parameter | |
---|---|
Name | Description |
profileName |
string
A fully-qualified path representing Profile resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;
Parse the project from Project resource.
Parameter | |
---|---|
Name | Description |
projectName |
string
A fully-qualified path representing Project resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
profilePath(project, profile)
profilePath(project: string, profile: string): string;
Return a fully-qualified profile resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
profile |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
projectPath(project)
projectPath(project: string): string;
Return a fully-qualified project resource name string.
Parameter | |
---|---|
Name | Description |
project |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |