feat: [AH-1168]: Added replication rule and migration API handlers (#3621)

* [AH-1168]: Updated properties
* [AH-1168]: Updated properties
* [AH-1168]: Updated description and params
* [AH-1168]: Added replication rule and migration API handlers
* [AH-1168]: Updated OpenAPI spec for all CRUDs
This commit is contained in:
Arvind Choudhary 2025-04-04 00:24:42 +00:00 committed by Harness
parent 3c22d6342a
commit 970a9e8a04
4 changed files with 2352 additions and 234 deletions

View File

@ -0,0 +1,93 @@
// Copyright 2023 Harness, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package metadata
import (
"context"
"github.com/harness/gitness/registry/app/api/openapi/contracts/artifact"
)
func (c *APIController) ListReplicationRules(
_ context.Context,
_ artifact.ListReplicationRulesRequestObject,
) (artifact.ListReplicationRulesResponseObject, error) {
// TODO implement me
panic("implement me")
}
func (c *APIController) CreateReplicationRule(
_ context.Context,
_ artifact.CreateReplicationRuleRequestObject,
) (artifact.CreateReplicationRuleResponseObject, error) {
// TODO implement me
panic("implement me")
}
func (c *APIController) DeleteReplicationRule(
_ context.Context,
_ artifact.DeleteReplicationRuleRequestObject,
) (artifact.DeleteReplicationRuleResponseObject, error) {
// TODO implement me
panic("implement me")
}
func (c *APIController) GetReplicationRule(
_ context.Context,
_ artifact.GetReplicationRuleRequestObject,
) (artifact.GetReplicationRuleResponseObject, error) {
// TODO implement me
panic("implement me")
}
func (c *APIController) UpdateReplicationRule(
_ context.Context,
_ artifact.UpdateReplicationRuleRequestObject,
) (artifact.UpdateReplicationRuleResponseObject, error) {
// TODO implement me
panic("implement me")
}
func (c *APIController) ListMigrationImages(
_ context.Context,
_ artifact.ListMigrationImagesRequestObject,
) (artifact.ListMigrationImagesResponseObject, error) {
// TODO implement me
panic("implement me")
}
func (c *APIController) GetMigrationLogsForImage(
_ context.Context,
_ artifact.GetMigrationLogsForImageRequestObject,
) (artifact.GetMigrationLogsForImageResponseObject, error) {
// TODO implement me
panic("implement me")
}
func (c *APIController) StartMigration(
_ context.Context,
_ artifact.StartMigrationRequestObject,
) (artifact.StartMigrationResponseObject, error) {
// TODO implement me
panic("implement me")
}
func (c *APIController) StopMigration(
_ context.Context,
_ artifact.StopMigrationRequestObject,
) (artifact.StopMigrationResponseObject, error) {
// TODO implement me
panic("implement me")
}

View File

@ -24,10 +24,11 @@ servers:
description: Registry
paths:
#Tag: Spaces
/spaces/{space_ref}/registries:
get:
summary: List Registries
description: Lists all the Registries.
summary: List registries
description: Lists all the registries.
operationId: GetAllRegistries
tags:
- Spaces
@ -54,6 +55,300 @@ paths:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
/spaces/{space_ref}/artifacts:
get:
summary: List artifacts
description: Lists all the artifacts
operationId: GetAllArtifacts
tags:
- Spaces
parameters:
- $ref: "#/components/parameters/spaceRefPathParam"
- $ref: "#/components/parameters/RegistryIdentifierParam"
- $ref: "#/components/parameters/pageNumber"
- $ref: "#/components/parameters/pageSize"
- $ref: "#/components/parameters/sortOrder"
- $ref: "#/components/parameters/sortField"
- $ref: "#/components/parameters/searchTerm"
- $ref: "#/components/parameters/latestVersion"
- $ref: "#/components/parameters/packageTypeParam"
responses:
200:
$ref: "#/components/responses/ListArtifactResponse"
400:
$ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthenticated"
403:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
/spaces/{space_ref}/artifact/stats:
get:
summary: Get artifact stats
description: Get artifact stats
operationId: GetArtifactStatsForSpace
tags:
- Spaces
parameters:
- $ref: "#/components/parameters/spaceRefPathParam"
- $ref: "#/components/parameters/fromDateParam"
- $ref: "#/components/parameters/toDateParam"
responses:
200:
$ref: "#/components/responses/ArtifactStatsResponse"
400:
$ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthenticated"
403:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
#Tag: Replication
/replication/rules:
get:
summary: List replication rules
description: List all replication rules
operationId: listReplicationRules
tags:
- Replication
parameters:
- $ref: "#/components/parameters/spaceRefQueryParam"
responses:
200:
$ref: "#/components/responses/ListReplicationRuleResponse"
400:
$ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthenticated"
403:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
post:
summary: Create a replication rule
description: Create a replication rule
operationId: createReplicationRule
tags:
- Replication
parameters:
- $ref: "#/components/parameters/spaceRefQueryParam"
requestBody:
$ref: "#/components/requestBodies/ReplicationRuleRequest"
responses:
200:
$ref: "#/components/responses/ReplicationRuleResponse"
400:
$ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthenticated"
403:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
/replication/rules/{id}:
get:
summary: Get a replication rule
description: Get a replication rule
operationId: getReplicationRule
tags:
- Replication
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
200:
$ref: "#/components/responses/ReplicationRuleResponse"
400:
$ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthenticated"
403:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
put:
summary: Update a replication rule
description: Update a replication rule
operationId: updateReplicationRule
tags:
- Replication
parameters:
- name: id
in: path
required: true
schema:
type: string
requestBody:
$ref: "#/components/requestBodies/ReplicationRuleRequest"
responses:
200:
$ref: "#/components/responses/ReplicationRuleResponse"
400:
$ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthenticated"
403:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
delete:
summary: Delete a replication rule
description: Delete a replication rule
operationId: deleteReplicationRule
tags:
- Replication
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
200:
$ref: "#/components/responses/Success"
400:
$ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthenticated"
403:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
/replication/rules/{id}/migration/start:
post:
summary: Start migration
description: Start migration given an id
operationId: startMigration
tags:
- Replication
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
200:
$ref: "#/components/responses/Success"
400:
$ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthenticated"
403:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
/replication/rules/{id}/migration/stop:
post:
summary: Stop migration
description: Stop migration given an id
operationId: stopMigration
tags:
- Replication
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
200:
$ref: "#/components/responses/Success"
400:
$ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthenticated"
403:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
/replication/rules/{id}/migration/images:
get:
summary: List migration images
description: List migration images given an id
operationId: listMigrationImages
tags:
- Replication
parameters:
- name: id
in: path
required: true
schema:
type: string
- $ref: "#/components/parameters/pageNumber"
- $ref: "#/components/parameters/pageSize"
- $ref: "#/components/parameters/sortOrder"
- $ref: "#/components/parameters/sortField"
responses:
200:
$ref: "#/components/responses/ListMigrationImageResponse"
400:
$ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthenticated"
403:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
/replication/rules/{id}/migration/images/{image_id}/logs:
get:
summary: Get migration logs for an image
operationId: getMigrationLogsForImage
tags:
- Replication
parameters:
- name: id
in: path
required: true
schema:
type: string
- name: image_id
in: path
required: true
schema:
type: string
responses:
200:
$ref: "#/components/responses/PlainTextResponse"
400:
$ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthenticated"
403:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
#Tag: Registries
/registry:
post:
summary: Create Registry.
@ -76,7 +371,6 @@ paths:
$ref: "#/components/responses/Unauthorized"
500:
$ref: "#/components/responses/InternalServerError"
/registry/{registry_ref}:
get:
summary: Returns Registry Details
@ -167,36 +461,6 @@ paths:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
/spaces/{space_ref}/artifacts:
get:
summary: List Artifacts
description: Lists all the Artifacts.
operationId: GetAllArtifacts
tags:
- Spaces
parameters:
- $ref: "#/components/parameters/spaceRefPathParam"
- $ref: "#/components/parameters/RegistryIdentifierParam"
- $ref: "#/components/parameters/pageNumber"
- $ref: "#/components/parameters/pageSize"
- $ref: "#/components/parameters/sortOrder"
- $ref: "#/components/parameters/sortField"
- $ref: "#/components/parameters/searchTerm"
- $ref: "#/components/parameters/latestVersion"
- $ref: "#/components/parameters/packageTypeParam"
responses:
200:
$ref: "#/components/responses/ListArtifactResponse"
400:
$ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthenticated"
403:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
/registry/{registry_ref}/artifacts:
get:
summary: List Artifacts for Registry
@ -225,30 +489,8 @@ paths:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
/spaces/{space_ref}/artifact/stats:
get:
summary: Get Artifact Stats
description: Get Artifact Stats.
operationId: GetArtifactStatsForSpace
tags:
- Spaces
parameters:
- $ref: "#/components/parameters/spaceRefPathParam"
- $ref: "#/components/parameters/fromDateParam"
- $ref: "#/components/parameters/toDateParam"
responses:
200:
$ref: "#/components/responses/ArtifactStatsResponse"
400:
$ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthenticated"
403:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
#Tag: Artifacts
/registry/{registry_ref}/artifact/labels:
get:
summary: List Artifact Labels
@ -495,7 +737,6 @@ paths:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
/registry/{registry_ref}/artifact/{artifact}/version/{version}/files:
get:
summary: Describe Artifact files
@ -525,6 +766,9 @@ paths:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
#Tag: Docker Artifacts
/registry/{registry_ref}/artifact/{artifact}/version/{version}/docker/details:
get:
summary: Describe Docker Artifact Detail
@ -624,6 +868,8 @@ paths:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
#Tag: Helm Artifacts
/registry/{registry_ref}/artifact/{artifact}/version/{version}/helm/details:
get:
summary: Describe Helm Artifact Detail
@ -672,6 +918,8 @@ paths:
$ref: "#/components/responses/NotFound"
500:
$ref: "#/components/responses/InternalServerError"
#Tag: Webhooks
/registry/{registry_ref}/webhooks:
post:
summary: CreateWebhook
@ -850,6 +1098,7 @@ paths:
$ref: "#/components/responses/Unauthorized"
500:
$ref: "#/components/responses/InternalServerError"
components:
requestBodies:
RegistryRequest:
@ -870,6 +1119,12 @@ components:
application/json:
schema:
$ref: "#/components/schemas/WebhookRequest"
ReplicationRuleRequest:
description: request for create and update replication rule
content:
application/json:
schema:
$ref: "#/components/schemas/ReplicationRuleRequest"
responses:
ArtifactStatsResponse:
description: response to get artifact stats response
@ -1160,6 +1415,34 @@ components:
required:
- status
- data
ReplicationRuleResponse:
description: Response for replication rule update
content:
application/json:
schema:
type: object
properties:
status:
$ref: "#/components/schemas/Status"
data:
$ref: "#/components/schemas/ReplicationRule"
required:
- status
- data
ListReplicationRuleResponse:
description: Response for list replication rules
content:
application/json:
schema:
type: object
properties:
status:
$ref: "#/components/schemas/Status"
data:
$ref: "#/components/schemas/ListReplicationRule"
required:
- status
- data
ListWebhooksResponse:
description: response for list webhooks
content:
@ -1188,6 +1471,20 @@ components:
required:
- status
- data
ListMigrationImageResponse:
description: Response for list migration images
content:
application/json:
schema:
type: object
properties:
status:
$ref: "#/components/schemas/Status"
data:
$ref: "#/components/schemas/ListMigrationImage"
required:
- status
- data
ListRegistryArtifactResponse:
description: response for list artifact
content:
@ -1257,7 +1554,174 @@ components:
application/json:
schema:
$ref: '#/components/schemas/Error'
PlainTextResponse:
description: A plain text response
content:
text/plain; charset=utf-8:
schema:
type: string
example: "Hello, world!"
schemas:
ListMigrationImage:
type: object
description: A list of migration images
properties:
pageCount:
type: integer
format: int64
description: The total number of pages
example: 100
itemCount:
type: integer
format: int64
description: The total number of items
example: 1
pageSize:
type: integer
description: The number of items per page
example: 1
pageIndex:
type: integer
description: The current page
format: int64
example: 0
images:
type: array
description: A list of Artifact versions
items:
$ref: "#/components/schemas/MigrationImage"
required:
- pageCount
- itemCount
- pageSize
- pageIndex
- images
MigrationImage:
type: object
properties:
imageId:
type: string
imageTag:
type: string
status:
type: string
progress:
type: integer
MigrationLog:
type: object
properties:
timestamp:
type: string
message:
type: string
ReplicationRule:
type: object
properties:
identifier:
type: string
source:
$ref: "#/components/schemas/ReplicationRegistry"
destination:
$ref: "#/components/schemas/ReplicationRegistry"
sourceType:
type: string
enum:
- Local
- Jfrog
- GCP
destinationType:
type: string
enum:
- Local
- Jfrog
- GCP
allowedPatterns:
type: array
items:
type: string
blockedPatterns:
type: array
items:
type: string
createdAt:
type: string
modifiedAt:
type: string
parentRef:
type: string
required:
- identifier
- source
- destination
- sourceType
- destinationType
- allowedPatterns
- blockedPatterns
- parentRef
- modifiedAt
- createdAt
ReplicationRuleRequest:
type: object
properties:
source:
$ref: "#/components/schemas/ReplicationRegistry"
destination:
$ref: "#/components/schemas/ReplicationRegistry"
sourceType:
type: string
enum:
- Local
- Jfrog
- GCP
destinationType:
type: string
enum:
- Local
- Jfrog
- GCP
allowedPatterns:
type: array
items:
type: string
blockedPatterns:
type: array
items:
type: string
required:
- source
- destination
- sourceType
- destinationType
- allowedPatterns
- blockedPatterns
ReplicationRegistry:
oneOf:
- $ref: "#/components/schemas/LocalReplicationRegistry"
- $ref: "#/components/schemas/JfrogReplicationRegistry"
LocalReplicationRegistry:
type: object
properties:
registryIdentifier:
type: string
required:
- registryIdentifier
JfrogReplicationRegistry:
type: object
properties:
url:
type: string
format: uri
namespace:
type: string
username:
type: string
passwordSecretId:
type: string
passwordSecretSpaceId:
type: string
required:
- url
- namespace
ArtifactStats:
type: object
description: Harness Artifact Stats
@ -1274,6 +1738,40 @@ components:
totalStorageSize:
type: integer
format: int64
ListReplicationRule:
type: object
description: A list of replication rules
properties:
pageCount:
type: integer
format: int64
description: The total number of pages
example: 100
itemCount:
type: integer
format: int64
description: The total number of items
example: 1
pageSize:
type: integer
description: The number of items per page
example: 10
pageIndex:
type: integer
format: int64
description: The current page
example: 0
rules:
type: array
description: A list of Replication Rules
items:
$ref: "#/components/schemas/ReplicationRule"
required:
- pageCount
- itemCount
- pageSize
- pageIndex
- rules
ListRegistry:
type: object
description: A list of Harness Artifact Registries
@ -1789,8 +2287,8 @@ components:
description: Config for python artifact details
properties:
metadata:
type: object
additionalProperties: true
type: object
additionalProperties: true
NpmArtifactDetailConfig:
type: object
description: Config for npm artifact details
@ -2378,7 +2876,10 @@ components:
name: space_ref
in: query
required: false
description: Unique space path
description: >
Unique path identifier for the final space in the branch.
The value can be provided either as a fully URL-encoded path (e.g., `organization%2Fproject`)
or as a plain path ending with a trailing plus sign (`+`) as separator (e.g., `organization/project/+`).
schema:
type: string
packageTypeParam:
@ -2421,7 +2922,10 @@ components:
name: space_ref
in: path
required: true
description: Unique space path.
description: >
Unique path identifier for the final space in the branch.
The value can be provided either as a fully URL-encoded path (e.g., `organization%2Fproject`)
or as a plain path ending with a trailing plus sign (`+`) as separator (e.g., `organization/project/+`).
schema:
type: string
LabelsParam:
@ -2437,7 +2941,10 @@ components:
name: registry_ref
in: path
required: true
description: Unique registry path.
description: >
Unique path identifier for the final registry in the branch.
The value can be provided either as a fully URL-encoded path (e.g., `organization%2Fproject%2Fregistry`)
or as a plain path ending with a trailing plus sign (`+`) as separator (e.g., `organization/project/registry/+`).
schema:
type: string
webhookIdentifierPathParam:

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
// Package artifact provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
package artifact
import (
@ -41,6 +41,34 @@ const (
RegistryTypeVIRTUAL RegistryType = "VIRTUAL"
)
// Defines values for ReplicationRuleDestinationType.
const (
ReplicationRuleDestinationTypeGCP ReplicationRuleDestinationType = "GCP"
ReplicationRuleDestinationTypeJfrog ReplicationRuleDestinationType = "Jfrog"
ReplicationRuleDestinationTypeLocal ReplicationRuleDestinationType = "Local"
)
// Defines values for ReplicationRuleSourceType.
const (
ReplicationRuleSourceTypeGCP ReplicationRuleSourceType = "GCP"
ReplicationRuleSourceTypeJfrog ReplicationRuleSourceType = "Jfrog"
ReplicationRuleSourceTypeLocal ReplicationRuleSourceType = "Local"
)
// Defines values for ReplicationRuleRequestDestinationType.
const (
ReplicationRuleRequestDestinationTypeGCP ReplicationRuleRequestDestinationType = "GCP"
ReplicationRuleRequestDestinationTypeJfrog ReplicationRuleRequestDestinationType = "Jfrog"
ReplicationRuleRequestDestinationTypeLocal ReplicationRuleRequestDestinationType = "Local"
)
// Defines values for ReplicationRuleRequestSourceType.
const (
ReplicationRuleRequestSourceTypeGCP ReplicationRuleRequestSourceType = "GCP"
ReplicationRuleRequestSourceTypeJfrog ReplicationRuleRequestSourceType = "Jfrog"
ReplicationRuleRequestSourceTypeLocal ReplicationRuleRequestSourceType = "Local"
)
// Defines values for SectionType.
const (
SectionTypeINLINE SectionType = "INLINE"
@ -346,6 +374,15 @@ type HelmArtifactManifest struct {
Manifest string `json:"manifest"`
}
// JfrogReplicationRegistry defines model for JfrogReplicationRegistry.
type JfrogReplicationRegistry struct {
Namespace string `json:"namespace"`
PasswordSecretId *string `json:"passwordSecretId,omitempty"`
PasswordSecretSpaceId *string `json:"passwordSecretSpaceId,omitempty"`
Url string `json:"url"`
Username *string `json:"username,omitempty"`
}
// ListArtifact A list of Artifacts
type ListArtifact struct {
// Artifacts A list of Artifact
@ -398,6 +435,24 @@ type ListArtifactVersion struct {
PageSize *int `json:"pageSize,omitempty"`
}
// ListMigrationImage A list of migration images
type ListMigrationImage struct {
// Images A list of Artifact versions
Images []MigrationImage `json:"images"`
// ItemCount The total number of items
ItemCount int64 `json:"itemCount"`
// PageCount The total number of pages
PageCount int64 `json:"pageCount"`
// PageIndex The current page
PageIndex int64 `json:"pageIndex"`
// PageSize The number of items per page
PageSize int `json:"pageSize"`
}
// ListRegistry A list of Harness Artifact Registries
type ListRegistry struct {
// ItemCount The total number of items
@ -434,6 +489,24 @@ type ListRegistryArtifact struct {
PageSize *int `json:"pageSize,omitempty"`
}
// ListReplicationRule A list of replication rules
type ListReplicationRule struct {
// ItemCount The total number of items
ItemCount int64 `json:"itemCount"`
// PageCount The total number of pages
PageCount int64 `json:"pageCount"`
// PageIndex The current page
PageIndex int64 `json:"pageIndex"`
// PageSize The number of items per page
PageSize int `json:"pageSize"`
// Rules A list of Replication Rules
Rules []ReplicationRule `json:"rules"`
}
// ListWebhooks A list of Harness Registries webhooks
type ListWebhooks struct {
// ItemCount The total number of items
@ -470,12 +543,25 @@ type ListWebhooksExecutions struct {
PageSize *int `json:"pageSize,omitempty"`
}
// LocalReplicationRegistry defines model for LocalReplicationRegistry.
type LocalReplicationRegistry struct {
RegistryIdentifier string `json:"registryIdentifier"`
}
// MavenArtifactDetailConfig Config for maven artifact details
type MavenArtifactDetailConfig struct {
ArtifactId *string `json:"artifactId,omitempty"`
GroupId *string `json:"groupId,omitempty"`
}
// MigrationImage defines model for MigrationImage.
type MigrationImage struct {
ImageId *string `json:"imageId,omitempty"`
ImageTag *string `json:"imageTag,omitempty"`
Progress *int `json:"progress,omitempty"`
Status *string `json:"status,omitempty"`
}
// NpmArtifactDetailConfig Config for npm artifact details
type NpmArtifactDetailConfig struct {
Metadata *map[string]interface{} `json:"metadata,omitempty"`
@ -568,6 +654,47 @@ type RegistryRequest struct {
// RegistryType refers to type of registry i.e virtual or upstream
type RegistryType string
// ReplicationRegistry defines model for ReplicationRegistry.
type ReplicationRegistry struct {
union json.RawMessage
}
// ReplicationRule defines model for ReplicationRule.
type ReplicationRule struct {
AllowedPatterns []string `json:"allowedPatterns"`
BlockedPatterns []string `json:"blockedPatterns"`
CreatedAt string `json:"createdAt"`
Destination ReplicationRegistry `json:"destination"`
DestinationType ReplicationRuleDestinationType `json:"destinationType"`
Identifier string `json:"identifier"`
ModifiedAt string `json:"modifiedAt"`
ParentRef string `json:"parentRef"`
Source ReplicationRegistry `json:"source"`
SourceType ReplicationRuleSourceType `json:"sourceType"`
}
// ReplicationRuleDestinationType defines model for ReplicationRule.DestinationType.
type ReplicationRuleDestinationType string
// ReplicationRuleSourceType defines model for ReplicationRule.SourceType.
type ReplicationRuleSourceType string
// ReplicationRuleRequest defines model for ReplicationRuleRequest.
type ReplicationRuleRequest struct {
AllowedPatterns []string `json:"allowedPatterns"`
BlockedPatterns []string `json:"blockedPatterns"`
Destination ReplicationRegistry `json:"destination"`
DestinationType ReplicationRuleRequestDestinationType `json:"destinationType"`
Source ReplicationRegistry `json:"source"`
SourceType ReplicationRuleRequestSourceType `json:"sourceType"`
}
// ReplicationRuleRequestDestinationType defines model for ReplicationRuleRequest.DestinationType.
type ReplicationRuleRequestDestinationType string
// ReplicationRuleRequestSourceType defines model for ReplicationRuleRequest.SourceType.
type ReplicationRuleRequestSourceType string
// SectionType refers to client setup section type
type SectionType string
@ -932,6 +1059,15 @@ type ListArtifactVersionResponse struct {
Status Status `json:"status"`
}
// ListMigrationImageResponse defines model for ListMigrationImageResponse.
type ListMigrationImageResponse struct {
// Data A list of migration images
Data ListMigrationImage `json:"data"`
// Status Indicates if the request was successful or not
Status Status `json:"status"`
}
// ListRegistryArtifactResponse defines model for ListRegistryArtifactResponse.
type ListRegistryArtifactResponse struct {
// Data A list of Artifacts
@ -950,6 +1086,15 @@ type ListRegistryResponse struct {
Status Status `json:"status"`
}
// ListReplicationRuleResponse defines model for ListReplicationRuleResponse.
type ListReplicationRuleResponse struct {
// Data A list of replication rules
Data ListReplicationRule `json:"data"`
// Status Indicates if the request was successful or not
Status Status `json:"status"`
}
// ListWebhooksExecutionResponse defines model for ListWebhooksExecutionResponse.
type ListWebhooksExecutionResponse struct {
// Data A list of Harness Registries webhooks executions
@ -980,6 +1125,14 @@ type RegistryResponse struct {
Status Status `json:"status"`
}
// ReplicationRuleResponse defines model for ReplicationRuleResponse.
type ReplicationRuleResponse struct {
Data ReplicationRule `json:"data"`
// Status Indicates if the request was successful or not
Status Status `json:"status"`
}
// Success defines model for Success.
type Success struct {
// Status Indicates if the request was successful or not
@ -1012,7 +1165,7 @@ type WebhookResponse struct {
// CreateRegistryParams defines parameters for CreateRegistry.
type CreateRegistryParams struct {
// SpaceRef Unique space path
// SpaceRef Unique path identifier for the final space in the branch. The value can be provided either as a fully URL-encoded path (e.g., `organization%2Fproject`) or as a plain path ending with a trailing plus sign (`+`) as separator (e.g., `organization/project/+`).
SpaceRef *SpaceRefQueryParam `form:"space_ref,omitempty" json:"space_ref,omitempty"`
}
@ -1163,6 +1316,33 @@ type ListWebhookExecutionsParams struct {
Size *PageSize `form:"size,omitempty" json:"size,omitempty"`
}
// ListReplicationRulesParams defines parameters for ListReplicationRules.
type ListReplicationRulesParams struct {
// SpaceRef Unique path identifier for the final space in the branch. The value can be provided either as a fully URL-encoded path (e.g., `organization%2Fproject`) or as a plain path ending with a trailing plus sign (`+`) as separator (e.g., `organization/project/+`).
SpaceRef *SpaceRefQueryParam `form:"space_ref,omitempty" json:"space_ref,omitempty"`
}
// CreateReplicationRuleParams defines parameters for CreateReplicationRule.
type CreateReplicationRuleParams struct {
// SpaceRef Unique path identifier for the final space in the branch. The value can be provided either as a fully URL-encoded path (e.g., `organization%2Fproject`) or as a plain path ending with a trailing plus sign (`+`) as separator (e.g., `organization/project/+`).
SpaceRef *SpaceRefQueryParam `form:"space_ref,omitempty" json:"space_ref,omitempty"`
}
// ListMigrationImagesParams defines parameters for ListMigrationImages.
type ListMigrationImagesParams struct {
// Page Current page number
Page *PageNumber `form:"page,omitempty" json:"page,omitempty"`
// Size Number of items per page
Size *PageSize `form:"size,omitempty" json:"size,omitempty"`
// SortOrder sortOrder
SortOrder *SortOrder `form:"sort_order,omitempty" json:"sort_order,omitempty"`
// SortField sortField
SortField *SortField `form:"sort_field,omitempty" json:"sort_field,omitempty"`
}
// GetArtifactStatsForSpaceParams defines parameters for GetArtifactStatsForSpace.
type GetArtifactStatsForSpaceParams struct {
// From Date. Format - MM/DD/YYYY
@ -1244,6 +1424,12 @@ type CreateWebhookJSONRequestBody WebhookRequest
// UpdateWebhookJSONRequestBody defines body for UpdateWebhook for application/json ContentType.
type UpdateWebhookJSONRequestBody WebhookRequest
// CreateReplicationRuleJSONRequestBody defines body for CreateReplicationRule for application/json ContentType.
type CreateReplicationRuleJSONRequestBody ReplicationRuleRequest
// UpdateReplicationRuleJSONRequestBody defines body for UpdateReplicationRule for application/json ContentType.
type UpdateReplicationRuleJSONRequestBody ReplicationRuleRequest
// AsDockerArtifactDetailConfig returns the union data inside the ArtifactDetail as a DockerArtifactDetailConfig
func (t ArtifactDetail) AsDockerArtifactDetailConfig() (DockerArtifactDetailConfig, error) {
var body DockerArtifactDetailConfig
@ -1874,6 +2060,68 @@ func (t *RegistryConfig) UnmarshalJSON(b []byte) error {
return err
}
// AsLocalReplicationRegistry returns the union data inside the ReplicationRegistry as a LocalReplicationRegistry
func (t ReplicationRegistry) AsLocalReplicationRegistry() (LocalReplicationRegistry, error) {
var body LocalReplicationRegistry
err := json.Unmarshal(t.union, &body)
return body, err
}
// FromLocalReplicationRegistry overwrites any union data inside the ReplicationRegistry as the provided LocalReplicationRegistry
func (t *ReplicationRegistry) FromLocalReplicationRegistry(v LocalReplicationRegistry) error {
b, err := json.Marshal(v)
t.union = b
return err
}
// MergeLocalReplicationRegistry performs a merge with any union data inside the ReplicationRegistry, using the provided LocalReplicationRegistry
func (t *ReplicationRegistry) MergeLocalReplicationRegistry(v LocalReplicationRegistry) error {
b, err := json.Marshal(v)
if err != nil {
return err
}
merged, err := runtime.JSONMerge(t.union, b)
t.union = merged
return err
}
// AsJfrogReplicationRegistry returns the union data inside the ReplicationRegistry as a JfrogReplicationRegistry
func (t ReplicationRegistry) AsJfrogReplicationRegistry() (JfrogReplicationRegistry, error) {
var body JfrogReplicationRegistry
err := json.Unmarshal(t.union, &body)
return body, err
}
// FromJfrogReplicationRegistry overwrites any union data inside the ReplicationRegistry as the provided JfrogReplicationRegistry
func (t *ReplicationRegistry) FromJfrogReplicationRegistry(v JfrogReplicationRegistry) error {
b, err := json.Marshal(v)
t.union = b
return err
}
// MergeJfrogReplicationRegistry performs a merge with any union data inside the ReplicationRegistry, using the provided JfrogReplicationRegistry
func (t *ReplicationRegistry) MergeJfrogReplicationRegistry(v JfrogReplicationRegistry) error {
b, err := json.Marshal(v)
if err != nil {
return err
}
merged, err := runtime.JSONMerge(t.union, b)
t.union = merged
return err
}
func (t ReplicationRegistry) MarshalJSON() ([]byte, error) {
b, err := t.union.MarshalJSON()
return b, err
}
func (t *ReplicationRegistry) UnmarshalJSON(b []byte) error {
err := t.union.UnmarshalJSON(b)
return err
}
// AsUserPassword returns the union data inside the UpstreamConfig_Auth as a UserPassword
func (t UpstreamConfig_Auth) AsUserPassword() (UserPassword, error) {
var body UserPassword