Skip to content

Commit

Permalink
Merge pull request #34 from opsmill/jbr-update-sdk-and-global-variables
Browse files Browse the repository at this point in the history
config and clean for sdk
  • Loading branch information
wartraxx51 authored Feb 26, 2025
2 parents 6e33b6b + 062116f commit 490727e
Show file tree
Hide file tree
Showing 60 changed files with 78 additions and 989 deletions.
2 changes: 1 addition & 1 deletion docs/docs-python-sdk/infrahubctl/infrahubctl-dump.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $ infrahubctl dump [OPTIONS]
* `--directory PATH`: Directory path to store export [default: (dynamic)]
* `--quiet / --no-quiet`: No console output [default: no-quiet]
* `--config-file TEXT`: [env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
* `--branch TEXT`: Branch from which to export
* `--branch TEXT`: Branch from which to export [default: main]
* `--concurrent INTEGER`: Maximum number of requests to execute at the same time. [env var: INFRAHUB_MAX_CONCURRENT_EXECUTION; default: 4]
* `--timeout INTEGER`: Timeout in sec [env var: INFRAHUB_TIMEOUT; default: 60]
* `--exclude TEXT`: Prevent node kind(s) from being exported, CoreAccount is excluded by default [default: CoreAccount]
Expand Down
2 changes: 1 addition & 1 deletion docs/docs-python-sdk/infrahubctl/infrahubctl-load.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $ infrahubctl load [OPTIONS]
* `--continue-on-error / --no-continue-on-error`: Allow exceptions during loading and display them when complete [default: no-continue-on-error]
* `--quiet / --no-quiet`: No console output [default: no-quiet]
* `--config-file TEXT`: [env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
* `--branch TEXT`: Branch from which to export
* `--branch TEXT`: Branch from which to export [default: main]
* `--concurrent INTEGER`: Maximum number of requests to execute at the same time. [env var: INFRAHUB_MAX_CONCURRENT_EXECUTION]
* `--timeout INTEGER`: Timeout in sec [env var: INFRAHUB_TIMEOUT; default: 60]
* `--install-completion`: Install completion for the current shell.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs-python-sdk/infrahubctl/infrahubctl-menu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ $ infrahubctl menu load [OPTIONS] MENUS...
**Options**:

* `--debug / --no-debug`: [default: no-debug]
* `--branch TEXT`: Branch on which to load the menu.
* `--branch TEXT`: Branch on which to load the menu. [default: main]
* `--config-file TEXT`: [env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
* `--help`: Show this message and exit.
2 changes: 1 addition & 1 deletion docs/docs-python-sdk/infrahubctl/infrahubctl-object.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ $ infrahubctl object load [OPTIONS] PATHS...
**Options**:

* `--debug / --no-debug`: [default: no-debug]
* `--branch TEXT`: Branch on which to load the objects.
* `--branch TEXT`: Branch on which to load the objects. [default: main]
* `--config-file TEXT`: [env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
* `--help`: Show this message and exit.
5 changes: 3 additions & 2 deletions docs/docs-python-sdk/infrahubctl/infrahubctl-repository.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ $ infrahubctl repository add [OPTIONS] NAME LOCATION
* `--description TEXT`
* `--username TEXT`
* `--password TEXT`
* `--ref TEXT`
* `--commit TEXT`
* `--read-only / --no-read-only`: [default: no-read-only]
* `--debug / --no-debug`: [default: no-debug]
* `--branch TEXT`: Branch on which to add the repository. [default: main]
* `--config-file TEXT`: [env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
* `--help`: Show this message and exit.

Expand All @@ -57,7 +58,7 @@ $ infrahubctl repository list [OPTIONS]

**Options**:

* `--branch TEXT`: Branch on which to list repositories.
* `--branch TEXT`
* `--debug / --no-debug`: [default: no-debug]
* `--config-file TEXT`: [env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
* `--help`: Show this message and exit.
2 changes: 1 addition & 1 deletion docs/docs-python-sdk/infrahubctl/infrahubctl-run.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ infrahubctl run [OPTIONS] SCRIPT [VARIABLES]...
* `--method TEXT`: [default: run]
* `--debug / --no-debug`: [default: no-debug]
* `--config-file TEXT`: [env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
* `--branch TEXT`: Branch on which to run the script.
* `--branch TEXT`: Branch on which to run the script. [default: main]
* `--concurrent INTEGER`: Maximum number of requests to execute at the same time. [env var: INFRAHUB_MAX_CONCURRENT_EXECUTION]
* `--timeout INTEGER`: Timeout in sec [env var: INFRAHUB_TIMEOUT; default: 60]
* `--install-completion`: Install completion for the current shell.
Expand Down
4 changes: 2 additions & 2 deletions docs/docs-python-sdk/infrahubctl/infrahubctl-schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $ infrahubctl schema check [OPTIONS] SCHEMAS...
**Options**:

* `--debug / --no-debug`: [default: no-debug]
* `--branch TEXT`: Branch on which to check the schema.
* `--branch TEXT`: Branch on which to check the schema. [default: main]
* `--config-file TEXT`: [env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
* `--help`: Show this message and exit.

Expand All @@ -57,7 +57,7 @@ $ infrahubctl schema load [OPTIONS] SCHEMAS...
**Options**:

* `--debug / --no-debug`: [default: no-debug]
* `--branch TEXT`: Branch on which to load the schema.
* `--branch TEXT`: Branch on which to load the schema. [default: main]
* `--wait INTEGER`: Time in seconds to wait until the schema has converged across all workers [default: 0]
* `--config-file TEXT`: [env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
* `--help`: Show this message and exit.
2 changes: 1 addition & 1 deletion docs/docs-python-sdk/infrahubctl/infrahubctl.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ It's meant to run on any laptop or server and it communicates with a remote Infr

## Installation

The `infrahubctl` command line utility is installed as a part of the [Infrahub SDK for Python](../python-sdk/guides/installation#ctl).
The `infrahubctl` command line utility is installed as a part of the [Infrahub SDK for Python]($(base_url)python-sdk/guides/installation#ctl).

## Configuration

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guides/check.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Creating a Check
<!-- vale off -->
## Creating a Check
<!-- vale on -->
Within Infrahub a [Check](../topics/check) is defined in an [external repository](../topics/repository). However, during development and troubleshooting it is easiest to start from your local computer and run the check using [infrahubctl check](../infrahubctl/infrahubctl-check).
Within Infrahub a [Check](../topics/check) is defined in an [external repository](../topics/repository). However, during development and troubleshooting it is easiest to start from your local computer and run the check using [infrahubctl check]($(base_url)infrahubctl/infrahubctl-check).

The goal of this guide is to develop a `Check` and add it to Infrahub, we will achieve this by following these steps.

Expand Down Expand Up @@ -110,7 +110,7 @@ Then save the `TagsQuery` as a text file named `tags_check.gql`.

### 2. Create the Python check file

The next step is to create the Check Python business logic. The check is a Python class that inherits from `InfrahubCheck` from the [Python SDK]($(local_base_url_1)python-sdk). Create a file called `tags_check.py`:
The next step is to create the Check Python business logic. The check is a Python class that inherits from `InfrahubCheck` from the [Python SDK]($(base_url)python-sdk/introduction). Create a file called `tags_check.py`:

```python
import re
Expand Down
10 changes: 5 additions & 5 deletions docs/docs/guides/generator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import TabItem from '@theme/TabItem';

# Creating a generator in Infrahub

Within Infrahub a generator is defined in an [external repository](../topics/repository). However, during development and troubleshooting it is easiest to start from your local computer and run the transform using [infrahubctl generator](../infrahubctl/infrahubctl-generator).
Within Infrahub a generator is defined in an [external repository](../topics/repository). However, during development and troubleshooting it is easiest to start from your local computer and run the transform using [infrahubctl generator]($(base_url)infrahubctl/infrahubctl-generator).

The goal of this guide is to develop a Generator and add it to Infrahub, we will achieve this by following these steps.

Expand Down Expand Up @@ -58,7 +58,7 @@ nodes:
unique: true
```
Load the following schema using the [infrahubctl schema](../infrahubctl/infrahubctl-schema) command.
Load the following schema using the [infrahubctl schema]($(base_url)infrahubctl/infrahubctl-schema) command.
```shell
infrahubctl schema load widgets.yml
Expand Down Expand Up @@ -104,7 +104,7 @@ We provide `convert_query_response` option to be toggled to be able to access ob

This allows you to manage the returned data with helper methods on the SDK objects such as `save`, `fetch`, etc. on the returned data rather than having to build a payload to send back to Infrahub to manage the objects.

Read more on the [Infrahub Python SDK]($(local_base_url_1)python-sdk).
Read more on the [Infrahub Python SDK](/python-sdk/introduction).
:::

<Tabs groupId="convertResponse">
Expand Down Expand Up @@ -291,7 +291,7 @@ widget_generator (widget_generator.py::Generator) Target: widgets

:::warning

When running a generator with `infrahubctl` the [SDK tracking]($(local_base_url_1)python-sdk/topics/tracking) feature isn't used. The reason for this is that internally Infrahub uses the ID of the generator_definition to control the tracking, this isn't available from the outside. For this reason it is recommended to create test branches when developing generators and validating the results.
When running a generator with `infrahubctl` the [SDK tracking]($(base_url)python-sdk/topics/tracking) feature isn't used. The reason for this is that internally Infrahub uses the ID of the generator_definition to control the tracking, this isn't available from the outside. For this reason it is recommended to create test branches when developing generators and validating the results.

:::

Expand All @@ -310,7 +310,7 @@ Now you should see the tree [TestResource](http://localhost:8000/objects/TestRes

![resources](../media/guides/generator_pc_3.png)

Merge the changes into the **main** branch using [infrahubctl branch](../infrahubctl/infrahubctl-branch) command.
Merge the changes into the **main** branch using [infrahubctl branch]($(base_url)infrahubctl/infrahubctl-branch) command.

```shell
infrahubctl branch merge 'test-branch1'
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/jinja2-transform.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Creating a Jinja transform

# Creating a Jinja rendered file (transform)

Within Infrahub a [Transform](../topics/transformation) is defined in an [external repository](../topics/repository). However, during development and troubleshooting it is easiest to start from your local computer and run the render using [infrahubctl render](../infrahubctl/infrahubctl-render).
Within Infrahub a [Transform](../topics/transformation) is defined in an [external repository](../topics/repository). However, during development and troubleshooting it is easiest to start from your local computer and run the render using [infrahubctl render]($(base_url)infrahubctl/infrahubctl-render).

The goal of this guide is to develop a Jinja Transform and add it to Infrahub, we will achieve this by following these steps.

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guides/menu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,5 @@ Load the menu into Infrahub using the following command
infrahubctl menu load /path/to/menu.yml
```

More information on `infrahubctl` command line utility can be found [here](../infrahubctl).
More information on the `menu` subcommand can be found [here](../infrahubctl/infrahubctl-menu).
More information on `infrahubctl` command line utility can be found [here]($(base_url)infrahubctl/infrahubctl).
More information on the `menu` subcommand can be found [here]($(base_url)infrahubctl/infrahubctl-menu).
4 changes: 2 additions & 2 deletions docs/docs/guides/python-transform.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import TabItem from '@theme/TabItem';

# Creating a Python transform

Within Infrahub a [Transform](../topics/transformation) is defined in an [external repository](../topics/repository). However, during development and troubleshooting it is easiest to start from your local computer and run the transform using [infrahubctl transform](../infrahubctl/infrahubctl-transform).
Within Infrahub a [Transform](../topics/transformation) is defined in an [external repository](../topics/repository). However, during development and troubleshooting it is easiest to start from your local computer and run the transform using [infrahubctl transform]($(base_url)infrahubctl/infrahubctl-transform).

The goal of this guide is to develop a Python Transform and add it to Infrahub, we will achieve this by following these steps.

Expand Down Expand Up @@ -166,7 +166,7 @@ Here the query will require an input parameter called `$name` what will refer to

## 2. Create the Python transform file

The next step is to create the actual Python transform. The transform is a Python class that inherits from InfrahubTransform from the [Python SDK]($(local_base_url_1)python-sdk). Create a file called `device_config.py`:
The next step is to create the actual Python transform. The transform is a Python class that inherits from InfrahubTransform from the [Python SDK]($(base_url)python-sdk/introduction). Create a file called `device_config.py`:

```python
from infrahub_sdk.transforms import InfrahubTransform
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/repository.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ The repository should be visible under [Unified Storage / Repository](http://loc

### Via the Infrahub SDK

1. Install and setup the [Infrahub SDK]($(local_base_url_1)python-sdk)
1. Install and setup the [Infrahub SDK]($(base_url)python-sdk/introduction)
2. If needed, i.e., your repository is private, create a Credential object to hold your username / password. We highly recommend to provide credentials for Repository to allow branch creation from Infrahub.

```python
Expand Down
42 changes: 0 additions & 42 deletions docs/docs/infrahubctl.mdx

This file was deleted.

138 changes: 0 additions & 138 deletions docs/docs/infrahubctl/infrahubctl-branch.mdx

This file was deleted.

Loading

0 comments on commit 490727e

Please # to comment.