#[non_exhaustive]pub struct Preview {Show 21 fields
pub name: String,
pub create_time: Option<Timestamp>,
pub labels: HashMap<String, String>,
pub state: State,
pub deployment: String,
pub preview_mode: PreviewMode,
pub service_account: String,
pub artifacts_gcs_bucket: Option<String>,
pub worker_pool: Option<String>,
pub error_code: ErrorCode,
pub error_status: Option<Status>,
pub build: String,
pub tf_errors: Vec<TerraformError>,
pub error_logs: String,
pub preview_artifacts: Option<PreviewArtifacts>,
pub logs: String,
pub tf_version: String,
pub tf_version_constraint: Option<String>,
pub annotations: HashMap<String, String>,
pub provider_config: Option<ProviderConfig>,
pub blueprint: Option<Blueprint>,
/* private fields */
}Expand description
A preview represents a set of actions Infra Manager would perform to move the resources towards the desired state as specified in the configuration.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringIdentifier. Resource name of the preview. Resource name can be user
provided or server generated ID if unspecified. Format:
projects/{project}/locations/{location}/previews/{preview}
create_time: Option<Timestamp>Output only. Time the preview was created.
labels: HashMap<String, String>Optional. User-defined labels for the preview.
state: StateOutput only. Current state of the preview.
deployment: StringOptional. Optional deployment reference. If specified, the preview will be performed using the provided deployment’s current state and use any relevant fields from the deployment unless explicitly specified in the preview create request.
preview_mode: PreviewModeOptional. Current mode of preview.
service_account: StringRequired. User-specified Service Account (SA) credentials to be used when
previewing resources.
Format: projects/{projectID}/serviceAccounts/{serviceAccount}
artifacts_gcs_bucket: Option<String>Optional. User-defined location of Cloud Build logs, artifacts, and
in Google Cloud Storage.
Format: gs://{bucket}/{folder}
A default bucket will be bootstrapped if the field is not set or empty
Default Bucket Format: gs://<project number>-<region>-blueprint-config
Constraints:
- The bucket needs to be in the same project as the deployment
- The path cannot be within the path of
gcs_sourceIf omitted and deployment resource ref provided has artifacts_gcs_bucket defined, that artifact bucket is used.
worker_pool: Option<String>Optional. The user-specified Worker Pool resource in which the Cloud Build job will execute. Format projects/{project}/locations/{location}/workerPools/{workerPoolId} If this field is unspecified, the default Cloud Build worker pool will be used. If omitted and deployment resource ref provided has worker_pool defined, that worker pool is used.
error_code: ErrorCodeOutput only. Code describing any errors that may have occurred.
error_status: Option<Status>Output only. Additional information regarding the current state.
build: StringOutput only. Cloud Build instance UUID associated with this preview.
tf_errors: Vec<TerraformError>Output only. Summary of errors encountered during Terraform preview. It has a size limit of 10, i.e. only top 10 errors will be summarized here.
error_logs: StringOutput only. Link to tf-error.ndjson file, which contains the full list of
the errors encountered during a Terraform preview.
Format: gs://{bucket}/{object}.
preview_artifacts: Option<PreviewArtifacts>Output only. Artifacts from preview.
logs: StringOutput only. Location of preview logs in gs://{bucket}/{object} format.
tf_version: StringOutput only. The current Terraform version set on the preview. It is in the format of “Major.Minor.Patch”, for example, “1.3.10”.
tf_version_constraint: Option<String>Optional. The user-specified Terraform version constraint. Example: “=1.3.10”.
annotations: HashMap<String, String>Optional. Arbitrary key-value metadata storage e.g. to help client tools identify preview during automation. See https://google.aip.dev/148#annotations for details on format and size limitations.
provider_config: Option<ProviderConfig>Optional. This field specifies the provider configurations.
blueprint: Option<Blueprint>Blueprint to preview.
Implementations§
Source§impl Preview
impl Preview
pub fn new() -> Self
Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = Preview::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = Preview::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Preview::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sourcepub fn set_deployment<T: Into<String>>(self, v: T) -> Self
pub fn set_deployment<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_preview_mode<T: Into<PreviewMode>>(self, v: T) -> Self
pub fn set_preview_mode<T: Into<PreviewMode>>(self, v: T) -> Self
Sets the value of preview_mode.
§Example
use google_cloud_config_v1::model::preview::PreviewMode;
let x0 = Preview::new().set_preview_mode(PreviewMode::Default);
let x1 = Preview::new().set_preview_mode(PreviewMode::Delete);Sourcepub fn set_service_account<T: Into<String>>(self, v: T) -> Self
pub fn set_service_account<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_artifacts_gcs_bucket<T>(self, v: T) -> Self
pub fn set_artifacts_gcs_bucket<T>(self, v: T) -> Self
Sets the value of artifacts_gcs_bucket.
§Example
let x = Preview::new().set_artifacts_gcs_bucket("example");Sourcepub fn set_or_clear_artifacts_gcs_bucket<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_artifacts_gcs_bucket<T>(self, v: Option<T>) -> Self
Sets or clears the value of artifacts_gcs_bucket.
§Example
let x = Preview::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
let x = Preview::new().set_or_clear_artifacts_gcs_bucket(None::<String>);Sourcepub fn set_worker_pool<T>(self, v: T) -> Self
pub fn set_worker_pool<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_worker_pool<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_worker_pool<T>(self, v: Option<T>) -> Self
Sets or clears the value of worker_pool.
§Example
let x = Preview::new().set_or_clear_worker_pool(Some("example"));
let x = Preview::new().set_or_clear_worker_pool(None::<String>);Sourcepub fn set_error_code<T: Into<ErrorCode>>(self, v: T) -> Self
pub fn set_error_code<T: Into<ErrorCode>>(self, v: T) -> Self
Sets the value of error_code.
§Example
use google_cloud_config_v1::model::preview::ErrorCode;
let x0 = Preview::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
let x1 = Preview::new().set_error_code(ErrorCode::BucketCreationPermissionDenied);
let x2 = Preview::new().set_error_code(ErrorCode::BucketCreationFailed);Sourcepub fn set_error_status<T>(self, v: T) -> Self
pub fn set_error_status<T>(self, v: T) -> Self
Sets the value of error_status.
§Example
use rpc::model::Status;
let x = Preview::new().set_error_status(Status::default()/* use setters */);Sourcepub fn set_or_clear_error_status<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_error_status<T>(self, v: Option<T>) -> Self
Sets or clears the value of error_status.
§Example
use rpc::model::Status;
let x = Preview::new().set_or_clear_error_status(Some(Status::default()/* use setters */));
let x = Preview::new().set_or_clear_error_status(None::<Status>);Sourcepub fn set_tf_errors<T, V>(self, v: T) -> Self
pub fn set_tf_errors<T, V>(self, v: T) -> Self
Sourcepub fn set_error_logs<T: Into<String>>(self, v: T) -> Self
pub fn set_error_logs<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_preview_artifacts<T>(self, v: T) -> Selfwhere
T: Into<PreviewArtifacts>,
pub fn set_preview_artifacts<T>(self, v: T) -> Selfwhere
T: Into<PreviewArtifacts>,
Sets the value of preview_artifacts.
§Example
use google_cloud_config_v1::model::PreviewArtifacts;
let x = Preview::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);Sourcepub fn set_or_clear_preview_artifacts<T>(self, v: Option<T>) -> Selfwhere
T: Into<PreviewArtifacts>,
pub fn set_or_clear_preview_artifacts<T>(self, v: Option<T>) -> Selfwhere
T: Into<PreviewArtifacts>,
Sets or clears the value of preview_artifacts.
§Example
use google_cloud_config_v1::model::PreviewArtifacts;
let x = Preview::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
let x = Preview::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);Sourcepub fn set_tf_version<T: Into<String>>(self, v: T) -> Self
pub fn set_tf_version<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_tf_version_constraint<T>(self, v: T) -> Self
pub fn set_tf_version_constraint<T>(self, v: T) -> Self
Sets the value of tf_version_constraint.
§Example
let x = Preview::new().set_tf_version_constraint("example");Sourcepub fn set_or_clear_tf_version_constraint<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_tf_version_constraint<T>(self, v: Option<T>) -> Self
Sets or clears the value of tf_version_constraint.
§Example
let x = Preview::new().set_or_clear_tf_version_constraint(Some("example"));
let x = Preview::new().set_or_clear_tf_version_constraint(None::<String>);Sourcepub fn set_annotations<T, K, V>(self, v: T) -> Self
pub fn set_annotations<T, K, V>(self, v: T) -> Self
Sets the value of annotations.
§Example
let x = Preview::new().set_annotations([
("key0", "abc"),
("key1", "xyz"),
]);Sourcepub fn set_provider_config<T>(self, v: T) -> Selfwhere
T: Into<ProviderConfig>,
pub fn set_provider_config<T>(self, v: T) -> Selfwhere
T: Into<ProviderConfig>,
Sets the value of provider_config.
§Example
use google_cloud_config_v1::model::ProviderConfig;
let x = Preview::new().set_provider_config(ProviderConfig::default()/* use setters */);Sourcepub fn set_or_clear_provider_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<ProviderConfig>,
pub fn set_or_clear_provider_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<ProviderConfig>,
Sets or clears the value of provider_config.
§Example
use google_cloud_config_v1::model::ProviderConfig;
let x = Preview::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
let x = Preview::new().set_or_clear_provider_config(None::<ProviderConfig>);Sourcepub fn set_blueprint<T: Into<Option<Blueprint>>>(self, v: T) -> Self
pub fn set_blueprint<T: Into<Option<Blueprint>>>(self, v: T) -> Self
Sets the value of blueprint.
Note that all the setters affecting blueprint are mutually
exclusive.
§Example
use google_cloud_config_v1::model::TerraformBlueprint;
let x = Preview::new().set_blueprint(Some(
google_cloud_config_v1::model::preview::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));Sourcepub fn terraform_blueprint(&self) -> Option<&Box<TerraformBlueprint>>
pub fn terraform_blueprint(&self) -> Option<&Box<TerraformBlueprint>>
The value of blueprint
if it holds a TerraformBlueprint, None if the field is not set or
holds a different branch.
Sourcepub fn set_terraform_blueprint<T: Into<Box<TerraformBlueprint>>>(
self,
v: T,
) -> Self
pub fn set_terraform_blueprint<T: Into<Box<TerraformBlueprint>>>( self, v: T, ) -> Self
Sets the value of blueprint
to hold a TerraformBlueprint.
Note that all the setters affecting blueprint are
mutually exclusive.
§Example
use google_cloud_config_v1::model::TerraformBlueprint;
let x = Preview::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
assert!(x.terraform_blueprint().is_some());