All URIs are relative to https://api.equinix.com/metal/v1
Method | HTTP request | Description |
---|---|---|
CreateBgpSession | Post /devices/{id}/bgp/sessions | Create a BGP session |
CreateDevice | Post /projects/{id}/devices | Create a device |
CreateIPAssignment | Post /devices/{id}/ips | Create an ip assignment |
DeleteDevice | Delete /devices/{id} | Delete the device |
FindBgpSessions | Get /devices/{id}/bgp/sessions | Retrieve all BGP sessions |
FindDeviceById | Get /devices/{id} | Retrieve a device |
FindDeviceCustomdata | Get /devices/{id}/customdata | Retrieve the custom metadata of an instance |
FindDeviceMetadataByID | Get /devices/{id}/metadata | Retrieve metadata |
FindDeviceUserdataByID | Get /devices/{id}/userdata | Retrieve userdata |
FindIPAssignmentCustomdata | Get /devices/{instance_id}/ips/{id}/customdata | Retrieve the custom metadata of an IP Assignment |
FindIPAssignments | Get /devices/{id}/ips | Retrieve all ip assignments |
FindInstanceBandwidth | Get /devices/{id}/bandwidth | Retrieve an instance bandwidth |
FindOrganizationDevices | Get /organizations/{id}/devices | Retrieve all devices of an organization |
FindProjectDevices | Get /projects/{id}/devices | Retrieve all devices of a project |
FindTraffic | Get /devices/{id}/traffic | Retrieve device traffic |
GetBgpNeighborData | Get /devices/{id}/bgp/neighbors | Retrieve BGP neighbor data for this device |
PerformAction | Post /devices/{id}/actions | Perform an action |
UpdateDevice | Put /devices/{id} | Update the device |
BgpSession CreateBgpSession(ctx, id).BGPSessionInput(bGPSessionInput).Execute()
Create a BGP session
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID
bGPSessionInput := *openapiclient.NewBGPSessionInput() // BGPSessionInput | BGP session to create
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.CreateBgpSession(context.Background(), id).BGPSessionInput(bGPSessionInput).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.CreateBgpSession``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateBgpSession`: BgpSession
fmt.Fprintf(os.Stdout, "Response from `DevicesApi.CreateBgpSession`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Device UUID |
Other parameters are passed through a pointer to a apiCreateBgpSessionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
bGPSessionInput | BGPSessionInput | BGP session to create |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Device CreateDevice(ctx, id).CreateDeviceRequest(createDeviceRequest).Execute()
Create a device
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID
createDeviceRequest := openapiclient.createDevice_request{DeviceCreateInFacilityInput: openapiclient.NewDeviceCreateInFacilityInput([]string{"Facility_example"}, "OperatingSystem_example", "c3.large.x86")} // CreateDeviceRequest | Device to create
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.CreateDevice(context.Background(), id).CreateDeviceRequest(createDeviceRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.CreateDevice``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateDevice`: Device
fmt.Fprintf(os.Stdout, "Response from `DevicesApi.CreateDevice`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Project UUID |
Other parameters are passed through a pointer to a apiCreateDeviceRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
createDeviceRequest | CreateDeviceRequest | Device to create |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
IPAssignment CreateIPAssignment(ctx, id).IPAssignmentInput(iPAssignmentInput).Execute()
Create an ip assignment
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID
iPAssignmentInput := *openapiclient.NewIPAssignmentInput("Address_example") // IPAssignmentInput | IPAssignment to create
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.CreateIPAssignment(context.Background(), id).IPAssignmentInput(iPAssignmentInput).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.CreateIPAssignment``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateIPAssignment`: IPAssignment
fmt.Fprintf(os.Stdout, "Response from `DevicesApi.CreateIPAssignment`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Device UUID |
Other parameters are passed through a pointer to a apiCreateIPAssignmentRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
iPAssignmentInput | IPAssignmentInput | IPAssignment to create |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteDevice(ctx, id).ForceDelete(forceDelete).Execute()
Delete the device
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID
forceDelete := true // bool | Force the deletion of the device, by detaching any storage volume still active. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.DeleteDevice(context.Background(), id).ForceDelete(forceDelete).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.DeleteDevice``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Device UUID |
Other parameters are passed through a pointer to a apiDeleteDeviceRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
forceDelete | bool | Force the deletion of the device, by detaching any storage volume still active. |
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BgpSessionList FindBgpSessions(ctx, id).Execute()
Retrieve all BGP sessions
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.FindBgpSessions(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindBgpSessions``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FindBgpSessions`: BgpSessionList
fmt.Fprintf(os.Stdout, "Response from `DevicesApi.FindBgpSessions`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Device UUID |
Other parameters are passed through a pointer to a apiFindBgpSessionsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Device FindDeviceById(ctx, id).Include(include).Exclude(exclude).Execute()
Retrieve a device
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID
include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional)
exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.FindDeviceById(context.Background(), id).Include(include).Exclude(exclude).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindDeviceById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FindDeviceById`: Device
fmt.Fprintf(os.Stdout, "Response from `DevicesApi.FindDeviceById`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Device UUID |
Other parameters are passed through a pointer to a apiFindDeviceByIdRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
include | []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | exclude | []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FindDeviceCustomdata(ctx, id).Execute()
Retrieve the custom metadata of an instance
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Instance UUID
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.FindDeviceCustomdata(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindDeviceCustomdata``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Instance UUID |
Other parameters are passed through a pointer to a apiFindDeviceCustomdataRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Metadata FindDeviceMetadataByID(ctx, id).Execute()
Retrieve metadata
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.FindDeviceMetadataByID(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindDeviceMetadataByID``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FindDeviceMetadataByID`: Metadata
fmt.Fprintf(os.Stdout, "Response from `DevicesApi.FindDeviceMetadataByID`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Device UUID |
Other parameters are passed through a pointer to a apiFindDeviceMetadataByIDRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Userdata FindDeviceUserdataByID(ctx, id).Execute()
Retrieve userdata
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.FindDeviceUserdataByID(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindDeviceUserdataByID``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FindDeviceUserdataByID`: Userdata
fmt.Fprintf(os.Stdout, "Response from `DevicesApi.FindDeviceUserdataByID`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Device UUID |
Other parameters are passed through a pointer to a apiFindDeviceUserdataByIDRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FindIPAssignmentCustomdata(ctx, instanceId, id).Execute()
Retrieve the custom metadata of an IP Assignment
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
instanceId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Instance UUID
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Ip Assignment UUID
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.FindIPAssignmentCustomdata(context.Background(), instanceId, id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindIPAssignmentCustomdata``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
instanceId | string | Instance UUID | |
id | string | Ip Assignment UUID |
Other parameters are passed through a pointer to a apiFindIPAssignmentCustomdataRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
IPAssignmentList FindIPAssignments(ctx, id).Include(include).Exclude(exclude).Execute()
Retrieve all ip assignments
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID
include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional)
exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.FindIPAssignments(context.Background(), id).Include(include).Exclude(exclude).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindIPAssignments``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FindIPAssignments`: IPAssignmentList
fmt.Fprintf(os.Stdout, "Response from `DevicesApi.FindIPAssignments`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Device UUID |
Other parameters are passed through a pointer to a apiFindIPAssignmentsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
include | []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | exclude | []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FindInstanceBandwidth(ctx, id).From(from).Until(until).Execute()
Retrieve an instance bandwidth
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID
from := "from_example" // string | Timestamp from range
until := "until_example" // string | Timestamp to range
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.FindInstanceBandwidth(context.Background(), id).From(from).Until(until).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindInstanceBandwidth``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Device UUID |
Other parameters are passed through a pointer to a apiFindInstanceBandwidthRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
from | string | Timestamp from range | until | string | Timestamp to range |
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeviceList FindOrganizationDevices(ctx, id).Facility(facility).Hostname(hostname).Reserved(reserved).Tag(tag).Type_(type_).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute()
Retrieve all devices of an organization
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID
facility := "facility_example" // string | Filter by device facility (optional)
hostname := "hostname_example" // string | Filter by partial hostname (optional)
reserved := true // bool | Filter only reserved instances (optional)
tag := "tag_example" // string | Filter by device tag (optional)
type_ := "type__example" // string | Filter by instance type (ondemand,spot,reserved) (optional)
include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional)
exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional)
page := int32(56) // int32 | Page to return (optional) (default to 1)
perPage := int32(56) // int32 | Items returned per page (optional) (default to 10)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.FindOrganizationDevices(context.Background(), id).Facility(facility).Hostname(hostname).Reserved(reserved).Tag(tag).Type_(type_).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindOrganizationDevices``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FindOrganizationDevices`: DeviceList
fmt.Fprintf(os.Stdout, "Response from `DevicesApi.FindOrganizationDevices`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Organization UUID |
Other parameters are passed through a pointer to a apiFindOrganizationDevicesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
facility | string | Filter by device facility | hostname | string | Filter by partial hostname | reserved | bool | Filter only reserved instances | tag | string | Filter by device tag | type_ | string | Filter by instance type (ondemand,spot,reserved) | include | []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | exclude | []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | page | int32 | Page to return | [default to 1] perPage | int32 | Items returned per page | [default to 10]
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeviceList FindProjectDevices(ctx, id).Facility(facility).Hostname(hostname).Reserved(reserved).Tag(tag).Type_(type_).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute()
Retrieve all devices of a project
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID
facility := "facility_example" // string | Filter by device facility (optional)
hostname := "hostname_example" // string | Filter by partial hostname (optional)
reserved := true // bool | Filter only reserved instances (optional)
tag := "tag_example" // string | Filter by device tag (optional)
type_ := "type__example" // string | Filter by instance type (ondemand,spot,reserved) (optional)
include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional)
exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional)
page := int32(56) // int32 | Page to return (optional) (default to 1)
perPage := int32(56) // int32 | Items returned per page (optional) (default to 10)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.FindProjectDevices(context.Background(), id).Facility(facility).Hostname(hostname).Reserved(reserved).Tag(tag).Type_(type_).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindProjectDevices``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FindProjectDevices`: DeviceList
fmt.Fprintf(os.Stdout, "Response from `DevicesApi.FindProjectDevices`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Project UUID |
Other parameters are passed through a pointer to a apiFindProjectDevicesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
facility | string | Filter by device facility | hostname | string | Filter by partial hostname | reserved | bool | Filter only reserved instances | tag | string | Filter by device tag | type_ | string | Filter by instance type (ondemand,spot,reserved) | include | []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | exclude | []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | page | int32 | Page to return | [default to 1] perPage | int32 | Items returned per page | [default to 10]
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FindTraffic(ctx, id).Direction(direction).Interval(interval).Bucket(bucket).Timeframe(timeframe).Execute()
Retrieve device traffic
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID
direction := "direction_example" // string | Traffic direction
interval := "interval_example" // string | Traffic interval (optional)
bucket := "bucket_example" // string | Traffic bucket (optional)
timeframe := map[string][]openapiclient.FindTrafficTimeframeParameter{"key": map[string]interface{}{ ... }} // FindTrafficTimeframeParameter | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.FindTraffic(context.Background(), id).Direction(direction).Interval(interval).Bucket(bucket).Timeframe(timeframe).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindTraffic``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Device UUID |
Other parameters are passed through a pointer to a apiFindTrafficRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
direction | string | Traffic direction | interval | string | Traffic interval | bucket | string | Traffic bucket | timeframe | FindTrafficTimeframeParameter | |
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BgpSessionNeighbors GetBgpNeighborData(ctx, id).Execute()
Retrieve BGP neighbor data for this device
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.GetBgpNeighborData(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.GetBgpNeighborData``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetBgpNeighborData`: BgpSessionNeighbors
fmt.Fprintf(os.Stdout, "Response from `DevicesApi.GetBgpNeighborData`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Device UUID |
Other parameters are passed through a pointer to a apiGetBgpNeighborDataRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PerformAction(ctx, id).DeviceActionInput(deviceActionInput).Execute()
Perform an action
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID
deviceActionInput := *openapiclient.NewDeviceActionInput("Type_example") // DeviceActionInput | Action to perform
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.PerformAction(context.Background(), id).DeviceActionInput(deviceActionInput).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.PerformAction``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Device UUID |
Other parameters are passed through a pointer to a apiPerformActionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
deviceActionInput | DeviceActionInput | Action to perform |
(empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Device UpdateDevice(ctx, id).DeviceUpdateInput(deviceUpdateInput).Execute()
Update the device
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID
deviceUpdateInput := *openapiclient.NewDeviceUpdateInput() // DeviceUpdateInput | Facility to update
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DevicesApi.UpdateDevice(context.Background(), id).DeviceUpdateInput(deviceUpdateInput).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.UpdateDevice``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateDevice`: Device
fmt.Fprintf(os.Stdout, "Response from `DevicesApi.UpdateDevice`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Device UUID |
Other parameters are passed through a pointer to a apiUpdateDeviceRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
deviceUpdateInput | DeviceUpdateInput | Facility to update |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]