> ## Documentation Index
> Fetch the complete documentation index at: https://gcore.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Import Network Mapping

> Import network mapping from YAML file.

Note: A YAML file use spaces as indentation, tabs are not allowed.
Example of input file:

```
  name: mapping_rule_1
  mapping:
      - tags:
          - tag_name_1
        cidr4:
          - 127.0.2.0/24
      - tags:
          - tag_name_2
          - tag_name_3
        cidr4:
          - 128.0.1.0/24
          - 128.0.2.0/24
          - 128.0.3.0/24
        cidr6:
          - ac:20::0/64
---
  name: mapping_rule_2
  mapping:
      - tags:
          - my_network
        cidr4:
          - 129.0.2.0/24
        cidr6:
          - ac:20::0/64
```

Example of request:

```
curl --location --request POST 'https://api.gcore.com/dns/v2/network-mappings/import' \
--header 'Authorization: Bearer ...' \
--header 'Content-Type: text/plain' \
--data-raw 'name: mapping_rule_1
mapping:
    - tags:
        - tag_name_1
      cidr4:
        - 127.0.2.0/24
    - tags:
        - tag_name_2
        - tag_name_3
      cidr4:
        - 128.0.1.0/24
        - 128.0.2.0/24
        - 128.0.3.0/24
      cidr6:
        - aa:10::/64
---
name: mapping_rule_2
mapping:
    - tags:
        - my_network
      cidr4:
        - 129.0.2.0/24
      cidr6:
        - ac:20::0/64'
```



## OpenAPI

````yaml /api-reference/services_docs_mintlify/dns_api.yaml post /dns/v2/network-mappings/import
openapi: 3.1.0
info:
  title: Gcore OpenAPI – DNS API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: 1282e760bff2
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: Analyze
  - name: Clients
  - name: DNSSEC
  - name: Locations
  - name: Lookup
  - name: Metrics
  - name: NetworkMappings
  - name: Pickers
  - name: RRsets
  - name: Zones
paths:
  /dns/v2/network-mappings/import:
    post:
      tags:
        - NetworkMappings
      summary: Import Network Mapping
      description: >-
        Import network mapping from YAML file.


        Note: A YAML file use spaces as indentation, tabs are not allowed.

        Example of input file:


        ```
          name: mapping_rule_1
          mapping:
              - tags:
                  - tag_name_1
                cidr4:
                  - 127.0.2.0/24
              - tags:
                  - tag_name_2
                  - tag_name_3
                cidr4:
                  - 128.0.1.0/24
                  - 128.0.2.0/24
                  - 128.0.3.0/24
                cidr6:
                  - ac:20::0/64
        ---
          name: mapping_rule_2
          mapping:
              - tags:
                  - my_network
                cidr4:
                  - 129.0.2.0/24
                cidr6:
                  - ac:20::0/64
        ```


        Example of request:


        ```

        curl --location --request POST
        'https://api.gcore.com/dns/v2/network-mappings/import' \

        --header 'Authorization: Bearer ...' \

        --header 'Content-Type: text/plain' \

        --data-raw 'name: mapping_rule_1

        mapping:
            - tags:
                - tag_name_1
              cidr4:
                - 127.0.2.0/24
            - tags:
                - tag_name_2
                - tag_name_3
              cidr4:
                - 128.0.1.0/24
                - 128.0.2.0/24
                - 128.0.3.0/24
              cidr6:
                - aa:10::/64
        ---

        name: mapping_rule_2

        mapping:
            - tags:
                - my_network
              cidr4:
                - 129.0.2.0/24
              cidr6:
                - ac:20::0/64'
        ```
      operationId: ImportNetworkMapping
      responses:
        '200':
          description: ImportNetworkMappingResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportNetworkMappingResponse'
        '400':
          description: Error message response
          headers:
            error:
              schema:
                type: string
          content: {}
components:
  schemas:
    ImportNetworkMappingResponse:
      type: object
      properties:
        success:
          type: boolean
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````