Create role
Creates a new customer-owned role in the specified zone. The owner_type is always customer; platform roles are managed by Keycard.
Parameters
zoneID string
Returns
Create role
package main
import (
"context"
"fmt"
"github.com/keycardai/keycard-go"
"github.com/keycardai/keycard-go/option"
)
func main() {
client := keycard.NewClient(
option.WithAPIKey("My API Key"),
)
role, err := client.Zones.Roles.New(
context.TODO(),
"zoneId",
keycard.ZoneRoleNewParams{
RoleCreate: keycard.RoleCreateParam{
Identifier: "identifier",
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", role.ID)
}
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"identifier": "identifier",
"owner_type": "platform",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"description": "description"
}Returns Examples
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"identifier": "identifier",
"owner_type": "platform",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"description": "description"
}