Create Cloud Integration
client.MagicCloudNetworking.CloudIntegrations.New(ctx, params) (*CloudIntegrationNewResponse, error)
POST/accounts/{account_id}/magic/cloud/providers
Create a new Cloud Integration (Closed Beta).
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Create Cloud Integration
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/magic_cloud_networking"
"github.com/cloudflare/cloudflare-go/option"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
cloudIntegration, err := client.MagicCloudNetworking.CloudIntegrations.New(context.TODO(), magic_cloud_networking.CloudIntegrationNewParams{
AccountID: cloudflare.F("account_id"),
CloudType: cloudflare.F(magic_cloud_networking.CloudIntegrationNewParamsCloudTypeAws),
FriendlyName: cloudflare.F("friendly_name"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", cloudIntegration.ID)
}
{
"errors": [
{
"code": 1001,
"message": "message",
"documentation_url": "documentation_url",
"meta": {
"l10n_key": "l10n_key",
"loggable_error": "loggable_error",
"template_data": {},
"trace_id": "trace_id"
},
"source": {
"parameter": "parameter",
"parameter_value_index": 0,
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1001,
"message": "message",
"documentation_url": "documentation_url",
"meta": {
"l10n_key": "l10n_key",
"loggable_error": "loggable_error",
"template_data": {},
"trace_id": "trace_id"
},
"source": {
"parameter": "parameter",
"parameter_value_index": 0,
"pointer": "pointer"
}
}
],
"result": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"cloud_type": "AWS",
"friendly_name": "friendly_name",
"last_updated": "last_updated",
"lifecycle_state": "ACTIVE",
"state": "UNSPECIFIED",
"state_v2": "UNSPECIFIED",
"aws_arn": "aws_arn",
"azure_subscription_id": "azure_subscription_id",
"azure_tenant_id": "azure_tenant_id",
"description": "description",
"gcp_project_id": "gcp_project_id",
"gcp_service_account_email": "gcp_service_account_email",
"status": {
"discovery_progress": {
"done": 0,
"total": 0,
"unit": "unit"
},
"discovery_progress_v2": {
"done": 0,
"total": 0,
"unit": "unit"
},
"last_discovery_status": "UNSPECIFIED",
"last_discovery_status_v2": "UNSPECIFIED",
"regions": [
"string"
],
"credentials_good_since": "credentials_good_since",
"credentials_missing_since": "credentials_missing_since",
"credentials_rejected_since": "credentials_rejected_since",
"discovery_message": "discovery_message",
"discovery_message_v2": "discovery_message_v2",
"in_use_by": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"client_type": "MAGIC_WAN_CLOUD_ONRAMP",
"name": "name"
}
],
"last_discovery_completed_at": "last_discovery_completed_at",
"last_discovery_completed_at_v2": "last_discovery_completed_at_v2",
"last_discovery_started_at": "last_discovery_started_at",
"last_discovery_started_at_v2": "last_discovery_started_at_v2",
"last_updated": "last_updated"
}
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 1001,
"message": "message",
"documentation_url": "documentation_url",
"meta": {
"l10n_key": "l10n_key",
"loggable_error": "loggable_error",
"template_data": {},
"trace_id": "trace_id"
},
"source": {
"parameter": "parameter",
"parameter_value_index": 0,
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1001,
"message": "message",
"documentation_url": "documentation_url",
"meta": {
"l10n_key": "l10n_key",
"loggable_error": "loggable_error",
"template_data": {},
"trace_id": "trace_id"
},
"source": {
"parameter": "parameter",
"parameter_value_index": 0,
"pointer": "pointer"
}
}
],
"result": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"cloud_type": "AWS",
"friendly_name": "friendly_name",
"last_updated": "last_updated",
"lifecycle_state": "ACTIVE",
"state": "UNSPECIFIED",
"state_v2": "UNSPECIFIED",
"aws_arn": "aws_arn",
"azure_subscription_id": "azure_subscription_id",
"azure_tenant_id": "azure_tenant_id",
"description": "description",
"gcp_project_id": "gcp_project_id",
"gcp_service_account_email": "gcp_service_account_email",
"status": {
"discovery_progress": {
"done": 0,
"total": 0,
"unit": "unit"
},
"discovery_progress_v2": {
"done": 0,
"total": 0,
"unit": "unit"
},
"last_discovery_status": "UNSPECIFIED",
"last_discovery_status_v2": "UNSPECIFIED",
"regions": [
"string"
],
"credentials_good_since": "credentials_good_since",
"credentials_missing_since": "credentials_missing_since",
"credentials_rejected_since": "credentials_rejected_since",
"discovery_message": "discovery_message",
"discovery_message_v2": "discovery_message_v2",
"in_use_by": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"client_type": "MAGIC_WAN_CLOUD_ONRAMP",
"name": "name"
}
],
"last_discovery_completed_at": "last_discovery_completed_at",
"last_discovery_completed_at_v2": "last_discovery_completed_at_v2",
"last_discovery_started_at": "last_discovery_started_at",
"last_discovery_started_at_v2": "last_discovery_started_at_v2",
"last_updated": "last_updated"
}
},
"success": true
}