Skip to content
Start here

Get an AI Gateway Dynamic Route Version.

client.AIGateway.DynamicRouting.GetVersion(ctx, gatewayID, id, versionID, query) (*DynamicRoutingGetVersionResponse, error)
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions/{version_id}

Get an AI Gateway Dynamic Route Version.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
AI Gateway WriteAI Gateway Read
ParametersExpand Collapse
gatewayID string
id string
versionID string
query DynamicRoutingGetVersionParams
AccountID param.Field[string]
ReturnsExpand Collapse
type DynamicRoutingGetVersionResponse struct{…}
ID string
Active DynamicRoutingGetVersionResponseActive
One of the following:
const DynamicRoutingGetVersionResponseActiveTrue DynamicRoutingGetVersionResponseActive = "true"
const DynamicRoutingGetVersionResponseActiveFalse DynamicRoutingGetVersionResponseActive = "false"
CreatedAt string
Data string
Elements []DynamicRoutingGetVersionResponseElement
One of the following:
type DynamicRoutingGetVersionResponseElementsObject struct{…}
ID string
Outputs DynamicRoutingGetVersionResponseElementsObjectOutputs
Type DynamicRoutingGetVersionResponseElementsObjectType
type DynamicRoutingGetVersionResponseElementsObject struct{…}
ID string
Outputs DynamicRoutingGetVersionResponseElementsObjectOutputs
False DynamicRoutingGetVersionResponseElementsObjectOutputsFalse
ElementID string
True DynamicRoutingGetVersionResponseElementsObjectOutputsTrue
ElementID string
Properties DynamicRoutingGetVersionResponseElementsObjectProperties
Conditions unknownoptional
Type DynamicRoutingGetVersionResponseElementsObjectType
type DynamicRoutingGetVersionResponseElementsObject struct{…}
ID string
Outputs map[string, DynamicRoutingGetVersionResponseElementsObjectOutput]
ElementID string
Type DynamicRoutingGetVersionResponseElementsObjectType
type DynamicRoutingGetVersionResponseElementsObject struct{…}
ID string
Outputs DynamicRoutingGetVersionResponseElementsObjectOutputs
Fallback DynamicRoutingGetVersionResponseElementsObjectOutputsFallback
ElementID string
Success DynamicRoutingGetVersionResponseElementsObjectOutputsSuccess
ElementID string
Properties DynamicRoutingGetVersionResponseElementsObjectProperties
Key string
Limit float64
LimitType DynamicRoutingGetVersionResponseElementsObjectPropertiesLimitType
One of the following:
const DynamicRoutingGetVersionResponseElementsObjectPropertiesLimitTypeCount DynamicRoutingGetVersionResponseElementsObjectPropertiesLimitType = "count"
const DynamicRoutingGetVersionResponseElementsObjectPropertiesLimitTypeCost DynamicRoutingGetVersionResponseElementsObjectPropertiesLimitType = "cost"
Window float64
Type DynamicRoutingGetVersionResponseElementsObjectType
type DynamicRoutingGetVersionResponseElementsObject struct{…}
ID string
Outputs DynamicRoutingGetVersionResponseElementsObjectOutputs
Fallback DynamicRoutingGetVersionResponseElementsObjectOutputsFallback
ElementID string
Success DynamicRoutingGetVersionResponseElementsObjectOutputsSuccess
ElementID string
Properties DynamicRoutingGetVersionResponseElementsObjectProperties
Model string
Provider string
Retries float64
Timeout float64
Type DynamicRoutingGetVersionResponseElementsObjectType
type DynamicRoutingGetVersionResponseElementsObject struct{…}
ID string
Outputs map[string, DynamicRoutingGetVersionResponseElementsObjectOutput]
ElementID string
Type DynamicRoutingGetVersionResponseElementsObjectType
GatewayID string
ModifiedAt Time
formatdate-time
Name string
VersionID string

Get an AI Gateway Dynamic Route Version.

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/ai_gateway"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.AIGateway.DynamicRouting.GetVersion(
    context.TODO(),
    "54442216",
    "54442216",
    "54442216",
    ai_gateway.DynamicRoutingGetVersionParams{
      AccountID: cloudflare.F("0d37909e38d3e99c29fa2cd343ac421a"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.ID)
}
{
  "result": {
    "id": "id",
    "active": "true",
    "created_at": "created_at",
    "data": "data",
    "elements": [
      {
        "id": "id",
        "outputs": {
          "next": {
            "elementId": "elementId"
          }
        },
        "type": "start"
      }
    ],
    "gateway_id": "gateway_id",
    "modified_at": "2019-12-27T18:11:19.117Z",
    "name": "name",
    "version_id": "version_id"
  },
  "success": true
}
Returns Examples
{
  "result": {
    "id": "id",
    "active": "true",
    "created_at": "created_at",
    "data": "data",
    "elements": [
      {
        "id": "id",
        "outputs": {
          "next": {
            "elementId": "elementId"
          }
        },
        "type": "start"
      }
    ],
    "gateway_id": "gateway_id",
    "modified_at": "2019-12-27T18:11:19.117Z",
    "name": "name",
    "version_id": "version_id"
  },
  "success": true
}