All URIs are relative to https://api.equinix.com/metal/v1
Method | HTTP request | Description |
---|---|---|
CreateProject | Post /projects | Create a project |
CreateProjectInvitation | Post /projects/{project_id}/invitations | Create an invitation for a project |
CreateTransferRequest | Post /projects/{id}/transfers | Create a transfer request |
DeleteProject | Delete /projects/{id} | Delete the project |
FindIPReservationCustomdata | Get /projects/{project_id}/ips/{id}/customdata | Retrieve the custom metadata of an IP Reservation |
FindProjectById | Get /projects/{id} | Retrieve a project |
FindProjectCustomdata | Get /projects/{id}/customdata | Retrieve the custom metadata of a project |
FindProjectInvitations | Get /projects/{project_id}/invitations | Retrieve project invitations |
FindProjectMemberships | Get /projects/{project_id}/memberships | Retrieve project memberships |
FindProjects | Get /projects | Retrieve all projects |
UpdateProject | Put /projects/{id} | Update the project |
Project CreateProject(ctx).ProjectCreateFromRootInput(projectCreateFromRootInput).Include(include).Exclude(exclude).Execute()
Create a project
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1"
)
func main() {
projectCreateFromRootInput := *openapiclient.NewProjectCreateFromRootInput("Name_example") // ProjectCreateFromRootInput | Project to create
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.ProjectsApi.CreateProject(context.Background()).ProjectCreateFromRootInput(projectCreateFromRootInput).Include(include).Exclude(exclude).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.CreateProject``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateProject`: Project
fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.CreateProject`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateProjectRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
projectCreateFromRootInput | ProjectCreateFromRootInput | Project to create | |
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: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Invitation CreateProjectInvitation(ctx, projectId).InvitationInput(invitationInput).Include(include).Execute()
Create an invitation for a project
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1"
)
func main() {
projectId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID
invitationInput := *openapiclient.NewInvitationInput("Invitee_example") // InvitationInput | Invitation to create
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)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ProjectsApi.CreateProjectInvitation(context.Background(), projectId).InvitationInput(invitationInput).Include(include).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.CreateProjectInvitation``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateProjectInvitation`: Invitation
fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.CreateProjectInvitation`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
projectId | string | Project UUID |
Other parameters are passed through a pointer to a apiCreateProjectInvitationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
invitationInput | InvitationInput | Invitation to create | 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. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
TransferRequest CreateTransferRequest(ctx, id).TransferRequestInput(transferRequestInput).Include(include).Execute()
Create a transfer request
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1"
)
func main() {
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | UUID of the project to be transferred
transferRequestInput := *openapiclient.NewTransferRequestInput() // TransferRequestInput | Transfer Request to create
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)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ProjectsApi.CreateTransferRequest(context.Background(), id).TransferRequestInput(transferRequestInput).Include(include).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.CreateTransferRequest``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateTransferRequest`: TransferRequest
fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.CreateTransferRequest`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | UUID of the project to be transferred |
Other parameters are passed through a pointer to a apiCreateTransferRequestRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
transferRequestInput | TransferRequestInput | Transfer Request to create | 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. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteProject(ctx, id).Execute()
Delete the project
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
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.ProjectsApi.DeleteProject(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.DeleteProject``: %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 | Project UUID |
Other parameters are passed through a pointer to a apiDeleteProjectRequest 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]
FindIPReservationCustomdata(ctx, projectId, id).Execute()
Retrieve the custom metadata of an IP Reservation
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1"
)
func main() {
projectId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Ip Reservation UUID
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.ProjectsApi.FindIPReservationCustomdata(context.Background(), projectId, id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.FindIPReservationCustomdata``: %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. | |
projectId | string | Project UUID | |
id | string | Ip Reservation UUID |
Other parameters are passed through a pointer to a apiFindIPReservationCustomdataRequest 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]
Project FindProjectById(ctx, id).Include(include).Exclude(exclude).Execute()
Retrieve a project
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.ProjectsApi.FindProjectById(context.Background(), id).Include(include).Exclude(exclude).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.FindProjectById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FindProjectById`: Project
fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.FindProjectById`: %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 apiFindProjectByIdRequest 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]
FindProjectCustomdata(ctx, id).Execute()
Retrieve the custom metadata of a project
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
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.ProjectsApi.FindProjectCustomdata(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.FindProjectCustomdata``: %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 | Project UUID |
Other parameters are passed through a pointer to a apiFindProjectCustomdataRequest 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]
InvitationList FindProjectInvitations(ctx, projectId).Include(include).Page(page).PerPage(perPage).Execute()
Retrieve project invitations
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1"
)
func main() {
projectId := "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)
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.ProjectsApi.FindProjectInvitations(context.Background(), projectId).Include(include).Page(page).PerPage(perPage).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.FindProjectInvitations``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FindProjectInvitations`: InvitationList
fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.FindProjectInvitations`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
projectId | string | Project UUID |
Other parameters are passed through a pointer to a apiFindProjectInvitationsRequest 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. | 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]
MembershipList FindProjectMemberships(ctx, projectId).Search(search).Include(include).Page(page).PerPage(perPage).Execute()
Retrieve project memberships
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1"
)
func main() {
projectId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID
search := "search_example" // string | Search by member full name, id and email. (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)
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.ProjectsApi.FindProjectMemberships(context.Background(), projectId).Search(search).Include(include).Page(page).PerPage(perPage).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.FindProjectMemberships``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FindProjectMemberships`: MembershipList
fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.FindProjectMemberships`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
projectId | string | Project UUID |
Other parameters are passed through a pointer to a apiFindProjectMembershipsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
search | string | Search by member full name, id and email. | 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. | 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]
ProjectList FindProjects(ctx).Name(name).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute()
Retrieve all projects
FindProjects is a paginated API operation. You can specify page number and per page parameters with Execute
, or to fetch and return all pages of results as a single slice you can call ExecuteWithPagination()
. ExecuteWithPagination()
, while convenient, can significantly increase the overhead of API calls in terms of time, network utilization, and memory. Excludes can make the call more efficient by removing any unneeded nested fields that are included by default. If any of the requests fail, the list of results will be nil and the error returned will represent the failed request.
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1"
)
func main() {
name := "name_example" // string | Filter results by name. (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.ProjectsApi.FindProjects(context.Background()).Name(name).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.FindProjects``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FindProjects`: ProjectList
fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.FindProjects`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiFindProjectsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
name | string | Filter results by name. | |
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]
Project UpdateProject(ctx, id).ProjectUpdateInput(projectUpdateInput).Include(include).Exclude(exclude).Execute()
Update the project
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
projectUpdateInput := *openapiclient.NewProjectUpdateInput() // ProjectUpdateInput | Project to update
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.ProjectsApi.UpdateProject(context.Background(), id).ProjectUpdateInput(projectUpdateInput).Include(include).Exclude(exclude).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.UpdateProject``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateProject`: Project
fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.UpdateProject`: %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 apiUpdateProjectRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
projectUpdateInput | ProjectUpdateInput | Project to update | 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: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]