Documentation
¶
Overview ¶
Copyright 2025 Pextra Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 Pextra Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 Pextra Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 Pextra Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 Pextra Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 Pextra Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 Pextra Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 Pextra Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 Pextra Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 Pextra Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 Pextra Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func CreateOrganization(ctx context.Context, c *Client, arg *CreateOrganizationArg) (*CreateOrganizationResponse, *APIError)
- func DeleteOrganizationById(ctx context.Context, c *Client, arg *DeleteOrganizationByIdArg) (*DeleteOrganizationByIdResponse, *APIError)
- func DeleteUserById(ctx context.Context, c *Client, arg *DeleteUserByIdArg) (*DeleteUserByIdResponse, *APIError)
- func GetClusterHardwareById(ctx context.Context, c *Client, arg *GetClusterHardwareByIdArg) (*GetClusterHardwareByIdResponse, *APIError)
- func GetClusterLicensingById(ctx context.Context, c *Client, arg *GetClusterLicensingByIdArg) (*GetClusterLicensingByIdResponse, *APIError)
- func GetInstancesById(ctx context.Context, c *Client, arg *GetInstancesByIdArg) (*GetInstancesByIdResponse, *APIError)
- func GetNodeById(ctx context.Context, c *Client, arg *GetNodeByIdArg) (*GetNodeByIdResponse, *APIError)
- func GetNodeHardwareById(ctx context.Context, c *Client, arg *GetNodeHardwareByIdArg) (*GetNodeHardwareByIdResponse, *APIError)
- func GetNodeLicenseById(ctx context.Context, c *Client, arg *GetNodeByIdArg) (*GetNodeLicenseByIdResponse, *APIError)
- func GetNodePciDevicesById(ctx context.Context, c *Client, arg *GetNodePciDevicesByIdArg) (*GetNodePciDevicesByIdResponse, *APIError)
- func GetNodeStoragePoolsById(ctx context.Context, c *Client, arg *GetNodeStoragePoolsByIdArg) (*GetNodeStoragePoolsByIdResponse, *APIError)
- func GetOrganizationById(ctx context.Context, c *Client, arg *GetOrganizationByIdArg) (*GetOrganizationByIdResponse, *APIError)
- func InvalidateUserSessionsById(ctx context.Context, c *Client, arg *InvalidateUserSessionsByIdArg) (*InvalidateUserSessionsByIdResponse, *APIError)
- func ListImagesByNode(ctx context.Context, c *Client, arg *ListImagesByNodeArg) (*ListImagesByNodeResponse, *APIError)
- func ListOrganizations(ctx context.Context, c *Client, arg *ListOrganizationsArg) (*ListOrganizationsResponse, *APIError)
- func ListUsersInOrganizationById(ctx context.Context, c *Client, arg *ListUsersInOrganizationByIdArg) (*ListUsersInOrganizationByIdResponse, *APIError)
- func PowerInstance(ctx context.Context, c *Client, arg *PowerInstanceArg) (*PowerInstanceResponse, *APIError)
- func RunHealthcheck(ctx context.Context, c *Client, arg *RunHealthcheckArg) (*RunHealthcheckResponse, *APIError)
- type APIError
- type Client
- func (c *Client) Delete(ctx context.Context, path string, query url.Values, out any) *APIError
- func (c *Client) Do(req *http.Request, out any) *APIError
- func (c *Client) ExpandPath(pathTemplate string, params map[string]string) string
- func (c *Client) Get(ctx context.Context, path string, query url.Values, out any) *APIError
- func (c *Client) Post(ctx context.Context, path string, query url.Values, body io.Reader, out any) *APIError
- func (c *Client) Put(ctx context.Context, path string, query url.Values, body io.Reader, out any) *APIError
- type ClusterList
- type CreateOrganizationArg
- type CreateOrganizationResponse
- type DatacenterList
- type DeleteOrganizationByIdArg
- type DeleteOrganizationByIdResponse
- type DeleteUserByIdArg
- type DeleteUserByIdResponse
- type GetClusterHardwareByIdArg
- type GetClusterHardwareByIdResponse
- type GetClusterLicensingByIdArg
- type GetClusterLicensingByIdResponse
- type GetInstancesByIdArg
- type GetInstancesByIdResponse
- type GetNodeByIdArg
- type GetNodeByIdResponse
- type GetNodeHardwareByIdArg
- type GetNodeHardwareByIdResponse
- type GetNodeLicenseByIdArg
- type GetNodeLicenseByIdResponse
- type GetNodePciDevicesByIdArg
- type GetNodePciDevicesByIdResponse
- type GetNodeStoragePoolsByIdArg
- type GetNodeStoragePoolsByIdResponse
- type GetOrganizationByIdArg
- type GetOrganizationByIdResponse
- type ImageList
- type InstanceList
- type InvalidateUserSessionsByIdArg
- type InvalidateUserSessionsByIdResponse
- type ListImagesByNodeArg
- type ListImagesByNodeResponse
- type ListOrganizationsArg
- type ListOrganizationsResponse
- type ListUsersInOrganizationByIdArg
- type ListUsersInOrganizationByIdResponse
- type NodeDetail
- type NodeHardwareCpu
- type NodeHardwareDisk
- type NodeHardwareMemory
- type NodeHardwareUsb
- type NodeList
- type NodePciDevice
- type OrganizationDetail
- type PowerInstanceArg
- type PowerInstanceResponse
- type RunHealthcheckArg
- type RunHealthcheckResponse
- type StoragePoolDetail
- type UserList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrganization ¶
func CreateOrganization(ctx context.Context, c *Client, arg *CreateOrganizationArg) (*CreateOrganizationResponse, *APIError)
func DeleteOrganizationById ¶
func DeleteOrganizationById(ctx context.Context, c *Client, arg *DeleteOrganizationByIdArg) (*DeleteOrganizationByIdResponse, *APIError)
func DeleteUserById ¶
func DeleteUserById(ctx context.Context, c *Client, arg *DeleteUserByIdArg) (*DeleteUserByIdResponse, *APIError)
func GetClusterHardwareById ¶
func GetClusterHardwareById(ctx context.Context, c *Client, arg *GetClusterHardwareByIdArg) (*GetClusterHardwareByIdResponse, *APIError)
func GetClusterLicensingById ¶
func GetClusterLicensingById(ctx context.Context, c *Client, arg *GetClusterLicensingByIdArg) (*GetClusterLicensingByIdResponse, *APIError)
func GetInstancesById ¶
func GetInstancesById(ctx context.Context, c *Client, arg *GetInstancesByIdArg) (*GetInstancesByIdResponse, *APIError)
func GetNodeById ¶
func GetNodeById(ctx context.Context, c *Client, arg *GetNodeByIdArg) (*GetNodeByIdResponse, *APIError)
func GetNodeHardwareById ¶
func GetNodeHardwareById(ctx context.Context, c *Client, arg *GetNodeHardwareByIdArg) (*GetNodeHardwareByIdResponse, *APIError)
func GetNodeLicenseById ¶
func GetNodeLicenseById(ctx context.Context, c *Client, arg *GetNodeByIdArg) (*GetNodeLicenseByIdResponse, *APIError)
func GetNodePciDevicesById ¶
func GetNodePciDevicesById(ctx context.Context, c *Client, arg *GetNodePciDevicesByIdArg) (*GetNodePciDevicesByIdResponse, *APIError)
func GetNodeStoragePoolsById ¶
func GetNodeStoragePoolsById(ctx context.Context, c *Client, arg *GetNodeStoragePoolsByIdArg) (*GetNodeStoragePoolsByIdResponse, *APIError)
func GetOrganizationById ¶
func GetOrganizationById(ctx context.Context, c *Client, arg *GetOrganizationByIdArg) (*GetOrganizationByIdResponse, *APIError)
func InvalidateUserSessionsById ¶
func InvalidateUserSessionsById(ctx context.Context, c *Client, arg *InvalidateUserSessionsByIdArg) (*InvalidateUserSessionsByIdResponse, *APIError)
func ListImagesByNode ¶
func ListImagesByNode(ctx context.Context, c *Client, arg *ListImagesByNodeArg) (*ListImagesByNodeResponse, *APIError)
func ListOrganizations ¶
func ListOrganizations(ctx context.Context, c *Client, arg *ListOrganizationsArg) (*ListOrganizationsResponse, *APIError)
func ListUsersInOrganizationById ¶
func ListUsersInOrganizationById(ctx context.Context, c *Client, arg *ListUsersInOrganizationByIdArg) (*ListUsersInOrganizationByIdResponse, *APIError)
func PowerInstance ¶
func PowerInstance(ctx context.Context, c *Client, arg *PowerInstanceArg) (*PowerInstanceResponse, *APIError)
func RunHealthcheck ¶
func RunHealthcheck(ctx context.Context, c *Client, arg *RunHealthcheckArg) (*RunHealthcheckResponse, *APIError)
Types ¶
type APIError ¶
type APIError struct {
Err error `json:"-"` // not serialized
Status int `json:"code"`
Message string `json:"message"`
}
API error struct.
func NewAPIError ¶
Creates a new APIError with status and message.
func WrapAPIError ¶
Wraps an existing error into an APIError with status and message.
type Client ¶
func NewClient ¶
func NewClient(baseURL string, insecureSkipVerify bool, timeout time.Duration, caCertPath string, customHeaders http.Header) (*Client, error)
Construct a new Client.
func (*Client) Do ¶
Do executes the request and decodes JSON into out if provided. On non-2xx responses it tries to parse an APIError from the body.
func (*Client) ExpandPath ¶
ExpandPath replaces placeholders in the form {name} with the corresponding values from params. Values are url.PathEscaped. Example:
p := client.ExpandPath("/nodes/{node_id}/images", map[string]string{"node_id": id})
client.Get(ctx, p, nil, out)
type ClusterList ¶
type ClusterList struct {
Id string `json:"id"`
OrganizationId string `json:"organization_id"`
DatacenterId string `json:"datacenter_id"`
Name string `json:"name"`
Creation string `json:"creation"`
Description string `json:"description"`
NodeCount int `json:"node_count"`
FaultTolerance int `json:"fault_tolerance"`
Standalone bool `json:"standalone"`
LeaderId string `json:"leader_id"`
HasLeader bool `json:"has_leader"`
}
type CreateOrganizationArg ¶
type CreateOrganizationResponse ¶
type CreateOrganizationResponse = struct {
Id string `json:"id"`
}
type DatacenterList ¶
type DatacenterList struct {
Id string `json:"id"`
OrganizationId string `json:"organization_id"`
Name string `json:"name"`
Location struct {
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
} `json:"location"`
Creation string `json:"creation"`
Description string `json:"description"`
}
type DeleteOrganizationByIdArg ¶
type DeleteOrganizationByIdArg struct {
OrganizationId string
}
type DeleteOrganizationByIdResponse ¶
type DeleteOrganizationByIdResponse = struct{}
type DeleteUserByIdArg ¶
type DeleteUserByIdArg struct {
UserId string
}
type DeleteUserByIdResponse ¶
type DeleteUserByIdResponse struct{}
type GetClusterHardwareByIdArg ¶
type GetClusterHardwareByIdArg struct {
ClusterId string
}
type GetClusterLicensingByIdArg ¶
type GetClusterLicensingByIdArg struct {
ClusterId string
}
type GetInstancesByIdArg ¶
type GetInstancesByIdResponse ¶
type GetInstancesByIdResponse = []InstanceList
type GetNodeByIdArg ¶
type GetNodeByIdArg struct {
NodeId string
}
type GetNodeByIdResponse ¶
type GetNodeByIdResponse struct {
Node NodeDetail `json:"node"`
Instances []InstanceList `json:"instances"`
Hostname string `json:"hostname"`
Os struct {
Kernel string `json:"kernel"`
Architecture string `json:"architecture"`
Uefi bool `json:"uefi"`
} `json:"os"`
Time struct {
Time int64 `json:"time"`
Timezone string `json:"timezone"`
Uptime int64 `json:"uptime"`
} `json:"time"`
PceVersion string `json:"pce_version"`
}
type GetNodeHardwareByIdArg ¶
type GetNodeHardwareByIdArg struct {
NodeId string
}
type GetNodeHardwareByIdResponse ¶
type GetNodeHardwareByIdResponse struct {
Vcpus int `json:"vcpus"`
CPU NodeHardwareCpu `json:"cpu"`
Memory []NodeHardwareMemory `json:"memory"`
Disks []NodeHardwareDisk `json:"disks"`
Usb []NodeHardwareUsb `json:"usb"`
}
type GetNodeLicenseByIdArg ¶
type GetNodeLicenseByIdArg struct {
NodeId string
}
type GetNodePciDevicesByIdArg ¶
type GetNodePciDevicesByIdArg struct {
NodeId string
}
type GetNodePciDevicesByIdResponse ¶
type GetNodePciDevicesByIdResponse = []NodePciDevice
type GetNodeStoragePoolsByIdArg ¶
type GetNodeStoragePoolsByIdArg struct {
NodeId string
}
type GetNodeStoragePoolsByIdResponse ¶
type GetNodeStoragePoolsByIdResponse = []StoragePoolDetail
type GetOrganizationByIdArg ¶
type GetOrganizationByIdArg struct {
OrganizationId string
}
type GetOrganizationByIdResponse ¶
type GetOrganizationByIdResponse = OrganizationDetail
type InstanceList ¶
type InstanceList struct {
Id string `json:"id"`
NodeId string `json:"node_id"`
Type int `json:"type"`
Name string `json:"name"`
Cpu struct {
Sockets int `json:"sockets"`
Cores int `json:"cores"`
Threads int `json:"threads"`
} `json:"cpu"`
Vcpus int `json:"vcpus"`
Memory int `json:"memory"`
Creation string `json:"creation"`
Autostart bool `json:"autostart"`
BootOrder int `json:"boot_order"`
}
type InvalidateUserSessionsByIdResponse ¶
type InvalidateUserSessionsByIdResponse struct{}
type ListImagesByNodeArg ¶
type ListImagesByNodeArg struct {
NodeId string
}
type ListImagesByNodeResponse ¶
type ListImagesByNodeResponse = []ImageList
type ListOrganizationsArg ¶
type ListOrganizationsArg struct{}
type ListOrganizationsResponse ¶
type ListOrganizationsResponse = []OrganizationDetail
type ListUsersInOrganizationByIdArg ¶
type ListUsersInOrganizationByIdArg struct {
OrganizationId string
}
type ListUsersInOrganizationByIdResponse ¶
type ListUsersInOrganizationByIdResponse = []UserList
type NodeDetail ¶
type NodeHardwareCpu ¶
type NodeHardwareCpu struct {
Manufacturer string `json:"manufacturer"`
Brand string `json:"brand"`
Speed struct {
CurrentGHz float64 `json:"current"`
} `json:"speed"`
Governor string `json:"governor"`
Cores struct {
Physical int `json:"physical"`
Performance int `json:"performance"`
Efficiency int `json:"efficiency"`
} `json:"cores"`
Processors int `json:"processors"`
Sockets int `json:"sockets"`
Flags []string `json:"flags"`
VirtualizationSupport bool `json:"virtualization"`
}
type NodeHardwareDisk ¶
type NodeHardwareMemory ¶
type NodeHardwareMemory struct {
Bank int `json:"bank"`
Empty bool `json:"empty"`
Data struct {
Size int `json:"size"`
Type string `json:"type"`
ECC bool `json:"ecc"`
Voltage struct {
Current float64 `json:"current"`
Min float64 `json:"min"`
Max float64 `json:"max"`
} `json:"voltage"`
} `json:"data"`
}
type NodeHardwareUsb ¶
type NodeList ¶
type NodeList struct {
Id string `json:"id"`
OrganizationId string `json:"organization_id"`
ClusterId string `json:"cluster_id"`
Name string `json:"name"`
Description string `json:"description"`
IpAddress string `json:"ip_address"`
WolMac string `json:"wol_mac"`
Creation string `json:"creation"`
Alive bool `json:"alive"`
LastSeen string `json:"last_seen"`
Joining bool `json:"joining"`
}
type NodePciDevice ¶
type NodePciDevice struct {
Slot string `json:"slot"`
Class string `json:"class"`
Vendor string `json:"vendor"`
Device string `json:"device"`
Revision string `json:"revision"`
ProgrammingInterface string `json:"prog_if"`
IOMMUGroup string `json:"iommu_group"`
MarkedForPassthrough bool `json:"marked_for_passthrough"`
}
type OrganizationDetail ¶
type OrganizationDetail struct {
Organization struct {
Id string `json:"id"`
Name string `json:"name"`
Creation string `json:"creation"`
Description string `json:"description"`
} `json:"organization"`
Datacenters []DatacenterList `json:"datacenters"`
Clusters []ClusterList `json:"clusters"`
Nodes []NodeList `json:"nodes"`
}
type PowerInstanceArg ¶
type PowerInstanceArg struct {
InstanceId string
NodeId string
Action enum.InstancePowerAction
}
type PowerInstanceResponse ¶
type PowerInstanceResponse struct {
TaskId string `json:"task_id"`
}
type RunHealthcheckArg ¶
type RunHealthcheckArg struct{}
type RunHealthcheckResponse ¶
type StoragePoolDetail ¶
type StoragePoolDetail struct {
Id string `json:"id"`
Type enum.StoragePoolTypeEnum `json:"type"`
Name string `json:"name"`
Initialized bool `json:"initialized"`
Available bool `json:"available"`
CanHoldImages bool `json:"can_hold_images"`
Usage struct {
CapacityGB float64 `json:"capacity"`
AllocatedGB float64 `json:"allocated"`
AvailableGB float64 `json:"available"`
PercentUsed float64 `json:"percent_used"`
} `json:"usage"`
VolumeCount int `json:"volume_count"`
}
type UserList ¶
type UserList struct {
Id string `json:"id"`
OrganizationId string `json:"organization_id"`
Username string `json:"username"`
Enabled bool `json:"enabled"`
Locked bool `json:"locked"`
Expiry string `json:"expiry"`
Expired bool `json:"expired"`
MfaEnabled bool `json:"mfa_enabled"`
IsRoot bool `json:"is_root"`
LinuxUser string `json:"linux_user"`
Description string `json:"description"`
Creation string `json:"creation"`
}