• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Keystone
  5. Mapping
  6. Updating a Mapping

Updating a Mapping

Function Description

This interface is used to update the information about a mapping. This interface applies only to domain names in the Global zone.

URI

  • URI format

    PATCH /v3/OS-FEDERATION/mappings/{id}

  • URI parameter description

    Parameter

    Mandatory

    Type

    Description

    id

    Yes

    String

    Mapping ID.

Request

  • Request header parameter description

    Parameter

    Mandatory

    Type

    Description

    Content-Type

    Yes

    String

    Fill application/json;charset=utf8 in this field.

    X-Auth-Token

    Yes

    String

    Authenticated token with the Security Administrator permission of the user whose mapping is to be updated.

  • Request body parameter description

    Parameter

    Mandatory

    Type

    Description

    rules

    Yes

    Object

    List of rules used to map remote users into local users.

    Example:

    "rules": [
                {
                    "local": [
                        {
                            "user": {
                                "name": "{0}"
                            }
                        },
                        {
                            "group": {
                                "name": "0cd5e9"
                            }
                        }
                    ],
                    "remote": [
                        {
                            "type": "UserName"
                        },
                        {
                            "type": "orgPersonType",
                            "any_one_of": [
                                "Contractor",
                                "SubContractor"
                            ]
                        }
                    ]
                }
            ]

    Under the local field:

    • user: indicates a local user.
    • group: indicates a local user group.

    Under the remote field:

    • "type": "UserName" indicates an attribute in an IdP assertion.
    • "type": "orgPersonType" indicates an attribute in an IdP assertion.
  • Sample request
    curl -i -k -H 'Accept:application/json' -H 'Content-Type:application/json;charset=utf8' -H "X-Auth-Token:$token" -X PATCH -d'{"mapping":{"rules":[{"local":[{"user":{"name":"{0}"}},{"group":{"name":"0cd5e9"}}],"remote":[{"type":"UserName"},{"type":"orgPersonType","any_one_of":["Contractor","SubContractor"]}]}]}}' https://10.185.190.118:31943/v3/OS-FEDERATION/mappings/ACME

Response

  • Response body parameter description

    Parameter

    Mandatory

    Type

    Description

    id

    Yes

    String

    Mapping ID.

    rules

    Yes

    Object

    List of rules used to map remote users into local users.

    Example:

    "rules": [
                {
                    "local": [
                        {
                            "user": {
                                "name": "{0}"
                            }
                        },
                        {
                            "group": {
                                "name": "0cd5e9"
                            }
                        }
                    ],
                    "remote": [
                        {
                            "type": "UserName"
                        },
                        {
                            "type": "orgPersonType",
                            "any_one_of": [
                                "Contractor",
                                "SubContractor"
                            ]
                        }
                    ]
                }
            ]

    Under the local field:

    • user: indicates a local user.
    • group: indicates a local user group.

    Under the remote field:

    • "type": "UserName" indicates an attribute in an IdP assertion.
    • "type": "orgPersonType" indicates an attribute in an IdP assertion.

    links

    Yes

    Object

    Resource links of a mapping, including self.

  • Sample response
    {
        "mapping": {
            "id": "ACME",
            "links": {
                "self": "https://example.com/v3/OS-FEDERATION/mappings/ACME"
            },
            "rules": [
                {
                    "local": [
                        {
                            "user": {
                                "name": "{0}"
                            }
                        },
                        {
                            "group": {
                                "name": "0cd5e9"
                            }
                        }
                    ],
                    "remote": [
                        {
                            "type": "UserName"
                        },
                        {
                            "type": "orgPersonType",
                            "any_one_of": [
                                "Contractor",
                                "SubContractor"
                            ]
                        }
                    ]
                }
            ]
        }
    }

Status Codes

Status Code

Description

200

The request is successful.

400

The server failed to process the request.

401

You must enter a username and password to access the requested page.

403

You are forbidden to access the requested page.

404

The server could not find the requested page.

405

You are not allowed to use the method specified in the request.

409

A resource conflict occurs.

413

The request entity is too large.

500

Failed to complete the request because of an internal service error.

503

Failed to complete the request because the service is unavailable.