Passer au contenu principal
PUT
https://{tenantDomain}/api/v2
/
network-acls
/
{id}
Go
package example

import (
    context "context"

    management "github.com/auth0/go-auth0/management/management"
    client "github.com/auth0/go-auth0/management/management/client"
    option "github.com/auth0/go-auth0/management/management/option"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &management.SetNetworkAclRequestContent{
        Description: "description",
        Active: true,
        Priority: 1.1,
        Rule: &management.NetworkAclRule{
            Action: &management.NetworkAclAction{},
            Scope: management.NetworkAclRuleScopeEnumManagement,
        },
    }
    client.NetworkAcls.Set(
        context.TODO(),
        "id",
        request,
    )
}
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.networkAcls.set("id", {
description: "description",
active: true,
priority: 1.1,
rule: {
action: {},
scope: "management",
},
});
}
main();
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.networkAcls.set("id", {
description: "description",
active: true,
priority: 1.1,
rule: {
action: {},
scope: "management",
},
});
}
main();
curl --request PUT \
--url https://{tenantDomain}/api/v2/network-acls/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"active": true,
"rule": {
"action": {
"block": true,
"allow": true,
"log": true,
"redirect": true,
"redirect_uri": "<string>"
},
"match": {
"asns": [
123
],
"geo_country_codes": [
"<string>"
],
"geo_subdivision_codes": [
"<string>"
],
"ipv4_cidrs": [
"127.0.0.1"
],
"ipv6_cidrs": [
"2606:4700:3108::ac42:2835"
],
"ja3_fingerprints": [
"<string>"
],
"ja4_fingerprints": [
"<string>"
],
"user_agents": [
"<string>"
],
"hostnames": [
"<string>"
],
"connecting_ipv4_cidrs": [
"127.0.0.1"
],
"connecting_ipv6_cidrs": [
"2606:4700:3108::ac42:2835"
]
},
"not_match": {
"asns": [
123
],
"geo_country_codes": [
"<string>"
],
"geo_subdivision_codes": [
"<string>"
],
"ipv4_cidrs": [
"127.0.0.1"
],
"ipv6_cidrs": [
"2606:4700:3108::ac42:2835"
],
"ja3_fingerprints": [
"<string>"
],
"ja4_fingerprints": [
"<string>"
],
"user_agents": [
"<string>"
],
"hostnames": [
"<string>"
],
"connecting_ipv4_cidrs": [
"127.0.0.1"
],
"connecting_ipv6_cidrs": [
"2606:4700:3108::ac42:2835"
]
}
},
"priority": 50
}
'
import requests

url = "https://{tenantDomain}/api/v2/network-acls/{id}"

