Class: Google::Apis::SecuritycenterV1::Database

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/securitycenter_v1/classes.rb,
lib/google/apis/securitycenter_v1/representations.rb,
lib/google/apis/securitycenter_v1/representations.rb

Overview

Represents database access information, such as queries. A database may be a sub-resource of an instance (as in the case of CloudSQL instances or Cloud Spanner instances), or the database instance itself. Some database resources may not have the full resource name populated because these resource types are not yet supported by Cloud Asset Inventory (e.g. CloudSQL databases). In these cases only the display name will be provided.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Database

Returns a new instance of Database.



844
845
846
# File 'lib/google/apis/securitycenter_v1/classes.rb', line 844

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#display_nameString

The human readable name of the database the user connected to. Corresponds to the JSON property displayName

Returns:

  • (String)


819
820
821
# File 'lib/google/apis/securitycenter_v1/classes.rb', line 819

def display_name
  @display_name
end

#granteesArray<String>

The target usernames/roles/groups of a SQL privilege grant (not an IAM policy change). Corresponds to the JSON property grantees

Returns:

  • (Array<String>)


825
826
827
# File 'lib/google/apis/securitycenter_v1/classes.rb', line 825

def grantees
  @grantees
end

#nameString

The full resource name of the database the user connected to, if it is supported by CAI. (https://google.aip.dev/122#full-resource-names) Corresponds to the JSON property name

Returns:

  • (String)


831
832
833
# File 'lib/google/apis/securitycenter_v1/classes.rb', line 831

def name
  @name
end

#queryString

The SQL statement associated with the relevant access. Corresponds to the JSON property query

Returns:

  • (String)


836
837
838
# File 'lib/google/apis/securitycenter_v1/classes.rb', line 836

def query
  @query
end

#user_nameString

The username used to connect to the DB. This may not necessarily be an IAM principal, and has no required format. Corresponds to the JSON property userName

Returns:

  • (String)


842
843
844
# File 'lib/google/apis/securitycenter_v1/classes.rb', line 842

def user_name
  @user_name
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



849
850
851
852
853
854
855
# File 'lib/google/apis/securitycenter_v1/classes.rb', line 849

def update!(**args)
  @display_name = args[:display_name] if args.key?(:display_name)
  @grantees = args[:grantees] if args.key?(:grantees)
  @name = args[:name] if args.key?(:name)
  @query = args[:query] if args.key?(:query)
  @user_name = args[:user_name] if args.key?(:user_name)
end