ports

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ports contains port management functionality in security portal API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProcessPage

type ProcessPage struct {
	pagination.LinkedPageBase
}

ProcessPage is the page returned by a pager when traversing over a collection of Single Port.

type SinglePort

type SinglePort struct {
	EnablePort string `json:"enable_port" required:"true"`
	IPAddress  string `json:"ip_address,omitempty"`
	NetworkID  string `json:"network_id,omitempty"`
	SubnetID   string `json:"subnet_id,omitempty"`
	MTU        string `json:"mtu,omitempty"`
	Comment    string `json:"comment,omitempty"`
}

SinglePort represents parameters to update a Single Port.

type UpdateOpts

type UpdateOpts struct {
	Port []SinglePort `json:"port" required:"true"`
}

UpdateOpts represents options used to update a port.

func (UpdateOpts) ToPortUpdateMap

func (opts UpdateOpts) ToPortUpdateMap() (map[string]interface{}, error)

ToPortUpdateMap formats a UpdateOpts into an update request.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToPortUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateProcess

type UpdateProcess struct {
	Message   string `json:"message"`
	ProcessID int    `json:"processId"`
	ID        string `json:"-"`
}

UpdateProcess represents the result of a each element in response of port api result.

func (*UpdateProcess) UnmarshalJSON

func (r *UpdateProcess) UnmarshalJSON(b []byte) error

UnmarshalJSON function overrides original functionality, to parse processId as unique identifier of process. Note: ID parameter in each struct must be string, but in api result of process polling API, processId is returned as integer value. This function solves this problem.

type UpdateQueryOpts

type UpdateQueryOpts struct {
	TenantID  string `q:"tenantid"`
	UserToken string `q:"usertoken"`
}

UpdateQueryOpts represents query strings for updating port.

func (UpdateQueryOpts) ToUpdateQuery

func (opts UpdateQueryOpts) ToUpdateQuery() (string, error)

ToUpdateQuery formats a ListOpts into a query string.

type UpdateQueryOptsBuilder

type UpdateQueryOptsBuilder interface {
	ToUpdateQuery() (string, error)
}

UpdateQueryOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a Port.

func Update

func Update(client *eclcloud.ServiceClient,
	serviceType string,
	hostName string,
	opts UpdateOptsBuilder,
	qOpts UpdateQueryOptsBuilder) (r UpdateResult)

Update modifies the attributes of a port.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*UpdateProcess, error)

Extract is a function that accepts a result and extracts a Port resource.

func (UpdateResult) ExtractInto

func (r UpdateResult) ExtractInto(v interface{}) error

Extract interprets any commonResult as a Port if possible.

Directories

Path Synopsis
Package testing contains ports unit tests
Package testing contains ports unit tests

Jump to

Keyboard shortcuts

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