mirror of
https://github.com/LukeHagar/developer.sailpoint.com.git
synced 2025-12-09 20:37:47 +00:00
Update to go SDK docs: 15029001030
This commit is contained in:
@@ -65,7 +65,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"encoding/json"
|
||||
"encoding/json"
|
||||
v2025 "github.com/sailpoint-oss/golang-sdk/v2/api_v2025"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
@@ -81,24 +81,23 @@ func main() {
|
||||
"type" : "idn"
|
||||
}`) // ManagedClusterRequest |
|
||||
|
||||
|
||||
var managedClusterRequest v2025.ManagedClusterRequest
|
||||
if err := json.Unmarshal(managedclusterrequest, &managedClusterRequest); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
var managedClusterRequest v2025.ManagedClusterRequest
|
||||
if err := json.Unmarshal(managedclusterrequest, &managedClusterRequest); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V2025.ManagedClustersAPI.CreateManagedCluster(context.Background()).ManagedClusterRequest(managedClusterRequest).Execute()
|
||||
//resp, r, err := apiClient.V2025.ManagedClustersAPI.CreateManagedCluster(context.Background()).ManagedClusterRequest(managedClusterRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `ManagedClustersAPI.CreateManagedCluster``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `CreateManagedCluster`: ManagedCluster
|
||||
fmt.Fprintf(os.Stdout, "Response from `ManagedClustersAPI.CreateManagedCluster`: %v\n", resp)
|
||||
//resp, r, err := apiClient.V2025.ManagedClustersAPI.CreateManagedCluster(context.Background()).ManagedClusterRequest(managedClusterRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `ManagedClustersAPI.CreateManagedCluster``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `CreateManagedCluster`: ManagedCluster
|
||||
fmt.Fprintf(os.Stdout, "Response from `ManagedClustersAPI.CreateManagedCluster`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -146,7 +145,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
|
||||
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
@@ -155,16 +154,17 @@ func main() {
|
||||
id := `2c9180897de347a2017de8859e8c5039` // string | Managed cluster ID. # string | Managed cluster ID.
|
||||
removeClients := false // bool | Flag to determine the need to delete a cluster with clients. (optional) (default to false) # bool | Flag to determine the need to delete a cluster with clients. (optional) (default to false)
|
||||
|
||||
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
r, err := apiClient.V2025.ManagedClustersAPI.DeleteManagedCluster(context.Background(), id).Execute()
|
||||
//r, err := apiClient.V2025.ManagedClustersAPI.DeleteManagedCluster(context.Background(), id).RemoveClients(removeClients).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `ManagedClustersAPI.DeleteManagedCluster``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
//r, err := apiClient.V2025.ManagedClustersAPI.DeleteManagedCluster(context.Background(), id).RemoveClients(removeClients).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `ManagedClustersAPI.DeleteManagedCluster``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
@@ -211,7 +211,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
|
||||
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
@@ -219,18 +219,18 @@ import (
|
||||
func main() {
|
||||
id := `2b838de9-db9b-abcf-e646-d4f274ad4238` // string | ID of managed cluster to get log configuration for. # string | ID of managed cluster to get log configuration for.
|
||||
|
||||
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V2025.ManagedClustersAPI.GetClientLogConfiguration(context.Background(), id).Execute()
|
||||
//resp, r, err := apiClient.V2025.ManagedClustersAPI.GetClientLogConfiguration(context.Background(), id).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `ManagedClustersAPI.GetClientLogConfiguration``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `GetClientLogConfiguration`: ClientLogConfiguration
|
||||
fmt.Fprintf(os.Stdout, "Response from `ManagedClustersAPI.GetClientLogConfiguration`: %v\n", resp)
|
||||
//resp, r, err := apiClient.V2025.ManagedClustersAPI.GetClientLogConfiguration(context.Background(), id).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `ManagedClustersAPI.GetClientLogConfiguration``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `GetClientLogConfiguration`: ClientLogConfiguration
|
||||
fmt.Fprintf(os.Stdout, "Response from `ManagedClustersAPI.GetClientLogConfiguration`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -277,7 +277,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
|
||||
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
@@ -285,18 +285,18 @@ import (
|
||||
func main() {
|
||||
id := `2c9180897de347a2017de8859e8c5039` // string | Managed cluster ID. # string | Managed cluster ID.
|
||||
|
||||
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V2025.ManagedClustersAPI.GetManagedCluster(context.Background(), id).Execute()
|
||||
//resp, r, err := apiClient.V2025.ManagedClustersAPI.GetManagedCluster(context.Background(), id).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `ManagedClustersAPI.GetManagedCluster``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `GetManagedCluster`: ManagedCluster
|
||||
fmt.Fprintf(os.Stdout, "Response from `ManagedClustersAPI.GetManagedCluster`: %v\n", resp)
|
||||
//resp, r, err := apiClient.V2025.ManagedClustersAPI.GetManagedCluster(context.Background(), id).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `ManagedClustersAPI.GetManagedCluster``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `GetManagedCluster`: ManagedCluster
|
||||
fmt.Fprintf(os.Stdout, "Response from `ManagedClustersAPI.GetManagedCluster`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -342,7 +342,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
|
||||
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
@@ -353,18 +353,18 @@ func main() {
|
||||
count := true // bool | If *true* it will populate the *X-Total-Count* response header with the number of results that would be returned if *limit* and *offset* were ignored. Since requesting a total count can have a performance impact, it is recommended not to send **count=true** if that value will not be used. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to false) # bool | If *true* it will populate the *X-Total-Count* response header with the number of results that would be returned if *limit* and *offset* were ignored. Since requesting a total count can have a performance impact, it is recommended not to send **count=true** if that value will not be used. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to false)
|
||||
filters := `operational eq "operation"` // string | Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results) Filtering is supported for the following fields and operators: **operational**: *eq* (optional) # string | Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results) Filtering is supported for the following fields and operators: **operational**: *eq* (optional)
|
||||
|
||||
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V2025.ManagedClustersAPI.GetManagedClusters(context.Background()).Execute()
|
||||
//resp, r, err := apiClient.V2025.ManagedClustersAPI.GetManagedClusters(context.Background()).Offset(offset).Limit(limit).Count(count).Filters(filters).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `ManagedClustersAPI.GetManagedClusters``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `GetManagedClusters`: []ManagedCluster
|
||||
fmt.Fprintf(os.Stdout, "Response from `ManagedClustersAPI.GetManagedClusters`: %v\n", resp)
|
||||
//resp, r, err := apiClient.V2025.ManagedClustersAPI.GetManagedClusters(context.Background()).Offset(offset).Limit(limit).Count(count).Filters(filters).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `ManagedClustersAPI.GetManagedClusters``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `GetManagedClusters`: []ManagedCluster
|
||||
fmt.Fprintf(os.Stdout, "Response from `ManagedClustersAPI.GetManagedClusters`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -412,7 +412,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"encoding/json"
|
||||
"encoding/json"
|
||||
v2025 "github.com/sailpoint-oss/golang-sdk/v2/api_v2025"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
@@ -421,24 +421,23 @@ func main() {
|
||||
id := `2b838de9-db9b-abcf-e646-d4f274ad4238` // string | ID of the managed cluster to update the log configuration for. # string | ID of the managed cluster to update the log configuration for.
|
||||
putclientlogconfigurationrequest := []byte(``) // PutClientLogConfigurationRequest | Client log configuration for the given managed cluster.
|
||||
|
||||
|
||||
var putClientLogConfigurationRequest v2025.PutClientLogConfigurationRequest
|
||||
if err := json.Unmarshal(putclientlogconfigurationrequest, &putClientLogConfigurationRequest); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
var putClientLogConfigurationRequest v2025.PutClientLogConfigurationRequest
|
||||
if err := json.Unmarshal(putclientlogconfigurationrequest, &putClientLogConfigurationRequest); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V2025.ManagedClustersAPI.PutClientLogConfiguration(context.Background(), id).PutClientLogConfigurationRequest(putClientLogConfigurationRequest).Execute()
|
||||
//resp, r, err := apiClient.V2025.ManagedClustersAPI.PutClientLogConfiguration(context.Background(), id).PutClientLogConfigurationRequest(putClientLogConfigurationRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `ManagedClustersAPI.PutClientLogConfiguration``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `PutClientLogConfiguration`: ClientLogConfiguration
|
||||
fmt.Fprintf(os.Stdout, "Response from `ManagedClustersAPI.PutClientLogConfiguration`: %v\n", resp)
|
||||
//resp, r, err := apiClient.V2025.ManagedClustersAPI.PutClientLogConfiguration(context.Background(), id).PutClientLogConfigurationRequest(putClientLogConfigurationRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `ManagedClustersAPI.PutClientLogConfiguration``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `PutClientLogConfiguration`: ClientLogConfiguration
|
||||
fmt.Fprintf(os.Stdout, "Response from `ManagedClustersAPI.PutClientLogConfiguration`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -486,7 +485,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
|
||||
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
@@ -494,18 +493,18 @@ import (
|
||||
func main() {
|
||||
id := `2b838de9-db9b-abcf-e646-d4f274ad4238` // string | ID of managed cluster to trigger manual upgrade. # string | ID of managed cluster to trigger manual upgrade.
|
||||
|
||||
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V2025.ManagedClustersAPI.Update(context.Background(), id).Execute()
|
||||
//resp, r, err := apiClient.V2025.ManagedClustersAPI.Update(context.Background(), id).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `ManagedClustersAPI.Update``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `Update`: ClusterManualUpgrade
|
||||
fmt.Fprintf(os.Stdout, "Response from `ManagedClustersAPI.Update`: %v\n", resp)
|
||||
//resp, r, err := apiClient.V2025.ManagedClustersAPI.Update(context.Background(), id).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `ManagedClustersAPI.Update``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `Update`: ClusterManualUpgrade
|
||||
fmt.Fprintf(os.Stdout, "Response from `ManagedClustersAPI.Update`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -553,7 +552,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"encoding/json"
|
||||
"encoding/json"
|
||||
v2025 "github.com/sailpoint-oss/golang-sdk/v2/api_v2025"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
@@ -562,24 +561,23 @@ func main() {
|
||||
id := `2c9180897de347a2017de8859e8c5039` // string | Managed cluster ID. # string | Managed cluster ID.
|
||||
jsonpatchoperation := []byte(``) // []JsonPatchOperation | JSONPatch payload used to update the object.
|
||||
|
||||
|
||||
var jsonPatchOperation v2025.[]JsonPatchOperation
|
||||
if err := json.Unmarshal(jsonpatchoperation, &jsonPatchOperation); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
var jsonPatchOperation []v2025.JsonPatchOperation
|
||||
if err := json.Unmarshal(jsonpatchoperation, &jsonPatchOperation); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V2025.ManagedClustersAPI.UpdateManagedCluster(context.Background(), id).JsonPatchOperation(jsonPatchOperation).Execute()
|
||||
//resp, r, err := apiClient.V2025.ManagedClustersAPI.UpdateManagedCluster(context.Background(), id).JsonPatchOperation(jsonPatchOperation).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `ManagedClustersAPI.UpdateManagedCluster``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `UpdateManagedCluster`: ManagedCluster
|
||||
fmt.Fprintf(os.Stdout, "Response from `ManagedClustersAPI.UpdateManagedCluster`: %v\n", resp)
|
||||
//resp, r, err := apiClient.V2025.ManagedClustersAPI.UpdateManagedCluster(context.Background(), id).JsonPatchOperation(jsonPatchOperation).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `ManagedClustersAPI.UpdateManagedCluster``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `UpdateManagedCluster`: ManagedCluster
|
||||
fmt.Fprintf(os.Stdout, "Response from `ManagedClustersAPI.UpdateManagedCluster`: %v\n", resp)
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user