# Network Interconnects # CNIs ## List existing CNI objects `client.NetworkInterconnects.CNIs.List(ctx, params) (*CNIListResponse, error)` **get** `/accounts/{account_id}/cni/cnis` List existing CNI objects ### Parameters - `params CNIListParams` - `AccountID param.Field[string]` Path param: Customer account tag - `Cursor param.Field[int64]` Query param - `Limit param.Field[int64]` Query param - `Slot param.Field[string]` Query param: If specified, only show CNIs associated with the specified slot - `TunnelID param.Field[string]` Query param: If specified, only show cnis associated with the specified tunnel id ### Returns - `type CNIListResponse struct{…}` - `Items []CNIListResponseItem` - `ID string` - `Account string` Customer account tag - `CustIP string` Customer end of the point-to-point link This should always be inside the same prefix as `p2p_ip`. - `Interconnect string` Interconnect identifier hosting this CNI - `Magic CNIListResponseItemsMagic` - `ConduitName string` - `Description string` - `Mtu int64` - `P2pIP string` Cloudflare end of the point-to-point link - `BGP CNIListResponseItemsBGP` - `CustomerASN int64` ASN used on the customer end of the BGP session - `ExtraPrefixes []string` Extra set of static prefixes to advertise to the customer's end of the session - `Md5Key string` MD5 key to use for session authentication. Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the key is not treated as a secret value. This is *only* supported for preventing misconfiguration, not for defending against malicious attacks. The MD5 key, if set, must be of non-zero length and consist only of the following types of character: * ASCII alphanumerics: `[a-zA-Z0-9]` * Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= |` In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests specifying an MD5 key with one or more of these disallowed characters will be rejected. - `Next int64` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) cnis, err := client.NetworkInterconnects.CNIs.List(context.TODO(), network_interconnects.CNIListParams{ AccountID: cloudflare.F("account_id"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", cnis.Items) } ``` #### Response ```json { "items": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "account": "account", "cust_ip": "192.168.3.4/31", "interconnect": "interconnect", "magic": { "conduit_name": "conduit_name", "description": "description", "mtu": 0 }, "p2p_ip": "192.168.3.4/31", "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" } } ], "next": 0 } ``` ## Get information about a CNI object `client.NetworkInterconnects.CNIs.Get(ctx, cni, query) (*CNIGetResponse, error)` **get** `/accounts/{account_id}/cni/cnis/{cni}` Get information about a CNI object ### Parameters - `cni string` - `query CNIGetParams` - `AccountID param.Field[string]` Customer account tag ### Returns - `type CNIGetResponse struct{…}` - `ID string` - `Account string` Customer account tag - `CustIP string` Customer end of the point-to-point link This should always be inside the same prefix as `p2p_ip`. - `Interconnect string` Interconnect identifier hosting this CNI - `Magic CNIGetResponseMagic` - `ConduitName string` - `Description string` - `Mtu int64` - `P2pIP string` Cloudflare end of the point-to-point link - `BGP CNIGetResponseBGP` - `CustomerASN int64` ASN used on the customer end of the BGP session - `ExtraPrefixes []string` Extra set of static prefixes to advertise to the customer's end of the session - `Md5Key string` MD5 key to use for session authentication. Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the key is not treated as a secret value. This is *only* supported for preventing misconfiguration, not for defending against malicious attacks. The MD5 key, if set, must be of non-zero length and consist only of the following types of character: * ASCII alphanumerics: `[a-zA-Z0-9]` * Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= |` In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests specifying an MD5 key with one or more of these disallowed characters will be rejected. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) cni, err := client.NetworkInterconnects.CNIs.Get( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", network_interconnects.CNIGetParams{ AccountID: cloudflare.F("account_id"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", cni.ID) } ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "account": "account", "cust_ip": "192.168.3.4/31", "interconnect": "interconnect", "magic": { "conduit_name": "conduit_name", "description": "description", "mtu": 0 }, "p2p_ip": "192.168.3.4/31", "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" } } ``` ## Create a new CNI object `client.NetworkInterconnects.CNIs.New(ctx, params) (*CNINewResponse, error)` **post** `/accounts/{account_id}/cni/cnis` Create a new CNI object ### Parameters - `params CNINewParams` - `AccountID param.Field[string]` Path param: Customer account tag - `Account param.Field[string]` Body param: Customer account tag - `Interconnect param.Field[string]` Body param - `Magic param.Field[CNINewParamsMagic]` Body param - `ConduitName string` - `Description string` - `Mtu int64` - `BGP param.Field[CNINewParamsBGP]` Body param - `CustomerASN int64` ASN used on the customer end of the BGP session - `ExtraPrefixes []string` Extra set of static prefixes to advertise to the customer's end of the session - `Md5Key string` MD5 key to use for session authentication. Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the key is not treated as a secret value. This is *only* supported for preventing misconfiguration, not for defending against malicious attacks. The MD5 key, if set, must be of non-zero length and consist only of the following types of character: * ASCII alphanumerics: `[a-zA-Z0-9]` * Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= |` In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests specifying an MD5 key with one or more of these disallowed characters will be rejected. ### Returns - `type CNINewResponse struct{…}` - `ID string` - `Account string` Customer account tag - `CustIP string` Customer end of the point-to-point link This should always be inside the same prefix as `p2p_ip`. - `Interconnect string` Interconnect identifier hosting this CNI - `Magic CNINewResponseMagic` - `ConduitName string` - `Description string` - `Mtu int64` - `P2pIP string` Cloudflare end of the point-to-point link - `BGP CNINewResponseBGP` - `CustomerASN int64` ASN used on the customer end of the BGP session - `ExtraPrefixes []string` Extra set of static prefixes to advertise to the customer's end of the session - `Md5Key string` MD5 key to use for session authentication. Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the key is not treated as a secret value. This is *only* supported for preventing misconfiguration, not for defending against malicious attacks. The MD5 key, if set, must be of non-zero length and consist only of the following types of character: * ASCII alphanumerics: `[a-zA-Z0-9]` * Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= |` In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests specifying an MD5 key with one or more of these disallowed characters will be rejected. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) cni, err := client.NetworkInterconnects.CNIs.New(context.TODO(), network_interconnects.CNINewParams{ AccountID: cloudflare.F("account_id"), Account: cloudflare.F("account"), Interconnect: cloudflare.F("interconnect"), Magic: cloudflare.F(network_interconnects.CNINewParamsMagic{ ConduitName: cloudflare.F("conduit_name"), Description: cloudflare.F("description"), Mtu: cloudflare.F(int64(0)), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", cni.ID) } ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "account": "account", "cust_ip": "192.168.3.4/31", "interconnect": "interconnect", "magic": { "conduit_name": "conduit_name", "description": "description", "mtu": 0 }, "p2p_ip": "192.168.3.4/31", "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" } } ``` ## Modify stored information about a CNI object `client.NetworkInterconnects.CNIs.Update(ctx, cni, params) (*CNIUpdateResponse, error)` **put** `/accounts/{account_id}/cni/cnis/{cni}` Modify stored information about a CNI object ### Parameters - `cni string` - `params CNIUpdateParams` - `AccountID param.Field[string]` Path param: Customer account tag - `ID param.Field[string]` Body param - `Account param.Field[string]` Body param: Customer account tag - `CustIP param.Field[string]` Body param: Customer end of the point-to-point link This should always be inside the same prefix as `p2p_ip`. - `Interconnect param.Field[string]` Body param: Interconnect identifier hosting this CNI - `Magic param.Field[CNIUpdateParamsMagic]` Body param - `ConduitName string` - `Description string` - `Mtu int64` - `P2pIP param.Field[string]` Body param: Cloudflare end of the point-to-point link - `BGP param.Field[CNIUpdateParamsBGP]` Body param - `CustomerASN int64` ASN used on the customer end of the BGP session - `ExtraPrefixes []string` Extra set of static prefixes to advertise to the customer's end of the session - `Md5Key string` MD5 key to use for session authentication. Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the key is not treated as a secret value. This is *only* supported for preventing misconfiguration, not for defending against malicious attacks. The MD5 key, if set, must be of non-zero length and consist only of the following types of character: * ASCII alphanumerics: `[a-zA-Z0-9]` * Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= |` In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests specifying an MD5 key with one or more of these disallowed characters will be rejected. ### Returns - `type CNIUpdateResponse struct{…}` - `ID string` - `Account string` Customer account tag - `CustIP string` Customer end of the point-to-point link This should always be inside the same prefix as `p2p_ip`. - `Interconnect string` Interconnect identifier hosting this CNI - `Magic CNIUpdateResponseMagic` - `ConduitName string` - `Description string` - `Mtu int64` - `P2pIP string` Cloudflare end of the point-to-point link - `BGP CNIUpdateResponseBGP` - `CustomerASN int64` ASN used on the customer end of the BGP session - `ExtraPrefixes []string` Extra set of static prefixes to advertise to the customer's end of the session - `Md5Key string` MD5 key to use for session authentication. Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the key is not treated as a secret value. This is *only* supported for preventing misconfiguration, not for defending against malicious attacks. The MD5 key, if set, must be of non-zero length and consist only of the following types of character: * ASCII alphanumerics: `[a-zA-Z0-9]` * Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= |` In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests specifying an MD5 key with one or more of these disallowed characters will be rejected. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) cni, err := client.NetworkInterconnects.CNIs.Update( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", network_interconnects.CNIUpdateParams{ AccountID: cloudflare.F("account_id"), ID: cloudflare.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), Account: cloudflare.F("account"), CustIP: cloudflare.F("192.168.3.4/31"), Interconnect: cloudflare.F("interconnect"), Magic: cloudflare.F(network_interconnects.CNIUpdateParamsMagic{ ConduitName: cloudflare.F("conduit_name"), Description: cloudflare.F("description"), Mtu: cloudflare.F(int64(0)), }), P2pIP: cloudflare.F("192.168.3.4/31"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", cni.ID) } ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "account": "account", "cust_ip": "192.168.3.4/31", "interconnect": "interconnect", "magic": { "conduit_name": "conduit_name", "description": "description", "mtu": 0 }, "p2p_ip": "192.168.3.4/31", "bgp": { "customer_asn": 0, "extra_prefixes": [ "string" ], "md5_key": "md5_key" } } ``` ## Delete a specified CNI object `client.NetworkInterconnects.CNIs.Delete(ctx, cni, body) error` **delete** `/accounts/{account_id}/cni/cnis/{cni}` Delete a specified CNI object ### Parameters - `cni string` - `body CNIDeleteParams` - `AccountID param.Field[string]` Customer account tag ### Example ```go package main import ( "context" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) err := client.NetworkInterconnects.CNIs.Delete( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", network_interconnects.CNIDeleteParams{ AccountID: cloudflare.F("account_id"), }, ) if err != nil { panic(err.Error()) } } ``` # Interconnects ## List existing interconnects `client.NetworkInterconnects.Interconnects.List(ctx, params) (*InterconnectListResponse, error)` **get** `/accounts/{account_id}/cni/interconnects` List existing interconnects ### Parameters - `params InterconnectListParams` - `AccountID param.Field[string]` Path param: Customer account tag - `Cursor param.Field[int64]` Query param - `Limit param.Field[int64]` Query param - `Site param.Field[string]` Query param: If specified, only show interconnects located at the given site - `Type param.Field[string]` Query param: If specified, only show interconnects of the given type ### Returns - `type InterconnectListResponse struct{…}` - `Items []InterconnectListResponseItem` - `type InterconnectListResponseItemsNscInterconnectPhysicalBody struct{…}` - `Account string` - `Facility InterconnectListResponseItemsNscInterconnectPhysicalBodyFacility` - `Address []string` - `Name string` - `Name string` - `Site string` A Cloudflare site name. - `SlotID string` - `Speed string` - `Type string` - `Owner string` - `type InterconnectListResponseItemsNscInterconnectGcpPartnerBody struct{…}` - `Account string` - `Name string` - `Region string` - `Type string` - `Owner string` - `Speed InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed` Bandwidth structure as visible through the customer-facing API. - `const InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed50M InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed = "50M"` - `const InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed100M InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed = "100M"` - `const InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed200M InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed = "200M"` - `const InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed300M InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed = "300M"` - `const InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed400M InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed = "400M"` - `const InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed500M InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed = "500M"` - `const InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed1G InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed = "1G"` - `const InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed2G InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed = "2G"` - `const InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed5G InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed = "5G"` - `const InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed10G InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed = "10G"` - `const InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed20G InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed = "20G"` - `const InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed50G InterconnectListResponseItemsNscInterconnectGcpPartnerBodySpeed = "50G"` - `Next int64` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) interconnects, err := client.NetworkInterconnects.Interconnects.List(context.TODO(), network_interconnects.InterconnectListParams{ AccountID: cloudflare.F("account_id"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", interconnects.Items) } ``` #### Response ```json { "items": [ { "account": "account", "facility": { "address": [ "string" ], "name": "name" }, "name": "name", "site": "site", "slot_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "speed": "speed", "type": "type", "owner": "owner" } ], "next": 0 } ``` ## Get information about an interconnect object `client.NetworkInterconnects.Interconnects.Get(ctx, icon, query) (*InterconnectGetResponse, error)` **get** `/accounts/{account_id}/cni/interconnects/{icon}` Get information about an interconnect object ### Parameters - `icon string` - `query InterconnectGetParams` - `AccountID param.Field[string]` Customer account tag ### Returns - `type InterconnectGetResponse interface{…}` - `type InterconnectGetResponseNscInterconnectPhysicalBody struct{…}` - `Account string` - `Facility InterconnectGetResponseNscInterconnectPhysicalBodyFacility` - `Address []string` - `Name string` - `Name string` - `Site string` A Cloudflare site name. - `SlotID string` - `Speed string` - `Type string` - `Owner string` - `type InterconnectGetResponseNscInterconnectGcpPartnerBody struct{…}` - `Account string` - `Name string` - `Region string` - `Type string` - `Owner string` - `Speed InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed` Bandwidth structure as visible through the customer-facing API. - `const InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed50M InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed = "50M"` - `const InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed100M InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed = "100M"` - `const InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed200M InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed = "200M"` - `const InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed300M InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed = "300M"` - `const InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed400M InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed = "400M"` - `const InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed500M InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed = "500M"` - `const InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed1G InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed = "1G"` - `const InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed2G InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed = "2G"` - `const InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed5G InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed = "5G"` - `const InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed10G InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed = "10G"` - `const InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed20G InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed = "20G"` - `const InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed50G InterconnectGetResponseNscInterconnectGcpPartnerBodySpeed = "50G"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) interconnect, err := client.NetworkInterconnects.Interconnects.Get( context.TODO(), "icon", network_interconnects.InterconnectGetParams{ AccountID: cloudflare.F("account_id"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", interconnect) } ``` #### Response ```json { "account": "account", "facility": { "address": [ "string" ], "name": "name" }, "name": "name", "site": "site", "slot_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "speed": "speed", "type": "type", "owner": "owner" } ``` ## Create a new interconnect `client.NetworkInterconnects.Interconnects.New(ctx, params) (*InterconnectNewResponse, error)` **post** `/accounts/{account_id}/cni/interconnects` Create a new interconnect ### Parameters - `params InterconnectNewParams` - `AccountID param.Field[string]` Path param: Customer account tag - `Account param.Field[string]` Body param - `SlotID param.Field[string]` Body param - `Type param.Field[string]` Body param - `Speed param.Field[string]` Body param ### Returns - `type InterconnectNewResponse interface{…}` - `type InterconnectNewResponseNscInterconnectPhysicalBody struct{…}` - `Account string` - `Facility InterconnectNewResponseNscInterconnectPhysicalBodyFacility` - `Address []string` - `Name string` - `Name string` - `Site string` A Cloudflare site name. - `SlotID string` - `Speed string` - `Type string` - `Owner string` - `type InterconnectNewResponseNscInterconnectGcpPartnerBody struct{…}` - `Account string` - `Name string` - `Region string` - `Type string` - `Owner string` - `Speed InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed` Bandwidth structure as visible through the customer-facing API. - `const InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed50M InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed = "50M"` - `const InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed100M InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed = "100M"` - `const InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed200M InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed = "200M"` - `const InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed300M InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed = "300M"` - `const InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed400M InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed = "400M"` - `const InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed500M InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed = "500M"` - `const InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed1G InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed = "1G"` - `const InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed2G InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed = "2G"` - `const InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed5G InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed = "5G"` - `const InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed10G InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed = "10G"` - `const InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed20G InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed = "20G"` - `const InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed50G InterconnectNewResponseNscInterconnectGcpPartnerBodySpeed = "50G"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) interconnect, err := client.NetworkInterconnects.Interconnects.New(context.TODO(), network_interconnects.InterconnectNewParams{ AccountID: cloudflare.F("account_id"), Body: network_interconnects.InterconnectNewParamsBodyNscInterconnectCreatePhysicalBody{ Account: cloudflare.F("account"), SlotID: cloudflare.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), Type: cloudflare.F("type"), }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", interconnect) } ``` #### Response ```json { "account": "account", "facility": { "address": [ "string" ], "name": "name" }, "name": "name", "site": "site", "slot_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "speed": "speed", "type": "type", "owner": "owner" } ``` ## Delete an interconnect object `client.NetworkInterconnects.Interconnects.Delete(ctx, icon, body) error` **delete** `/accounts/{account_id}/cni/interconnects/{icon}` Delete an interconnect object ### Parameters - `icon string` - `body InterconnectDeleteParams` - `AccountID param.Field[string]` Customer account tag ### Example ```go package main import ( "context" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) err := client.NetworkInterconnects.Interconnects.Delete( context.TODO(), "icon", network_interconnects.InterconnectDeleteParams{ AccountID: cloudflare.F("account_id"), }, ) if err != nil { panic(err.Error()) } } ``` ## Generate the Letter of Authorization (LOA) for a given interconnect `client.NetworkInterconnects.Interconnects.LOA(ctx, icon, query) error` **get** `/accounts/{account_id}/cni/interconnects/{icon}/loa` Generate the Letter of Authorization (LOA) for a given interconnect ### Parameters - `icon string` - `query InterconnectLOAParams` - `AccountID param.Field[string]` Customer account tag ### Example ```go package main import ( "context" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) err := client.NetworkInterconnects.Interconnects.LOA( context.TODO(), "icon", network_interconnects.InterconnectLOAParams{ AccountID: cloudflare.F("account_id"), }, ) if err != nil { panic(err.Error()) } } ``` ## Get the current status of an interconnect object `client.NetworkInterconnects.Interconnects.Status(ctx, icon, query) (*InterconnectStatusResponse, error)` **get** `/accounts/{account_id}/cni/interconnects/{icon}/status` Get the current status of an interconnect object ### Parameters - `icon string` - `query InterconnectStatusParams` - `AccountID param.Field[string]` Customer account tag ### Returns - `type InterconnectStatusResponse interface{…}` - `type InterconnectStatusResponsePending struct{…}` - `State InterconnectStatusResponsePendingState` - `const InterconnectStatusResponsePendingStatePending InterconnectStatusResponsePendingState = "Pending"` - `type InterconnectStatusResponseDown struct{…}` - `State InterconnectStatusResponseDownState` - `const InterconnectStatusResponseDownStateDown InterconnectStatusResponseDownState = "Down"` - `Reason string` Diagnostic information, if available - `type InterconnectStatusResponseUnhealthy struct{…}` - `State InterconnectStatusResponseUnhealthyState` - `const InterconnectStatusResponseUnhealthyStateUnhealthy InterconnectStatusResponseUnhealthyState = "Unhealthy"` - `Reason string` Diagnostic information, if available - `type InterconnectStatusResponseHealthy struct{…}` - `State InterconnectStatusResponseHealthyState` - `const InterconnectStatusResponseHealthyStateHealthy InterconnectStatusResponseHealthyState = "Healthy"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.NetworkInterconnects.Interconnects.Status( context.TODO(), "icon", network_interconnects.InterconnectStatusParams{ AccountID: cloudflare.F("account_id"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "state": "Pending" } ``` # Settings ## Get the current settings for the active account `client.NetworkInterconnects.Settings.Get(ctx, query) (*SettingGetResponse, error)` **get** `/accounts/{account_id}/cni/settings` Get the current settings for the active account ### Parameters - `query SettingGetParams` - `AccountID param.Field[string]` Account tag to retrieve settings for ### Returns - `type SettingGetResponse struct{…}` - `DefaultASN int64` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) setting, err := client.NetworkInterconnects.Settings.Get(context.TODO(), network_interconnects.SettingGetParams{ AccountID: cloudflare.F("account_id"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", setting.DefaultASN) } ``` #### Response ```json { "default_asn": 0 } ``` ## Update the current settings for the active account `client.NetworkInterconnects.Settings.Update(ctx, params) (*SettingUpdateResponse, error)` **put** `/accounts/{account_id}/cni/settings` Update the current settings for the active account ### Parameters - `params SettingUpdateParams` - `AccountID param.Field[string]` Path param: Account tag to update settings for - `DefaultASN param.Field[int64]` Body param ### Returns - `type SettingUpdateResponse struct{…}` - `DefaultASN int64` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) setting, err := client.NetworkInterconnects.Settings.Update(context.TODO(), network_interconnects.SettingUpdateParams{ AccountID: cloudflare.F("account_id"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", setting.DefaultASN) } ``` #### Response ```json { "default_asn": 0 } ``` # Slots ## Retrieve a list of all slots matching the specified parameters `client.NetworkInterconnects.Slots.List(ctx, params) (*SlotListResponse, error)` **get** `/accounts/{account_id}/cni/slots` Retrieve a list of all slots matching the specified parameters ### Parameters - `params SlotListParams` - `AccountID param.Field[string]` Path param: Customer account tag - `AddressContains param.Field[string]` Query param: If specified, only show slots with the given text in their address field - `Cursor param.Field[int64]` Query param - `Limit param.Field[int64]` Query param - `Occupied param.Field[bool]` Query param: If specified, only show slots with a specific occupied/unoccupied state - `Site param.Field[string]` Query param: If specified, only show slots located at the given site - `Speed param.Field[string]` Query param: If specified, only show slots that support the given speed ### Returns - `type SlotListResponse struct{…}` - `Items []SlotListResponseItem` - `ID string` Slot ID - `Facility SlotListResponseItemsFacility` - `Address []string` - `Name string` - `Occupied bool` Whether the slot is occupied or not - `Site string` - `Speed string` - `Account string` Customer account tag - `Next int64` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) slots, err := client.NetworkInterconnects.Slots.List(context.TODO(), network_interconnects.SlotListParams{ AccountID: cloudflare.F("account_id"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", slots.Items) } ``` #### Response ```json { "items": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "facility": { "address": [ "string" ], "name": "name" }, "occupied": true, "site": "site", "speed": "speed", "account": "account" } ], "next": 0 } ``` ## Get information about the specified slot `client.NetworkInterconnects.Slots.Get(ctx, slot, query) (*SlotGetResponse, error)` **get** `/accounts/{account_id}/cni/slots/{slot}` Get information about the specified slot ### Parameters - `slot string` - `query SlotGetParams` - `AccountID param.Field[string]` Customer account tag ### Returns - `type SlotGetResponse struct{…}` - `ID string` Slot ID - `Facility SlotGetResponseFacility` - `Address []string` - `Name string` - `Occupied bool` Whether the slot is occupied or not - `Site string` - `Speed string` - `Account string` Customer account tag ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/network_interconnects" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) slot, err := client.NetworkInterconnects.Slots.Get( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", network_interconnects.SlotGetParams{ AccountID: cloudflare.F("account_id"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", slot.ID) } ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "facility": { "address": [ "string" ], "name": "name" }, "occupied": true, "site": "site", "speed": "speed", "account": "account" } ```