payload = {
"description": "<string>",
"active": True,
"rule": {
"action": {
"block": True,
"allow": True,
"log": True,
"redirect": True,
"redirect_uri": "<string>"
},
"match": {
"asns": [123],
"geo_country_codes": ["<string>"],
"geo_subdivision_codes": ["<string>"],
"ipv4_cidrs": ["127.0.0.1"],
"ipv6_cidrs": ["2606:4700:3108::ac42:2835"],
"ja3_fingerprints": ["<string>"],
"ja4_fingerprints": ["<string>"],
"user_agents": ["<string>"],
"hostnames": ["<string>"],
"connecting_ipv4_cidrs": ["127.0.0.1"],
"connecting_ipv6_cidrs": ["2606:4700:3108::ac42:2835"]
},
"not_match": {
"asns": [123],
"geo_country_codes": ["<string>"],
"geo_subdivision_codes": ["<string>"],
"ipv4_cidrs": ["127.0.0.1"],
"ipv6_cidrs": ["2606:4700:3108::ac42:2835"],
"ja3_fingerprints": ["<string>"],
"ja4_fingerprints": ["<string>"],
"user_agents": ["<string>"],
"hostnames": ["<string>"],
"connecting_ipv4_cidrs": ["127.0.0.1"],
"connecting_ipv6_cidrs": ["2606:4700:3108::ac42:2835"]
}
},
"priority": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/network-acls/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'active' => true,
'rule' => [
'action' => [
'block' => true,
'allow' => true,
'log' => true,
'redirect' => true,
'redirect_uri' => '<string>'
],
'match' => [
'asns' => [
123
],
'geo_country_codes' => [
'<string>'
],
'geo_subdivision_codes' => [
'<string>'
],
'ipv4_cidrs' => [
'127.0.0.1'
],
'ipv6_cidrs' => [
'2606:4700:3108::ac42:2835'
],
'ja3_fingerprints' => [
'<string>'
],
'ja4_fingerprints' => [
'<string>'
],
'user_agents' => [
'<string>'
],
'hostnames' => [
'<string>'
],
'connecting_ipv4_cidrs' => [
'127.0.0.1'
],
'connecting_ipv6_cidrs' => [
'2606:4700:3108::ac42:2835'
]
],
'not_match' => [
'asns' => [
123
],
'geo_country_codes' => [
'<string>'
],
'geo_subdivision_codes' => [
'<string>'
],
'ipv4_cidrs' => [
'127.0.0.1'
],
'ipv6_cidrs' => [
'2606:4700:3108::ac42:2835'
],
'ja3_fingerprints' => [
'<string>'
],
'ja4_fingerprints' => [
'<string>'
],
'user_agents' => [
'<string>'
],
'hostnames' => [
'<string>'
],
'connecting_ipv4_cidrs' => [
'127.0.0.1'
],
'connecting_ipv6_cidrs' => [
'2606:4700:3108::ac42:2835'
]
]
],
'priority' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.put("https://{tenantDomain}/api/v2/network-acls/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"active\": true,\n \"rule\": {\n \"action\": {\n \"block\": true,\n \"allow\": true,\n \"log\": true,\n \"redirect\": true,\n \"redirect_uri\": \"<string>\"\n },\n \"match\": {\n \"asns\": [\n 123\n ],\n \"geo_country_codes\": [\n \"<string>\"\n ],\n \"geo_subdivision_codes\": [\n \"<string>\"\n ],\n \"ipv4_cidrs\": [\n \"127.0.0.1\"\n ],\n \"ipv6_cidrs\": [\n \"2606:4700:3108::ac42:2835\"\n ],\n \"ja3_fingerprints\": [\n \"<string>\"\n ],\n \"ja4_fingerprints\": [\n \"<string>\"\n ],\n \"user_agents\": [\n \"<string>\"\n ],\n \"hostnames\": [\n \"<string>\"\n ],\n \"connecting_ipv4_cidrs\": [\n \"127.0.0.1\"\n ],\n \"connecting_ipv6_cidrs\": [\n \"2606:4700:3108::ac42:2835\"\n ]\n },\n \"not_match\": {\n \"asns\": [\n 123\n ],\n \"geo_country_codes\": [\n \"<string>\"\n ],\n \"geo_subdivision_codes\": [\n \"<string>\"\n ],\n \"ipv4_cidrs\": [\n \"127.0.0.1\"\n ],\n \"ipv6_cidrs\": [\n \"2606:4700:3108::ac42:2835\"\n ],\n \"ja3_fingerprints\": [\n \"<string>\"\n ],\n \"ja4_fingerprints\": [\n \"<string>\"\n ],\n \"user_agents\": [\n \"<string>\"\n ],\n \"hostnames\": [\n \"<string>\"\n ],\n \"connecting_ipv4_cidrs\": [\n \"127.0.0.1\"\n ],\n \"connecting_ipv6_cidrs\": [\n \"2606:4700:3108::ac42:2835\"\n ]\n }\n },\n \"priority\": 50\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{tenantDomain}/api/v2/network-acls/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"active\": true,\n \"rule\": {\n \"action\": {\n \"block\": true,\n \"allow\": true,\n \"log\": true,\n \"redirect\": true,\n \"redirect_uri\": \"<string>\"\n },\n \"match\": {\n \"asns\": [\n 123\n ],\n \"geo_country_codes\": [\n \"<string>\"\n ],\n \"geo_subdivision_codes\": [\n \"<string>\"\n ],\n \"ipv4_cidrs\": [\n \"127.0.0.1\"\n ],\n \"ipv6_cidrs\": [\n \"2606:4700:3108::ac42:2835\"\n ],\n \"ja3_fingerprints\": [\n \"<string>\"\n ],\n \"ja4_fingerprints\": [\n \"<string>\"\n ],\n \"user_agents\": [\n \"<string>\"\n ],\n \"hostnames\": [\n \"<string>\"\n ],\n \"connecting_ipv4_cidrs\": [\n \"127.0.0.1\"\n ],\n \"connecting_ipv6_cidrs\": [\n \"2606:4700:3108::ac42:2835\"\n ]\n },\n \"not_match\": {\n \"asns\": [\n 123\n ],\n \"geo_country_codes\": [\n \"<string>\"\n ],\n \"geo_subdivision_codes\": [\n \"<string>\"\n ],\n \"ipv4_cidrs\": [\n \"127.0.0.1\"\n ],\n \"ipv6_cidrs\": [\n \"2606:4700:3108::ac42:2835\"\n ],\n \"ja3_fingerprints\": [\n \"<string>\"\n ],\n \"ja4_fingerprints\": [\n \"<string>\"\n ],\n \"user_agents\": [\n \"<string>\"\n ],\n \"hostnames\": [\n \"<string>\"\n ],\n \"connecting_ipv4_cidrs\": [\n \"127.0.0.1\"\n ],\n \"connecting_ipv6_cidrs\": [\n \"2606:4700:3108::ac42:2835\"\n ]\n }\n },\n \"priority\": 50\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "description": "<string>",
  "active": true,
  "priority": 50.5,
  "rule": {
    "action": {
      "block": true,
      "allow": true,
      "log": true,
      "redirect": true,
      "redirect_uri": "<string>"
    },
    "match": {
      "asns": [
        123
      ],
      "geo_country_codes": [
        "<string>"
      ],
      "geo_subdivision_codes": [
        "<string>"
      ],
      "ipv4_cidrs": [
        "127.0.0.1"
      ],
      "ipv6_cidrs": [
        "2606:4700:3108::ac42:2835"
      ],
      "ja3_fingerprints": [
        "<string>"
      ],
      "ja4_fingerprints": [
        "<string>"
      ],
      "user_agents": [
        "<string>"
      ],
      "hostnames": [
        "<string>"
      ],
      "connecting_ipv4_cidrs": [
        "127.0.0.1"
      ],
      "connecting_ipv6_cidrs": [
        "2606:4700:3108::ac42:2835"
      ]
    },
    "not_match": {
      "asns": [
        123
      ],
      "geo_country_codes": [
        "<string>"
      ],
      "geo_subdivision_codes": [
        "<string>"
      ],
      "ipv4_cidrs": [
        "127.0.0.1"
      ],
      "ipv6_cidrs": [
        "2606:4700:3108::ac42:2835"
      ],
      "ja3_fingerprints": [
        "<string>"
      ],
      "ja4_fingerprints": [
        "<string>"
      ],
      "user_agents": [
        "<string>"
      ],
      "hostnames": [
        "<string>"
      ],
      "connecting_ipv4_cidrs": [
        "127.0.0.1"
      ],
      "connecting_ipv6_cidrs": [
        "2606:4700:3108::ac42:2835"
      ]
    }
  },
  "created_at": "<string>",
  "updated_at": "<string>"
}

Autorisations

Authorization
string
header
requis

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Paramètres de chemin

id
string
requis

The id of the ACL to update.

Maximum string length: 36

Corps

description
string
requis
Maximum string length: 255
active
boolean
requis

Indicates whether or not this access control list is actively being used

rule
object
requis
priority
number
défaut:50

Indicates the order in which the ACL will be evaluated relative to other ACL rules.

Plage requise: 1 <= x <= 100

Réponse

Network ACL properties successfully updated

id
string
description
string
active
boolean
priority
number
Plage requise: 1 <= x <= 100
rule
object
created_at
string

The timestamp when the Network ACL Configuration was created

updated_at
string

The timestamp when the Network ACL Configuration was last updated