-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically generated by magic modules for service: vertex_ai and r…
…esource: Tensorboards__experiment. This commit includes the following changes: - Singular Resource - Plural Resource - Documentation updates - Terraform configuration - Integration tests Signed-off-by: Samir Anand <[email protected]>
- Loading branch information
1 parent
5e1a34c
commit fdcbe0e
Showing
9 changed files
with
403 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
docs/resources/google_vertex_ai_tensorboards_experiment.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
title: About the google_vertex_ai_tensorboards_experiment resource | ||
platform: gcp | ||
--- | ||
|
||
## Syntax | ||
A `google_vertex_ai_tensorboards_experiment` is used to test a Google TensorboardsExperiment resource | ||
|
||
## Examples | ||
``` | ||
describe google_vertex_ai_tensorboards_experiment(name: "projects/#{gcp_project_id}/locations/#{tensorboards_experiment['region']}/tensorboards/#{tensorboards_experiment['tensorboard']}/experiments/#{tensorboards_experiment['name']}", region: ' value_region') do | ||
it { should exist } | ||
its('description') { should cmp 'value_description' } | ||
its('source') { should cmp 'value_source' } | ||
its('display_name') { should cmp 'value_displayname' } | ||
its('create_time') { should cmp 'value_createtime' } | ||
its('update_time') { should cmp 'value_updatetime' } | ||
its('name') { should cmp 'value_name' } | ||
its('etag') { should cmp 'value_etag' } | ||
end | ||
describe google_vertex_ai_tensorboards_experiment(name: "does_not_exit", region: ' value_region') do | ||
it { should_not exist } | ||
end | ||
``` | ||
|
||
## Properties | ||
Properties that can be accessed from the `google_vertex_ai_tensorboards_experiment` resource: | ||
|
||
|
||
* `description`: Description of this TensorboardExperiment. | ||
|
||
* `source`: Immutable. Source of the TensorboardExperiment. Example: a custom training job. | ||
|
||
* `display_name`: User provided name of this TensorboardExperiment. | ||
|
||
* `create_time`: Output only. Timestamp when this TensorboardExperiment was created. | ||
|
||
* `update_time`: Output only. Timestamp when this TensorboardExperiment was last updated. | ||
|
||
* `labels`: The labels with user-defined metadata to organize your TensorboardExperiment. Label keys and values cannot be longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. No more than 64 user labels can be associated with one Dataset (System labels are excluded). See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with `aiplatform.googleapis.com/` and are immutable. The following system labels exist for each Dataset: * `aiplatform.googleapis.com/dataset_metadata_schema`: output only. Its value is the metadata_schema's title. | ||
|
||
* `additional_properties`: | ||
|
||
* `name`: Output only. Name of the TensorboardExperiment. Format: `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` | ||
|
||
* `etag`: Used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens. | ||
|
||
|
||
## GCP Permissions |
33 changes: 33 additions & 0 deletions
33
docs/resources/google_vertex_ai_tensorboards_experiments.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
title: About the google_vertex_ai_tensorboards_experiments resource | ||
platform: gcp | ||
--- | ||
|
||
## Syntax | ||
A `google_vertex_ai_tensorboards_experiments` is used to test a Google TensorboardsExperiment resource | ||
|
||
## Examples | ||
``` | ||
describe google_vertex_ai_tensorboards_experiments(parent: "projects/#{gcp_project_id}/locations/#{tensorboards_experiment['region']}/tensorboards/#{tensorboards_experiment['tensorboard']}", region: ' value_region') do | ||
it { should exist } | ||
end | ||
``` | ||
|
||
## Properties | ||
Properties that can be accessed from the `google_vertex_ai_tensorboards_experiments` resource: | ||
|
||
See [google_vertex_ai_tensorboards_experiment.md](google_vertex_ai_tensorboards_experiment.md) for more detailed information | ||
* `descriptions`: an array of `google_vertex_ai_tensorboards_experiment` description | ||
* `sources`: an array of `google_vertex_ai_tensorboards_experiment` source | ||
* `display_names`: an array of `google_vertex_ai_tensorboards_experiment` display_name | ||
* `create_times`: an array of `google_vertex_ai_tensorboards_experiment` create_time | ||
* `update_times`: an array of `google_vertex_ai_tensorboards_experiment` update_time | ||
* `labels`: an array of `google_vertex_ai_tensorboards_experiment` labels | ||
* `names`: an array of `google_vertex_ai_tensorboards_experiment` name | ||
* `etags`: an array of `google_vertex_ai_tensorboards_experiment` etag | ||
|
||
## Filter Criteria | ||
This resource supports all of the above properties as filter criteria, which can be used | ||
with `where` as a block or a method. | ||
|
||
## GCP Permissions |
34 changes: 34 additions & 0 deletions
34
libraries/google/vertexai/property/tensorboardsexperiment_labels.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: false | ||
|
||
# ---------------------------------------------------------------------------- | ||
# | ||
# *** AUTO GENERATED CODE *** Type: MMv1 *** | ||
# | ||
# ---------------------------------------------------------------------------- | ||
# | ||
# This file is automatically generated by Magic Modules and manual | ||
# changes will be clobbered when the file is regenerated. | ||
# | ||
# Please read more about how to change this file in README.md and | ||
# CONTRIBUTING.md located at the root of this package. | ||
# | ||
# ---------------------------------------------------------------------------- | ||
module GoogleInSpec | ||
module VertexAI | ||
module Property | ||
class TensorboardsExperimentLabels | ||
attr_reader :additional_properties | ||
|
||
def initialize(args = nil, parent_identifier = nil) | ||
return if args.nil? | ||
@parent_identifier = parent_identifier | ||
@additional_properties = args['additionalProperties'] | ||
end | ||
|
||
def to_s | ||
"#{@parent_identifier} TensorboardsExperimentLabels" | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# frozen_string_literal: false | ||
|
||
# ---------------------------------------------------------------------------- | ||
# | ||
# *** AUTO GENERATED CODE *** Type: MMv1 *** | ||
# | ||
# ---------------------------------------------------------------------------- | ||
# | ||
# This file is automatically generated by Magic Modules and manual | ||
# changes will be clobbered when the file is regenerated. | ||
# | ||
# Please read more about how to change this file in README.md and | ||
# CONTRIBUTING.md located at the root of this package. | ||
# | ||
# ---------------------------------------------------------------------------- | ||
require 'gcp_backend' | ||
require 'google/vertexai/property/tensorboardsexperiment_labels' | ||
|
||
# A provider to manage Vertex AI resources. | ||
class VertexAITensorboardsExperiment < GcpResourceBase | ||
name 'google_vertex_ai_tensorboards_experiment' | ||
desc 'TensorboardsExperiment' | ||
supports platform: 'gcp' | ||
|
||
attr_reader :params | ||
attr_reader :description | ||
attr_reader :source | ||
attr_reader :display_name | ||
attr_reader :create_time | ||
attr_reader :update_time | ||
attr_reader :labels | ||
attr_reader :name | ||
attr_reader :etag | ||
|
||
def initialize(params) | ||
super(params.merge({ use_http_transport: true })) | ||
@params = params | ||
@fetched = @connection.fetch(product_url(params[:beta]), resource_base_url, params, 'Get') | ||
parse unless @fetched.nil? | ||
end | ||
|
||
def parse | ||
@description = @fetched['description'] | ||
@source = @fetched['source'] | ||
@display_name = @fetched['displayName'] | ||
@create_time = @fetched['createTime'] | ||
@update_time = @fetched['updateTime'] | ||
@labels = GoogleInSpec::VertexAI::Property::TensorboardsExperimentLabels.new(@fetched['labels'], to_s) | ||
@name = @fetched['name'] | ||
@etag = @fetched['etag'] | ||
end | ||
|
||
def exists? | ||
!@fetched.nil? | ||
end | ||
|
||
def to_s | ||
"TensorboardsExperiment #{@params[:name]}" | ||
end | ||
|
||
private | ||
|
||
def product_url(_ = nil) | ||
'https://{{region}}-aiplatform.googleapis.com/v1/' | ||
end | ||
|
||
def resource_base_url | ||
'{{name}}' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# frozen_string_literal: false | ||
|
||
# ---------------------------------------------------------------------------- | ||
# | ||
# *** AUTO GENERATED CODE *** Type: MMv1 *** | ||
# | ||
# ---------------------------------------------------------------------------- | ||
# | ||
# This file is automatically generated by Magic Modules and manual | ||
# changes will be clobbered when the file is regenerated. | ||
# | ||
# Please read more about how to change this file in README.md and | ||
# CONTRIBUTING.md located at the root of this package. | ||
# | ||
# ---------------------------------------------------------------------------- | ||
require 'gcp_backend' | ||
class VertexAITensorboardsExperiments < GcpResourceBase | ||
name 'google_vertex_ai_tensorboards_experiments' | ||
desc 'TensorboardsExperiment plural resource' | ||
supports platform: 'gcp' | ||
|
||
attr_reader :table | ||
|
||
filter_table_config = FilterTable.create | ||
|
||
filter_table_config.add(:descriptions, field: :description) | ||
filter_table_config.add(:sources, field: :source) | ||
filter_table_config.add(:display_names, field: :display_name) | ||
filter_table_config.add(:create_times, field: :create_time) | ||
filter_table_config.add(:update_times, field: :update_time) | ||
filter_table_config.add(:labels, field: :labels) | ||
filter_table_config.add(:names, field: :name) | ||
filter_table_config.add(:etags, field: :etag) | ||
|
||
filter_table_config.connect(self, :table) | ||
|
||
def initialize(params = {}) | ||
super(params.merge({ use_http_transport: true })) | ||
@params = params | ||
@table = fetch_wrapped_resource('tensorboardsExperiments') | ||
end | ||
|
||
def fetch_wrapped_resource(wrap_path) | ||
# fetch_resource returns an array of responses (to handle pagination) | ||
result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get') | ||
return if result.nil? | ||
|
||
# Conversion of string -> object hash to symbol -> object hash that InSpec needs | ||
converted = [] | ||
result.each do |response| | ||
next if response.nil? || !response.key?(wrap_path) | ||
response[wrap_path].each do |hash| | ||
hash_with_symbols = {} | ||
hash.each_key do |key| | ||
name, value = transform(key, hash) | ||
hash_with_symbols[name] = value | ||
end | ||
converted.push(hash_with_symbols) | ||
end | ||
end | ||
|
||
converted | ||
end | ||
|
||
def transform(key, value) | ||
return transformers[key].call(value) if transformers.key?(key) | ||
|
||
[key.to_sym, value] | ||
end | ||
|
||
def transformers | ||
{ | ||
'description' => ->(obj) { return :description, obj['description'] }, | ||
'source' => ->(obj) { return :source, obj['source'] }, | ||
'displayName' => ->(obj) { return :display_name, obj['displayName'] }, | ||
'createTime' => ->(obj) { return :create_time, obj['createTime'] }, | ||
'updateTime' => ->(obj) { return :update_time, obj['updateTime'] }, | ||
'labels' => ->(obj) { return :labels, GoogleInSpec::VertexAI::Property::TensorboardsExperimentLabels.new(obj['labels'], to_s) }, | ||
'name' => ->(obj) { return :name, obj['name'] }, | ||
'etag' => ->(obj) { return :etag, obj['etag'] }, | ||
} | ||
end | ||
|
||
private | ||
|
||
def product_url(_ = nil) | ||
'https://{{region}}-aiplatform.googleapis.com/v1/' | ||
end | ||
|
||
def resource_base_url | ||
'{{parent}}/experiments' | ||
end | ||
end |
Oops, something went wrong.