Skip to content

Commit

Permalink
Merge pull request #485 from inspec/CHEF-5570-MAGIC-MODULE-vertex_ai-…
Browse files Browse the repository at this point in the history
…Model

CHEF-5570-MAGIC-MODULE-vertex_ai-Model - Resource Implementation
  • Loading branch information
sa-progress authored Oct 9, 2023
2 parents b84d1e1 + 0e95d20 commit 661a8d9
Show file tree
Hide file tree
Showing 37 changed files with 1,922 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ The following resources are available in the InSpec GCP Profile
| [google_storage_default_object_acl](docs/resources/google_storage_default_object_acl.md) | No Plural Resource |
| [google_storage_object_acl](docs/resources/google_storage_object_acl.md) | No Plural Resource |
| [google_user](docs/resources/google_user.md) | [google_users](docs/resources/google_users.md) |
| [google_vertex_ai_model](docs/resources/google_vertex_ai_model.md) | [google_vertex_ai_models](docs/resources/google_vertex_ai_models.md) |
| [google_vertex_ai_dataset](docs/resources/google_vertex_ai_dataset.md) | [google_vertex_ai_datasets](docs/resources/google_vertex_ai_datasets.md) |
| [google_vertex_ai_batch_prediction_job](docs/resources/google_vertex_ai_batch_prediction_job.md) | [google_vertex_ai_batch_prediction_jobs](docs/resources/google_vertex_ai_batch_prediction_jobs.md) |
| [google_vertex_ai_custom_job](docs/resources/google_vertex_ai_custom_job.md) | [google_vertex_ai_custom_jobs](docs/resources/google_vertex_ai_custom_jobs.md) |
Expand Down
249 changes: 249 additions & 0 deletions docs/resources/google_vertex_ai_model.md

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions docs/resources/google_vertex_ai_models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: About the google_vertex_ai_models resource
platform: gcp
---

## Syntax
A `google_vertex_ai_models` is used to test a Google Model resource

## Examples
```
describe google_vertex_ai_models(parent: "projects/#{gcp_project_id}/locations/#{model['region']}", region: ' value_region') do
it { should exist }
end
```

## Properties
Properties that can be accessed from the `google_vertex_ai_models` resource:

See [google_vertex_ai_model.md](google_vertex_ai_model.md) for more detailed information
* `model_source_infos`: an array of `google_vertex_ai_model` model_source_info
* `names`: an array of `google_vertex_ai_model` name
* `metadata`: an array of `google_vertex_ai_model` metadata
* `update_times`: an array of `google_vertex_ai_model` update_time
* `etags`: an array of `google_vertex_ai_model` etag
* `descriptions`: an array of `google_vertex_ai_model` description
* `deployed_models`: an array of `google_vertex_ai_model` deployed_models
* `create_times`: an array of `google_vertex_ai_model` create_time
* `explanation_specs`: an array of `google_vertex_ai_model` explanation_spec
* `encryption_specs`: an array of `google_vertex_ai_model` encryption_spec
* `pipeline_jobs`: an array of `google_vertex_ai_model` pipeline_job
* `predict_schemata`: an array of `google_vertex_ai_model` predict_schemata
* `version_update_times`: an array of `google_vertex_ai_model` version_update_time
* `supported_export_formats`: an array of `google_vertex_ai_model` supported_export_formats
* `original_model_infos`: an array of `google_vertex_ai_model` original_model_info
* `metadata_artifacts`: an array of `google_vertex_ai_model` metadata_artifact
* `supported_input_storage_formats`: an array of `google_vertex_ai_model` supported_input_storage_formats
* `metadata_schema_uris`: an array of `google_vertex_ai_model` metadata_schema_uri
* `container_specs`: an array of `google_vertex_ai_model` container_spec
* `version_ids`: an array of `google_vertex_ai_model` version_id
* `artifact_uris`: an array of `google_vertex_ai_model` artifact_uri
* `training_pipelines`: an array of `google_vertex_ai_model` training_pipeline
* `display_names`: an array of `google_vertex_ai_model` display_name
* `supported_deployment_resources_types`: an array of `google_vertex_ai_model` supported_deployment_resources_types
* `supported_output_storage_formats`: an array of `google_vertex_ai_model` supported_output_storage_formats
* `version_aliases`: an array of `google_vertex_ai_model` version_aliases
* `version_create_times`: an array of `google_vertex_ai_model` version_create_time
* `version_descriptions`: an array of `google_vertex_ai_model` version_description
* `labels`: an array of `google_vertex_ai_model` labels

## 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
54 changes: 54 additions & 0 deletions libraries/google/vertexai/property/model_container_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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 'google/vertexai/property/model_container_spec_env'
require 'google/vertexai/property/model_container_spec_ports'
module GoogleInSpec
module VertexAI
module Property
class ModelContainerSpec
attr_reader :predict_route

attr_reader :image_uri

attr_reader :env

attr_reader :args

attr_reader :command

attr_reader :ports

attr_reader :health_route

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@predict_route = args['predictRoute']
@image_uri = args['imageUri']
@env = GoogleInSpec::VertexAI::Property::ModelContainerSpecEnvArray.parse(args['env'], to_s)
@args = args['args']
@command = args['command']
@ports = GoogleInSpec::VertexAI::Property::ModelContainerSpecPortsArray.parse(args['ports'], to_s)
@health_route = args['healthRoute']
end

