|
| 1 | +package dto |
| 2 | + |
| 3 | +// Infrastructure represents a Harness infrastructure definition |
| 4 | +type Infrastructure struct { |
| 5 | + ID string `json:"identifier"` |
| 6 | + Name string `json:"name"` |
| 7 | + Description string `json:"description,omitempty"` |
| 8 | + OrgIdentifier string `json:"orgIdentifier"` |
| 9 | + ProjectIdentifier string `json:"projectIdentifier"` |
| 10 | + EnvironmentRef string `json:"environmentRef"` |
| 11 | + Type string `json:"type,omitempty"` |
| 12 | + DeploymentType string `json:"deploymentType,omitempty"` // e.g., Kubernetes, ECS, etc. |
| 13 | + YAML string `json:"yaml,omitempty"` |
| 14 | + Tags map[string]string `json:"tags,omitempty"` |
| 15 | + Variables []map[string]interface{} `json:"variables,omitempty"` |
| 16 | + GitOpsEnabled bool `json:"gitOpsEnabled,omitempty"` |
| 17 | + AccountID string `json:"accountId,omitempty"` |
| 18 | + StoreType string `json:"storeType,omitempty"` |
| 19 | +} |
| 20 | + |
| 21 | +// InfrastructureItem represents an item in the response list |
| 22 | +type InfrastructureItem struct { |
| 23 | + Infrastructure Infrastructure `json:"infrastructure"` |
| 24 | + CreatedAt int64 `json:"createdAt,omitempty"` |
| 25 | + LastModifiedAt int64 `json:"lastModifiedAt,omitempty"` |
| 26 | + EntityValidityDetails interface{} `json:"entityValidityDetails"` |
| 27 | + GovernanceMetadata interface{} `json:"governanceMetadata"` |
| 28 | +} |
| 29 | + |
| 30 | +// InfrastructureListResponse represents the response from the list infrastructures API |
| 31 | +type InfrastructureListResponse struct { |
| 32 | + Status string `json:"status,omitempty"` |
| 33 | + MetaData interface{} `json:"metaData"` |
| 34 | + CorrelationID string `json:"correlationId,omitempty"` |
| 35 | + Data struct { |
| 36 | + Content []InfrastructureItem `json:"content"` |
| 37 | + TotalPages int `json:"totalPages"` |
| 38 | + TotalItems int `json:"totalItems"` |
| 39 | + PageItemCount int `json:"pageItemCount"` |
| 40 | + PageSize int `json:"pageSize"` |
| 41 | + PageIndex int `json:"pageIndex"` |
| 42 | + Empty bool `json:"empty"` |
| 43 | + PageToken interface{} `json:"pageToken"` |
| 44 | + } `json:"data"` |
| 45 | +} |
| 46 | + |
| 47 | +// InfrastructureOptions represents the options for listing infrastructures |
| 48 | +type InfrastructureOptions struct { |
| 49 | + Page int `json:"page,omitempty"` |
| 50 | + Limit int `json:"limit,omitempty"` |
| 51 | + Sort string `json:"sort,omitempty"` |
| 52 | + Order string `json:"order,omitempty"` |
| 53 | + DeploymentType string `json:"deploymentType,omitempty"` // Filter by deployment type |
| 54 | + EnvironmentIdentifier string `json:"environmentIdentifier,omitempty"` // Filter by environment |
| 55 | +} |
| 56 | + |
| 57 | +// MoveInfraConfigsRequest represents the request to move infrastructure configurations |
| 58 | +type MoveInfraConfigsRequest struct { |
| 59 | + InfraIdentifier string `json:"-"` // Required - from path parameter |
| 60 | + EnvironmentIdentifier string `json:"-"` // Required |
| 61 | + AccountIdentifier string `json:"-"` // Required |
| 62 | + OrgIdentifier string `json:"-"` |
| 63 | + ProjectIdentifier string `json:"-"` |
| 64 | + ConnectorRef string `json:"-"` |
| 65 | + RepoName string `json:"-"` |
| 66 | + Branch string `json:"-"` |
| 67 | + FilePath string `json:"-"` |
| 68 | + CommitMsg string `json:"-"` |
| 69 | + IsNewBranch *bool `json:"-"` |
| 70 | + BaseBranch string `json:"-"` |
| 71 | + IsHarnessCodeRepo *bool `json:"-"` |
| 72 | + MoveConfigType MoveConfigType `json:"-"` // Required - enum: "INLINE_TO_REMOTE" "REMOTE_TO_INLINE" |
| 73 | +} |
| 74 | + |
| 75 | +// MoveInfraConfigsResponse represents the response from the move infrastructure configs API |
| 76 | +type MoveInfraConfigsResponse struct { |
| 77 | + Status string `json:"status"` |
| 78 | + CorrelationId string `json:"correlationId"` |
| 79 | + MetaData any `json:"metaData"` |
| 80 | + |
| 81 | + Data struct { |
| 82 | + Identifier string `json:"identifier"` |
| 83 | + Success bool `json:"success"` |
| 84 | + } `json:"data,omitempty"` |
| 85 | + |
| 86 | + Code string `json:"code,omitempty"` |
| 87 | + Message string `json:"message,omitempty"` |
| 88 | + DetailedMessage string `json:"detailedMessage,omitempty"` |
| 89 | + ResponseMessages []HarnessErrorMessage `json:"responseMessages,omitempty"` |
| 90 | +} |
0 commit comments