Documentation Index
Fetch the complete documentation index at: https://arize-ax.mintlify.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
The resourcerestrictions client methods are currently in ALPHA. The API may change without notice. A one-time warning is emitted on first use.
Restricting a resource prevents roles bound at higher hierarchy levels (space, org, account) from granting access to it. Only users with the PROJECT_RESTRICT permission can perform these actions. Currently only PROJECT resources are supported.
Restrict a Resource
Create issues a POST to restrict a resource and returns the created restriction. This operation is idempotent — restricting an already-restricted resource returns the existing restriction without error.
Signature:
func (c *Client) Create(
ctx context.Context,
req CreateRequest,
) (*ResourceRestrictionResponse, error)
Usage Example:
package main
import (
"context"
"errors"
"fmt"
"log"
"github.com/Arize-ai/client-go-v2"
"github.com/Arize-ai/client-go-v2/resourcerestrictions"
)
func main() {
client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
if err != nil {
log.Fatal(err)
}
resp, err := client.ResourceRestrictions.Create(
context.Background(),
resourcerestrictions.CreateRequest{
ResourceId: "your-project-id", // global ID of the resource to restrict
},
)
if err != nil {
var forbidden *arize.ForbiddenError
if errors.As(err, &forbidden) {
log.Fatalf("missing PROJECT_RESTRICT permission: %v", forbidden)
}
log.Fatal(err)
}
fmt.Printf("restricted %s (type=%s) at %s\n",
resp.ResourceRestriction.ResourceId,
resp.ResourceRestriction.ResourceType,
resp.ResourceRestriction.CreatedAt,
)
}
Unrestrict a Resource
Delete issues a DELETE for the given resource ID. It returns only an error.
Signature:
func (c *Client) Delete(ctx context.Context, resourceID string) error
Usage Example:
package main
import (
"context"
"errors"
"log"
"github.com/Arize-ai/client-go-v2"
)
func main() {
client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
if err != nil {
log.Fatal(err)
}
err = client.ResourceRestrictions.Delete(context.Background(), "your-project-id")
if err != nil {
var notFound *arize.NotFoundError
if errors.As(err, ¬Found) {
log.Printf("no restriction to remove: %v", notFound)
return
}
log.Fatal(err)
}
}