From b7ad0253dac456600897c39d0203ad193e3065ae Mon Sep 17 00:00:00 2001 From: balasubramanian-s Date: Mon, 19 Aug 2024 15:46:46 +0530 Subject: [PATCH] rename resource name Signed-off-by: balasubramanian-s --- README.md | 1 + ...ogle_dataproc_project_location_sessions.md | 76 -------------- ..._session.md => google_dataproc_session.md} | 18 ++-- docs/resources/google_dataproc_sessions.md | 76 ++++++++++++++ ...onfig.rb => session_environment_config.rb} | 14 +-- ...on_environment_config_execution_config.rb} | 4 +- ..._environment_config_peripherals_config.rb} | 8 +- ...als_config_spark_history_server_config.rb} | 4 +- ..._session.rb => session_jupyter_session.rb} | 4 +- ...ionsession_labels.rb => session_labels.rb} | 4 +- ...me_config.rb => session_runtime_config.rb} | 14 +-- ...b => session_runtime_config_properties.rb} | 4 +- ...ssion_runtime_config_repository_config.rb} | 8 +- ...pository_config_pypi_repository_config.rb} | 4 +- ...untime_info.rb => session_runtime_info.rb} | 16 +-- ...session_runtime_info_approximate_usage.rb} | 4 +- ... => session_runtime_info_current_usage.rb} | 4 +- ...s.rb => session_runtime_info_endpoints.rb} | 4 +- ...te_history.rb => session_state_history.rb} | 10 +- ...oogle_dataproc_project_location_session.rb | 98 ------------------- libraries/google_dataproc_session.rb | 98 +++++++++++++++++++ ...essions.rb => google_dataproc_sessions.rb} | 22 ++--- ...oogle_dataproc_project_location_session.rb | 52 ---------- ...ogle_dataproc_project_location_sessions.rb | 38 ------- .../controls/google_dataproc_session.rb | 51 ++++++++++ .../controls/google_dataproc_sessions.rb | 43 ++++++++ 26 files changed, 342 insertions(+), 337 deletions(-) delete mode 100644 docs/resources/google_dataproc_project_location_sessions.md rename docs/resources/{google_dataproc_project_location_session.md => google_dataproc_session.md} (92%) create mode 100644 docs/resources/google_dataproc_sessions.md rename libraries/google/dataproc/property/{projectlocationsession_environment_config.rb => session_environment_config.rb} (63%) rename libraries/google/dataproc/property/{projectlocationsession_environment_config_execution_config.rb => session_environment_config_execution_config.rb} (90%) rename libraries/google/dataproc/property/{projectlocationsession_environment_config_peripherals_config.rb => session_environment_config_peripherals_config.rb} (72%) rename libraries/google/dataproc/property/{projectlocationsession_environment_config_peripherals_config_spark_history_server_config.rb => session_environment_config_peripherals_config_spark_history_server_config.rb} (82%) rename libraries/google/dataproc/property/{projectlocationsession_jupyter_session.rb => session_jupyter_session.rb} (89%) rename libraries/google/dataproc/property/{projectlocationsession_labels.rb => session_labels.rb} (90%) rename libraries/google/dataproc/property/{projectlocationsession_runtime_config.rb => session_runtime_config.rb} (64%) rename libraries/google/dataproc/property/{projectlocationsession_runtime_info_endpoints.rb => session_runtime_config_properties.rb} (88%) rename libraries/google/dataproc/property/{projectlocationsession_runtime_config_repository_config.rb => session_runtime_config_repository_config.rb} (71%) rename libraries/google/dataproc/property/{projectlocationsession_runtime_config_repository_config_pypi_repository_config.rb => session_runtime_config_repository_config_pypi_repository_config.rb} (83%) rename libraries/google/dataproc/property/{projectlocationsession_runtime_info.rb => session_runtime_info.rb} (62%) rename libraries/google/dataproc/property/{projectlocationsession_runtime_info_approximate_usage.rb => session_runtime_info_approximate_usage.rb} (89%) rename libraries/google/dataproc/property/{projectlocationsession_runtime_info_current_usage.rb => session_runtime_info_current_usage.rb} (91%) rename libraries/google/dataproc/property/{projectlocationsession_runtime_config_properties.rb => session_runtime_info_endpoints.rb} (87%) rename libraries/google/dataproc/property/{projectlocationsession_state_history.rb => session_state_history.rb} (76%) delete mode 100644 libraries/google_dataproc_project_location_session.rb create mode 100644 libraries/google_dataproc_session.rb rename libraries/{google_dataproc_project_location_sessions.rb => google_dataproc_sessions.rb} (82%) delete mode 100644 test/integration/verify/controls/google_dataproc_project_location_session.rb delete mode 100644 test/integration/verify/controls/google_dataproc_project_location_sessions.rb create mode 100644 test/integration/verify/controls/google_dataproc_session.rb create mode 100644 test/integration/verify/controls/google_dataproc_sessions.rb diff --git a/README.md b/README.md index d12632e4..7079ef87 100644 --- a/README.md +++ b/README.md @@ -301,6 +301,7 @@ The following resources are available in the InSpec GCP Profile | [google_dlp_job_trigger](docs/resources/google_dlp_job_trigger.md) | [google_dlp_job_triggers](docs/resources/google_dlp_job_triggers.md) | | [google_dlp_job](docs/resources/google_dlp_job.md) | [google_dlp_jobs](docs/resources/google_dlp_jobs.md) | | [google_dataproc_metastore_service](docs/resources/google_dataproc_metastore_service.md) | [google_dataproc_metastore_services](docs/resources/google_dataproc_metastore_services.md) | +| [google_dataproc_session](docs/resources/google_dataproc_session.md) | [google_dataproc_sessions](docs/resources/google_dataproc_sessions.md) | | [google_dlp_stored_info_type](docs/resources/google_dlp_stored_info_types.md) | [google_dlp_stored_info_types](docs/resources/google_dlp_stored_info_types.md) | | [google_filestore_instance](docs/resources/google_filestore_instance.md) | [google_filestore_instances](docs/resources/google_filestore_instances.md) | | [google_iam_organization_custom_role](docs/resources/google_iam_organization_custom_role.md) | [google_iam_organization_custom_roles](docs/resources/google_iam_organization_custom_roles.md) | diff --git a/docs/resources/google_dataproc_project_location_sessions.md b/docs/resources/google_dataproc_project_location_sessions.md deleted file mode 100644 index e8dab877..00000000 --- a/docs/resources/google_dataproc_project_location_sessions.md +++ /dev/null @@ -1,76 +0,0 @@ -+++ - -title = "google_dataproc_project_location_sessions Resource" -platform = "gcp" -draft = false -gh_repo = "inspec-gcp" - - -[menu.inspec] - -title = "google_dataproc_project_location_sessions" -identifier = "inspec/resources/gcp/google_dataproc_project_location_sessions Resource" -parent = "inspec/resources/gcp" -+++ - -Use the `google_dataproc_project_location_sessions` InSpec audit resource to test the properties of a test a Google ProjectLocationSession. - -## Installation -{{% inspec_gcp_install %}} - -## Syntax -A `google_dataproc_project_location_sessions` is used to test a Google ProjectLocationSession resource - -## Examples -``` - describe google_dataproc_project_location_sessions(parent: ' value_parent') do - it { should exist } - end -``` - -## Parameters -Properties that can be accessed from the `google_dataproc_project_location_sessions` resource: - -See [google_dataproc_project_location_session.md](google_dataproc_project_location_session.md) for more detailed information -* `names`: an array of `google_dataproc_project_location_session` name -* `uuids`: an array of `google_dataproc_project_location_session` uuid -* `create_times`: an array of `google_dataproc_project_location_session` create_time -* `jupyter_sessions`: an array of `google_dataproc_project_location_session` jupyter_session -* `runtime_infos`: an array of `google_dataproc_project_location_session` runtime_info -* `states`: an array of `google_dataproc_project_location_session` state -* `state_messages`: an array of `google_dataproc_project_location_session` state_message -* `state_times`: an array of `google_dataproc_project_location_session` state_time -* `creators`: an array of `google_dataproc_project_location_session` creator -* `labels`: an array of `google_dataproc_project_location_session` labels -* `runtime_configs`: an array of `google_dataproc_project_location_session` runtime_config -* `environment_configs`: an array of `google_dataproc_project_location_session` environment_config -* `users`: an array of `google_dataproc_project_location_session` user -* `state_histories`: an array of `google_dataproc_project_location_session` state_history -* `session_templates`: an array of `google_dataproc_project_location_session` session_template -## Properties -Properties that can be accessed from the `google_dataproc_project_location_sessions` resource: - -See [google_dataproc_project_location_session.md](google_dataproc_project_location_session.md) for more detailed information -* `names`: an array of `google_dataproc_project_location_session` name -* `uuids`: an array of `google_dataproc_project_location_session` uuid -* `create_times`: an array of `google_dataproc_project_location_session` create_time -* `jupyter_sessions`: an array of `google_dataproc_project_location_session` jupyter_session -* `runtime_infos`: an array of `google_dataproc_project_location_session` runtime_info -* `states`: an array of `google_dataproc_project_location_session` state -* `state_messages`: an array of `google_dataproc_project_location_session` state_message -* `state_times`: an array of `google_dataproc_project_location_session` state_time -* `creators`: an array of `google_dataproc_project_location_session` creator -* `labels`: an array of `google_dataproc_project_location_session` labels -* `runtime_configs`: an array of `google_dataproc_project_location_session` runtime_config -* `environment_configs`: an array of `google_dataproc_project_location_session` environment_config -* `users`: an array of `google_dataproc_project_location_session` user -* `state_histories`: an array of `google_dataproc_project_location_session` state_history -* `session_templates`: an array of `google_dataproc_project_location_session` session_template - -## 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 - -Ensure the [Cloud Dataproc API](https://console.cloud.google.com/apis/library/dataproc.googleapis.com) is enabled for the current project. diff --git a/docs/resources/google_dataproc_project_location_session.md b/docs/resources/google_dataproc_session.md similarity index 92% rename from docs/resources/google_dataproc_project_location_session.md rename to docs/resources/google_dataproc_session.md index 7fa72e26..e2422e93 100644 --- a/docs/resources/google_dataproc_project_location_session.md +++ b/docs/resources/google_dataproc_session.md @@ -1,6 +1,6 @@ +++ -title = "google_dataproc_project_location_session Resource" +title = "google_dataproc_session Resource" platform = "gcp" draft = false gh_repo = "inspec-gcp" @@ -8,22 +8,22 @@ gh_repo = "inspec-gcp" [menu.inspec] -title = "google_dataproc_project_location_session" -identifier = "inspec/resources/gcp/google_dataproc_project_location_session Resource" +title = "google_dataproc_session" +identifier = "inspec/resources/gcp/google_dataproc_session Resource" parent = "inspec/resources/gcp" +++ -Use the `google_dataproc_project_location_session` InSpec audit resource to test the properties of a test a Google ProjectLocationSession. +Use the `google_dataproc_session` InSpec audit resource to test the properties of a test a Google Session. ## Installation {{% inspec_gcp_install %}} ## Syntax -A `google_dataproc_project_location_session` is used to test a Google ProjectLocationSession resource +A `google_dataproc_session` is used to test a Google Session resource ## Examples ``` -describe google_dataproc_project_location_session(name: ' value_name') do +describe google_dataproc_session(name: ' value_name') do it { should exist } its('name') { should cmp 'value_name' } its('uuid') { should cmp 'value_uuid' } @@ -37,16 +37,16 @@ describe google_dataproc_project_location_session(name: ' value_name') do end -describe google_dataproc_project_location_session(name: "does_not_exit") do +describe google_dataproc_session(name: "does_not_exit") do it { should_not exist } end ``` ## Parameters -Properties that can be accessed from the `google_dataproc_project_location_session` resource: +Properties that can be accessed from the `google_dataproc_session` resource: ## Properties -Properties that can be accessed from the `google_dataproc_project_location_session` resource: +Properties that can be accessed from the `google_dataproc_session` resource: * `name`: Required. The resource name of the session. diff --git a/docs/resources/google_dataproc_sessions.md b/docs/resources/google_dataproc_sessions.md new file mode 100644 index 00000000..a910e4c7 --- /dev/null +++ b/docs/resources/google_dataproc_sessions.md @@ -0,0 +1,76 @@ ++++ + +title = "google_dataproc_sessions Resource" +platform = "gcp" +draft = false +gh_repo = "inspec-gcp" + + +[menu.inspec] + +title = "google_dataproc_sessions" +identifier = "inspec/resources/gcp/google_dataproc_sessions Resource" +parent = "inspec/resources/gcp" ++++ + +Use the `google_dataproc_sessions` InSpec audit resource to test the properties of a test a Google Session. + +## Installation +{{% inspec_gcp_install %}} + +## Syntax +A `google_dataproc_sessions` is used to test a Google Session resource + +## Examples +``` + describe google_dataproc_sessions(parent: ' value_parent') do + it { should exist } + end +``` + +## Parameters +Properties that can be accessed from the `google_dataproc_sessions` resource: + +See [google_dataproc_session.md](google_dataproc_session.md) for more detailed information +* `names`: an array of `google_dataproc_session` name +* `uuids`: an array of `google_dataproc_session` uuid +* `create_times`: an array of `google_dataproc_session` create_time +* `jupyter_sessions`: an array of `google_dataproc_session` jupyter_session +* `runtime_infos`: an array of `google_dataproc_session` runtime_info +* `states`: an array of `google_dataproc_session` state +* `state_messages`: an array of `google_dataproc_session` state_message +* `state_times`: an array of `google_dataproc_session` state_time +* `creators`: an array of `google_dataproc_session` creator +* `labels`: an array of `google_dataproc_session` labels +* `runtime_configs`: an array of `google_dataproc_session` runtime_config +* `environment_configs`: an array of `google_dataproc_session` environment_config +* `users`: an array of `google_dataproc_session` user +* `state_histories`: an array of `google_dataproc_session` state_history +* `session_templates`: an array of `google_dataproc_session` session_template +## Properties +Properties that can be accessed from the `google_dataproc_sessions` resource: + +See [google_dataproc_session.md](google_dataproc_session.md) for more detailed information +* `names`: an array of `google_dataproc_session` name +* `uuids`: an array of `google_dataproc_session` uuid +* `create_times`: an array of `google_dataproc_session` create_time +* `jupyter_sessions`: an array of `google_dataproc_session` jupyter_session +* `runtime_infos`: an array of `google_dataproc_session` runtime_info +* `states`: an array of `google_dataproc_session` state +* `state_messages`: an array of `google_dataproc_session` state_message +* `state_times`: an array of `google_dataproc_session` state_time +* `creators`: an array of `google_dataproc_session` creator +* `labels`: an array of `google_dataproc_session` labels +* `runtime_configs`: an array of `google_dataproc_session` runtime_config +* `environment_configs`: an array of `google_dataproc_session` environment_config +* `users`: an array of `google_dataproc_session` user +* `state_histories`: an array of `google_dataproc_session` state_history +* `session_templates`: an array of `google_dataproc_session` session_template + +## 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 + +Ensure the [Cloud Dataproc API](https://console.cloud.google.com/apis/library/dataproc.googleapis.com) is enabled for the current project. diff --git a/libraries/google/dataproc/property/projectlocationsession_environment_config.rb b/libraries/google/dataproc/property/session_environment_config.rb similarity index 63% rename from libraries/google/dataproc/property/projectlocationsession_environment_config.rb rename to libraries/google/dataproc/property/session_environment_config.rb index ceea086a..e831bbb2 100644 --- a/libraries/google/dataproc/property/projectlocationsession_environment_config.rb +++ b/libraries/google/dataproc/property/session_environment_config.rb @@ -13,13 +13,13 @@ # CONTRIBUTING.md located at the root of this package. # # ---------------------------------------------------------------------------- -require 'google/dataproc/property/projectlocationsession_environment_config_execution_config' -require 'google/dataproc/property/projectlocationsession_environment_config_peripherals_config' -require 'google/dataproc/property/projectlocationsession_environment_config_peripherals_config_spark_history_server_config' +require 'google/dataproc/property/session_environment_config_execution_config' +require 'google/dataproc/property/session_environment_config_peripherals_config' +require 'google/dataproc/property/session_environment_config_peripherals_config_spark_history_server_config' module GoogleInSpec module Dataproc module Property - class ProjectLocationSessionEnvironmentConfig + class SessionEnvironmentConfig attr_reader :execution_config attr_reader :peripherals_config @@ -27,12 +27,12 @@ class ProjectLocationSessionEnvironmentConfig def initialize(args = nil, parent_identifier = nil) return if args.nil? @parent_identifier = parent_identifier - @execution_config = GoogleInSpec::Dataproc::Property::ProjectLocationSessionEnvironmentConfigExecutionConfig.new(args['executionConfig'], to_s) - @peripherals_config = GoogleInSpec::Dataproc::Property::ProjectLocationSessionEnvironmentConfigPeripheralsConfig.new(args['peripheralsConfig'], to_s) + @execution_config = GoogleInSpec::Dataproc::Property::SessionEnvironmentConfigExecutionConfig.new(args['executionConfig'], to_s) + @peripherals_config = GoogleInSpec::Dataproc::Property::SessionEnvironmentConfigPeripheralsConfig.new(args['peripheralsConfig'], to_s) end def to_s - "#{@parent_identifier} ProjectLocationSessionEnvironmentConfig" + "#{@parent_identifier} SessionEnvironmentConfig" end end end diff --git a/libraries/google/dataproc/property/projectlocationsession_environment_config_execution_config.rb b/libraries/google/dataproc/property/session_environment_config_execution_config.rb similarity index 90% rename from libraries/google/dataproc/property/projectlocationsession_environment_config_execution_config.rb rename to libraries/google/dataproc/property/session_environment_config_execution_config.rb index 78c516fd..d20774b6 100644 --- a/libraries/google/dataproc/property/projectlocationsession_environment_config_execution_config.rb +++ b/libraries/google/dataproc/property/session_environment_config_execution_config.rb @@ -16,7 +16,7 @@ module GoogleInSpec module Dataproc module Property - class ProjectLocationSessionEnvironmentConfigExecutionConfig + class SessionEnvironmentConfigExecutionConfig attr_reader :service_account attr_reader :network_uri @@ -47,7 +47,7 @@ def initialize(args = nil, parent_identifier = nil) end def to_s - "#{@parent_identifier} ProjectLocationSessionEnvironmentConfigExecutionConfig" + "#{@parent_identifier} SessionEnvironmentConfigExecutionConfig" end end end diff --git a/libraries/google/dataproc/property/projectlocationsession_environment_config_peripherals_config.rb b/libraries/google/dataproc/property/session_environment_config_peripherals_config.rb similarity index 72% rename from libraries/google/dataproc/property/projectlocationsession_environment_config_peripherals_config.rb rename to libraries/google/dataproc/property/session_environment_config_peripherals_config.rb index eed91cbf..e83197c3 100644 --- a/libraries/google/dataproc/property/projectlocationsession_environment_config_peripherals_config.rb +++ b/libraries/google/dataproc/property/session_environment_config_peripherals_config.rb @@ -13,11 +13,11 @@ # CONTRIBUTING.md located at the root of this package. # # ---------------------------------------------------------------------------- -require 'google/dataproc/property/projectlocationsession_environment_config_peripherals_config_spark_history_server_config' +require 'google/dataproc/property/session_environment_config_peripherals_config_spark_history_server_config' module GoogleInSpec module Dataproc module Property - class ProjectLocationSessionEnvironmentConfigPeripheralsConfig + class SessionEnvironmentConfigPeripheralsConfig attr_reader :metastore_service attr_reader :spark_history_server_config @@ -26,11 +26,11 @@ def initialize(args = nil, parent_identifier = nil) return if args.nil? @parent_identifier = parent_identifier @metastore_service = args['metastoreService'] - @spark_history_server_config = GoogleInSpec::Dataproc::Property::ProjectLocationSessionEnvironmentConfigPeripheralsConfigSparkHistoryServerConfig.new(args['sparkHistoryServerConfig'], to_s) + @spark_history_server_config = GoogleInSpec::Dataproc::Property::SessionEnvironmentConfigPeripheralsConfigSparkHistoryServerConfig.new(args['sparkHistoryServerConfig'], to_s) end def to_s - "#{@parent_identifier} ProjectLocationSessionEnvironmentConfigPeripheralsConfig" + "#{@parent_identifier} SessionEnvironmentConfigPeripheralsConfig" end end end diff --git a/libraries/google/dataproc/property/projectlocationsession_environment_config_peripherals_config_spark_history_server_config.rb b/libraries/google/dataproc/property/session_environment_config_peripherals_config_spark_history_server_config.rb similarity index 82% rename from libraries/google/dataproc/property/projectlocationsession_environment_config_peripherals_config_spark_history_server_config.rb rename to libraries/google/dataproc/property/session_environment_config_peripherals_config_spark_history_server_config.rb index e3be2069..d5d43ed0 100644 --- a/libraries/google/dataproc/property/projectlocationsession_environment_config_peripherals_config_spark_history_server_config.rb +++ b/libraries/google/dataproc/property/session_environment_config_peripherals_config_spark_history_server_config.rb @@ -16,7 +16,7 @@ module GoogleInSpec module Dataproc module Property - class ProjectLocationSessionEnvironmentConfigPeripheralsConfigSparkHistoryServerConfig + class SessionEnvironmentConfigPeripheralsConfigSparkHistoryServerConfig attr_reader :dataproc_cluster def initialize(args = nil, parent_identifier = nil) @@ -26,7 +26,7 @@ def initialize(args = nil, parent_identifier = nil) end def to_s - "#{@parent_identifier} ProjectLocationSessionEnvironmentConfigPeripheralsConfigSparkHistoryServerConfig" + "#{@parent_identifier} SessionEnvironmentConfigPeripheralsConfigSparkHistoryServerConfig" end end end diff --git a/libraries/google/dataproc/property/projectlocationsession_jupyter_session.rb b/libraries/google/dataproc/property/session_jupyter_session.rb similarity index 89% rename from libraries/google/dataproc/property/projectlocationsession_jupyter_session.rb rename to libraries/google/dataproc/property/session_jupyter_session.rb index e76f4ff8..5629a583 100644 --- a/libraries/google/dataproc/property/projectlocationsession_jupyter_session.rb +++ b/libraries/google/dataproc/property/session_jupyter_session.rb @@ -16,7 +16,7 @@ module GoogleInSpec module Dataproc module Property - class ProjectLocationSessionJupyterSession + class SessionJupyterSession attr_reader :kernel attr_reader :display_name @@ -29,7 +29,7 @@ def initialize(args = nil, parent_identifier = nil) end def to_s - "#{@parent_identifier} ProjectLocationSessionJupyterSession" + "#{@parent_identifier} SessionJupyterSession" end end end diff --git a/libraries/google/dataproc/property/projectlocationsession_labels.rb b/libraries/google/dataproc/property/session_labels.rb similarity index 90% rename from libraries/google/dataproc/property/projectlocationsession_labels.rb rename to libraries/google/dataproc/property/session_labels.rb index ea2dd170..0b640866 100644 --- a/libraries/google/dataproc/property/projectlocationsession_labels.rb +++ b/libraries/google/dataproc/property/session_labels.rb @@ -16,7 +16,7 @@ module GoogleInSpec module Dataproc module Property - class ProjectLocationSessionLabels + class SessionLabels attr_reader :additional_properties def initialize(args = nil, parent_identifier = nil) @@ -26,7 +26,7 @@ def initialize(args = nil, parent_identifier = nil) end def to_s - "#{@parent_identifier} ProjectLocationSessionLabels" + "#{@parent_identifier} SessionLabels" end end end diff --git a/libraries/google/dataproc/property/projectlocationsession_runtime_config.rb b/libraries/google/dataproc/property/session_runtime_config.rb similarity index 64% rename from libraries/google/dataproc/property/projectlocationsession_runtime_config.rb rename to libraries/google/dataproc/property/session_runtime_config.rb index a17d2fbb..c1e99e63 100644 --- a/libraries/google/dataproc/property/projectlocationsession_runtime_config.rb +++ b/libraries/google/dataproc/property/session_runtime_config.rb @@ -13,13 +13,13 @@ # CONTRIBUTING.md located at the root of this package. # # ---------------------------------------------------------------------------- -require 'google/dataproc/property/projectlocationsession_runtime_config_properties' -require 'google/dataproc/property/projectlocationsession_runtime_config_repository_config' -require 'google/dataproc/property/projectlocationsession_runtime_config_repository_config_pypi_repository_config' +require 'google/dataproc/property/session_runtime_config_properties' +require 'google/dataproc/property/session_runtime_config_repository_config' +require 'google/dataproc/property/session_runtime_config_repository_config_pypi_repository_config' module GoogleInSpec module Dataproc module Property - class ProjectLocationSessionRuntimeConfig + class SessionRuntimeConfig attr_reader :version attr_reader :container_image @@ -33,12 +33,12 @@ def initialize(args = nil, parent_identifier = nil) @parent_identifier = parent_identifier @version = args['version'] @container_image = args['containerImage'] - @properties = GoogleInSpec::Dataproc::Property::ProjectLocationSessionRuntimeConfigProperties.new(args['properties'], to_s) - @repository_config = GoogleInSpec::Dataproc::Property::ProjectLocationSessionRuntimeConfigRepositoryConfig.new(args['repositoryConfig'], to_s) + @properties = GoogleInSpec::Dataproc::Property::SessionRuntimeConfigProperties.new(args['properties'], to_s) + @repository_config = GoogleInSpec::Dataproc::Property::SessionRuntimeConfigRepositoryConfig.new(args['repositoryConfig'], to_s) end def to_s - "#{@parent_identifier} ProjectLocationSessionRuntimeConfig" + "#{@parent_identifier} SessionRuntimeConfig" end end end diff --git a/libraries/google/dataproc/property/projectlocationsession_runtime_info_endpoints.rb b/libraries/google/dataproc/property/session_runtime_config_properties.rb similarity index 88% rename from libraries/google/dataproc/property/projectlocationsession_runtime_info_endpoints.rb rename to libraries/google/dataproc/property/session_runtime_config_properties.rb index 923e3362..abe872c7 100644 --- a/libraries/google/dataproc/property/projectlocationsession_runtime_info_endpoints.rb +++ b/libraries/google/dataproc/property/session_runtime_config_properties.rb @@ -16,7 +16,7 @@ module GoogleInSpec module Dataproc module Property - class ProjectLocationSessionRuntimeInfoEndpoints + class SessionRuntimeConfigProperties attr_reader :additional_properties def initialize(args = nil, parent_identifier = nil) @@ -26,7 +26,7 @@ def initialize(args = nil, parent_identifier = nil) end def to_s - "#{@parent_identifier} ProjectLocationSessionRuntimeInfoEndpoints" + "#{@parent_identifier} SessionRuntimeConfigProperties" end end end diff --git a/libraries/google/dataproc/property/projectlocationsession_runtime_config_repository_config.rb b/libraries/google/dataproc/property/session_runtime_config_repository_config.rb similarity index 71% rename from libraries/google/dataproc/property/projectlocationsession_runtime_config_repository_config.rb rename to libraries/google/dataproc/property/session_runtime_config_repository_config.rb index 3a2efa2d..9a0dee07 100644 --- a/libraries/google/dataproc/property/projectlocationsession_runtime_config_repository_config.rb +++ b/libraries/google/dataproc/property/session_runtime_config_repository_config.rb @@ -13,21 +13,21 @@ # CONTRIBUTING.md located at the root of this package. # # ---------------------------------------------------------------------------- -require 'google/dataproc/property/projectlocationsession_runtime_config_repository_config_pypi_repository_config' +require 'google/dataproc/property/session_runtime_config_repository_config_pypi_repository_config' module GoogleInSpec module Dataproc module Property - class ProjectLocationSessionRuntimeConfigRepositoryConfig + class SessionRuntimeConfigRepositoryConfig attr_reader :pypi_repository_config def initialize(args = nil, parent_identifier = nil) return if args.nil? @parent_identifier = parent_identifier - @pypi_repository_config = GoogleInSpec::Dataproc::Property::ProjectLocationSessionRuntimeConfigRepositoryConfigPypiRepositoryConfig.new(args['pypiRepositoryConfig'], to_s) + @pypi_repository_config = GoogleInSpec::Dataproc::Property::SessionRuntimeConfigRepositoryConfigPypiRepositoryConfig.new(args['pypiRepositoryConfig'], to_s) end def to_s - "#{@parent_identifier} ProjectLocationSessionRuntimeConfigRepositoryConfig" + "#{@parent_identifier} SessionRuntimeConfigRepositoryConfig" end end end diff --git a/libraries/google/dataproc/property/projectlocationsession_runtime_config_repository_config_pypi_repository_config.rb b/libraries/google/dataproc/property/session_runtime_config_repository_config_pypi_repository_config.rb similarity index 83% rename from libraries/google/dataproc/property/projectlocationsession_runtime_config_repository_config_pypi_repository_config.rb rename to libraries/google/dataproc/property/session_runtime_config_repository_config_pypi_repository_config.rb index d5b34f3c..2cc012b1 100644 --- a/libraries/google/dataproc/property/projectlocationsession_runtime_config_repository_config_pypi_repository_config.rb +++ b/libraries/google/dataproc/property/session_runtime_config_repository_config_pypi_repository_config.rb @@ -16,7 +16,7 @@ module GoogleInSpec module Dataproc module Property - class ProjectLocationSessionRuntimeConfigRepositoryConfigPypiRepositoryConfig + class SessionRuntimeConfigRepositoryConfigPypiRepositoryConfig attr_reader :pypi_repository def initialize(args = nil, parent_identifier = nil) @@ -26,7 +26,7 @@ def initialize(args = nil, parent_identifier = nil) end def to_s - "#{@parent_identifier} ProjectLocationSessionRuntimeConfigRepositoryConfigPypiRepositoryConfig" + "#{@parent_identifier} SessionRuntimeConfigRepositoryConfigPypiRepositoryConfig" end end end diff --git a/libraries/google/dataproc/property/projectlocationsession_runtime_info.rb b/libraries/google/dataproc/property/session_runtime_info.rb similarity index 62% rename from libraries/google/dataproc/property/projectlocationsession_runtime_info.rb rename to libraries/google/dataproc/property/session_runtime_info.rb index 5e1014b8..d48ef23c 100644 --- a/libraries/google/dataproc/property/projectlocationsession_runtime_info.rb +++ b/libraries/google/dataproc/property/session_runtime_info.rb @@ -13,13 +13,13 @@ # CONTRIBUTING.md located at the root of this package. # # ---------------------------------------------------------------------------- -require 'google/dataproc/property/projectlocationsession_runtime_info_approximate_usage' -require 'google/dataproc/property/projectlocationsession_runtime_info_current_usage' -require 'google/dataproc/property/projectlocationsession_runtime_info_endpoints' +require 'google/dataproc/property/session_runtime_info_approximate_usage' +require 'google/dataproc/property/session_runtime_info_current_usage' +require 'google/dataproc/property/session_runtime_info_endpoints' module GoogleInSpec module Dataproc module Property - class ProjectLocationSessionRuntimeInfo + class SessionRuntimeInfo attr_reader :endpoints attr_reader :output_uri @@ -33,15 +33,15 @@ class ProjectLocationSessionRuntimeInfo def initialize(args = nil, parent_identifier = nil) return if args.nil? @parent_identifier = parent_identifier - @endpoints = GoogleInSpec::Dataproc::Property::ProjectLocationSessionRuntimeInfoEndpoints.new(args['endpoints'], to_s) + @endpoints = GoogleInSpec::Dataproc::Property::SessionRuntimeInfoEndpoints.new(args['endpoints'], to_s) @output_uri = args['outputUri'] @diagnostic_output_uri = args['diagnosticOutputUri'] - @approximate_usage = GoogleInSpec::Dataproc::Property::ProjectLocationSessionRuntimeInfoApproximateUsage.new(args['approximateUsage'], to_s) - @current_usage = GoogleInSpec::Dataproc::Property::ProjectLocationSessionRuntimeInfoCurrentUsage.new(args['currentUsage'], to_s) + @approximate_usage = GoogleInSpec::Dataproc::Property::SessionRuntimeInfoApproximateUsage.new(args['approximateUsage'], to_s) + @current_usage = GoogleInSpec::Dataproc::Property::SessionRuntimeInfoCurrentUsage.new(args['currentUsage'], to_s) end def to_s - "#{@parent_identifier} ProjectLocationSessionRuntimeInfo" + "#{@parent_identifier} SessionRuntimeInfo" end end end diff --git a/libraries/google/dataproc/property/projectlocationsession_runtime_info_approximate_usage.rb b/libraries/google/dataproc/property/session_runtime_info_approximate_usage.rb similarity index 89% rename from libraries/google/dataproc/property/projectlocationsession_runtime_info_approximate_usage.rb rename to libraries/google/dataproc/property/session_runtime_info_approximate_usage.rb index 74297f18..96f283e9 100644 --- a/libraries/google/dataproc/property/projectlocationsession_runtime_info_approximate_usage.rb +++ b/libraries/google/dataproc/property/session_runtime_info_approximate_usage.rb @@ -16,7 +16,7 @@ module GoogleInSpec module Dataproc module Property - class ProjectLocationSessionRuntimeInfoApproximateUsage + class SessionRuntimeInfoApproximateUsage attr_reader :milli_dcu_seconds attr_reader :shuffle_storage_gb_seconds @@ -35,7 +35,7 @@ def initialize(args = nil, parent_identifier = nil) end def to_s - "#{@parent_identifier} ProjectLocationSessionRuntimeInfoApproximateUsage" + "#{@parent_identifier} SessionRuntimeInfoApproximateUsage" end end end diff --git a/libraries/google/dataproc/property/projectlocationsession_runtime_info_current_usage.rb b/libraries/google/dataproc/property/session_runtime_info_current_usage.rb similarity index 91% rename from libraries/google/dataproc/property/projectlocationsession_runtime_info_current_usage.rb rename to libraries/google/dataproc/property/session_runtime_info_current_usage.rb index 10954659..ab07f23a 100644 --- a/libraries/google/dataproc/property/projectlocationsession_runtime_info_current_usage.rb +++ b/libraries/google/dataproc/property/session_runtime_info_current_usage.rb @@ -16,7 +16,7 @@ module GoogleInSpec module Dataproc module Property - class ProjectLocationSessionRuntimeInfoCurrentUsage + class SessionRuntimeInfoCurrentUsage attr_reader :milli_dcu attr_reader :shuffle_storage_gb @@ -44,7 +44,7 @@ def initialize(args = nil, parent_identifier = nil) end def to_s - "#{@parent_identifier} ProjectLocationSessionRuntimeInfoCurrentUsage" + "#{@parent_identifier} SessionRuntimeInfoCurrentUsage" end end end diff --git a/libraries/google/dataproc/property/projectlocationsession_runtime_config_properties.rb b/libraries/google/dataproc/property/session_runtime_info_endpoints.rb similarity index 87% rename from libraries/google/dataproc/property/projectlocationsession_runtime_config_properties.rb rename to libraries/google/dataproc/property/session_runtime_info_endpoints.rb index a12132c8..6a740f77 100644 --- a/libraries/google/dataproc/property/projectlocationsession_runtime_config_properties.rb +++ b/libraries/google/dataproc/property/session_runtime_info_endpoints.rb @@ -16,7 +16,7 @@ module GoogleInSpec module Dataproc module Property - class ProjectLocationSessionRuntimeConfigProperties + class SessionRuntimeInfoEndpoints attr_reader :additional_properties def initialize(args = nil, parent_identifier = nil) @@ -26,7 +26,7 @@ def initialize(args = nil, parent_identifier = nil) end def to_s - "#{@parent_identifier} ProjectLocationSessionRuntimeConfigProperties" + "#{@parent_identifier} SessionRuntimeInfoEndpoints" end end end diff --git a/libraries/google/dataproc/property/projectlocationsession_state_history.rb b/libraries/google/dataproc/property/session_state_history.rb similarity index 76% rename from libraries/google/dataproc/property/projectlocationsession_state_history.rb rename to libraries/google/dataproc/property/session_state_history.rb index f1307a88..45a133f4 100644 --- a/libraries/google/dataproc/property/projectlocationsession_state_history.rb +++ b/libraries/google/dataproc/property/session_state_history.rb @@ -16,7 +16,7 @@ module GoogleInSpec module Dataproc module Property - class ProjectLocationSessionStateHistory + class SessionStateHistory attr_reader :state attr_reader :state_message @@ -32,15 +32,15 @@ def initialize(args = nil, parent_identifier = nil) end def to_s - "#{@parent_identifier} ProjectLocationSessionStateHistory" + "#{@parent_identifier} SessionStateHistory" end end - class ProjectLocationSessionStateHistoryArray + class SessionStateHistoryArray def self.parse(value, parent_identifier) return if value.nil? - return ProjectLocationSessionStateHistory.new(value, parent_identifier) unless value.is_a?(::Array) - value.map { |v| ProjectLocationSessionStateHistory.new(v, parent_identifier) } + return SessionStateHistory.new(value, parent_identifier) unless value.is_a?(::Array) + value.map { |v| SessionStateHistory.new(v, parent_identifier) } end end end diff --git a/libraries/google_dataproc_project_location_session.rb b/libraries/google_dataproc_project_location_session.rb deleted file mode 100644 index ff733029..00000000 --- a/libraries/google_dataproc_project_location_session.rb +++ /dev/null @@ -1,98 +0,0 @@ -# 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/dataproc/property/projectlocationsession_environment_config' -require 'google/dataproc/property/projectlocationsession_environment_config_execution_config' -require 'google/dataproc/property/projectlocationsession_environment_config_peripherals_config' -require 'google/dataproc/property/projectlocationsession_environment_config_peripherals_config_spark_history_server_config' -require 'google/dataproc/property/projectlocationsession_jupyter_session' -require 'google/dataproc/property/projectlocationsession_labels' -require 'google/dataproc/property/projectlocationsession_runtime_config' -require 'google/dataproc/property/projectlocationsession_runtime_config_properties' -require 'google/dataproc/property/projectlocationsession_runtime_config_repository_config' -require 'google/dataproc/property/projectlocationsession_runtime_config_repository_config_pypi_repository_config' -require 'google/dataproc/property/projectlocationsession_runtime_info' -require 'google/dataproc/property/projectlocationsession_runtime_info_approximate_usage' -require 'google/dataproc/property/projectlocationsession_runtime_info_current_usage' -require 'google/dataproc/property/projectlocationsession_runtime_info_endpoints' -require 'google/dataproc/property/projectlocationsession_state_history' - -# A provider to manage Dataproc resources. -class DataprocProjectLocationSession < GcpResourceBase - name 'google_dataproc_project_location_session' - desc 'ProjectLocationSession' - supports platform: 'gcp' - - attr_reader :params - attr_reader :name - attr_reader :uuid - attr_reader :create_time - attr_reader :jupyter_session - attr_reader :runtime_info - attr_reader :state - attr_reader :state_message - attr_reader :state_time - attr_reader :creator - attr_reader :labels - attr_reader :runtime_config - attr_reader :environment_config - attr_reader :user - attr_reader :state_history - attr_reader :session_template - - 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'] - @uuid = @fetched['uuid'] - @create_time = @fetched['createTime'] - @jupyter_session = GoogleInSpec::Dataproc::Property::ProjectLocationSessionJupyterSession.new(@fetched['jupyterSession'], to_s) - @runtime_info = GoogleInSpec::Dataproc::Property::ProjectLocationSessionRuntimeInfo.new(@fetched['runtimeInfo'], to_s) - @state = @fetched['state'] - @state_message = @fetched['stateMessage'] - @state_time = @fetched['stateTime'] - @creator = @fetched['creator'] - @labels = GoogleInSpec::Dataproc::Property::ProjectLocationSessionLabels.new(@fetched['labels'], to_s) - @runtime_config = GoogleInSpec::Dataproc::Property::ProjectLocationSessionRuntimeConfig.new(@fetched['runtimeConfig'], to_s) - @environment_config = GoogleInSpec::Dataproc::Property::ProjectLocationSessionEnvironmentConfig.new(@fetched['environmentConfig'], to_s) - @user = @fetched['user'] - @state_history = GoogleInSpec::Dataproc::Property::ProjectLocationSessionStateHistoryArray.parse(@fetched['stateHistory'], to_s) - @session_template = @fetched['sessionTemplate'] - end - - def exists? - !@fetched.nil? - end - - def to_s - "ProjectLocationSession #{@params}" - end - - private - - def product_url(_ = nil) - 'https://dataproc.googleapis.com/v1/' - end - - def resource_base_url - '{{+name}}' - end -end diff --git a/libraries/google_dataproc_session.rb b/libraries/google_dataproc_session.rb new file mode 100644 index 00000000..b2813be7 --- /dev/null +++ b/libraries/google_dataproc_session.rb @@ -0,0 +1,98 @@ +# 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/dataproc/property/session_environment_config' +require 'google/dataproc/property/session_environment_config_execution_config' +require 'google/dataproc/property/session_environment_config_peripherals_config' +require 'google/dataproc/property/session_environment_config_peripherals_config_spark_history_server_config' +require 'google/dataproc/property/session_jupyter_session' +require 'google/dataproc/property/session_labels' +require 'google/dataproc/property/session_runtime_config' +require 'google/dataproc/property/session_runtime_config_properties' +require 'google/dataproc/property/session_runtime_config_repository_config' +require 'google/dataproc/property/session_runtime_config_repository_config_pypi_repository_config' +require 'google/dataproc/property/session_runtime_info' +require 'google/dataproc/property/session_runtime_info_approximate_usage' +require 'google/dataproc/property/session_runtime_info_current_usage' +require 'google/dataproc/property/session_runtime_info_endpoints' +require 'google/dataproc/property/session_state_history' + +# A provider to manage Dataproc resources. +class DataprocSession < GcpResourceBase + name 'google_dataproc_session' + desc 'Session' + supports platform: 'gcp' + + attr_reader :params + attr_reader :name + attr_reader :uuid + attr_reader :create_time + attr_reader :jupyter_session + attr_reader :runtime_info + attr_reader :state + attr_reader :state_message + attr_reader :state_time + attr_reader :creator + attr_reader :labels + attr_reader :runtime_config + attr_reader :environment_config + attr_reader :user + attr_reader :state_history + attr_reader :session_template + + 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'] + @uuid = @fetched['uuid'] + @create_time = @fetched['createTime'] + @jupyter_session = GoogleInSpec::Dataproc::Property::SessionJupyterSession.new(@fetched['jupyterSession'], to_s) + @runtime_info = GoogleInSpec::Dataproc::Property::SessionRuntimeInfo.new(@fetched['runtimeInfo'], to_s) + @state = @fetched['state'] + @state_message = @fetched['stateMessage'] + @state_time = @fetched['stateTime'] + @creator = @fetched['creator'] + @labels = GoogleInSpec::Dataproc::Property::SessionLabels.new(@fetched['labels'], to_s) + @runtime_config = GoogleInSpec::Dataproc::Property::SessionRuntimeConfig.new(@fetched['runtimeConfig'], to_s) + @environment_config = GoogleInSpec::Dataproc::Property::SessionEnvironmentConfig.new(@fetched['environmentConfig'], to_s) + @user = @fetched['user'] + @state_history = GoogleInSpec::Dataproc::Property::SessionStateHistoryArray.parse(@fetched['stateHistory'], to_s) + @session_template = @fetched['sessionTemplate'] + end + + def exists? + !@fetched.nil? + end + + def to_s + "Session #{@params}" + end + + private + + def product_url(_ = nil) + 'https://dataproc.googleapis.com/v1/' + end + + def resource_base_url + '{{name}}' + end +end diff --git a/libraries/google_dataproc_project_location_sessions.rb b/libraries/google_dataproc_sessions.rb similarity index 82% rename from libraries/google_dataproc_project_location_sessions.rb rename to libraries/google_dataproc_sessions.rb index ed2180b0..e8efba7c 100644 --- a/libraries/google_dataproc_project_location_sessions.rb +++ b/libraries/google_dataproc_sessions.rb @@ -14,9 +14,9 @@ # # ---------------------------------------------------------------------------- require 'gcp_backend' -class DataprocProjectLocationSessions < GcpResourceBase - name 'google_dataproc_project_location_sessions' - desc 'ProjectLocationSession plural resource' +class DataprocSessions < GcpResourceBase + name 'google_dataproc_sessions' + desc 'Session plural resource' supports platform: 'gcp' attr_reader :table @@ -44,7 +44,7 @@ class DataprocProjectLocationSessions < GcpResourceBase def initialize(params = {}) super(params.merge({ use_http_transport: true })) @params = params - @table = fetch_wrapped_resource('projectLocationSessions') + @table = fetch_wrapped_resource('sessions') end def fetch_wrapped_resource(wrap_path) @@ -80,17 +80,17 @@ def transformers 'name' => ->(obj) { [:name, obj['name']] }, 'uuid' => ->(obj) { [:uuid, obj['uuid']] }, 'createTime' => ->(obj) { [:create_time, obj['createTime']] }, - 'jupyterSession' => ->(obj) { [:jupyter_session, GoogleInSpec::Dataproc::Property::ProjectLocationSessionJupyterSession.new(obj['jupyterSession'], to_s)] }, - 'runtimeInfo' => ->(obj) { [:runtime_info, GoogleInSpec::Dataproc::Property::ProjectLocationSessionRuntimeInfo.new(obj['runtimeInfo'], to_s)] }, + 'jupyterSession' => ->(obj) { [:jupyter_session, GoogleInSpec::Dataproc::Property::SessionJupyterSession.new(obj['jupyterSession'], to_s)] }, + 'runtimeInfo' => ->(obj) { [:runtime_info, GoogleInSpec::Dataproc::Property::SessionRuntimeInfo.new(obj['runtimeInfo'], to_s)] }, 'state' => ->(obj) { [:state, obj['state']] }, 'stateMessage' => ->(obj) { [:state_message, obj['stateMessage']] }, 'stateTime' => ->(obj) { [:state_time, obj['stateTime']] }, 'creator' => ->(obj) { [:creator, obj['creator']] }, - 'labels' => ->(obj) { [:labels, GoogleInSpec::Dataproc::Property::ProjectLocationSessionLabels.new(obj['labels'], to_s)] }, - 'runtimeConfig' => ->(obj) { [:runtime_config, GoogleInSpec::Dataproc::Property::ProjectLocationSessionRuntimeConfig.new(obj['runtimeConfig'], to_s)] }, - 'environmentConfig' => ->(obj) { [:environment_config, GoogleInSpec::Dataproc::Property::ProjectLocationSessionEnvironmentConfig.new(obj['environmentConfig'], to_s)] }, + 'labels' => ->(obj) { [:labels, GoogleInSpec::Dataproc::Property::SessionLabels.new(obj['labels'], to_s)] }, + 'runtimeConfig' => ->(obj) { [:runtime_config, GoogleInSpec::Dataproc::Property::SessionRuntimeConfig.new(obj['runtimeConfig'], to_s)] }, + 'environmentConfig' => ->(obj) { [:environment_config, GoogleInSpec::Dataproc::Property::SessionEnvironmentConfig.new(obj['environmentConfig'], to_s)] }, 'user' => ->(obj) { [:user, obj['user']] }, - 'stateHistory' => ->(obj) { [:state_history, GoogleInSpec::Dataproc::Property::ProjectLocationSessionStateHistoryArray.parse(obj['stateHistory'], to_s)] }, + 'stateHistory' => ->(obj) { [:state_history, GoogleInSpec::Dataproc::Property::SessionStateHistoryArray.parse(obj['stateHistory'], to_s)] }, 'sessionTemplate' => ->(obj) { [:session_template, obj['sessionTemplate']] }, } end @@ -102,6 +102,6 @@ def product_url(_ = nil) end def resource_base_url - '{{+parent}}/sessions' + '{{parent}}/sessions' end end diff --git a/test/integration/verify/controls/google_dataproc_project_location_session.rb b/test/integration/verify/controls/google_dataproc_project_location_session.rb deleted file mode 100644 index ce26c262..00000000 --- a/test/integration/verify/controls/google_dataproc_project_location_session.rb +++ /dev/null @@ -1,52 +0,0 @@ -# ---------------------------------------------------------------------------- -# -# *** 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. -# -# ---------------------------------------------------------------------------- - -title 'Test GCP google_dataproc_project_location_session resource.' - -gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') - - project_location_session = input('project_location_session', value: { - "name": "value_name", - "parent": "value_parent", - "uuid": "value_uuid", - "create_time": "value_createtime", - "state": "value_state", - "state_message": "value_statemessage", - "state_time": "value_statetime", - "creator": "value_creator", - "user": "value_user", - "session_template": "value_sessiontemplate" -}, description: 'project_location_session description') -control 'google_dataproc_project_location_session-1.0' do - impact 1.0 - title 'google_dataproc_project_location_session resource test' - - describe google_dataproc_project_location_session(name: project_location_session['name']) do - it { should exist } - its('name') { should cmp project_location_session['name'] } - its('uuid') { should cmp project_location_session['uuid'] } - its('create_time') { should cmp project_location_session['create_time'] } - its('state') { should cmp project_location_session['state'] } - its('state_message') { should cmp project_location_session['state_message'] } - its('state_time') { should cmp project_location_session['state_time'] } - its('creator') { should cmp project_location_session['creator'] } - its('user') { should cmp project_location_session['user'] } - its('session_template') { should cmp project_location_session['session_template'] } - - end - - describe google_dataproc_project_location_session(name: "does_not_exit") do - it { should_not exist } - end -end diff --git a/test/integration/verify/controls/google_dataproc_project_location_sessions.rb b/test/integration/verify/controls/google_dataproc_project_location_sessions.rb deleted file mode 100644 index 1992125a..00000000 --- a/test/integration/verify/controls/google_dataproc_project_location_sessions.rb +++ /dev/null @@ -1,38 +0,0 @@ -# ---------------------------------------------------------------------------- -# -# *** 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. -# -# ---------------------------------------------------------------------------- - -title 'Test GCP google_dataproc_project_location_sessions resource.' - -gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') - - project_location_session = input('project_location_session', value: { - "name": "value_name", - "parent": "value_parent", - "uuid": "value_uuid", - "create_time": "value_createtime", - "state": "value_state", - "state_message": "value_statemessage", - "state_time": "value_statetime", - "creator": "value_creator", - "user": "value_user", - "session_template": "value_sessiontemplate" -}, description: 'project_location_session description') -control 'google_dataproc_project_location_sessions-1.0' do - impact 1.0 - title 'google_dataproc_project_location_sessions resource test' - - describe google_dataproc_project_location_sessions(parent: project_location_session['parent']) do - it { should exist } - end -end diff --git a/test/integration/verify/controls/google_dataproc_session.rb b/test/integration/verify/controls/google_dataproc_session.rb new file mode 100644 index 00000000..00b1d6b0 --- /dev/null +++ b/test/integration/verify/controls/google_dataproc_session.rb @@ -0,0 +1,51 @@ +# ---------------------------------------------------------------------------- +# +# *** 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. +# +# ---------------------------------------------------------------------------- + +title 'Test GCP google_dataproc_session resource.' + +gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') + +session = input('session', value: { + "name": "projects/ppradhan/locations/us-central1/sessions/inspec-runtime-0ae1-b98f4174", + "parent": "projects/ppradhan/locations/us-central1", + "uuid": "0b8d8483-b1ff-4f67-8e34-8d57987430a2", + "create_time": "2024-08-19T06:59:23.721658Z", + "state": "value_state", + "state_message": "value_statemessage", + "state_time": "value_statetime", + "creator": "balasubramanian.s@chef.io", + "user": "value_user", + "session_template": "projects/ppradhan/locations/us-central1/sessionTemplates/inspec-runtime-0ae1" +}, description: 'session description') +control 'google_dataproc_session-1.0' do + impact 1.0 + title 'google_dataproc_session resource test' + + describe google_dataproc_session(name: session['name']) do + it { should exist } + its('name') { should cmp session['name'] } + its('uuid') { should cmp session['uuid'] } + its('create_time') { should cmp session['create_time'] } + its('state') { should cmp session['state'] } + its('state_message') { should cmp session['state_message'] } + its('state_time') { should cmp session['state_time'] } + its('creator') { should cmp session['creator'] } + its('user') { should cmp session['user'] } + its('session_template') { should cmp session['session_template'] } + end + + describe google_dataproc_session(name: "does_not_exit") do + it { should_not exist } + end +end diff --git a/test/integration/verify/controls/google_dataproc_sessions.rb b/test/integration/verify/controls/google_dataproc_sessions.rb new file mode 100644 index 00000000..f50d1c71 --- /dev/null +++ b/test/integration/verify/controls/google_dataproc_sessions.rb @@ -0,0 +1,43 @@ +# ---------------------------------------------------------------------------- +# +# *** 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. +# +# ---------------------------------------------------------------------------- + +title 'Test GCP google_dataproc_sessions resource.' + +gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') + +session = input('session', value: { + "name": "projects/ppradhan/locations/us-central1/sessions/inspec-runtime-0ae1-b98f4174", + "parent": "projects/ppradhan/locations/us-central1", + "uuid": "0b8d8483-b1ff-4f67-8e34-8d57987430a2", + "create_time": "2024-08-19T06:59:23.721658Z", + "state": "value_state", + "state_message": "value_statemessage", + "state_time": "value_statetime", + "creator": "balasubramanian.s@chef.io", + "user": "value_user", + "session_template": "projects/ppradhan/locations/us-central1/sessionTemplates/inspec-runtime-0ae1" +}, description: 'session description') +control 'google_dataproc_sessions-1.0' do + impact 1.0 + title 'google_dataproc_sessions resource test' + + describe google_dataproc_sessions(parent: session['parent']) do + it { should exist } + its('names') { should include session['name'] } + its('uuids') { should include session['uuid'] } + its('create_times') { should include session['create_time'] } + its('creators') { should include session['creator'] } + its('session_templates') { should include session['session_template'] } + end +end