AssetServiceClient

AssetServiceClient

Asset service definition.

Constructor

new AssetServiceClient(optionsopt)

Construct an instance of AssetServiceClient.

Parameters:
Name Type Attributes Description
options object <optional>

The configuration object. See the subsequent parameters for more details.

Properties
Name Type Attributes Description
credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
email string <optional>

Account email address. Required when using a .pem or .p12 keyFilename.

keyFilename string <optional>

Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option below is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.

port number <optional>

The port on which to connect to the remote host.

projectId string <optional>

The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

apiEndpoint string <optional>

The domain name of the API remote host.

Members

(static) apiEndpoint

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

(static) port

The port for this API service.

(static) scopes

The scopes needed to make gRPC calls for every method defined in this service.

(static) servicePath

The DNS address for this API service.

Methods

close()

Terminate the GRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

createFeed(request, optionsopt) → {Promise}

Creates a feed in a parent project/folder/organization to listen to its asset updates.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The name of the project/folder/organization where this feed should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id")", or a project number (such as "projects/12345").

feedId string

Required. This is the client-assigned asset feed identifier and it needs to be unique under a specific parent project/folder/organization.

feed google.cloud.asset.v1p2beta1.Feed

Required. The feed details. The field name must be empty and it will be generated in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

options object <optional>

Call options. See CallOptions for more details.

deleteFeed(request, optionsopt) → {Promise}

Deletes an asset feed.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The name of the feed and it must be in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

options object <optional>

Call options. See CallOptions for more details.

folderFeedPath(folder, feed) → {string}

Return a fully-qualified folderFeed resource name string.

Parameters:
Name Type Description
folder string
feed string

getFeed(request, optionsopt) → {Promise}

Gets details about an asset feed.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The name of the Feed and it must be in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

options object <optional>

Call options. See CallOptions for more details.

getProjectId(callback)

Return the project ID used by this class.

Parameters:
Name Type Description
callback function

the callback to be called with the current project Id.

initialize() → {Promise}

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.

listFeeds(request, optionsopt) → {Promise}

Lists all asset feeds in a parent project/folder/organization.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The parent project/folder/organization whose feeds are to be listed. It can only be using project/folder/organization number (such as "folders/12345")", or a project ID (such as "projects/my-project-id").

options object <optional>

Call options. See CallOptions for more details.

matchFeedFromFolderFeedName(folderFeedName) → {string}

Parse the feed from FolderFeed resource.

Parameters:
Name Type Description
folderFeedName string

A fully-qualified path representing folder_feed resource.

matchFeedFromOrganizationFeedName(organizationFeedName) → {string}

Parse the feed from OrganizationFeed resource.

Parameters:
Name Type Description
organizationFeedName string

A fully-qualified path representing organization_feed resource.

matchFeedFromProjectFeedName(projectFeedName) → {string}

Parse the feed from ProjectFeed resource.

Parameters:
Name Type Description
projectFeedName string

A fully-qualified path representing project_feed resource.

matchFolderFromFolderFeedName(folderFeedName) → {string}

Parse the folder from FolderFeed resource.

Parameters:
Name Type Description
folderFeedName string

A fully-qualified path representing folder_feed resource.

matchOrganizationFromOrganizationFeedName(organizationFeedName) → {string}

Parse the organization from OrganizationFeed resource.

Parameters:
Name Type Description
organizationFeedName string

A fully-qualified path representing organization_feed resource.

matchProjectFromProjectFeedName(projectFeedName) → {string}

Parse the project from ProjectFeed resource.

Parameters:
Name Type Description
projectFeedName string

A fully-qualified path representing project_feed resource.

organizationFeedPath(organization, feed) → {string}

Return a fully-qualified organizationFeed resource name string.

Parameters:
Name Type Description
organization string
feed string

projectFeedPath(project, feed) → {string}

Return a fully-qualified projectFeed resource name string.

Parameters:
Name Type Description
project string
feed string

updateFeed(request, optionsopt) → {Promise}

Updates an asset feed configuration.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
feed google.cloud.asset.v1p2beta1.Feed

Required. The new values of feed details. It must match an existing feed and the field name must be in the format of: projects/project_number/feeds/feed_id or folders/folder_number/feeds/feed_id or organizations/organization_number/feeds/feed_id.

updateMask google.protobuf.FieldMask

Required. Only updates the feed fields indicated by this mask. The field mask must not be empty, and it must not contain fields that are immutable or only set by the server.

options object <optional>

Call options. See CallOptions for more details.