diff --git a/client_generated.go b/client_generated.go index 380c8ce..83ac706 100644 --- a/client_generated.go +++ b/client_generated.go @@ -32,6 +32,7 @@ import ( opensearch "github.com/aiven/go-client-codegen/handler/opensearch" organization "github.com/aiven/go-client-codegen/handler/organization" organizationuser "github.com/aiven/go-client-codegen/handler/organizationuser" + organizationvpc "github.com/aiven/go-client-codegen/handler/organizationvpc" postgresql "github.com/aiven/go-client-codegen/handler/postgresql" privatelink "github.com/aiven/go-client-codegen/handler/privatelink" project "github.com/aiven/go-client-codegen/handler/project" @@ -78,6 +79,7 @@ func newClient(doer doer) Client { OpenSearchHandler: opensearch.NewHandler(doer), OrganizationHandler: organization.NewHandler(doer), OrganizationUserHandler: organizationuser.NewHandler(doer), + OrganizationVpcHandler: organizationvpc.NewHandler(doer), PostgreSQLHandler: postgresql.NewHandler(doer), PrivatelinkHandler: privatelink.NewHandler(doer), ProjectBillingHandler: projectbilling.NewHandler(doer), @@ -119,6 +121,7 @@ type client struct { opensearch.OpenSearchHandler organization.OrganizationHandler organizationuser.OrganizationUserHandler + organizationvpc.OrganizationVpcHandler postgresql.PostgreSQLHandler privatelink.PrivatelinkHandler project.ProjectHandler @@ -158,6 +161,7 @@ type Client interface { opensearch.Handler organization.Handler organizationuser.Handler + organizationvpc.Handler postgresql.Handler privatelink.Handler project.Handler diff --git a/config.yaml b/config.yaml index 17705b7..3da3489 100644 --- a/config.yaml +++ b/config.yaml @@ -218,6 +218,13 @@ OrganizationUser: - OrganizationUserRevokeToken - OrganizationUserTokensList - OrganizationUserUpdate +OrganizationVpc: + - OrganizationVpcCreate + - OrganizationVpcDelete + - OrganizationVpcGet + - OrganizationVpcList + - OrganizationVpcPeeringConnectionCreate + - OrganizationVpcPeeringConnectionDeleteById PostgreSQL: - PGServiceAvailableExtensions - PGServiceQueryStatistics diff --git a/handler/organizationvpc/organizationvpc.go b/handler/organizationvpc/organizationvpc.go new file mode 100644 index 0000000..265e6ee --- /dev/null +++ b/handler/organizationvpc/organizationvpc.go @@ -0,0 +1,411 @@ +// Code generated by Aiven. DO NOT EDIT. + +package organizationvpc + +import ( + "context" + "encoding/json" + "fmt" + "net/url" + "time" +) + +type Handler interface { + // OrganizationVpcCreate create an organization VPC + // POST /v1/organization/{organization_id}/vpcs + // https://api.aiven.io/doc/#tag/Organization_Vpc/operation/OrganizationVpcCreate + OrganizationVpcCreate(ctx context.Context, organizationId string, in *OrganizationVpcCreateIn) (*OrganizationVpcCreateOut, error) + + // OrganizationVpcDelete delete an organization VPC + // DELETE /v1/organization/{organization_id}/vpcs/{organization_vpc_id} + // https://api.aiven.io/doc/#tag/Organization_Vpc/operation/OrganizationVpcDelete + OrganizationVpcDelete(ctx context.Context, organizationId string, organizationVpcId string) (*OrganizationVpcDeleteOut, error) + + // OrganizationVpcGet get a single organization VPC + // GET /v1/organization/{organization_id}/vpcs/{organization_vpc_id} + // https://api.aiven.io/doc/#tag/Organization_Vpc/operation/OrganizationVpcGet + OrganizationVpcGet(ctx context.Context, organizationId string, organizationVpcId string) (*OrganizationVpcGetOut, error) + + // OrganizationVpcList list organization VPCs + // GET /v1/organization/{organization_id}/vpcs + // https://api.aiven.io/doc/#tag/Organization_Vpc/operation/OrganizationVpcList + OrganizationVpcList(ctx context.Context, organizationId string) ([]VpcOut, error) + + // OrganizationVpcPeeringConnectionCreate create a peering connection for an organization VPC + // POST /v1/organization/{organization_id}/vpcs/{organization_vpc_id}/peering-connections + // https://api.aiven.io/doc/#tag/Organization_Vpc/operation/OrganizationVpcPeeringConnectionCreate + OrganizationVpcPeeringConnectionCreate(ctx context.Context, organizationId string, organizationVpcId string, in *OrganizationVpcPeeringConnectionCreateIn) (*OrganizationVpcPeeringConnectionCreateOut, error) + + // OrganizationVpcPeeringConnectionDeleteById delete a peering connection from an organization VPC by peering connection ID + // DELETE /v1/organization/{organization_id}/vpcs/{organization_vpc_id}/peering-connections/{peering_connection_id} + // https://api.aiven.io/doc/#tag/Organization_Vpc/operation/OrganizationVpcPeeringConnectionDeleteById + OrganizationVpcPeeringConnectionDeleteById(ctx context.Context, organizationId string, organizationVpcId string, peeringConnectionId string) (*OrganizationVpcPeeringConnectionDeleteByIdOut, error) +} + +// doer http client +type doer interface { + Do(ctx context.Context, operationID, method, path string, in any, query ...[2]string) ([]byte, error) +} + +func NewHandler(doer doer) OrganizationVpcHandler { + return OrganizationVpcHandler{doer} +} + +type OrganizationVpcHandler struct { + doer doer +} + +func (h *OrganizationVpcHandler) OrganizationVpcCreate(ctx context.Context, organizationId string, in *OrganizationVpcCreateIn) (*OrganizationVpcCreateOut, error) { + path := fmt.Sprintf("/v1/organization/%s/vpcs", url.PathEscape(organizationId)) + b, err := h.doer.Do(ctx, "OrganizationVpcCreate", "POST", path, in) + if err != nil { + return nil, err + } + out := new(OrganizationVpcCreateOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out, nil +} +func (h *OrganizationVpcHandler) OrganizationVpcDelete(ctx context.Context, organizationId string, organizationVpcId string) (*OrganizationVpcDeleteOut, error) { + path := fmt.Sprintf("/v1/organization/%s/vpcs/%s", url.PathEscape(organizationId), url.PathEscape(organizationVpcId)) + b, err := h.doer.Do(ctx, "OrganizationVpcDelete", "DELETE", path, nil) + if err != nil { + return nil, err + } + out := new(OrganizationVpcDeleteOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out, nil +} +func (h *OrganizationVpcHandler) OrganizationVpcGet(ctx context.Context, organizationId string, organizationVpcId string) (*OrganizationVpcGetOut, error) { + path := fmt.Sprintf("/v1/organization/%s/vpcs/%s", url.PathEscape(organizationId), url.PathEscape(organizationVpcId)) + b, err := h.doer.Do(ctx, "OrganizationVpcGet", "GET", path, nil) + if err != nil { + return nil, err + } + out := new(OrganizationVpcGetOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out, nil +} +func (h *OrganizationVpcHandler) OrganizationVpcList(ctx context.Context, organizationId string) ([]VpcOut, error) { + path := fmt.Sprintf("/v1/organization/%s/vpcs", url.PathEscape(organizationId)) + b, err := h.doer.Do(ctx, "OrganizationVpcList", "GET", path, nil) + if err != nil { + return nil, err + } + out := new(organizationVpcListOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out.Vpcs, nil +} +func (h *OrganizationVpcHandler) OrganizationVpcPeeringConnectionCreate(ctx context.Context, organizationId string, organizationVpcId string, in *OrganizationVpcPeeringConnectionCreateIn) (*OrganizationVpcPeeringConnectionCreateOut, error) { + path := fmt.Sprintf("/v1/organization/%s/vpcs/%s/peering-connections", url.PathEscape(organizationId), url.PathEscape(organizationVpcId)) + b, err := h.doer.Do(ctx, "OrganizationVpcPeeringConnectionCreate", "POST", path, in) + if err != nil { + return nil, err + } + out := new(OrganizationVpcPeeringConnectionCreateOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out, nil +} +func (h *OrganizationVpcHandler) OrganizationVpcPeeringConnectionDeleteById(ctx context.Context, organizationId string, organizationVpcId string, peeringConnectionId string) (*OrganizationVpcPeeringConnectionDeleteByIdOut, error) { + path := fmt.Sprintf("/v1/organization/%s/vpcs/%s/peering-connections/%s", url.PathEscape(organizationId), url.PathEscape(organizationVpcId), url.PathEscape(peeringConnectionId)) + b, err := h.doer.Do(ctx, "OrganizationVpcPeeringConnectionDeleteById", "DELETE", path, nil) + if err != nil { + return nil, err + } + out := new(OrganizationVpcPeeringConnectionDeleteByIdOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out, nil +} + +type CloudIn struct { + CloudName string `json:"cloud_name"` // Target cloud + NetworkCidr string `json:"network_cidr"` // IPv4 network range CIDR +} +type CloudOut struct { + CloudName string `json:"cloud_name"` // Target cloud + NetworkCidr string `json:"network_cidr"` // IPv4 network range CIDR +} + +// OrganizationVpcCreateIn OrganizationVpcCreateRequestBody +type OrganizationVpcCreateIn struct { + Clouds []CloudIn `json:"clouds"` // Clouds to create this VPC in + PeeringConnections []PeeringConnectionIn `json:"peering_connections"` // List of peering connection requests for the VPC +} + +// OrganizationVpcCreateOut OrganizationVpcCreateResponse +type OrganizationVpcCreateOut struct { + Clouds []CloudOut `json:"clouds"` // Clouds or clouds to create this VPC in + CreateTime time.Time `json:"create_time"` // VPC creation timestamp + OrganizationId string `json:"organization_id"` // Organization ID + OrganizationVpcId string `json:"organization_vpc_id"` // Project VPC ID + PeeringConnections []PeeringConnectionOut `json:"peering_connections"` // List of peering connections + PendingBuildOnlyPeeringConnections *string `json:"pending_build_only_peering_connections,omitempty"` // VPC rebuild is scheduled + State OrganizationVpcStateType `json:"state"` // Project VPC state + UpdateTime time.Time `json:"update_time"` // Timestamp of last change to VPC +} + +// OrganizationVpcDeleteOut OrganizationVpcDeleteResponse +type OrganizationVpcDeleteOut struct { + Clouds []CloudOut `json:"clouds"` // Clouds or clouds to create this VPC in + CreateTime time.Time `json:"create_time"` // VPC creation timestamp + OrganizationId string `json:"organization_id"` // Organization ID + OrganizationVpcId string `json:"organization_vpc_id"` // Project VPC ID + PeeringConnections []PeeringConnectionOut `json:"peering_connections"` // List of peering connections + PendingBuildOnlyPeeringConnections *string `json:"pending_build_only_peering_connections,omitempty"` // VPC rebuild is scheduled + State OrganizationVpcStateType `json:"state"` // Project VPC state + UpdateTime time.Time `json:"update_time"` // Timestamp of last change to VPC +} + +// OrganizationVpcGetOut OrganizationVpcGetResponse +type OrganizationVpcGetOut struct { + Clouds []CloudOut `json:"clouds"` // Clouds or clouds to create this VPC in + CreateTime time.Time `json:"create_time"` // VPC creation timestamp + OrganizationId string `json:"organization_id"` // Organization ID + OrganizationVpcId string `json:"organization_vpc_id"` // Project VPC ID + PeeringConnections []OrganizationVpcGetPeeringConnectionOut `json:"peering_connections"` // List of peering connections + PendingBuildOnlyPeeringConnections *string `json:"pending_build_only_peering_connections,omitempty"` // VPC rebuild is scheduled + State OrganizationVpcStateType `json:"state"` // Project VPC state + UpdateTime time.Time `json:"update_time"` // Timestamp of last change to VPC +} +type OrganizationVpcGetPeeringConnectionOut struct { + CreateTime time.Time `json:"create_time"` // VPC peering connection creation timestamp + PeerAzureAppId string `json:"peer_azure_app_id"` // Azure app registration id in UUID4 form that is allowed to create a peering to the peer vnet + PeerAzureTenantId string `json:"peer_azure_tenant_id"` // Azure tenant id in UUID4 form + PeerCloudAccount string `json:"peer_cloud_account"` // AWS account ID, GCP project ID, Azure subscription ID of the peered VPC, or string "upcloud" for UpCloud peering connections + PeerRegion *string `json:"peer_region,omitempty"` // The peer VPC's region in AWS clouds. Always null in GCP, Azure, or UpCloud clouds + PeerResourceGroup string `json:"peer_resource_group"` // Azure resource group name of the peered VPC + PeerVpc string `json:"peer_vpc"` // AWS VPC ID, GCP VPC network name, Azure Virtual network name of the peered VPC, or UpCloud VPC ID + PeeringConnectionId *string `json:"peering_connection_id,omitempty"` // VPC peering connection ID + State VpcPeeringConnectionStateType `json:"state"` // Project VPC peering connection state + StateInfo PeeringConnectionStateInfoOut `json:"state_info"` // State-specific help or error information + UpdateTime time.Time `json:"update_time"` // Timestamp of last change to the VPC peering connection + UserPeerNetworkCidrs []string `json:"user_peer_network_cidrs"` // List of private IPv4 ranges to route through the peering connection + VpcPeeringConnectionType VpcPeeringConnectionType `json:"vpc_peering_connection_type"` // Type of network connection from the VPC +} +type OrganizationVpcPeeringConnectionByIdStateType string + +const ( + OrganizationVpcPeeringConnectionByIdStateTypeActive OrganizationVpcPeeringConnectionByIdStateType = "ACTIVE" + OrganizationVpcPeeringConnectionByIdStateTypeApproved OrganizationVpcPeeringConnectionByIdStateType = "APPROVED" + OrganizationVpcPeeringConnectionByIdStateTypeApprovedPeerRequested OrganizationVpcPeeringConnectionByIdStateType = "APPROVED_PEER_REQUESTED" + OrganizationVpcPeeringConnectionByIdStateTypeDeleted OrganizationVpcPeeringConnectionByIdStateType = "DELETED" + OrganizationVpcPeeringConnectionByIdStateTypeDeletedByPeer OrganizationVpcPeeringConnectionByIdStateType = "DELETED_BY_PEER" + OrganizationVpcPeeringConnectionByIdStateTypeDeleting OrganizationVpcPeeringConnectionByIdStateType = "DELETING" + OrganizationVpcPeeringConnectionByIdStateTypeError OrganizationVpcPeeringConnectionByIdStateType = "ERROR" + OrganizationVpcPeeringConnectionByIdStateTypeInvalidSpecification OrganizationVpcPeeringConnectionByIdStateType = "INVALID_SPECIFICATION" + OrganizationVpcPeeringConnectionByIdStateTypePendingPeer OrganizationVpcPeeringConnectionByIdStateType = "PENDING_PEER" + OrganizationVpcPeeringConnectionByIdStateTypeRejectedByPeer OrganizationVpcPeeringConnectionByIdStateType = "REJECTED_BY_PEER" +) + +func OrganizationVpcPeeringConnectionByIdStateTypeChoices() []string { + return []string{"ACTIVE", "APPROVED", "APPROVED_PEER_REQUESTED", "DELETED", "DELETED_BY_PEER", "DELETING", "ERROR", "INVALID_SPECIFICATION", "PENDING_PEER", "REJECTED_BY_PEER"} +} + +// OrganizationVpcPeeringConnectionCreateIn OrganizationVpcPeeringConnectionCreateRequestBody +type OrganizationVpcPeeringConnectionCreateIn struct { + PeerAzureAppId *string `json:"peer_azure_app_id,omitempty"` // Azure app registration id in UUID4 form that is allowed to create a peering to the peer vnet + PeerAzureTenantId *string `json:"peer_azure_tenant_id,omitempty"` // Azure tenant id in UUID4 form + PeerCloudAccount string `json:"peer_cloud_account"` // AWS account ID, GCP project ID, Azure subscription ID of the peered VPC, or string "upcloud" for UpCloud peering connections + PeerRegion *string `json:"peer_region,omitempty"` // The peer VPC's region on AWS. May be omitted or set to null if the peer is in the same region as the Aiven project VPC. Omit or set to null on GCP, Azure, or UpCloud. + PeerResourceGroup *string `json:"peer_resource_group,omitempty"` // Azure resource group name of the peered VPC + PeerVpc string `json:"peer_vpc"` // AWS VPC ID, GCP VPC network name, Azure Virtual network name of the peered VPC, or UpCloud VPC ID + UserPeerNetworkCidrs *[]string `json:"user_peer_network_cidrs,omitempty"` // List of private IPv4 ranges to route through the peering connection +} + +// OrganizationVpcPeeringConnectionCreateOut OrganizationVpcPeeringConnectionCreateResponse +type OrganizationVpcPeeringConnectionCreateOut struct { + CreateTime time.Time `json:"create_time"` // VPC peering connection creation timestamp + PeerAzureAppId string `json:"peer_azure_app_id"` // Azure app registration id in UUID4 form that is allowed to create a peering to the peer vnet + PeerAzureTenantId string `json:"peer_azure_tenant_id"` // Azure tenant id in UUID4 form + PeerCloudAccount string `json:"peer_cloud_account"` // AWS account ID, GCP project ID, Azure subscription ID of the peered VPC, or string "upcloud" for UpCloud peering connections + PeerRegion *string `json:"peer_region,omitempty"` // The peer VPC's region in AWS clouds. Always null in GCP, Azure, or UpCloud clouds + PeerResourceGroup string `json:"peer_resource_group"` // Azure resource group name of the peered VPC + PeerVpc string `json:"peer_vpc"` // AWS VPC ID, GCP VPC network name, Azure Virtual network name of the peered VPC, or UpCloud VPC ID + PeeringConnectionId *string `json:"peering_connection_id,omitempty"` // VPC peering connection ID + State OrganizationVpcPeeringConnectionStateType `json:"state"` // Project VPC peering connection state + StateInfo StateInfoOut `json:"state_info"` // State-specific help or error information + UpdateTime time.Time `json:"update_time"` // Timestamp of last change to the VPC peering connection + UserPeerNetworkCidrs []string `json:"user_peer_network_cidrs"` // List of private IPv4 ranges to route through the peering connection + VpcPeeringConnectionType VpcPeeringConnectionType `json:"vpc_peering_connection_type"` // Type of network connection from the VPC +} + +// OrganizationVpcPeeringConnectionDeleteByIdOut OrganizationVpcPeeringConnectionDeleteByIdResponse +type OrganizationVpcPeeringConnectionDeleteByIdOut struct { + CreateTime time.Time `json:"create_time"` // VPC peering connection creation timestamp + PeerAzureAppId string `json:"peer_azure_app_id"` // Azure app registration id in UUID4 form that is allowed to create a peering to the peer vnet + PeerAzureTenantId string `json:"peer_azure_tenant_id"` // Azure tenant id in UUID4 form + PeerCloudAccount string `json:"peer_cloud_account"` // AWS account ID, GCP project ID, Azure subscription ID of the peered VPC, or string "upcloud" for UpCloud peering connections + PeerRegion *string `json:"peer_region,omitempty"` // The peer VPC's region in AWS clouds. Always null in GCP, Azure, or UpCloud clouds + PeerResourceGroup string `json:"peer_resource_group"` // Azure resource group name of the peered VPC + PeerVpc string `json:"peer_vpc"` // AWS VPC ID, GCP VPC network name, Azure Virtual network name of the peered VPC, or UpCloud VPC ID + PeeringConnectionId *string `json:"peering_connection_id,omitempty"` // VPC peering connection ID + State OrganizationVpcPeeringConnectionByIdStateType `json:"state"` // Project VPC peering connection state + StateInfo StateInfoOut `json:"state_info"` // State-specific help or error information + UpdateTime time.Time `json:"update_time"` // Timestamp of last change to the VPC peering connection + UserPeerNetworkCidrs []string `json:"user_peer_network_cidrs"` // List of private IPv4 ranges to route through the peering connection + VpcPeeringConnectionType VpcPeeringConnectionType `json:"vpc_peering_connection_type"` // Type of network connection from the VPC +} +type OrganizationVpcPeeringConnectionStateType string + +const ( + OrganizationVpcPeeringConnectionStateTypeActive OrganizationVpcPeeringConnectionStateType = "ACTIVE" + OrganizationVpcPeeringConnectionStateTypeApproved OrganizationVpcPeeringConnectionStateType = "APPROVED" + OrganizationVpcPeeringConnectionStateTypeApprovedPeerRequested OrganizationVpcPeeringConnectionStateType = "APPROVED_PEER_REQUESTED" + OrganizationVpcPeeringConnectionStateTypeDeleted OrganizationVpcPeeringConnectionStateType = "DELETED" + OrganizationVpcPeeringConnectionStateTypeDeletedByPeer OrganizationVpcPeeringConnectionStateType = "DELETED_BY_PEER" + OrganizationVpcPeeringConnectionStateTypeDeleting OrganizationVpcPeeringConnectionStateType = "DELETING" + OrganizationVpcPeeringConnectionStateTypeError OrganizationVpcPeeringConnectionStateType = "ERROR" + OrganizationVpcPeeringConnectionStateTypeInvalidSpecification OrganizationVpcPeeringConnectionStateType = "INVALID_SPECIFICATION" + OrganizationVpcPeeringConnectionStateTypePendingPeer OrganizationVpcPeeringConnectionStateType = "PENDING_PEER" + OrganizationVpcPeeringConnectionStateTypeRejectedByPeer OrganizationVpcPeeringConnectionStateType = "REJECTED_BY_PEER" +) + +func OrganizationVpcPeeringConnectionStateTypeChoices() []string { + return []string{"ACTIVE", "APPROVED", "APPROVED_PEER_REQUESTED", "DELETED", "DELETED_BY_PEER", "DELETING", "ERROR", "INVALID_SPECIFICATION", "PENDING_PEER", "REJECTED_BY_PEER"} +} + +type OrganizationVpcStateType string + +const ( + OrganizationVpcStateTypeActive OrganizationVpcStateType = "ACTIVE" + OrganizationVpcStateTypeApproved OrganizationVpcStateType = "APPROVED" + OrganizationVpcStateTypeDeleted OrganizationVpcStateType = "DELETED" + OrganizationVpcStateTypeDeleting OrganizationVpcStateType = "DELETING" +) + +func OrganizationVpcStateTypeChoices() []string { + return []string{"ACTIVE", "APPROVED", "DELETED", "DELETING"} +} + +type PeeringConnectionIn struct { + PeerAzureAppId *string `json:"peer_azure_app_id,omitempty"` // Azure app registration id in UUID4 form that is allowed to create a peering to the peer vnet + PeerAzureTenantId *string `json:"peer_azure_tenant_id,omitempty"` // Azure tenant id in UUID4 form + PeerCloudAccount string `json:"peer_cloud_account"` // AWS account ID, GCP project ID, Azure subscription ID of the peered VPC, or string "upcloud" for UpCloud peering connections + PeerRegion *string `json:"peer_region,omitempty"` // The peer VPC's region on AWS. May be omitted or set to null if the peer is in the same region as the Aiven project VPC. Omit or set to null on GCP, Azure, or UpCloud. + PeerResourceGroup *string `json:"peer_resource_group,omitempty"` // Azure resource group name of the peered VPC + PeerVpc string `json:"peer_vpc"` // AWS VPC ID, GCP VPC network name, Azure Virtual network name of the peered VPC, or UpCloud VPC ID + UserPeerNetworkCidrs *[]string `json:"user_peer_network_cidrs,omitempty"` // List of private IPv4 ranges to route through the peering connection +} +type PeeringConnectionOut struct { + CreateTime time.Time `json:"create_time"` // VPC peering connection creation timestamp + PeerAzureAppId string `json:"peer_azure_app_id"` // Azure app registration id in UUID4 form that is allowed to create a peering to the peer vnet + PeerAzureTenantId string `json:"peer_azure_tenant_id"` // Azure tenant id in UUID4 form + PeerCloudAccount string `json:"peer_cloud_account"` // AWS account ID, GCP project ID, Azure subscription ID of the peered VPC, or string "upcloud" for UpCloud peering connections + PeerRegion *string `json:"peer_region,omitempty"` // The peer VPC's region in AWS clouds. Always null in GCP, Azure, or UpCloud clouds + PeerResourceGroup string `json:"peer_resource_group"` // Azure resource group name of the peered VPC + PeerVpc string `json:"peer_vpc"` // AWS VPC ID, GCP VPC network name, Azure Virtual network name of the peered VPC, or UpCloud VPC ID + PeeringConnectionId *string `json:"peering_connection_id,omitempty"` // VPC peering connection ID + State VpcPeeringConnectionStateType `json:"state"` // Project VPC peering connection state + StateInfo StateInfoOut `json:"state_info"` // State-specific help or error information + UpdateTime time.Time `json:"update_time"` // Timestamp of last change to the VPC peering connection + UserPeerNetworkCidrs []string `json:"user_peer_network_cidrs"` // List of private IPv4 ranges to route through the peering connection + VpcPeeringConnectionType VpcPeeringConnectionType `json:"vpc_peering_connection_type"` // Type of network connection from the VPC +} + +// PeeringConnectionStateInfoOut State-specific help or error information +type PeeringConnectionStateInfoOut struct { + AwsVpcPeeringConnectionId *string `json:"aws_vpc_peering_connection_id,omitempty"` + Message string `json:"message"` // Human-readable information message + Type string `json:"type"` // Type of state information + Warnings []WarningOut `json:"warnings,omitempty"` // List of warnings if any +} + +// StateInfoOut State-specific help or error information +type StateInfoOut struct { + Message string `json:"message"` // Human-readable information message + Type string `json:"type"` // Type of state information + Warnings []WarningOut `json:"warnings,omitempty"` // List of warnings if any +} +type VpcOut struct { + Clouds []CloudOut `json:"clouds"` // Clouds or clouds to create this VPC in + CreateTime time.Time `json:"create_time"` // VPC creation timestamp + OrganizationId string `json:"organization_id"` // Organization ID + OrganizationVpcId string `json:"organization_vpc_id"` // Project VPC ID + State VpcStateType `json:"state"` // Project VPC state + UpdateTime time.Time `json:"update_time"` // Timestamp of last change to VPC +} +type VpcPeeringConnectionStateType string + +const ( + VpcPeeringConnectionStateTypeActive VpcPeeringConnectionStateType = "ACTIVE" + VpcPeeringConnectionStateTypeApproved VpcPeeringConnectionStateType = "APPROVED" + VpcPeeringConnectionStateTypeApprovedPeerRequested VpcPeeringConnectionStateType = "APPROVED_PEER_REQUESTED" + VpcPeeringConnectionStateTypeDeleted VpcPeeringConnectionStateType = "DELETED" + VpcPeeringConnectionStateTypeDeletedByPeer VpcPeeringConnectionStateType = "DELETED_BY_PEER" + VpcPeeringConnectionStateTypeDeleting VpcPeeringConnectionStateType = "DELETING" + VpcPeeringConnectionStateTypeError VpcPeeringConnectionStateType = "ERROR" + VpcPeeringConnectionStateTypeInvalidSpecification VpcPeeringConnectionStateType = "INVALID_SPECIFICATION" + VpcPeeringConnectionStateTypePendingPeer VpcPeeringConnectionStateType = "PENDING_PEER" + VpcPeeringConnectionStateTypeRejectedByPeer VpcPeeringConnectionStateType = "REJECTED_BY_PEER" +) + +func VpcPeeringConnectionStateTypeChoices() []string { + return []string{"ACTIVE", "APPROVED", "APPROVED_PEER_REQUESTED", "DELETED", "DELETED_BY_PEER", "DELETING", "ERROR", "INVALID_SPECIFICATION", "PENDING_PEER", "REJECTED_BY_PEER"} +} + +type VpcPeeringConnectionType string + +const ( + VpcPeeringConnectionTypeAwsTgwVpcAttachment VpcPeeringConnectionType = "aws-tgw-vpc-attachment" + VpcPeeringConnectionTypeAwsVpcPeeringConnection VpcPeeringConnectionType = "aws-vpc-peering-connection" + VpcPeeringConnectionTypeAzureVnetPeering VpcPeeringConnectionType = "azure-vnet-peering" + VpcPeeringConnectionTypeGoogleVpcPeering VpcPeeringConnectionType = "google-vpc-peering" + VpcPeeringConnectionTypeUpcloudVpcPeering VpcPeeringConnectionType = "upcloud-vpc-peering" +) + +func VpcPeeringConnectionTypeChoices() []string { + return []string{"aws-tgw-vpc-attachment", "aws-vpc-peering-connection", "azure-vnet-peering", "google-vpc-peering", "upcloud-vpc-peering"} +} + +type VpcStateType string + +const ( + VpcStateTypeActive VpcStateType = "ACTIVE" + VpcStateTypeApproved VpcStateType = "APPROVED" + VpcStateTypeDeleted VpcStateType = "DELETED" + VpcStateTypeDeleting VpcStateType = "DELETING" +) + +func VpcStateTypeChoices() []string { + return []string{"ACTIVE", "APPROVED", "DELETED", "DELETING"} +} + +type WarningOut struct { + ConflictingAwsAccountId *string `json:"conflicting_aws_account_id,omitempty"` // AWS account id of conflicting VPC + ConflictingAwsVpcId *string `json:"conflicting_aws_vpc_id,omitempty"` // VPC id which is conflicting with the current one + ConflictingAwsVpcPeeringConnectionId *string `json:"conflicting_aws_vpc_peering_connection_id,omitempty"` // AWS VPC connection id which is conflicting with current VPC + Message string `json:"message"` // Warning message to be shown to the user + Type WarningType `json:"type"` // Type of warning +} +type WarningType string + +const ( + WarningTypeOverlappingPeerVpcIpRanges WarningType = "overlapping-peer-vpc-ip-ranges" + WarningTypeUpcloudPeeringInError WarningType = "upcloud-peering-in-error" +) + +func WarningTypeChoices() []string { + return []string{"overlapping-peer-vpc-ip-ranges", "upcloud-peering-in-error"} +} + +// organizationVpcListOut OrganizationVpcListResponse +type organizationVpcListOut struct { + Vpcs []VpcOut `json:"vpcs"` // List of VPCs +} diff --git a/openapi_patch.yaml b/openapi_patch.yaml index 1b58cd1..61cb8c2 100644 --- a/openapi_patch.yaml +++ b/openapi_patch.yaml @@ -15,6 +15,15 @@ paths: components: schemas: + OrganizationVpcGetResponse: + properties: + peering_connections: + items: + properties: + state_info: + properties: + aws_vpc_peering_connection_id: + type: string ServiceKafkaQuotaDescribeResponse: properties: quota: