Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Experimental] Upgrade beta.18 and migrate to docusaurus-openapi-docs #117

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 66 additions & 2 deletions api.sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,70 @@
* LICENSE file in the root directory of this source tree.
*/

module.exports = {
cloud: require("./static/oas/expander/sidebar").sidebar,
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
expander: [
{
type: "category",
label: "Annotations API",
link: {
type: "generated-index",
title: "Annotations API",
slug: "/category/annotations-api"
},
items: [{ type: "autogenerated", dirName: "expander/annotations" }]
},
{
type: "category",
label: "Assets API",
link: {
type: "generated-index",
title: "Assets API",
slug: "/category/assets-api"
},
items: [{ type: "autogenerated", dirName: "expander/assets" }]
},
{
type: "category",
label: "Connectors API",
link: {
type: "generated-index",
title: "Connectors API",
slug: "/category/connectors-api"
},
items: [{ type: "autogenerated", dirName: "expander/connectors" }]
},
{
type: "category",
label: "Entities API",
link: {
type: "generated-index",
title: "Entities API",
slug: "/category/entities-api"
},
items: [{ type: "autogenerated", dirName: "expander/entities" }]
},
{
type: "category",
label: "Issues API",
link: {
type: "generated-index",
title: "Issues API",
slug: "/category/issues-api"
},
items: [{ type: "autogenerated", dirName: "expander/issues" }]
},
{
type: "category",
label: "Services API",
link: {
type: "generated-index",
title: "Services API",
slug: "/category/services-api"
},
items: [{ type: "autogenerated", dirName: "expander/services" }]
}
]
};

module.exports = sidebars;
11 changes: 0 additions & 11 deletions api/expander/annotations.mdx

This file was deleted.

17 changes: 17 additions & 0 deletions api/expander/annotations/annotations-api.info.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
id: annotations-api
sidebar_label: Introduction
sidebar_position: 0
hide_title: true
---

<span className={"theme-doc-version-badge badge badge--secondary"}>Version: 3.0.0</span>

# Annotations API



API for interacting with Expander annotations

<div style={{"display":"flex","flexDirection":"column","marginBottom":"var(--ifm-paragraph-margin-bottom)"}}><h3 style={{"marginBottom":"0.25rem"}}>Contact</h3><span>API Support: <a href={"mailto:expanse-support@paloaltonetworks.com"}>expanse-support@paloaltonetworks.com</a></span><span>URL: <a href={"https://docs.paloaltonetworks.com/cortex/cortex-xpanse/cortex-xpanse-user-guide/apis-and-integrations-main/expander-apis-and-integrations/expander-apis.html#expander-apis"}>https://docs.paloaltonetworks.com/cortex/cortex-xpanse/cortex-xpanse-user-guide/apis-and-integrations-main/expander-apis-and-integrations/expander-apis.html#expander-apis</a></span></div><div style={{"marginBottom":"var(--ifm-paragraph-margin-bottom)"}}><h3 style={{"marginBottom":"0.25rem"}}>Terms of Service</h3><a href={"https://www.paloaltonetworks.com/content/dam/pan/en_US/assets/pdf/legal/palo-alto-networks-end-user-license-agreement-eula.pdf"}>https://www.paloaltonetworks.com/content/dam/pan/en_US/assets/pdf/legal/palo-alto-networks-end-user-license-agreement-eula.pdf</a></div>

