-
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.
Merge pull request #489 from inspec/CHEF-5581-MAGIC-MODULE-vertex_ai-…
…Tensorboard CHEF-5581-MAGIC-MODULE-vertex_ai-Tensorboard - Resource Implementation
- Loading branch information
Showing
10 changed files
with
443 additions
and
62 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
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,59 @@ | ||
--- | ||
title: About the google_vertex_ai_tensorboard resource | ||
platform: gcp | ||
--- | ||
|
||
## Syntax | ||
A `google_vertex_ai_tensorboard` is used to test a Google Tensorboard resource | ||
|
||
## Examples | ||
``` | ||
describe google_vertex_ai_tensorboard(name: "projects/#{gcp_project_id}/locations/#{tensorboard['region']}/tensorboards/#{tensorboard['name']}", region: ' value_region') do | ||
it { should exist } | ||
its('name') { should cmp 'value_name' } | ||
its('update_time') { should cmp 'value_updatetime' } | ||
its('blob_storage_path_prefix') { should cmp 'value_blobstoragepathprefix' } | ||
its('etag') { should cmp 'value_etag' } | ||
its('create_time') { should cmp 'value_createtime' } | ||
its('display_name') { should cmp 'value_displayname' } | ||
its('description') { should cmp 'value_description' } | ||
end | ||
describe google_vertex_ai_tensorboard(name: "does_not_exit", region: ' value_region') do | ||
it { should_not exist } | ||
end | ||
``` | ||
|
||
## Properties | ||
Properties that can be accessed from the `google_vertex_ai_tensorboard` resource: | ||
|
||
|
||
* `name`: Output only. Name of the Tensorboard. Format: `projects/{project}/locations/{location}/tensorboards/{tensorboard}` | ||
|
||
* `is_default`: Used to indicate if the TensorBoard instance is the default one. Each project & region can have at most one default TensorBoard instance. Creation of a default TensorBoard instance and updating an existing TensorBoard instance to be default will mark all other TensorBoard instances (if any) as non default. | ||
|
||
* `update_time`: Output only. Timestamp when this Tensorboard was last updated. | ||
|
||
* `labels`: The labels with user-defined metadata to organize your Tensorboards. Label keys and values can be no 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 Tensorboard (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. | ||
|
||
* `additional_properties`: | ||
|
||
* `blob_storage_path_prefix`: Output only. Consumer project Cloud Storage path prefix used to store blob data, which can either be a bucket or directory. Does not end with a '/'. | ||
|
||
* `etag`: Used to perform a consistent read-modify-write updates. If not set, a blind "overwrite" update happens. | ||
|
||
* `create_time`: Output only. Timestamp when this Tensorboard was created. | ||
|
||
* `run_count`: Output only. The number of Runs stored in this Tensorboard. | ||
|
||
* `encryption_spec`: Represents a customer-managed encryption key spec that can be applied to a top-level resource. | ||
|
||
* `kms_key_name`: Required. The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. Has the form: `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. The key needs to be in the same region as where the compute resource is created. | ||
|
||
* `display_name`: Required. User provided name of this Tensorboard. | ||
|
||
* `description`: Description of this Tensorboard. | ||
|
||
|
||
## GCP Permissions |
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,36 @@ | ||
--- | ||
title: About the google_vertex_ai_tensorboards resource | ||
platform: gcp | ||
--- | ||
|
||
## Syntax | ||
A `google_vertex_ai_tensorboards` is used to test a Google Tensorboard resource | ||
|
||
## Examples | ||
``` | ||
describe google_vertex_ai_tensorboards(parent: "projects/#{gcp_project_id}/locations/#{tensorboard['region']}", region: ' value_region') do | ||
it { should exist } | ||
end | ||
``` | ||
|
||
## Properties | ||
Properties that can be accessed from the `google_vertex_ai_tensorboards` resource: | ||
|
||
See [google_vertex_ai_tensorboard.md](google_vertex_ai_tensorboard.md) for more detailed information | ||
* `names`: an array of `google_vertex_ai_tensorboard` name | ||
* `is_defaults`: an array of `google_vertex_ai_tensorboard` is_default | ||
* `update_times`: an array of `google_vertex_ai_tensorboard` update_time | ||
* `labels`: an array of `google_vertex_ai_tensorboard` labels | ||
* `blob_storage_path_prefixes`: an array of `google_vertex_ai_tensorboard` blob_storage_path_prefix | ||
* `etags`: an array of `google_vertex_ai_tensorboard` etag | ||
* `create_times`: an array of `google_vertex_ai_tensorboard` create_time | ||
* `run_counts`: an array of `google_vertex_ai_tensorboard` run_count | ||
* `encryption_specs`: an array of `google_vertex_ai_tensorboard` encryption_spec | ||
* `display_names`: an array of `google_vertex_ai_tensorboard` display_name | ||
* `descriptions`: an array of `google_vertex_ai_tensorboard` description | ||
|
||
## 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/tensorboard_encryption_spec.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 TensorboardEncryptionSpec | ||
attr_reader :kms_key_name | ||
|
||
def initialize(args = nil, parent_identifier = nil) | ||
return if args.nil? | ||
@parent_identifier = parent_identifier | ||
@kms_key_name = args['kmsKeyName'] | ||
end | ||
|
||
def to_s | ||
"#{@parent_identifier} TensorboardEncryptionSpec" | ||
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,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 TensorboardLabels | ||
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} TensorboardLabels" | ||
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,77 @@ | ||
# 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/tensorboard_encryption_spec' | ||
require 'google/vertexai/property/tensorboard_labels' | ||
|
||
# A provider to manage Vertex AI resources. | ||
class VertexAITensorboard < GcpResourceBase | ||
name 'google_vertex_ai_tensorboard' | ||
desc 'Tensorboard' | ||
supports platform: 'gcp' | ||
|
||
attr_reader :params | ||
attr_reader :name | ||
attr_reader :is_default | ||
attr_reader :update_time | ||
attr_reader :labels | ||
attr_reader :blob_storage_path_prefix | ||
attr_reader :etag | ||
attr_reader :create_time | ||
attr_reader :run_count | ||
attr_reader :encryption_spec | ||
attr_reader :display_name | ||
attr_reader :description | ||
|
||
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 | ||
@name = @fetched['name'] | ||
@is_default = @fetched['isDefault'] | ||
@update_time = @fetched['updateTime'] | ||
@labels = GoogleInSpec::VertexAI::Property::TensorboardLabels.new(@fetched['labels'], to_s) | ||
@blob_storage_path_prefix = @fetched['blobStoragePathPrefix'] | ||
@etag = @fetched['etag'] | ||
@create_time = @fetched['createTime'] | ||
@run_count = @fetched['runCount'] | ||
@encryption_spec = GoogleInSpec::VertexAI::Property::TensorboardEncryptionSpec.new(@fetched['encryptionSpec'], to_s) | ||
@display_name = @fetched['displayName'] | ||
@description = @fetched['description'] | ||
end | ||
|
||
def exists? | ||
!@fetched.nil? | ||
end | ||
|
||
def to_s | ||
"Tensorboard #{@params[:name]}" | ||
end | ||
|
||
private | ||
|
||
def product_url(_ = nil) | ||
'https://{{region}}-aiplatform.googleapis.com/v1/' | ||
end | ||
|
||
def resource_base_url | ||
'{{name}}' | ||
end | ||
end |
Oops, something went wrong.