Skip to content

Latest commit

 

History

History
158 lines (103 loc) · 6.07 KB

PlansApi.md

File metadata and controls

158 lines (103 loc) · 6.07 KB

\PlansApi

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

Method HTTP request Description
FindPlans Get /plans Retrieve all plans
FindPlansByProject Get /projects/{id}/plans Retrieve all plans visible by the project

FindPlans

PlanList FindPlans(ctx).Categories(categories).Type_(type_).Slug(slug).Include(include).Exclude(exclude).Execute()

Retrieve all plans

Example

package main

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

func main() {
    categories := []openapiclient.FindOrganizationDevicesCategoriesParameterInner{openapiclient.findOrganizationDevices_categories_parameter_inner("compute")} // []FindOrganizationDevicesCategoriesParameterInner | Filter plans by its category (optional)
    type_ := openapiclient.findPlans_type_parameter("standard") // FindPlansTypeParameter | Filter plans by its plan type (optional)
    slug := "c3.small.x86" // string | Filter plans by slug (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)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PlansApi.FindPlans(context.Background()).Categories(categories).Type_(type_).Slug(slug).Include(include).Exclude(exclude).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PlansApi.FindPlans``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `FindPlans`: PlanList
    fmt.Fprintf(os.Stdout, "Response from `PlansApi.FindPlans`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
categories []FindOrganizationDevicesCategoriesParameterInner Filter plans by its category
type_ FindPlansTypeParameter Filter plans by its plan type
slug string Filter plans by slug
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.

Return type

PlanList

Authorization

x_auth_token

HTTP request headers

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

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

FindPlansByProject

PlanList FindPlansByProject(ctx, id).Include(include).Exclude(exclude).Execute()

Retrieve all plans visible by the project

Example

package main

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

func main() {
    id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project 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.PlansApi.FindPlansByProject(context.Background(), id).Include(include).Exclude(exclude).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PlansApi.FindPlansByProject``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `FindPlansByProject`: PlanList
    fmt.Fprintf(os.Stdout, "Response from `PlansApi.FindPlansByProject`: %v\n", resp)
}

Path Parameters

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

Other Parameters

Other parameters are passed through a pointer to a apiFindPlansByProjectRequest 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. |

Return type

PlanList

Authorization

x_auth_token

HTTP request headers

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

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