# Address Maps ## List Address Maps `client.Addressing.AddressMaps.List(ctx, query) (*SinglePage[AddressMap], error)` **get** `/accounts/{account_id}/addressing/address_maps` List all address maps owned by the account. ### Parameters - `query AddressMapListParams` - `AccountID param.Field[string]` Identifier of a Cloudflare account. ### Returns - `type AddressMap struct{…}` - `ID string` Identifier of an Address Map. - `CanDelete bool` If set to false, then the Address Map cannot be deleted via API. This is true for Cloudflare-managed maps. - `CanModifyIPs bool` If set to false, then the IPs on the Address Map cannot be modified via the API. This is true for Cloudflare-managed maps. - `CreatedAt Time` - `DefaultSNI string` If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map. If Cloudflare receives a TLS handshake from a client without an SNI, it will respond with the default SNI on those IPs. The default SNI can be any valid zone or subdomain owned by the account. - `Description string` An optional description field which may be used to describe the types of IPs or zones on the map. - `Enabled bool` Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map is enabled. - `ModifiedAt Time` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/addressing" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) page, err := client.Addressing.AddressMaps.List(context.TODO(), addressing.AddressMapListParams{ AccountID: cloudflare.F("258def64c72dae45f3e4c8516e2111f2"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "055817b111884e0227e1be16a0be6ee0", "can_delete": true, "can_modify_ips": true, "created_at": "2014-01-01T05:20:00.12345Z", "default_sni": "*.example.com", "description": "My Ecommerce zones", "enabled": true, "modified_at": "2014-01-01T05:20:00.12345Z" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Address Map Details `client.Addressing.AddressMaps.Get(ctx, addressMapID, query) (*AddressMapGetResponse, error)` **get** `/accounts/{account_id}/addressing/address_maps/{address_map_id}` Show a particular address map owned by the account. ### Parameters - `addressMapID string` Identifier of an Address Map. - `query AddressMapGetParams` - `AccountID param.Field[string]` Identifier of a Cloudflare account. ### Returns - `type AddressMapGetResponse struct{…}` - `ID string` Identifier of an Address Map. - `CanDelete bool` If set to false, then the Address Map cannot be deleted via API. This is true for Cloudflare-managed maps. - `CanModifyIPs bool` If set to false, then the IPs on the Address Map cannot be modified via the API. This is true for Cloudflare-managed maps. - `CreatedAt Time` - `DefaultSNI string` If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map. If Cloudflare receives a TLS handshake from a client without an SNI, it will respond with the default SNI on those IPs. The default SNI can be any valid zone or subdomain owned by the account. - `Description string` An optional description field which may be used to describe the types of IPs or zones on the map. - `Enabled bool` Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map is enabled. - `IPs IPs` The set of IPs on the Address Map. - `CreatedAt Time` - `IP string` An IPv4 or IPv6 address. - `Memberships []AddressMapGetResponseMembership` Zones and Accounts which will be assigned IPs on this Address Map. A zone membership will take priority over an account membership. - `CanDelete bool` Controls whether the membership can be deleted via the API or not. - `CreatedAt Time` - `Identifier string` The identifier for the membership (eg. a zone or account tag). - `Kind Kind` The type of the membership. - `const KindZone Kind = "zone"` - `const KindAccount Kind = "account"` - `ModifiedAt Time` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/addressing" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) addressMap, err := client.Addressing.AddressMaps.Get( context.TODO(), "055817b111884e0227e1be16a0be6ee0", addressing.AddressMapGetParams{ AccountID: cloudflare.F("258def64c72dae45f3e4c8516e2111f2"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", addressMap.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "055817b111884e0227e1be16a0be6ee0", "can_delete": true, "can_modify_ips": true, "created_at": "2014-01-01T05:20:00.12345Z", "default_sni": "*.example.com", "description": "My Ecommerce zones", "enabled": true, "ips": [ { "created_at": "2014-01-01T05:20:00.12345Z", "ip": "192.0.2.1" } ], "memberships": [ { "can_delete": true, "created_at": "2014-01-01T05:20:00.12345Z", "identifier": "023e105f4ecef8ad9ca31a8372d0c353", "kind": "zone" } ], "modified_at": "2014-01-01T05:20:00.12345Z" } } ``` ## Create Address Map `client.Addressing.AddressMaps.New(ctx, params) (*AddressMapNewResponse, error)` **post** `/accounts/{account_id}/addressing/address_maps` Create a new address map under the account. ### Parameters - `params AddressMapNewParams` - `AccountID param.Field[string]` Path param: Identifier of a Cloudflare account. - `Description param.Field[string]` Body param: An optional description field which may be used to describe the types of IPs or zones on the map. - `Enabled param.Field[bool]` Body param: Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map is enabled. - `IPs param.Field[[]string]` Body param - `Memberships param.Field[[]AddressMapNewParamsMembership]` Body param: Zones and Accounts which will be assigned IPs on this Address Map. A zone membership will take priority over an account membership. - `Identifier string` The identifier for the membership (eg. a zone or account tag). - `Kind Kind` The type of the membership. - `const KindZone Kind = "zone"` - `const KindAccount Kind = "account"` ### Returns - `type AddressMapNewResponse struct{…}` - `ID string` Identifier of an Address Map. - `CanDelete bool` If set to false, then the Address Map cannot be deleted via API. This is true for Cloudflare-managed maps. - `CanModifyIPs bool` If set to false, then the IPs on the Address Map cannot be modified via the API. This is true for Cloudflare-managed maps. - `CreatedAt Time` - `DefaultSNI string` If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map. If Cloudflare receives a TLS handshake from a client without an SNI, it will respond with the default SNI on those IPs. The default SNI can be any valid zone or subdomain owned by the account. - `Description string` An optional description field which may be used to describe the types of IPs or zones on the map. - `Enabled bool` Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map is enabled. - `IPs IPs` The set of IPs on the Address Map. - `CreatedAt Time` - `IP string` An IPv4 or IPv6 address. - `Memberships []AddressMapNewResponseMembership` Zones and Accounts which will be assigned IPs on this Address Map. A zone membership will take priority over an account membership. - `CanDelete bool` Controls whether the membership can be deleted via the API or not. - `CreatedAt Time` - `Identifier string` The identifier for the membership (eg. a zone or account tag). - `Kind Kind` The type of the membership. - `const KindZone Kind = "zone"` - `const KindAccount Kind = "account"` - `ModifiedAt Time` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/addressing" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) addressMap, err := client.Addressing.AddressMaps.New(context.TODO(), addressing.AddressMapNewParams{ AccountID: cloudflare.F("258def64c72dae45f3e4c8516e2111f2"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", addressMap.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "055817b111884e0227e1be16a0be6ee0", "can_delete": true, "can_modify_ips": true, "created_at": "2014-01-01T05:20:00.12345Z", "default_sni": "*.example.com", "description": "My Ecommerce zones", "enabled": true, "ips": [ { "created_at": "2014-01-01T05:20:00.12345Z", "ip": "192.0.2.1" } ], "memberships": [ { "can_delete": true, "created_at": "2014-01-01T05:20:00.12345Z", "identifier": "023e105f4ecef8ad9ca31a8372d0c353", "kind": "zone" } ], "modified_at": "2014-01-01T05:20:00.12345Z" } } ``` ## Update Address Map `client.Addressing.AddressMaps.Edit(ctx, addressMapID, params) (*AddressMap, error)` **patch** `/accounts/{account_id}/addressing/address_maps/{address_map_id}` Modify properties of an address map owned by the account. ### Parameters - `addressMapID string` Identifier of an Address Map. - `params AddressMapEditParams` - `AccountID param.Field[string]` Path param: Identifier of a Cloudflare account. - `DefaultSNI param.Field[string]` Body param: If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map. If Cloudflare receives a TLS handshake from a client without an SNI, it will respond with the default SNI on those IPs. The default SNI can be any valid zone or subdomain owned by the account. - `Description param.Field[string]` Body param: An optional description field which may be used to describe the types of IPs or zones on the map. - `Enabled param.Field[bool]` Body param: Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map is enabled. ### Returns - `type AddressMap struct{…}` - `ID string` Identifier of an Address Map. - `CanDelete bool` If set to false, then the Address Map cannot be deleted via API. This is true for Cloudflare-managed maps. - `CanModifyIPs bool` If set to false, then the IPs on the Address Map cannot be modified via the API. This is true for Cloudflare-managed maps. - `CreatedAt Time` - `DefaultSNI string` If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map. If Cloudflare receives a TLS handshake from a client without an SNI, it will respond with the default SNI on those IPs. The default SNI can be any valid zone or subdomain owned by the account. - `Description string` An optional description field which may be used to describe the types of IPs or zones on the map. - `Enabled bool` Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map is enabled. - `ModifiedAt Time` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/addressing" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) addressMap, err := client.Addressing.AddressMaps.Edit( context.TODO(), "055817b111884e0227e1be16a0be6ee0", addressing.AddressMapEditParams{ AccountID: cloudflare.F("258def64c72dae45f3e4c8516e2111f2"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", addressMap.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "055817b111884e0227e1be16a0be6ee0", "can_delete": true, "can_modify_ips": true, "created_at": "2014-01-01T05:20:00.12345Z", "default_sni": "*.example.com", "description": "My Ecommerce zones", "enabled": true, "modified_at": "2014-01-01T05:20:00.12345Z" } } ``` ## Delete Address Map `client.Addressing.AddressMaps.Delete(ctx, addressMapID, body) (*AddressMapDeleteResponse, error)` **delete** `/accounts/{account_id}/addressing/address_maps/{address_map_id}` Delete a particular address map owned by the account. An Address Map must be disabled before it can be deleted. ### Parameters - `addressMapID string` Identifier of an Address Map. - `body AddressMapDeleteParams` - `AccountID param.Field[string]` Identifier of a Cloudflare account. ### Returns - `type AddressMapDeleteResponse struct{…}` - `Errors []AddressMapDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AddressMapDeleteResponseErrorsSource` - `Pointer string` - `Messages []AddressMapDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AddressMapDeleteResponseMessagesSource` - `Pointer string` - `Success AddressMapDeleteResponseSuccess` Whether the API call was successful. - `const AddressMapDeleteResponseSuccessTrue AddressMapDeleteResponseSuccess = true` - `ResultInfo AddressMapDeleteResponseResultInfo` - `Count float64` Total number of results for the requested service. - `Page float64` Current page within paginated list of results. - `PerPage float64` Number of results per page of results. - `TotalCount float64` Total results available without any search parameters. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/addressing" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) addressMap, err := client.Addressing.AddressMaps.Delete( context.TODO(), "055817b111884e0227e1be16a0be6ee0", addressing.AddressMapDeleteParams{ AccountID: cloudflare.F("258def64c72dae45f3e4c8516e2111f2"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", addressMap.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Domain Types ### Address Map - `type AddressMap struct{…}` - `ID string` Identifier of an Address Map. - `CanDelete bool` If set to false, then the Address Map cannot be deleted via API. This is true for Cloudflare-managed maps. - `CanModifyIPs bool` If set to false, then the IPs on the Address Map cannot be modified via the API. This is true for Cloudflare-managed maps. - `CreatedAt Time` - `DefaultSNI string` If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map. If Cloudflare receives a TLS handshake from a client without an SNI, it will respond with the default SNI on those IPs. The default SNI can be any valid zone or subdomain owned by the account. - `Description string` An optional description field which may be used to describe the types of IPs or zones on the map. - `Enabled bool` Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map is enabled. - `ModifiedAt Time` ### Kind - `type Kind string` The type of the membership. - `const KindZone Kind = "zone"` - `const KindAccount Kind = "account"` # Accounts ## Add an account membership to an Address Map `client.Addressing.AddressMaps.Accounts.Update(ctx, addressMapID, params) (*AddressMapAccountUpdateResponse, error)` **put** `/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}` Add an account as a member of a particular address map. ### Parameters - `addressMapID string` Identifier of an Address Map. - `params AddressMapAccountUpdateParams` - `AccountID param.Field[string]` Path param: Identifier of a Cloudflare account. - `Body param.Field[unknown]` Body param ### Returns - `type AddressMapAccountUpdateResponse struct{…}` - `Errors []AddressMapAccountUpdateResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AddressMapAccountUpdateResponseErrorsSource` - `Pointer string` - `Messages []AddressMapAccountUpdateResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AddressMapAccountUpdateResponseMessagesSource` - `Pointer string` - `Success AddressMapAccountUpdateResponseSuccess` Whether the API call was successful. - `const AddressMapAccountUpdateResponseSuccessTrue AddressMapAccountUpdateResponseSuccess = true` - `ResultInfo AddressMapAccountUpdateResponseResultInfo` - `Count float64` Total number of results for the requested service. - `Page float64` Current page within paginated list of results. - `PerPage float64` Number of results per page of results. - `TotalCount float64` Total results available without any search parameters. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/addressing" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) account, err := client.Addressing.AddressMaps.Accounts.Update( context.TODO(), "055817b111884e0227e1be16a0be6ee0", addressing.AddressMapAccountUpdateParams{ AccountID: cloudflare.F("258def64c72dae45f3e4c8516e2111f2"), Body: map[string]interface{}{ }, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", account.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Remove an account membership from an Address Map `client.Addressing.AddressMaps.Accounts.Delete(ctx, addressMapID, body) (*AddressMapAccountDeleteResponse, error)` **delete** `/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}` Remove an account as a member of a particular address map. ### Parameters - `addressMapID string` Identifier of an Address Map. - `body AddressMapAccountDeleteParams` - `AccountID param.Field[string]` Identifier of a Cloudflare account. ### Returns - `type AddressMapAccountDeleteResponse struct{…}` - `Errors []AddressMapAccountDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AddressMapAccountDeleteResponseErrorsSource` - `Pointer string` - `Messages []AddressMapAccountDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AddressMapAccountDeleteResponseMessagesSource` - `Pointer string` - `Success AddressMapAccountDeleteResponseSuccess` Whether the API call was successful. - `const AddressMapAccountDeleteResponseSuccessTrue AddressMapAccountDeleteResponseSuccess = true` - `ResultInfo AddressMapAccountDeleteResponseResultInfo` - `Count float64` Total number of results for the requested service. - `Page float64` Current page within paginated list of results. - `PerPage float64` Number of results per page of results. - `TotalCount float64` Total results available without any search parameters. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/addressing" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) account, err := client.Addressing.AddressMaps.Accounts.Delete( context.TODO(), "055817b111884e0227e1be16a0be6ee0", addressing.AddressMapAccountDeleteParams{ AccountID: cloudflare.F("258def64c72dae45f3e4c8516e2111f2"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", account.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` # IPs ## Add an IP to an Address Map `client.Addressing.AddressMaps.IPs.Update(ctx, addressMapID, ipAddress, params) (*AddressMapIPUpdateResponse, error)` **put** `/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}` Add an IP from a prefix owned by the account to a particular address map. ### Parameters - `addressMapID string` Identifier of an Address Map. - `ipAddress string` An IPv4 or IPv6 address. - `params AddressMapIPUpdateParams` - `AccountID param.Field[string]` Path param: Identifier of a Cloudflare account. - `Body param.Field[unknown]` Body param ### Returns - `type AddressMapIPUpdateResponse struct{…}` - `Errors []AddressMapIPUpdateResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AddressMapIPUpdateResponseErrorsSource` - `Pointer string` - `Messages []AddressMapIPUpdateResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AddressMapIPUpdateResponseMessagesSource` - `Pointer string` - `Success AddressMapIPUpdateResponseSuccess` Whether the API call was successful. - `const AddressMapIPUpdateResponseSuccessTrue AddressMapIPUpdateResponseSuccess = true` - `ResultInfo AddressMapIPUpdateResponseResultInfo` - `Count float64` Total number of results for the requested service. - `Page float64` Current page within paginated list of results. - `PerPage float64` Number of results per page of results. - `TotalCount float64` Total results available without any search parameters. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/addressing" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) ip, err := client.Addressing.AddressMaps.IPs.Update( context.TODO(), "055817b111884e0227e1be16a0be6ee0", "192.0.2.1", addressing.AddressMapIPUpdateParams{ AccountID: cloudflare.F("258def64c72dae45f3e4c8516e2111f2"), Body: map[string]interface{}{ }, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", ip.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Remove an IP from an Address Map `client.Addressing.AddressMaps.IPs.Delete(ctx, addressMapID, ipAddress, body) (*AddressMapIPDeleteResponse, error)` **delete** `/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}` Remove an IP from a particular address map. ### Parameters - `addressMapID string` Identifier of an Address Map. - `ipAddress string` An IPv4 or IPv6 address. - `body AddressMapIPDeleteParams` - `AccountID param.Field[string]` Identifier of a Cloudflare account. ### Returns - `type AddressMapIPDeleteResponse struct{…}` - `Errors []AddressMapIPDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AddressMapIPDeleteResponseErrorsSource` - `Pointer string` - `Messages []AddressMapIPDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AddressMapIPDeleteResponseMessagesSource` - `Pointer string` - `Success AddressMapIPDeleteResponseSuccess` Whether the API call was successful. - `const AddressMapIPDeleteResponseSuccessTrue AddressMapIPDeleteResponseSuccess = true` - `ResultInfo AddressMapIPDeleteResponseResultInfo` - `Count float64` Total number of results for the requested service. - `Page float64` Current page within paginated list of results. - `PerPage float64` Number of results per page of results. - `TotalCount float64` Total results available without any search parameters. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/addressing" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) ip, err := client.Addressing.AddressMaps.IPs.Delete( context.TODO(), "055817b111884e0227e1be16a0be6ee0", "192.0.2.1", addressing.AddressMapIPDeleteParams{ AccountID: cloudflare.F("258def64c72dae45f3e4c8516e2111f2"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", ip.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` # Zones ## Add a zone membership to an Address Map `client.Addressing.AddressMaps.Zones.Update(ctx, addressMapID, params) (*AddressMapZoneUpdateResponse, error)` **put** `/accounts/{account_id}/addressing/address_maps/{address_map_id}/zones/{zone_id}` Add a zone as a member of a particular address map. ### Parameters - `addressMapID string` Identifier of an Address Map. - `params AddressMapZoneUpdateParams` - `ZoneID param.Field[string]` Path param: Identifier of a zone. - `AccountID param.Field[string]` Path param: Identifier of a Cloudflare account. - `Body param.Field[unknown]` Body param ### Returns - `type AddressMapZoneUpdateResponse struct{…}` - `Errors []AddressMapZoneUpdateResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AddressMapZoneUpdateResponseErrorsSource` - `Pointer string` - `Messages []AddressMapZoneUpdateResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AddressMapZoneUpdateResponseMessagesSource` - `Pointer string` - `Success AddressMapZoneUpdateResponseSuccess` Whether the API call was successful. - `const AddressMapZoneUpdateResponseSuccessTrue AddressMapZoneUpdateResponseSuccess = true` - `ResultInfo AddressMapZoneUpdateResponseResultInfo` - `Count float64` Total number of results for the requested service. - `Page float64` Current page within paginated list of results. - `PerPage float64` Number of results per page of results. - `TotalCount float64` Total results available without any search parameters. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/addressing" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) zone, err := client.Addressing.AddressMaps.Zones.Update( context.TODO(), "055817b111884e0227e1be16a0be6ee0", addressing.AddressMapZoneUpdateParams{ ZoneID: cloudflare.F("8ac8489932db6327334c9b6d58544cfe"), AccountID: cloudflare.F("258def64c72dae45f3e4c8516e2111f2"), Body: map[string]interface{}{ }, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", zone.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Remove a zone membership from an Address Map `client.Addressing.AddressMaps.Zones.Delete(ctx, addressMapID, body) (*AddressMapZoneDeleteResponse, error)` **delete** `/accounts/{account_id}/addressing/address_maps/{address_map_id}/zones/{zone_id}` Remove a zone as a member of a particular address map. ### Parameters - `addressMapID string` Identifier of an Address Map. - `body AddressMapZoneDeleteParams` - `ZoneID param.Field[string]` Identifier of a zone. - `AccountID param.Field[string]` Identifier of a Cloudflare account. ### Returns - `type AddressMapZoneDeleteResponse struct{…}` - `Errors []AddressMapZoneDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AddressMapZoneDeleteResponseErrorsSource` - `Pointer string` - `Messages []AddressMapZoneDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AddressMapZoneDeleteResponseMessagesSource` - `Pointer string` - `Success AddressMapZoneDeleteResponseSuccess` Whether the API call was successful. - `const AddressMapZoneDeleteResponseSuccessTrue AddressMapZoneDeleteResponseSuccess = true` - `ResultInfo AddressMapZoneDeleteResponseResultInfo` - `Count float64` Total number of results for the requested service. - `Page float64` Current page within paginated list of results. - `PerPage float64` Number of results per page of results. - `TotalCount float64` Total results available without any search parameters. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/addressing" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) zone, err := client.Addressing.AddressMaps.Zones.Delete( context.TODO(), "055817b111884e0227e1be16a0be6ee0", addressing.AddressMapZoneDeleteParams{ ZoneID: cloudflare.F("8ac8489932db6327334c9b6d58544cfe"), AccountID: cloudflare.F("258def64c72dae45f3e4c8516e2111f2"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", zone.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ```