Files
autoglue/sdk/go/docs/ServersAPI.md
2025-11-02 22:37:41 +00:00

370 lines
10 KiB
Markdown

# \ServersAPI
All URIs are relative to *http://localhost:8080/api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**CreateServer**](ServersAPI.md#CreateServer) | **Post** /servers | Create server (org scoped)
[**DeleteServer**](ServersAPI.md#DeleteServer) | **Delete** /servers/{id} | Delete server (org scoped)
[**GetServer**](ServersAPI.md#GetServer) | **Get** /servers/{id} | Get server by ID (org scoped)
[**ListServers**](ServersAPI.md#ListServers) | **Get** /servers | List servers (org scoped)
[**UpdateServer**](ServersAPI.md#UpdateServer) | **Patch** /servers/{id} | Update server (org scoped)
## CreateServer
> DtoServerResponse CreateServer(ctx).Body(body).XOrgID(xOrgID).Execute()
Create server (org scoped)
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/glueops/autoglue-sdk-go"
)
func main() {
body := *openapiclient.NewDtoCreateServerRequest() // DtoCreateServerRequest | Server payload
xOrgID := "xOrgID_example" // string | Organization UUID (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ServersAPI.CreateServer(context.Background()).Body(body).XOrgID(xOrgID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ServersAPI.CreateServer``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateServer`: DtoServerResponse
fmt.Fprintf(os.Stdout, "Response from `ServersAPI.CreateServer`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiCreateServerRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**DtoCreateServerRequest**](DtoCreateServerRequest.md) | Server payload |
**xOrgID** | **string** | Organization UUID |
### Return type
[**DtoServerResponse**](DtoServerResponse.md)
### Authorization
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## DeleteServer
> string DeleteServer(ctx, id).XOrgID(xOrgID).Execute()
Delete server (org scoped)
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/glueops/autoglue-sdk-go"
)
func main() {
id := "id_example" // string | Server ID (UUID)
xOrgID := "xOrgID_example" // string | Organization UUID (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ServersAPI.DeleteServer(context.Background(), id).XOrgID(xOrgID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ServersAPI.DeleteServer``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteServer`: string
fmt.Fprintf(os.Stdout, "Response from `ServersAPI.DeleteServer`: %v\n", resp)
}
```
### Path Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**id** | **string** | Server ID (UUID) |
### Other Parameters
Other parameters are passed through a pointer to a apiDeleteServerRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**xOrgID** | **string** | Organization UUID |
### Return type
**string**
### Authorization
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## GetServer
> DtoServerResponse GetServer(ctx, id).XOrgID(xOrgID).Execute()
Get server by ID (org scoped)
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/glueops/autoglue-sdk-go"
)
func main() {
id := "id_example" // string | Server ID (UUID)
xOrgID := "xOrgID_example" // string | Organization UUID (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ServersAPI.GetServer(context.Background(), id).XOrgID(xOrgID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ServersAPI.GetServer``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetServer`: DtoServerResponse
fmt.Fprintf(os.Stdout, "Response from `ServersAPI.GetServer`: %v\n", resp)
}
```
### Path Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**id** | **string** | Server ID (UUID) |
### Other Parameters
Other parameters are passed through a pointer to a apiGetServerRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**xOrgID** | **string** | Organization UUID |
### Return type
[**DtoServerResponse**](DtoServerResponse.md)
### Authorization
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## ListServers
> []DtoServerResponse ListServers(ctx).XOrgID(xOrgID).Status(status).Role(role).Execute()
List servers (org scoped)
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/glueops/autoglue-sdk-go"
)
func main() {
xOrgID := "xOrgID_example" // string | Organization UUID (optional)
status := "status_example" // string | Filter by status (pending|provisioning|ready|failed) (optional)
role := "role_example" // string | Filter by role (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ServersAPI.ListServers(context.Background()).XOrgID(xOrgID).Status(status).Role(role).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ServersAPI.ListServers``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListServers`: []DtoServerResponse
fmt.Fprintf(os.Stdout, "Response from `ServersAPI.ListServers`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiListServersRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**xOrgID** | **string** | Organization UUID |
**status** | **string** | Filter by status (pending|provisioning|ready|failed) |
**role** | **string** | Filter by role |
### Return type
[**[]DtoServerResponse**](DtoServerResponse.md)
### Authorization
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## UpdateServer
> DtoServerResponse UpdateServer(ctx, id).Body(body).XOrgID(xOrgID).Execute()
Update server (org scoped)
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/glueops/autoglue-sdk-go"
)
func main() {
id := "id_example" // string | Server ID (UUID)
body := *openapiclient.NewDtoUpdateServerRequest() // DtoUpdateServerRequest | Fields to update
xOrgID := "xOrgID_example" // string | Organization UUID (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ServersAPI.UpdateServer(context.Background(), id).Body(body).XOrgID(xOrgID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ServersAPI.UpdateServer``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateServer`: DtoServerResponse
fmt.Fprintf(os.Stdout, "Response from `ServersAPI.UpdateServer`: %v\n", resp)
}
```
### Path Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**id** | **string** | Server ID (UUID) |
### Other Parameters
Other parameters are passed through a pointer to a apiUpdateServerRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**DtoUpdateServerRequest**](DtoUpdateServerRequest.md) | Fields to update |
**xOrgID** | **string** | Organization UUID |
### Return type
[**DtoServerResponse**](DtoServerResponse.md)
### Authorization
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)