def to_s
"#{@parent_identifier} ModelContainerSpec"
end
end
end
end
end
45 changes: 45 additions & 0 deletions libraries/google/vertexai/property/model_container_spec_env.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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 ModelContainerSpecEnv
attr_reader :name

attr_reader :value

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@name = args['name']
@value = args['value']
end

def to_s
"#{@parent_identifier} ModelContainerSpecEnv"
end
end

class ModelContainerSpecEnvArray
def self.parse(value, parent_identifier)
return if value.nil?
return ModelContainerSpecEnv.new(value, parent_identifier) unless value.is_a?(::Array)
value.map { |v| ModelContainerSpecEnv.new(v, parent_identifier) }
end
end
end
end
end
42 changes: 42 additions & 0 deletions libraries/google/vertexai/property/model_container_spec_ports.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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 ModelContainerSpecPorts
attr_reader :container_port

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@container_port = args['containerPort']
end

def to_s
"#{@parent_identifier} ModelContainerSpecPorts"
end
end

class ModelContainerSpecPortsArray
def self.parse(value, parent_identifier)
return if value.nil?
return ModelContainerSpecPorts.new(value, parent_identifier) unless value.is_a?(::Array)
value.map { |v| ModelContainerSpecPorts.new(v, parent_identifier) }
end
end
end
end
end
45 changes: 45 additions & 0 deletions libraries/google/vertexai/property/model_deployed_models.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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 ModelDeployedModels
attr_reader :deployed_model_id

attr_reader :endpoint

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@deployed_model_id = args['deployedModelId']
@endpoint = args['endpoint']
end

def to_s
"#{@parent_identifier} ModelDeployedModels"
end
end

class ModelDeployedModelsArray
def self.parse(value, parent_identifier)
return if value.nil?
return ModelDeployedModels.new(value, parent_identifier) unless value.is_a?(::Array)
value.map { |v| ModelDeployedModels.new(v, parent_identifier) }
end
end
end
end
end
34 changes: 34 additions & 0 deletions libraries/google/vertexai/property/model_encryption_spec.rb
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 ModelEncryptionSpec
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} ModelEncryptionSpec"
end
end
end
end
end
56 changes: 56 additions & 0 deletions libraries/google/vertexai/property/model_explanation_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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 'google/vertexai/property/model_explanation_spec_metadata'
require 'google/vertexai/property/model_explanation_spec_metadata_inputs'
require 'google/vertexai/property/model_explanation_spec_metadata_outputs'
require 'google/vertexai/property/model_explanation_spec_parameters'
require 'google/vertexai/property/model_explanation_spec_parameters_examples'
require 'google/vertexai/property/model_explanation_spec_parameters_examples_example_gcs_source'
require 'google/vertexai/property/model_explanation_spec_parameters_examples_example_gcs_source_gcs_source'
require 'google/vertexai/property/model_explanation_spec_parameters_examples_presets'
require 'google/vertexai/property/model_explanation_spec_parameters_integrated_gradients_attribution'
require 'google/vertexai/property/model_explanation_spec_parameters_integrated_gradients_attribution_blur_baseline_config'
require 'google/vertexai/property/model_explanation_spec_parameters_integrated_gradients_attribution_smooth_grad_config'
require 'google/vertexai/property/model_explanation_spec_parameters_integrated_gradients_attribution_smooth_grad_config_feature_noise_sigma'
require 'google/vertexai/property/model_explanation_spec_parameters_integrated_gradients_attribution_smooth_grad_config_feature_noise_sigma_noise_sigma'
require 'google/vertexai/property/model_explanation_spec_parameters_sampled_shapley_attribution'
require 'google/vertexai/property/model_explanation_spec_parameters_xrai_attribution'
require 'google/vertexai/property/model_explanation_spec_parameters_xrai_attribution_blur_baseline_config'
require 'google/vertexai/property/model_explanation_spec_parameters_xrai_attribution_smooth_grad_config'
require 'google/vertexai/property/model_explanation_spec_parameters_xrai_attribution_smooth_grad_config_feature_noise_sigma'
require 'google/vertexai/property/model_explanation_spec_parameters_xrai_attribution_smooth_grad_config_feature_noise_sigma_noise_sigma'
module GoogleInSpec
module VertexAI
module Property
class ModelExplanationSpec
attr_reader :parameters

attr_reader :metadata

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@parameters = GoogleInSpec::VertexAI::Property::ModelExplanationSpecParameters.new(args['parameters'], to_s)
@metadata = GoogleInSpec::VertexAI::Property::ModelExplanationSpecMetadata.new(args['metadata'], to_s)
end

def to_s
"#{@parent_identifier} ModelExplanationSpec"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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 'google/vertexai/property/model_explanation_spec_metadata_inputs'
require 'google/vertexai/property/model_explanation_spec_metadata_outputs'
module GoogleInSpec
module VertexAI
module Property
class ModelExplanationSpecMetadata
attr_reader :feature_attributions_schema_uri

attr_reader :latent_space_source

attr_reader :outputs

attr_reader :inputs

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@feature_attributions_schema_uri = args['featureAttributionsSchemaUri']
@latent_space_source = args['latentSpaceSource']
@outputs = GoogleInSpec::VertexAI::Property::ModelExplanationSpecMetadataOutputs.new(args['outputs'], to_s)
@inputs = GoogleInSpec::VertexAI::Property::ModelExplanationSpecMetadataInputs.new(args['inputs'], to_s)
end

def to_s
"#{@parent_identifier} ModelExplanationSpecMetadata"
end
end
end
end
end
Loading

0 comments on commit 661a8d9

Please sign in to comment.