2018-05-29 21:07:40 +00:00
|
|
|
---
|
|
|
|
layout: api
|
|
|
|
page_title: Intentions - Connect - HTTP API
|
2020-04-13 18:40:26 +00:00
|
|
|
sidebar_title: Intentions
|
2018-05-29 21:07:40 +00:00
|
|
|
description: |-
|
|
|
|
The /connect/intentions endpoint provide tools for managing intentions via
|
|
|
|
Consul's HTTP API.
|
|
|
|
---
|
|
|
|
|
|
|
|
# Intentions - Connect HTTP API
|
|
|
|
|
|
|
|
The `/connect/intentions` endpoint provide tools for managing
|
2020-04-09 23:46:54 +00:00
|
|
|
[intentions](/docs/connect/intentions).
|
2018-05-29 21:07:40 +00:00
|
|
|
|
|
|
|
## Create Intention
|
|
|
|
|
|
|
|
This endpoint creates a new intention and returns its ID if it was created
|
|
|
|
successfully.
|
|
|
|
|
|
|
|
The name and destination pair must be unique. If another intention matches
|
|
|
|
the name and destination, the creation will fail. You must either update the
|
|
|
|
existing intention or delete it prior to creating a new one.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | --------------------- | ------------------ |
|
|
|
|
| `POST` | `/connect/intentions` | `application/json` |
|
2018-05-29 21:07:40 +00:00
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
2020-04-09 23:46:54 +00:00
|
|
|
[blocking queries](/api/features/blocking),
|
|
|
|
[consistency modes](/api/features/consistency),
|
|
|
|
[agent caching](/api/features/caching), and
|
2020-04-09 23:20:00 +00:00
|
|
|
[required ACLs](/api#authentication).
|
2018-05-29 21:07:40 +00:00
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ------------------------------ |
|
|
|
|
| `NO` | `none` | `none` | `intentions:write`<sup>1</sup> |
|
2018-08-20 19:33:15 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
<p>
|
|
|
|
<sup>1</sup> Intention ACL rules are specified as part of a `service` rule.
|
|
|
|
See{' '}
|
2020-04-09 23:46:54 +00:00
|
|
|
<a href="/docs/connect/intentions#intention-management-permissions">
|
2020-04-07 18:55:19 +00:00
|
|
|
Intention Management Permissions
|
|
|
|
</a>{' '}
|
|
|
|
for more details.
|
|
|
|
</p>
|
2018-05-29 21:07:40 +00:00
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
- `SourceName` `(string: <required>)` - The source of the intention.
|
|
|
|
For a `SourceType` of `consul` this is the name of a Consul service. The
|
|
|
|
service doesn't need to be registered.
|
|
|
|
|
|
|
|
- `DestinationName` `(string: <required>)` - The destination of the intention.
|
|
|
|
The intention destination is always a Consul service, unlike the source.
|
|
|
|
The service doesn't need to be registered.
|
|
|
|
|
|
|
|
- `SourceType` `(string: <required>)` - The type for the `SourceName` value.
|
|
|
|
This can be only "consul" today to represent a Consul service.
|
|
|
|
|
|
|
|
- `Action` `(string: <required>)` - This is one of "allow" or "deny" for
|
|
|
|
the action that should be taken if this intention matches a request.
|
|
|
|
|
|
|
|
- `Description` `(string: nil)` - Description for the intention. This is not
|
|
|
|
used for anything by Consul, but is presented in API responses to assist
|
|
|
|
tooling.
|
|
|
|
|
|
|
|
- `Meta` `(map<string|string>: nil)` - Specifies arbitrary KV metadata pairs.
|
|
|
|
|
|
|
|
### Sample Payload
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"SourceName": "web",
|
|
|
|
"DestinationName": "db",
|
|
|
|
"SourceType": "consul",
|
|
|
|
"Action": "allow"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2018-05-29 21:07:40 +00:00
|
|
|
$ curl \
|
|
|
|
--request POST \
|
|
|
|
--data @payload.json \
|
2018-08-28 16:07:15 +00:00
|
|
|
http://127.0.0.1:8500/v1/connect/intentions
|
2018-05-29 21:07:40 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"ID": "8f246b77-f3e1-ff88-5b48-8ec93abf3e05"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Read Specific Intention
|
|
|
|
|
|
|
|
This endpoint reads a specific intention.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | --------------------------- | ------------------ |
|
|
|
|
| `GET` | `/connect/intentions/:uuid` | `application/json` |
|
2018-05-29 21:07:40 +00:00
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
2020-04-09 23:46:54 +00:00
|
|
|
[blocking queries](/api/features/blocking),
|
|
|
|
[consistency modes](/api/features/consistency),
|
|
|
|
[agent caching](/api/features/caching), and
|
2020-04-09 23:20:00 +00:00
|
|
|
[required ACLs](/api#authentication).
|
2018-05-29 21:07:40 +00:00
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ----------------------------- |
|
2018-09-06 10:34:28 +00:00
|
|
|
| `YES` | `all` | `none` | `intentions:read`<sup>1</sup> |
|
2018-08-20 19:33:15 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
<p>
|
|
|
|
<sup>1</sup> Intention ACL rules are specified as part of a `service` rule.
|
|
|
|
See{' '}
|
2020-04-09 23:46:54 +00:00
|
|
|
<a href="/docs/connect/intentions#intention-management-permissions">
|
2020-04-07 18:55:19 +00:00
|
|
|
Intention Management Permissions
|
|
|
|
</a>{' '}
|
|
|
|
for more details.
|
|
|
|
</p>
|
2018-05-29 21:07:40 +00:00
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
- `uuid` `(string: <required>)` - Specifies the UUID of the intention to read. This
|
|
|
|
is specified as part of the URL.
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2018-05-29 21:07:40 +00:00
|
|
|
$ curl \
|
2018-08-28 16:07:15 +00:00
|
|
|
http://127.0.0.1:8500/v1/connect/intentions/e9ebc19f-d481-42b1-4871-4d298d3acd5c
|
2018-05-29 21:07:40 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"ID": "e9ebc19f-d481-42b1-4871-4d298d3acd5c",
|
|
|
|
"Description": "",
|
|
|
|
"SourceNS": "default",
|
|
|
|
"SourceName": "web",
|
|
|
|
"DestinationNS": "default",
|
|
|
|
"DestinationName": "db",
|
|
|
|
"SourceType": "consul",
|
|
|
|
"Action": "allow",
|
|
|
|
"DefaultAddr": "",
|
|
|
|
"DefaultPort": 0,
|
|
|
|
"Meta": {},
|
2018-06-07 04:18:32 +00:00
|
|
|
"Precedence": 9,
|
2018-05-29 21:07:40 +00:00
|
|
|
"CreatedAt": "2018-05-21T16:41:27.977155457Z",
|
|
|
|
"UpdatedAt": "2018-05-21T16:41:27.977157724Z",
|
|
|
|
"CreateIndex": 11,
|
|
|
|
"ModifyIndex": 11
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## List Intentions
|
|
|
|
|
|
|
|
This endpoint lists all intentions.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | --------------------- | ------------------ |
|
|
|
|
| `GET` | `/connect/intentions` | `application/json` |
|
2018-05-29 21:07:40 +00:00
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
2020-04-09 23:46:54 +00:00
|
|
|
[blocking queries](/api/features/blocking),
|
|
|
|
[consistency modes](/api/features/consistency),
|
|
|
|
[agent caching](/api/features/caching), and
|
2020-04-09 23:20:00 +00:00
|
|
|
[required ACLs](/api#authentication).
|
2018-05-29 21:07:40 +00:00
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ----------------------------- |
|
2018-09-06 10:34:28 +00:00
|
|
|
| `YES` | `all` | `none` | `intentions:read`<sup>1</sup> |
|
2018-08-20 19:33:15 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
<p>
|
|
|
|
<sup>1</sup> Intention ACL rules are specified as part of a `service` rule.
|
|
|
|
See{' '}
|
2020-04-09 23:46:54 +00:00
|
|
|
<a href="/docs/connect/intentions#intention-management-permissions">
|
2020-04-07 18:55:19 +00:00
|
|
|
Intention Management Permissions
|
|
|
|
</a>{' '}
|
|
|
|
for more details.
|
|
|
|
</p>
|
2018-05-29 21:07:40 +00:00
|
|
|
|
2020-04-07 15:48:44 +00:00
|
|
|
### Parameters
|
|
|
|
|
|
|
|
- `filter` `(string: "")` - Specifies the expression used to filter the
|
|
|
|
queries results prior to returning the data.
|
|
|
|
|
2018-05-29 21:07:40 +00:00
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2018-05-29 21:07:40 +00:00
|
|
|
$ curl \
|
2020-04-07 15:48:44 +00:00
|
|
|
'http://127.0.0.1:8500/v1/connect/intentions?filter=SourceName==web'
|
2018-05-29 21:07:40 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"ID": "e9ebc19f-d481-42b1-4871-4d298d3acd5c",
|
|
|
|
"Description": "",
|
|
|
|
"SourceNS": "default",
|
|
|
|
"SourceName": "web",
|
|
|
|
"DestinationNS": "default",
|
|
|
|
"DestinationName": "db",
|
|
|
|
"SourceType": "consul",
|
|
|
|
"Action": "allow",
|
|
|
|
"DefaultAddr": "",
|
|
|
|
"DefaultPort": 0,
|
|
|
|
"Meta": {},
|
2018-06-07 04:18:32 +00:00
|
|
|
"Precedence": 9,
|
2018-05-29 21:07:40 +00:00
|
|
|
"CreatedAt": "2018-05-21T16:41:27.977155457Z",
|
|
|
|
"UpdatedAt": "2018-05-21T16:41:27.977157724Z",
|
|
|
|
"CreateIndex": 11,
|
|
|
|
"ModifyIndex": 11
|
|
|
|
}
|
|
|
|
]
|
|
|
|
```
|
|
|
|
|
2020-04-07 15:48:44 +00:00
|
|
|
### Filtering
|
|
|
|
|
|
|
|
The filter will be executed against each Intention in the result list with
|
|
|
|
the following selectors and filter operations being supported:
|
|
|
|
|
2020-04-13 17:38:44 +00:00
|
|
|
| Selector | Supported Operations |
|
|
|
|
| ----------------- | -------------------------------------------------- |
|
|
|
|
| `Action` | Equal, Not Equal, In, Not In, Matches, Not Matches |
|
|
|
|
| `DefaultAddr` | Equal, Not Equal, In, Not In, Matches, Not Matches |
|
|
|
|
| `DefaultPort` | Equal, Not Equal |
|
|
|
|
| `Description` | Equal, Not Equal, In, Not In, Matches, Not Matches |
|
|
|
|
| `DestinationNS` | Equal, Not Equal, In, Not In, Matches, Not Matches |
|
|
|
|
| `DestinationName` | Equal, Not Equal, In, Not In, Matches, Not Matches |
|
|
|
|
| `ID` | Equal, Not Equal, In, Not In, Matches, Not Matches |
|
|
|
|
| `Meta` | Is Empty, Is Not Empty, In, Not In |
|
|
|
|
| `Meta.<any>` | Equal, Not Equal, In, Not In, Matches, Not Matches |
|
|
|
|
| `Precedence` | Equal, Not Equal |
|
|
|
|
| `SourceNS` | Equal, Not Equal, In, Not In, Matches, Not Matches |
|
|
|
|
| `SourceName` | Equal, Not Equal, In, Not In, Matches, Not Matches |
|
|
|
|
| `SourceType` | Equal, Not Equal, In, Not In, Matches, Not Matches |
|
2020-04-07 15:48:44 +00:00
|
|
|
|
2018-05-29 21:07:40 +00:00
|
|
|
## Update Intention
|
|
|
|
|
|
|
|
This endpoint updates an intention with the given values.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | --------------------------- | ------------------ |
|
|
|
|
| `PUT` | `/connect/intentions/:uuid` | `application/json` |
|
2018-05-29 21:07:40 +00:00
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
2020-04-09 23:46:54 +00:00
|
|
|
[blocking queries](/api/features/blocking),
|
|
|
|
[consistency modes](/api/features/consistency),
|
|
|
|
[agent caching](/api/features/caching), and
|
2020-04-09 23:20:00 +00:00
|
|
|
[required ACLs](/api#authentication).
|
2018-05-29 21:07:40 +00:00
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ------------------------------ |
|
2018-09-06 10:34:28 +00:00
|
|
|
| `NO` | `none` | `none` | `intentions:write`<sup>1</sup> |
|
2018-08-20 19:33:15 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
<p>
|
|
|
|
<sup>1</sup> Intention ACL rules are specified as part of a `service` rule.
|
|
|
|
See{' '}
|
2020-04-09 23:46:54 +00:00
|
|
|
<a href="/docs/connect/intentions#intention-management-permissions">
|
2020-04-07 18:55:19 +00:00
|
|
|
Intention Management Permissions
|
|
|
|
</a>{' '}
|
|
|
|
for more details.
|
|
|
|
</p>
|
2018-05-29 21:07:40 +00:00
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
- `uuid` `(string: <required>)` - Specifies the UUID of the intention to update. This
|
|
|
|
is specified as part of the URL.
|
|
|
|
|
|
|
|
- Other parameters are identical to creating an intention.
|
|
|
|
|
|
|
|
### Sample Payload
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"SourceName": "web",
|
|
|
|
"DestinationName": "other-db",
|
|
|
|
"SourceType": "consul",
|
|
|
|
"Action": "allow"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2018-05-29 21:07:40 +00:00
|
|
|
$ curl \
|
|
|
|
--request PUT \
|
|
|
|
--data @payload.json \
|
2018-08-28 16:07:15 +00:00
|
|
|
http://127.0.0.1:8500/v1/connect/intentions/e9ebc19f-d481-42b1-4871-4d298d3acd5c
|
2018-05-29 21:07:40 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Delete Intention
|
|
|
|
|
|
|
|
This endpoint deletes a specific intention.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| -------- | --------------------------- | ------------------ |
|
|
|
|
| `DELETE` | `/connect/intentions/:uuid` | `application/json` |
|
2018-05-29 21:07:40 +00:00
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
2020-04-09 23:46:54 +00:00
|
|
|
[blocking queries](/api/features/blocking),
|
|
|
|
[consistency modes](/api/features/consistency),
|
|
|
|
[agent caching](/api/features/caching), and
|
2020-04-09 23:20:00 +00:00
|
|
|
[required ACLs](/api#authentication).
|
2018-05-29 21:07:40 +00:00
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ------------------------------ |
|
2018-09-06 10:34:28 +00:00
|
|
|
| `NO` | `none` | `none` | `intentions:write`<sup>1</sup> |
|
2018-08-20 19:33:15 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
<p>
|
|
|
|
<sup>1</sup> Intention ACL rules are specified as part of a `service` rule.
|
|
|
|
See{' '}
|
2020-04-09 23:46:54 +00:00
|
|
|
<a href="/docs/connect/intentions#intention-management-permissions">
|
2020-04-07 18:55:19 +00:00
|
|
|
Intention Management Permissions
|
|
|
|
</a>{' '}
|
|
|
|
for more details.
|
|
|
|
</p>
|
2018-05-29 21:07:40 +00:00
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
- `uuid` `(string: <required>)` - Specifies the UUID of the intention to delete. This
|
|
|
|
is specified as part of the URL.
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2018-05-29 21:07:40 +00:00
|
|
|
$ curl \
|
|
|
|
--request DELETE \
|
2018-08-28 16:07:15 +00:00
|
|
|
http://127.0.0.1:8500/v1/connect/intentions/e9ebc19f-d481-42b1-4871-4d298d3acd5c
|
2018-05-29 21:07:40 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Check Intention Result
|
|
|
|
|
|
|
|
This endpoint evaluates the intentions for a specific source and destination
|
|
|
|
and returns whether the connection would be authorized or not given the
|
|
|
|
current Consul configuration and set of intentions.
|
|
|
|
|
|
|
|
This endpoint will work even if the destination service has
|
|
|
|
`intention = "deny"` specifically set, because the resulting API response
|
|
|
|
does not contain any information about the intention itself.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | --------------------------- | ------------------ |
|
|
|
|
| `GET` | `/connect/intentions/check` | `application/json` |
|
2018-05-29 21:07:40 +00:00
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
2020-04-09 23:46:54 +00:00
|
|
|
[blocking queries](/api/features/blocking),
|
|
|
|
[consistency modes](/api/features/consistency),
|
|
|
|
[agent caching](/api/features/caching), and
|
2020-04-09 23:20:00 +00:00
|
|
|
[required ACLs](/api#authentication).
|
2018-05-29 21:07:40 +00:00
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ----------------------------- |
|
2018-09-06 10:34:28 +00:00
|
|
|
| `NO` | `none` | `none` | `intentions:read`<sup>1</sup> |
|
2018-08-20 19:33:15 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
<p>
|
|
|
|
<sup>1</sup> Intention ACL rules are specified as part of a `service` rule.
|
|
|
|
See{' '}
|
2020-04-09 23:46:54 +00:00
|
|
|
<a href="/docs/connect/intentions#intention-management-permissions">
|
2020-04-07 18:55:19 +00:00
|
|
|
Intention Management Permissions
|
|
|
|
</a>{' '}
|
|
|
|
for more details.
|
|
|
|
</p>
|
2018-05-29 21:07:40 +00:00
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
- `source` `(string: <required>)` - Specifies the source service. This
|
|
|
|
is specified as part of the URL.
|
|
|
|
|
|
|
|
- `destination` `(string: <required>)` - Specifies the destination service. This
|
|
|
|
is specified as part of the URL.
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2018-05-29 21:07:40 +00:00
|
|
|
$ curl \
|
2018-08-28 16:07:15 +00:00
|
|
|
http://127.0.0.1:8500/v1/connect/intentions/check?source=web&destination=db
|
2018-05-29 21:07:40 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"Allowed": true
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
- `Allowed` is true if the connection would be allowed, false otherwise.
|
|
|
|
|
|
|
|
## List Matching Intentions
|
|
|
|
|
|
|
|
This endpoint lists the intentions that match a given source or destination.
|
|
|
|
The intentions in the response are in evaluation order.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | --------------------------- | ------------------ |
|
|
|
|
| `GET` | `/connect/intentions/match` | `application/json` |
|
2018-05-29 21:07:40 +00:00
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
2020-04-09 23:46:54 +00:00
|
|
|
[blocking queries](/api/features/blocking),
|
|
|
|
[consistency modes](/api/features/consistency),
|
|
|
|
[agent caching](/api/features/caching), and
|
2020-04-09 23:20:00 +00:00
|
|
|
[required ACLs](/api#authentication).
|
2018-05-29 21:07:40 +00:00
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ----------------------------- |
|
2018-09-06 10:34:28 +00:00
|
|
|
| `NO` | `none` | `none` | `intentions:read`<sup>1</sup> |
|
2018-08-20 19:33:15 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
<p>
|
|
|
|
<sup>1</sup> Intention ACL rules are specified as part of a `service` rule.
|
|
|
|
See{' '}
|
2020-04-09 23:46:54 +00:00
|
|
|
<a href="/docs/connect/intentions#intention-management-permissions">
|
2020-04-07 18:55:19 +00:00
|
|
|
Intention Management Permissions
|
|
|
|
</a>{' '}
|
|
|
|
for more details.
|
|
|
|
</p>
|
2018-05-29 21:07:40 +00:00
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
- `by` `(string: <required>)` - Specifies whether to match the "name" value
|
|
|
|
by "source" or "destination".
|
|
|
|
|
|
|
|
- `name` `(string: <required>)` - Specifies a name to match. This parameter
|
|
|
|
can be repeated for batching multiple matches.
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2018-05-29 21:07:40 +00:00
|
|
|
$ curl \
|
2018-08-28 16:07:15 +00:00
|
|
|
http://127.0.0.1:8500/v1/connect/intentions/match?by=source&name=web
|
2018-05-29 21:07:40 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"web": [
|
|
|
|
{
|
|
|
|
"ID": "ed16f6a6-d863-1bec-af45-96bbdcbe02be",
|
|
|
|
"Description": "",
|
|
|
|
"SourceNS": "default",
|
|
|
|
"SourceName": "web",
|
|
|
|
"DestinationNS": "default",
|
|
|
|
"DestinationName": "db",
|
|
|
|
"SourceType": "consul",
|
|
|
|
"Action": "deny",
|
|
|
|
"DefaultAddr": "",
|
|
|
|
"DefaultPort": 0,
|
|
|
|
"Meta": {},
|
|
|
|
"CreatedAt": "2018-05-21T16:41:33.296693825Z",
|
|
|
|
"UpdatedAt": "2018-05-21T16:41:33.296694288Z",
|
|
|
|
"CreateIndex": 12,
|
|
|
|
"ModifyIndex": 12
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"ID": "e9ebc19f-d481-42b1-4871-4d298d3acd5c",
|
|
|
|
"Description": "",
|
|
|
|
"SourceNS": "default",
|
|
|
|
"SourceName": "web",
|
|
|
|
"DestinationNS": "default",
|
|
|
|
"DestinationName": "*",
|
|
|
|
"SourceType": "consul",
|
|
|
|
"Action": "allow",
|
|
|
|
"DefaultAddr": "",
|
|
|
|
"DefaultPort": 0,
|
|
|
|
"Meta": {},
|
|
|
|
"CreatedAt": "2018-05-21T16:41:27.977155457Z",
|
|
|
|
"UpdatedAt": "2018-05-21T16:41:27.977157724Z",
|
|
|
|
"CreateIndex": 11,
|
|
|
|
"ModifyIndex": 11
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|