-
Notifications
You must be signed in to change notification settings - Fork 0
Docs/targetsource userguide push #91
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
Open
Janooski
wants to merge
18
commits into
docs/targetsource-userguide
Choose a base branch
from
docs/targetsource-userguide-push
base: docs/targetsource-userguide
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
7adee4b
add acceptPush
Janooski 301abf9
Merge branch 'docs/targetsource-userguide' of github.com:gnmic/operat…
Janooski 00555b4
generate docs
Janooski ad2b377
add header to generated md
Janooski 3a0f5c8
tests with markdown templates
Janooski 131d838
fix links
Janooski a7c6321
udpate folder structure
Janooski 7aec4c2
fix links, cleanup some text
Janooski 7732cb4
update inline md links
Janooski 6d6c720
add signature
Janooski 0424404
paths again and small corrections
Janooski ede85b6
remove #section hyperlink
Janooski 8e8e251
add push-interface document structure
Janooski 7bc8886
first version push
Janooski a4cdf03
add Netbox webhook example
Janooski b17bf93
small grammar changes
Janooski 5e5cca7
fix pages build
Janooski a9ad35f
remove unneeded files, cleanup
Janooski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # DefaultApi | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -c /local/docs/content/docs/advanced/openapi-generator-config.yaml | ||
|
|
||
| generatorName: markdown | ||
| inputSpec: /local/internal/apiserver/openapi.yaml | ||
| outputDir: /local/docs/content/docs/advanced/rest-api-documentation | ||
| templateDir: /local/docs/content/docs/advanced/openapi-templates/markdown-documentation | ||
| files: | ||
| README.mustache: | ||
| destinationFilename: _index.md |
69 changes: 69 additions & 0 deletions
69
docs/content/docs/advanced/openapi-templates/markdown-documentation/README.mustache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| --- | ||
| title: "REST API interface" | ||
| linkTitle: "REST API interface" | ||
| weight: 3 | ||
| description: > | ||
| This document describes the REST API exposed by the gNMIc Operator, including the available endpoints, request formats, and usage examples. | ||
| --- | ||
|
|
||
| {{#generateApiDocs}} | ||
| <a name="documentation-for-api-endpoints"></a> | ||
| ## Documentation for API Endpoints | ||
|
|
||
| All URIs are relative to *{{{basePath}}}:8082* | ||
|
|
||
| | Class | Method | HTTP request | Description | | ||
| |------------ | ------------- | ------------- | -------------| | ||
| {{#apiInfo}}{{#apis}}{{#operations}}| {{#operation}}*{{#lambda.lowercase}}{{classname}}{{/lambda.lowercase}}* | [**{{operationId}}**](/docs/advanced/rest-api-documentation/apis/{{#lambda.lowercase}}{{classname}}{{/lambda.lowercase}}) | **{{httpMethod}}** {{path}} | {{{summary}}}{{^summary}}{{{notes}}}{{/summary}} | | ||
| {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} | ||
| {{/generateApiDocs}} | ||
|
|
||
| {{#generateModelDocs}} | ||
| <a name="documentation-for-models"></a> | ||
| ## Documentation for Models | ||
|
|
||
| {{#modelPackage}} | ||
| {{#models}}{{#model}} - [{{#lambda.lowercase}}{{{classname}}}{{/lambda.lowercase}}](/docs/advanced/rest-api-documentation/models/{{#lambda.lowercase}}{{{classFilename}}}{{/lambda.lowercase}}/) | ||
| {{/model}}{{/models}} | ||
| {{/modelPackage}} | ||
| {{^modelPackage}} | ||
| No model defined in this package | ||
| {{/modelPackage}} | ||
| {{/generateModelDocs}} | ||
|
|
||
| <a name="documentation-for-authorization"></a>{{! TODO: optional documentation for authorization? }} | ||
| ## Documentation for Authorization | ||
|
|
||
| For a detailed explanation on how to configure the required secrets within the gNMIc Operator, refer to [TargetSource > Push mode](/docs/user-guide/targetsource/push/). | ||
|
|
||
| {{^authMethods}} | ||
| All endpoints do not require authorization. | ||
| {{/authMethods}} | ||
| {{#authMethods}} | ||
| {{#last}} | ||
| Authentication schemes defined for the API: | ||
| {{/last}} | ||
| {{/authMethods}} | ||
| {{#authMethods}} | ||
| <a name="{{name}}"></a> | ||
| ### {{name}} | ||
|
|
||
| {{#isApiKey}}- **Type**: API key | ||
| - **API key parameter name**: {{keyParamName}} | ||
| - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} | ||
| {{/isApiKey}} | ||
| {{#isBasicBasic}}- **Type**: HTTP basic authentication | ||
| {{/isBasicBasic}} | ||
| {{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} | ||
| {{/isBasicBearer}} | ||
| {{#isHttpSignature}}- **Type**: HTTP signature authentication | ||
| {{/isHttpSignature}} | ||
| {{#isOAuth}}- **Type**: OAuth | ||
| - **Flow**: {{flow}} | ||
| - **Authorization URL**: {{authorizationUrl}} | ||
| - **Scopes**: {{^scopes}}N/A{{/scopes}} | ||
| {{#scopes}} - {{scope}}: {{description}} | ||
| {{/scopes}} | ||
| {{/isOAuth}} | ||
|
|
||
| {{/authMethods}} |
50 changes: 50 additions & 0 deletions
50
docs/content/docs/advanced/openapi-templates/markdown-documentation/api.mustache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| --- | ||
| title: "Routes" | ||
| linkTitle: "Routes" | ||
| weight: 4 | ||
| description: > | ||
| Available HTTP routes on the gNMIc Operator API interface. | ||
| --- | ||
|
|
||
| # {{#lambda.lowercase}}{{classname}}{{/lambda.lowercase}}{{#description}} | ||
| {{.}}{{/description}} | ||
|
|
||
| All URIs are relative to *{{basePath}}:8082* | ||
|
|
||
| | Method | HTTP request | Description | | ||
| |------------- | ------------- | -------------| | ||
| {{#operations}}{{#operation}}| **{{operationId}}** | **{{httpMethod}}** {{path}} | {{summary}} | | ||
| {{/operation}}{{/operations}} | ||
|
|
||
| {{#operations}} | ||
| {{#operation}} | ||
| <a name="{{operationId}}"></a> | ||
| # **{{operationId}}** | ||
| > {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) | ||
|
|
||
| {{summary}}{{#notes}} | ||
|
|
||
| {{.}}{{/notes}} | ||
|
|
||
| ### Parameters | ||
| {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} | ||
| |Name | Type | Description | Notes | | ||
| |------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} | ||
| {{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**](/docs/advanced/rest-api-documentation/models/{{#lambda.lowercase}}{{baseType}}{{/lambda.lowercase}}/){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | | ||
| {{/allParams}} | ||
|
|
||
| ### Return type | ||
|
|
||
| {{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{#generateModelDocs}}[**{{returnType}}**](/docs/advanced/rest-api-documentation/models/{{#lambda.lowercase}}{{returnBaseType}}{{/lambda.lowercase}}/){{/generateModelDocs}}{{^generateModelDocs}}**{{returnType}}**{{/generateModelDocs}}{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}} | ||
|
|
||
| ### Authorization | ||
|
|
||
| {{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](/docs/advanced/rest-api-documentation/#{{name}}){{^-last}}, {{/-last}}{{/authMethods}} | ||
|
|
||
| ### HTTP request headers | ||
|
|
||
| - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} | ||
| - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} | ||
|
|
||
| {{/operation}} | ||
| {{/operations}} |
29 changes: 29 additions & 0 deletions
29
docs/content/docs/advanced/openapi-templates/markdown-documentation/model.mustache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| --- | ||
| title: "Model" | ||
| linkTitle: "Model" | ||
| weight: 4 | ||
| description: > | ||
| Documentation for OpenAPI models and their schema-defined properties. | ||
| --- | ||
|
|
||
| {{#models}} | ||
| {{#model}} | ||
| # {{#lambda}}{{{classname}}}{{/lambda}} | ||
| {{#description}} | ||
| {{{description}}} | ||
| {{/description}} | ||
|
|
||
| ## Properties | ||
|
|
||
| | Name | Type | Description | Notes | | ||
| |------------ | ------------- | ------------- | -------------| | ||
| {{#parent}} | ||
| {{#parentVars}} | ||
| | **{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{#lambda.lowercase}}{{complexType}}{{/lambda.lowercase}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} | | ||
| {{/parentVars}} | ||
| {{/parent}} | ||
| {{#vars}}| **{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{#lambda.lowercase}}{{complexType}}{{/lambda.lowercase}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} | | ||
| {{/vars}} | ||
|
|
||
| {{/model}} | ||
| {{/models}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| --- | ||
| title: "Documentation for gNMIc Operator REST API" | ||
| linkTitle: "REST API interface" | ||
| weight: 3 | ||
| description: > | ||
| Documentation of REST API interface according to openAPI standard. | ||
| --- | ||
|
|
||
| <a name="documentation-for-api-endpoints"></a> | ||
| ## Documentation for API Endpoints | ||
|
|
||
| All URIs are relative to *http://localhost* | ||
|
|
||
| | Class | Method | HTTP request | Description | | ||
| |------------ | ------------- | ------------- | -------------| | ||
| | *DefaultApi* | [**applyTargets**](../Apis/DefaultApi.md#applyTargets) | **POST** /api/v1/:namespace/target-source/:name/applyTargets | Interface for real-time target updates, usually using a webhook. Targets are applied in the gNMIc Operator. | | ||
| *DefaultApi* | [**getClusterPlan**](../Apis/DefaultApi.md#getClusterPlan) | **GET** /clusters/:namespace/:name/plan | Get cluster plan. | | ||
|
|
||
|
|
||
| <a name="documentation-for-models"></a> | ||
| ## Documentation for Models | ||
|
|
||
| - [Target](../Models/Target.md) | ||
|
|
||
|
|
||
| <a name="documentation-for-authorization"></a> | ||
| ## Documentation for Authorization | ||
|
|
||
| <a name="bearerAuth"></a> | ||
| ### bearerAuth | ||
|
|
||
| - **Type**: HTTP Bearer Token authentication | ||
|
|
65 changes: 65 additions & 0 deletions
65
docs/content/docs/advanced/rest-api-documentation/Apis/DefaultApi.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| --- | ||
| title: "Routes" | ||
| linkTitle: "Routes" | ||
| weight: 4 | ||
| description: > | ||
| Available HTTP routes on the gNMIc Operator API interface. | ||
| --- | ||
|
|
||
| # defaultapi | ||
|
|
||
| All URIs are relative to *http://localhost:8082* | ||
|
|
||
| | Method | HTTP request | Description | | ||
| |------------- | ------------- | -------------| | ||
| | **applyTargets** | **POST** /api/v1/:namespace/target-source/:name/applyTargets | Interface for real-time target updates, usually using a webhook. Targets are applied in the gNMIc Operator. | | ||
| | **getClusterPlan** | **GET** /clusters/:namespace/:name/plan | Get cluster plan. | | ||
|
|
||
|
|
||
| <a name="applyTargets"></a> | ||
| # **applyTargets** | ||
| > List applyTargets(Target) | ||
|
|
||
| Interface for real-time target updates, usually using a webhook. Targets are applied in the gNMIc Operator. | ||
|
|
||
| ### Parameters | ||
|
|
||
| |Name | Type | Description | Notes | | ||
| |------------- | ------------- | ------------- | -------------| | ||
| | **Target** | [**List**](/docs/advanced/rest-api-documentation/models/target/)| Target must be passed as a list, multiple targets possible. | | | ||
|
|
||
| ### Return type | ||
|
|
||
| [**List**](/docs/advanced/rest-api-documentation/models/target/) | ||
|
|
||
| ### Authorization | ||
|
|
||
| [signature](/docs/advanced/rest-api-documentation/#signature), [bearerAuth](/docs/advanced/rest-api-documentation/#bearerAuth) | ||
|
|
||
| ### HTTP request headers | ||
|
|
||
| - **Content-Type**: application/json | ||
| - **Accept**: application/json | ||
|
|
||
| <a name="getClusterPlan"></a> | ||
| # **getClusterPlan** | ||
| > getClusterPlan() | ||
|
|
||
| Get cluster plan. | ||
|
|
||
| ### Parameters | ||
| This endpoint does not need any parameter. | ||
|
|
||
| ### Return type | ||
|
|
||
| null (empty response body) | ||
|
|
||
| ### Authorization | ||
|
|
||
| No authorization required | ||
|
|
||
| ### HTTP request headers | ||
|
|
||
| - **Content-Type**: Not defined | ||
| - **Accept**: Not defined | ||
|
|
22 changes: 22 additions & 0 deletions
22
docs/content/docs/advanced/rest-api-documentation/Models/Target.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| --- | ||
| title: "Model" | ||
| linkTitle: "Model" | ||
| weight: 4 | ||
| description: > | ||
| Documentation for OpenAPI models and their schema-defined properties. | ||
| --- | ||
|
|
||
| # Target | ||
| Network device to be monitored. Properties not marked as optional must be in JSON body. | ||
|
|
||
| ## Properties | ||
|
|
||
| | Name | Type | Description | Notes | | ||
| |------------ | ------------- | ------------- | -------------| | ||
| | **name** | **String** | Name of device to be monitored. | [default to null] | | ||
| | **address** | **String** | IPv4/IPv6 address or hostname. | [default to null] | | ||
| | **port** | **Integer** | gNMIc port. | [optional] [default to null] | | ||
| | **targetProfile** | **String** | TargetProfile applied to apply to this router. | [optional] [default to null] | | ||
| | **labels** | [**List**](map.md) | Input of labels as key:value pair. | [optional] [default to null] | | ||
| | **operation** | **String** | Either `created`, `updated` or `deleted`. `created` and `updated` are identical and both apply the target. | [default to null] | | ||
|
|
||
42 changes: 42 additions & 0 deletions
42
docs/content/docs/advanced/rest-api-documentation/_index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| --- | ||
| title: "REST API interface" | ||
| linkTitle: "REST API interface" | ||
| weight: 3 | ||
| description: > | ||
| This document describes the REST API exposed by the gNMIc Operator, including the available endpoints, request formats, and usage examples. | ||
| --- | ||
|
|
||
| <a name="documentation-for-api-endpoints"></a> | ||
| ## Documentation for API Endpoints | ||
|
|
||
| All URIs are relative to *http://localhost:8082* | ||
|
|
||
| | Class | Method | HTTP request | Description | | ||
| |------------ | ------------- | ------------- | -------------| | ||
| | *defaultapi* | [**applyTargets**](/docs/advanced/rest-api-documentation/apis/defaultapi) | **POST** /api/v1/:namespace/target-source/:name/applyTargets | Interface for real-time target updates, usually using a webhook. Targets are applied in the gNMIc Operator. | | ||
| *defaultapi* | [**getClusterPlan**](/docs/advanced/rest-api-documentation/apis/defaultapi) | **GET** /clusters/:namespace/:name/plan | Get cluster plan. | | ||
|
|
||
|
|
||
| <a name="documentation-for-models"></a> | ||
| ## Documentation for Models | ||
|
|
||
| - [target](/docs/advanced/rest-api-documentation/models/target/) | ||
|
|
||
|
|
||
| <a name="documentation-for-authorization"></a> | ||
| ## Documentation for Authorization | ||
|
|
||
| For a detailed explanation on how to configure the required secrets within the gNMIc Operator, refer to [TargetSource > Push mode](/docs/user-guide/targetsource/push/). | ||
|
|
||
| <a name="bearerAuth"></a> | ||
| ### bearerAuth | ||
|
|
||
| - **Type**: HTTP Bearer Token authentication | ||
|
|
||
| <a name="signature"></a> | ||
| ### signature | ||
|
|
||
| - **Type**: API key | ||
| - **API key parameter name**: X-Hook-Signature | ||
| - **Location**: HTTP header | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
404 not found -> labels should be a map of string string -> map[string]string
description is not that helpful