Skip to content

Commit

Permalink
feat: [IAC-2080]: Add support for IACM default pipelines in workspaces (
Browse files Browse the repository at this point in the history
  • Loading branch information
scottyw-harness committed Jun 24, 2024
1 parent b78a149 commit e7dd75c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 7 deletions.
10 changes: 7 additions & 3 deletions harness/nextgen/iacm_model_create_workspace_request_body.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
package nextgen

type IacmCreateWorkspaceRequestBody struct {
// define the budget for a specific workspace
Budget float32 `json:"budget,omitempty"`
// cost_breakdown_json is the identifier to the breakdown cost file from the current execution that was applied successfully
CostBreakdownJson string `json:"cost_breakdown_json,omitempty"`
// cost_diff_json is the identifier to the diff cost file between the previous and current successful executions
CostDiffJson string `json:"cost_diff_json,omitempty"`
// define if cost estimation operations will be performed in this workspace
CostEstimationEnabled bool `json:"cost_estimation_enabled,omitempty"`
// List of default pipelines associated with this workspace and any per-workspace overrrides.
DefaultPipelines map[string]IacmDefaultPipelineOverride `json:"default_pipelines,omitempty"`
// Description provides long-form text about the resource.
Description string `json:"description,omitempty"`
// list of environment variables configured on the workspace.
Expand All @@ -36,11 +40,11 @@ type IacmCreateWorkspaceRequestBody struct {
// Repository Commit/Tag in which the code should be accessed.
RepositoryCommit string `json:"repository_commit,omitempty"`
// Repository Connector is the reference to the connector to use for this code.
RepositoryConnector string `json:"repository_connector"`
RepositoryConnector string `json:"repository_connector,omitempty"`
// Repository Path is the path in which the infra code resides.
RepositoryPath string `json:"repository_path,omitempty"`
// terraform_plan is the identifier to the current state file.
TerraformPlan string `json:"terraform_plan,omitempty"`
// Repository SHA in which the code should be accessed.
RepositorySha string `json:"repository_sha,omitempty"`
// terraform_plan_json is the identifier to the current state file onl in JSON format.
TerraformPlanJson string `json:"terraform_plan_json,omitempty"`
// terraform_state is the identifier to the plan file used to create the latest state.
Expand Down
17 changes: 17 additions & 0 deletions harness/nextgen/iacm_model_default_pipeline_override.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Infrastructure as Code Management
*
* Services for Harness IaCM Module.
*
* API version: 0.1.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package nextgen

// Per-workspace override to the assigned default pipelines.
type IacmDefaultPipelineOverride struct {
// Default pipeline assigned as the project-level
ProjectPipeline string `json:"project_pipeline"`
// Default pipeline assigned as the workspace-level
WorkspacePipeline string `json:"workspace_pipeline"`
}
12 changes: 9 additions & 3 deletions harness/nextgen/iacm_model_show_workspace_response_body.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ package nextgen
type IacmShowWorkspaceResponseBody struct {
// Account is the internal customer account ID.
Account string `json:"account"`
// Defines if the remote backend is locked or not
BackendLocked bool `json:"backend_locked,omitempty"`
// define the budget for a specific workspace
Budget float32 `json:"budget,omitempty"`
// cost_breakdown_json is the identifier to the breakdown cost file from the current execution that was applied successfully
CostBreakdownJson string `json:"cost_breakdown_json,omitempty"`
// cost_diff_json is the identifier to the diff cost file between the previous and current successful executions
Expand All @@ -20,6 +24,8 @@ type IacmShowWorkspaceResponseBody struct {
CostEstimationEnabled bool `json:"cost_estimation_enabled,omitempty"`
// Created is the unix timestamp at which the resource was originally created in milliseconds.
Created int64 `json:"created"`
// List of default pipelines associated with this workspace and any per-workspace overrrides.
DefaultPipelines map[string]IacmDefaultPipelineOverride `json:"default_pipelines,omitempty"`
// Description provides long-form text about the resource.
Description string `json:"description,omitempty"`
// list of environment variables configured on the workspace.
Expand Down Expand Up @@ -49,10 +55,10 @@ type IacmShowWorkspaceResponseBody struct {
RepositoryConnector string `json:"repository_connector"`
// Repository Path is the path in which the infra code resides.
RepositoryPath string `json:"repository_path,omitempty"`
// Repository SHA in which the code should be accessed.
RepositorySha string `json:"repository_sha,omitempty"`
// The status of the workspace
Status string `json:"status,omitempty"`
// terraform_plan is the identifier to the current state file.
TerraformPlan string `json:"terraform_plan,omitempty"`
Status string `json:"status"`
// terraform_plan_json is the identifier to the current state file onl in JSON format.
TerraformPlanJson string `json:"terraform_plan_json,omitempty"`
// terraform_state is the identifier to the plan file used to create the latest state.
Expand Down
8 changes: 7 additions & 1 deletion harness/nextgen/iacm_model_update_workspace_request_body.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
package nextgen

type IacmUpdateWorkspaceRequestBody struct {
// define the budget for a specific workspace
Budget float32 `json:"budget,omitempty"`
// define if cost estimation operations will be performed in this workspace
CostEstimationEnabled bool `json:"cost_estimation_enabled,omitempty"`
// List of default pipelines associated with this workspace and any per-workspace overrrides.
DefaultPipelines map[string]IacmDefaultPipelineOverride `json:"default_pipelines,omitempty"`
// Description provides long-form text about the resource.
Description string `json:"description,omitempty"`
// list of environment variables configured on the workspace.
Expand All @@ -30,9 +34,11 @@ type IacmUpdateWorkspaceRequestBody struct {
// Repository Commit/Tag in which the code should be accessed.
RepositoryCommit string `json:"repository_commit,omitempty"`
// Repository Connector is the reference to the connector to use for this code.
RepositoryConnector string `json:"repository_connector"`
RepositoryConnector string `json:"repository_connector,omitempty"`
// Repository Path is the path in which the infra code resides.
RepositoryPath string `json:"repository_path,omitempty"`
// Repository SHA in which the code should be accessed.
RepositorySha string `json:"repository_sha,omitempty"`
// define an array of terraform variables files that belong to a different repository
TerraformVariableFiles []IacmWorkspaceTerraformVariableFiles `json:"terraform_variable_files,omitempty"`
// list of terraform variables configured on the workspace.
Expand Down

0 comments on commit e7dd75c

Please sign in to comment.