policy

package
v0.9.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(client *golangsdk.ServiceClient, centralNetworkId, policyId string) error

Types

type ApplyResp

type ApplyResp struct {
	// Request ID.
	RequestId string `json:"request_id"`
	// Central network policy.
	CentralNetworkPolicy CentralNetworkPolicy `json:"central_network_policy"`
	// List of central network policy changes.
	CentralNetworkPolicyChangeSet []ElementChangeEntry `json:"central_network_policy_change_set"`
}

func Apply

func Apply(client *golangsdk.ServiceClient, centralNetworkId, policyId string) (*ApplyResp, error)

Apply applies a central network policy.

type AssociateErInstance

type AssociateErInstance struct {
	// Enterprise router ID.
	EnterpriseRouterId string `json:"enterprise_router_id,omitempty"`
	// Project ID.
	ProjectId string `json:"project_id,omitempty"`
	// Region ID.
	RegionId string `json:"region_id,omitempty"`
}

AssociateErInstance describes an enterprise router instance on a central network.

type AssociateErTable

type AssociateErTable struct {
	// Project ID.
	ProjectId string `json:"project_id,omitempty"`
	// Region ID.
	RegionId string `json:"region_id,omitempty"`
	// Enterprise router ID.
	EnterpriseRouterId string `json:"enterprise_router_id,omitempty"`
	// Enterprise router route table ID.
	EnterpriseRouterTableId string `json:"enterprise_router_table_id,omitempty"`
}

AssociateErTable describes an associated enterprise router route table.

type CentralNetworkPolicy

type CentralNetworkPolicy struct {
	// Instance ID.
	ID string `json:"id"`
	// Time when the resource was created.
	CreatedAt string `json:"created_at"`
	// Account ID.
	DomainId string `json:"domain_id"`
	// Policy status. Value options: AVAILABLE, CANCELING, APPLYING, FAILED, DELETED.
	State string `json:"state"`
	// Central network ID.
	CentralNetworkId string `json:"central_network_id"`
	// Policy document template version.
	DocumentTemplateVersion string `json:"document_template_version"`
	// Whether the policy is applied.
	IsApplied bool `json:"is_applied"`
	// Policy version.
	Version int `json:"version"`
	// Central network policy document.
	Document PolicyDocument `json:"document"`
}

CentralNetworkPolicy is a central network policy.

func Create

type ChangeSetResp

type ChangeSetResp struct {
	// Request ID.
	RequestId string `json:"request_id"`
	// Pagination query information.
	PageInfo PageInfo `json:"page_info"`
	// List of central network policy changes.
	CentralNetworkPolicyChangeSet []ElementChangeEntry `json:"central_network_policy_change_set"`
}

func ListChangeSet

func ListChangeSet(client *golangsdk.ServiceClient, centralNetworkId, policyId string) (*ChangeSetResp, error)

ListChangeSet queries the changes between the current policy and an applied policy.

type CreateOpts

type CreateOpts struct {
	// Central network ID.
	CentralNetworkId string `json:"-" required:"true"`
	// Name of the default central network plane.
	DefaultPlane string `json:"default_plane" required:"true"`
	// List of the central network planes.
	Planes []PlaneDocument `json:"planes" required:"true"`
	// List of the enterprise routers on a central network.
	ErInstances []AssociateErInstance `json:"er_instances,omitempty"`
}

type ElementChangeEntry

type ElementChangeEntry struct {
	// Change operation. Value options: CreateCentralNetworkPlane, DeleteCentralNetworkPlane,
	// UpdateCentralNetworkPlane, CreateCentralNetworkErInstance, DeleteCentralNetworkErInstance,
	// CreateCentralNetworkErConnection, DeleteCentralNetworkErConnection, CreateCentralNetworkErTable,
	// DeleteCentralNetworkErTable, SwitchCentralNetworkErTable.
	OperationId string `json:"operation_id"`
	// Plane to be created.
	CreateCentralNetworkPlane *PlaneChangeDocument `json:"create_central_network_plane"`
	// Original plane.
	OriginalCentralNetworkPlane *PlaneChangeDocument `json:"original_central_network_plane"`
	// Newest plane.
	NewestCentralNetworkPlane *PlaneChangeDocument `json:"newest_central_network_plane"`
	// Plane to be deleted.
	DeleteCentralNetworkPlane *PlaneChangeDocument `json:"delete_central_network_plane"`
	// Enterprise router instance to be created.
	CreateCentralNetworkErInstance *AssociateErInstance `json:"create_central_network_er_instance"`
	// Enterprise router instance to be deleted.
	DeleteCentralNetworkErInstance *AssociateErInstance `json:"delete_central_network_er_instance"`
	// Central network plane name.
	CentralNetworkPlaneName string `json:"central_network_plane_name"`
	// Enterprise router connections to be created.
	CreateCentralNetworkErConnection []AssociateErTable `json:"create_central_network_er_connection"`
	// Enterprise router connections to be deleted.
	DeleteCentralNetworkErConnection []AssociateErTable `json:"delete_central_network_er_connection"`
	// Enterprise router route table to be created.
	CreateCentralNetworkErTable *AssociateErTable `json:"create_central_network_er_table"`
	// Enterprise router route table to be deleted.
	DeleteCentralNetworkErTable *AssociateErTable `json:"delete_central_network_er_table"`
	// Enterprise router route table to be switched.
	SwitchCentralNetworkErTable *SwitchErTableDocument `json:"switch_central_network_er_table"`
}