30 changes: 30 additions & 0 deletions api/expander/annotations/create-a-tag.api.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
id: create-a-tag
sidebar_label: Create a tag.
hide_title: true
hide_table_of_contents: true
api: {"tags":["Tags"],"description":"Create a new tag. Tag names must be less than 128 characters and descriptions must be less than 512 characters. Attempting to create a tag that already exists will throw a 409 conflict error.","operationId":"createTag","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"tenantId":{"type":"string","format":"uuid"},"name":{"maxLength":128,"minLength":1,"type":"string"},"description":{"maxLength":512,"minLength":0,"type":"string"},"disabled":{"type":"boolean"},"created":{"type":"string","format":"date-time"},"modified":{"type":"string","format":"date-time"}}}}},"required":true},"responses":{"201":{"description":"Created","headers":{"Location":{"description":"Path to created resource","style":"simple","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"tenantId":{"type":"string","format":"uuid"},"name":{"maxLength":128,"minLength":1,"type":"string"},"description":{"maxLength":512,"minLength":0,"type":"string"},"disabled":{"type":"boolean"},"created":{"type":"string","format":"date-time"},"modified":{"type":"string","format":"date-time"}}}}}},"409":{"description":"Conflict"}},"method":"post","path":"/api/v3/annotations/tags","servers":[{"url":"https://expander.expanse.co"}],"security":[{"Bearer":[]}],"securitySchemes":{"ClientCredentials":{"type":"oauth2","description":"For more information on how to retrieve client credentials, visit the Xpanse [TechDocs](https://docs.paloaltonetworks.com/cortex/cortex-xpanse/cortex-xpanse-user-guide/apis-and-integrations-main/expander-apis-and-integrations/expander-apis.html#expander-apis). This is the preferred method for retrieving a JWT for Xpanse APIs. There will be significant customer communications and a lengthy migration period before refresh token support is removed in favor of the client credentials flow.\n\nExchange a `client_id` and `client_secret` for an `access_token` (JWT) that can be passed to all Xpanse APIs. See [Get Access Token from Client Credentials](#operation/getAccessToken) for more info.","flows":{"clientCredentials":{"tokenUrl":"/api/oauth2/RequestToken","scopes":{"scope-xpanse":"access Xpanse APIs"}}}},"RefreshToken-Deprecated":{"type":"apiKey","description":"Xpanse APIs continue to support this JWT retrieval method alongside the preferred client credentials flow. There will be significant customer communications and a lengthy migration period before refresh token support is removed in favor of the client credentials flow.\n\nProvide a valid Xpanse-provided refresh token to access `/api/v1/idToken/`. This route will generate a JWT token that can be used with the other api endpoints.\n\nExample: `Authorization: Bearer <refreshToken>`","name":"Authorization","in":"header"},"Bearer":{"type":"http","description":"To access Xpanse APIs, a valid access token (JWT) must be included in every request\nin the `Authorization` header, which is retrieved by going through the client credentials flow (preferred method of JWT retrieval).\n\nThe value for this header should be `Bearer <access_token>`, where the token is the base64-encoded JSON Web Token returned as the `access_token` field in the client credentials flow.","name":"Authorization","in":"header","scheme":"bearer","bearerFormat":"JWT"}},"jsonRequestBodyExample":{"id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","tenantId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","name":"string","description":"string","disabled":true,"created":"string","modified":"string"},"info":{"title":"Annotations API","description":"API for interacting with Expander annotations","termsOfService":"https://www.paloaltonetworks.com/content/dam/pan/en_US/assets/pdf/legal/palo-alto-networks-end-user-license-agreement-eula.pdf","contact":{"name":"API Support","url":"https://docs.paloaltonetworks.com/cortex/cortex-xpanse/cortex-xpanse-user-guide/apis-and-integrations-main/expander-apis-and-integrations/expander-apis.html#expander-apis","email":"expanse-support@paloaltonetworks.com"},"version":"3.0.0"},"postman":{"name":"Create a tag.","description":{"content":"Create a new tag. Tag names must be less than 128 characters and descriptions must be less than 512 characters. Attempting to create a tag that already exists will throw a 409 conflict error.","type":"text/plain"},"url":{"path":["api","v3","annotations","tags"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}}
sidebar_class_name: "post api-method"
---

import ParamsItem from "@theme/ParamsItem";
import SchemaItem from "@theme/SchemaItem"
import ApiTabs from "@theme/ApiTabs";
import TabItem from "@theme/TabItem";

## Create a tag.



Create a new tag. Tag names must be less than 128 characters and descriptions must be less than 512 characters. Attempting to create a tag that already exists will throw a 409 conflict error.

<details style={{}}><summary style={{"textAlign":"left"}}><strong>Request Body</strong><strong style={{"fontSize":"var(--ifm-code-font-size)","color":"var(--openapi-required)"}}> required</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaDescription={undefined} schemaName={"uuid"} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={false} name={"tenantId"} required={false} schemaDescription={undefined} schemaName={"uuid"} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={false} name={"name"} required={false} schemaDescription={undefined} schemaName={"string"} qualifierMessage={"**Possible values:** 1 ≤ length ≤ 128"}></SchemaItem><SchemaItem collapsible={false} name={"description"} required={false} schemaDescription={undefined} schemaName={"string"} qualifierMessage={"**Possible values:** length ≤ 512"}></SchemaItem><SchemaItem collapsible={false} name={"disabled"} required={false} schemaDescription={undefined} schemaName={"boolean"} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={false} name={"created"} required={false} schemaDescription={undefined} schemaName={"date-time"} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={false} name={"modified"} required={false} schemaDescription={undefined} schemaName={"date-time"} qualifierMessage={undefined}></SchemaItem></ul></details><div><ApiTabs><TabItem label={"201"} value={"201"}><div>

Created

</div><div><details style={{}}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaDescription={undefined} schemaName={"uuid"} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={false} name={"tenantId"} required={false} schemaDescription={undefined} schemaName={"uuid"} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={false} name={"name"} required={false} schemaDescription={undefined} schemaName={"string"} qualifierMessage={"**Possible values:** 1 ≤ length ≤ 128"}></SchemaItem><SchemaItem collapsible={false} name={"description"} required={false} schemaDescription={undefined} schemaName={"string"} qualifierMessage={"**Possible values:** length ≤ 512"}></SchemaItem><SchemaItem collapsible={false} name={"disabled"} required={false} schemaDescription={undefined} schemaName={"boolean"} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={false} name={"created"} required={false} schemaDescription={undefined} schemaName={"date-time"} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={false} name={"modified"} required={false} schemaDescription={undefined} schemaName={"date-time"} qualifierMessage={undefined}></SchemaItem></ul></details></div></TabItem><TabItem label={"409"} value={"409"}><div>

Conflict

</div><div></div></TabItem></ApiTabs></div>

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
id: get-access-token-from-client-credentials
sidebar_label: Get Access Token from Client Credentials
hide_title: true
hide_table_of_contents: true
api: {"tags":["Tokens"],"description":"<b> NOTE: </b>This endpoint uses the server `https://api.paloaltonetworks.com` instead of `https://expander.expanse.co`.\n This route can be accessed with a `client_id` and `client_secret` to generate a valid `access_token` to be used with the other Xpanse api endpoints. For more information on how to retrieve client credentials, visit the Xpanse [TechDocs](https://docs.paloaltonetworks.com/cortex/cortex-xpanse/cortex-xpanse-user-guide/apis-and-integrations-main/expander-apis-and-integrations/expander-apis.html#expander-apis). \n\nExample: `Authorization: Bearer access_token`","operationId":"getAccessToken","requestBody":{"description":"scope should be `scope-xpanse`, grant_type should be `client_credentials`","content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"client_secret":{"type":"string"},"scope":{"type":"string","example":"scope-xpanse"},"grant_type":{"type":"string","example":"client_credentials"}}}}}},"responses":{"200":{"description":"Response field `access_token` can be used as the Bearer token in future requests to other Xpanse endpoints.\n\nExample: `Authorization: Bearer access_token`","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string"},"expires_in":{"type":"integer","example":3599}}}}}}},"security":[{"ClientCredentials":[]}],"servers":[{"url":"https://api.paloaltonetworks.com"}],"method":"post","path":"/api/oauth2/RequestToken","securitySchemes":{"ClientCredentials":{"type":"oauth2","description":"For more information on how to retrieve client credentials, visit the Xpanse [TechDocs](https://docs.paloaltonetworks.com/cortex/cortex-xpanse/cortex-xpanse-user-guide/apis-and-integrations-main/expander-apis-and-integrations/expander-apis.html#expander-apis). This is the preferred method for retrieving a JWT for Xpanse APIs. There will be significant customer communications and a lengthy migration period before refresh token support is removed in favor of the client credentials flow.\n\nExchange a `client_id` and `client_secret` for an `access_token` (JWT) that can be passed to all Xpanse APIs. See [Get Access Token from Client Credentials](#operation/getAccessToken) for more info.","flows":{"clientCredentials":{"tokenUrl":"/api/oauth2/RequestToken","scopes":{"scope-xpanse":"access Xpanse APIs"}}}},"RefreshToken-Deprecated":{"type":"apiKey","description":"Xpanse APIs continue to support this JWT retrieval method alongside the preferred client credentials flow. There will be significant customer communications and a lengthy migration period before refresh token support is removed in favor of the client credentials flow.\n\nProvide a valid Xpanse-provided refresh token to access `/api/v1/idToken/`. This route will generate a JWT token that can be used with the other api endpoints.\n\nExample: `Authorization: Bearer <refreshToken>`","name":"Authorization","in":"header"},"Bearer":{"type":"http","description":"To access Xpanse APIs, a valid access token (JWT) must be included in every request\nin the `Authorization` header, which is retrieved by going through the client credentials flow (preferred method of JWT retrieval).\n\nThe value for this header should be `Bearer <access_token>`, where the token is the base64-encoded JSON Web Token returned as the `access_token` field in the client credentials flow.","name":"Authorization","in":"header","scheme":"bearer","bearerFormat":"JWT"}},"jsonRequestBodyExample":{"client_id":"string","client_secret":"string","scope":"scope-xpanse","grant_type":"client_credentials"},"info":{"title":"Annotations API","description":"API for interacting with Expander annotations","termsOfService":"https://www.paloaltonetworks.com/content/dam/pan/en_US/assets/pdf/legal/palo-alto-networks-end-user-license-agreement-eula.pdf","contact":{"name":"API Support","url":"https://docs.paloaltonetworks.com/cortex/cortex-xpanse/cortex-xpanse-user-guide/apis-and-integrations-main/expander-apis-and-integrations/expander-apis.html#expander-apis","email":"expanse-support@paloaltonetworks.com"},"version":"3.0.0"},"postman":{"name":"Get Access Token from Client Credentials","description":{"content":"<b> NOTE: </b>This endpoint uses the server `https://api.paloaltonetworks.com` instead of `https://expander.expanse.co`.\n This route can be accessed with a `client_id` and `client_secret` to generate a valid `access_token` to be used with the other Xpanse api endpoints. For more information on how to retrieve client credentials, visit the Xpanse [TechDocs](https://docs.paloaltonetworks.com/cortex/cortex-xpanse/cortex-xpanse-user-guide/apis-and-integrations-main/expander-apis-and-integrations/expander-apis.html#expander-apis). \n\nExample: `Authorization: Bearer access_token`","type":"text/plain"},"url":{"path":["api","oauth2","RequestToken"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}},"auth":{"type":"oauth2","oauth2":[]}}}
sidebar_class_name: "post api-method"
---

import ParamsItem from "@theme/ParamsItem";
import SchemaItem from "@theme/SchemaItem"
import ApiTabs from "@theme/ApiTabs";
import TabItem from "@theme/TabItem";

## Get Access Token from Client Credentials



&lt;b&gt; NOTE: &lt;/b&gt;This endpoint uses the server `https://api.paloaltonetworks.com` instead of `https://expander.expanse.co`.
This route can be accessed with a `client_id` and `client_secret` to generate a valid `access_token` to be used with the other Xpanse api endpoints. For more information on how to retrieve client credentials, visit the Xpanse [TechDocs](https://docs.paloaltonetworks.com/cortex/cortex-xpanse/cortex-xpanse-user-guide/apis-and-integrations-main/expander-apis-and-integrations/expander-apis.html#expander-apis).

Example: `Authorization: Bearer access_token`

<details style={{}}><summary style={{"textAlign":"left"}}><strong>Request Body</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}><div style={{"marginTop":"1rem","marginBottom":"1rem"}}>

scope should be `scope-xpanse`, grant_type should be `client_credentials`

</div></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"client_id"} required={false} schemaDescription={undefined} schemaName={"string"} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={false} name={"client_secret"} required={false} schemaDescription={undefined} schemaName={"string"} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={false} name={"scope"} required={false} schemaDescription={undefined} schemaName={"string"} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={false} name={"grant_type"} required={false} schemaDescription={undefined} schemaName={"string"} qualifierMessage={undefined}></SchemaItem></ul></details><div><ApiTabs><TabItem label={"200"} value={"200"}><div>

Response field `access_token` can be used as the Bearer token in future requests to other Xpanse endpoints.

Example: `Authorization: Bearer access_token`

</div><div><details style={{}}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"access_token"} required={false} schemaDescription={undefined} schemaName={"string"} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={false} name={"token_type"} required={false} schemaDescription={undefined} schemaName={"string"} qualifierMessage={undefined}></SchemaItem><SchemaItem collapsible={false} name={"expires_in"} required={false} schemaDescription={undefined} schemaName={"integer"} qualifierMessage={undefined}></SchemaItem></ul></details></div></TabItem></ApiTabs></div>

Loading