Skip to content

Latest commit

 

History

History
491 lines (309 loc) · 12.3 KB

PortsApi.md

File metadata and controls

491 lines (309 loc) · 12.3 KB

\PortsApi

All URIs are relative to https://api.equinix.com

Method HTTP request Description
AddToLag Post /fabric/v4/ports/{portId}/physicalPorts/bulk Add to Lag
CreateBulkPort Post /fabric/v4/ports/bulk Create Port
CreatePort Post /fabric/v4/ports Create Port
GetPortByUuid Get /fabric/v4/ports/{portId} Get Port by uuid
GetPorts Get /fabric/v4/ports Get All Ports
GetVlans Get /fabric/v4/ports/{portUuid}/linkProtocols Get Vlans
SearchPorts Post /fabric/v4/ports/search Search ports

AddToLag

AllPhysicalPortsResponse AddToLag(ctx, portId).BulkPhysicalPort(bulkPhysicalPort).Execute()

Add to Lag

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/equinix/equinix-sdk-go/services/fabricv4"
)

func main() {
	portId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID
	bulkPhysicalPort := *openapiclient.NewBulkPhysicalPort() // BulkPhysicalPort | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.PortsApi.AddToLag(context.Background(), portId).BulkPhysicalPort(bulkPhysicalPort).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.AddToLag``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `AddToLag`: AllPhysicalPortsResponse
	fmt.Fprintf(os.Stdout, "Response from `PortsApi.AddToLag`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
portId string Port UUID

Other Parameters

Other parameters are passed through a pointer to a apiAddToLagRequest struct via the builder pattern

Name Type Description Notes

bulkPhysicalPort | BulkPhysicalPort | |

Return type

AllPhysicalPortsResponse

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreateBulkPort

AllPortsResponse CreateBulkPort(ctx).BulkPort(bulkPort).Execute()

Create Port

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/equinix/equinix-sdk-go/services/fabricv4"
)

func main() {
	bulkPort := *openapiclient.NewBulkPort() // BulkPort | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.PortsApi.CreateBulkPort(context.Background()).BulkPort(bulkPort).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.CreateBulkPort``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateBulkPort`: AllPortsResponse
	fmt.Fprintf(os.Stdout, "Response from `PortsApi.CreateBulkPort`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateBulkPortRequest struct via the builder pattern

Name Type Description Notes
bulkPort BulkPort

Return type

AllPortsResponse

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreatePort

PortResponse CreatePort(ctx).Port(port).Execute()

Create Port

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/equinix/equinix-sdk-go/services/fabricv4"
)

func main() {
	port := *openapiclient.NewPort(*openapiclient.NewSimplifiedAccount(), openapiclient.PortType("XF_PORT"), int32(123), openapiclient.PortResponse_physicalPortsType("1000BASE_LX"), openapiclient.PortResponse_connectivitySourceType("COLO"), *openapiclient.NewSimplifiedLocation(), *openapiclient.NewPortEncapsulation(), *openapiclient.NewPortSettings()) // Port | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.PortsApi.CreatePort(context.Background()).Port(port).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.CreatePort``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreatePort`: PortResponse
	fmt.Fprintf(os.Stdout, "Response from `PortsApi.CreatePort`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreatePortRequest struct via the builder pattern

Name Type Description Notes
port Port

Return type

PortResponse

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetPortByUuid

PortResponse GetPortByUuid(ctx, portId).Execute()

Get Port by uuid

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/equinix/equinix-sdk-go/services/fabricv4"
)

func main() {
	portId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.PortsApi.GetPortByUuid(context.Background(), portId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.GetPortByUuid``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetPortByUuid`: PortResponse
	fmt.Fprintf(os.Stdout, "Response from `PortsApi.GetPortByUuid`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
portId string Port UUID

Other Parameters

Other parameters are passed through a pointer to a apiGetPortByUuidRequest struct via the builder pattern

Name Type Description Notes

Return type

PortResponse

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetPorts

AllPortsResponse GetPorts(ctx).Name(name).Execute()

Get All Ports

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/equinix/equinix-sdk-go/services/fabricv4"
)

func main() {
	name := "name_example" // string | port name to be provided if specific port(s) to be retrieved (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.PortsApi.GetPorts(context.Background()).Name(name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.GetPorts``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetPorts`: AllPortsResponse
	fmt.Fprintf(os.Stdout, "Response from `PortsApi.GetPorts`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetPortsRequest struct via the builder pattern

Name Type Description Notes
name string port name to be provided if specific port(s) to be retrieved

Return type

AllPortsResponse

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetVlans

LinkProtocolGetResponse GetVlans(ctx, portUuid).Execute()

Get Vlans

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/equinix/equinix-sdk-go/services/fabricv4"
)

func main() {
	portUuid := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.PortsApi.GetVlans(context.Background(), portUuid).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.GetVlans``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetVlans`: LinkProtocolGetResponse
	fmt.Fprintf(os.Stdout, "Response from `PortsApi.GetVlans`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
portUuid string Port UUID

Other Parameters

Other parameters are passed through a pointer to a apiGetVlansRequest struct via the builder pattern

Name Type Description Notes

Return type

LinkProtocolGetResponse

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SearchPorts

AllPortsResponse SearchPorts(ctx).PortV4SearchRequest(portV4SearchRequest).Execute()

Search ports

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/equinix/equinix-sdk-go/services/fabricv4"
)

func main() {
	portV4SearchRequest := *openapiclient.NewPortV4SearchRequest() // PortV4SearchRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.PortsApi.SearchPorts(context.Background()).PortV4SearchRequest(portV4SearchRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.SearchPorts``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `SearchPorts`: AllPortsResponse
	fmt.Fprintf(os.Stdout, "Response from `PortsApi.SearchPorts`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiSearchPortsRequest struct via the builder pattern

Name Type Description Notes
portV4SearchRequest PortV4SearchRequest

Return type

AllPortsResponse

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]