ElementChangeEntry describes a single change between policies.

type ListOpts

type ListOpts struct {
	// Central network ID.
	CentralNetworkId string `json:"-" required:"true"`
	// Number of records returned on each page. Value range: 1 to 2000.
	Limit int `q:"limit"`
	// ID of the last record on the previous page.
	Marker string `q:"marker"`
	// Keyword for sorting.
	SortKey string `q:"sort_key"`
	// Sorting order. Value options: asc, desc.
	SortDir string `q:"sort_dir"`
	// Filter by resource IDs.
	ID []string `q:"id"`
	// Filter by status. Value options: AVAILABLE, CANCELING, APPLYING, FAILED, DELETED.
	State []string `q:"state"`
	// Filter by whether the policy is applied.
	IsApplied *bool `q:"is_applied"`
	// Filter by version.
	Version []int `q:"version"`
}

type ListPolicyResp

type ListPolicyResp struct {
	// Request ID.
	RequestId string `json:"request_id"`
	// Pagination query information.
	PageInfo PageInfo `json:"page_info"`
	// Central network policy list.
	CentralNetworkPolicies []CentralNetworkPolicy `json:"central_network_policies"`
}

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) (*ListPolicyResp, error)

type PageInfo

type PageInfo struct {
	// Marker of the next page.
	NextMarker string `json:"next_marker"`
	// Marker of the previous page.
	PreviousMarker string `json:"previous_marker"`
	// Number of records in the current page.
	CurrentCount int `json:"current_count"`
}

PageInfo is the pagination information returned by list operations.

type PlaneChangeDocument

type PlaneChangeDocument struct {
	// Plane name.
	Name string `json:"name"`
	// Whether the plane is the default one.
	IsDefault bool `json:"is_default"`
	// Enterprise router route tables associated with the plane.
	AssociateErTables []AssociateErTable `json:"associate_er_tables"`
	// Connections between enterprise routers excluded from the plane.
	ExcludeErConnections [][]AssociateErInstance `json:"exclude_er_connections"`
}

PlaneChangeDocument describes a plane in a change set entry.

type PlaneDocument

type PlaneDocument struct {
	// Central network plane name.
	Name string `json:"name,omitempty"`
	// Enterprise router route tables associated with the central network plane.
	AssociateErTables []AssociateErTable `json:"associate_er_tables,omitempty"`
	// Connections between enterprise routers excluded from the central network plane.
	ExcludeErConnections [][]AssociateErInstance `json:"exclude_er_connections,omitempty"`
}

PlaneDocument describes a central network plane.

type PolicyDocument

type PolicyDocument struct {
	// Name of the default central network plane.
	DefaultPlane string `json:"default_plane"`
	// List of the central network planes.
	Planes []PlaneDocument `json:"planes"`
	// List of the enterprise routers on a central network.
	ErInstances []AssociateErInstance `json:"er_instances"`
}

PolicyDocument is the central network policy document.

type SwitchErTableDocument

type SwitchErTableDocument struct {
	// Project ID.
	ProjectId string `json:"project_id"`
	// Region ID.
	RegionId string `json:"region_id"`
	// Enterprise router ID.
	EnterpriseRouterId string `json:"enterprise_router_id"`
	// Route table ID of the original enterprise router.
	OriginalEnterpriseRouterTableId string `json:"original_enterprise_router_table_id"`
	// Route table ID of the new enterprise router.
	NewEnterpriseRouterTableId string `json:"new_enterprise_router_table_id"`
}

SwitchErTableDocument describes a route table switch.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL