semvec/pypi-packages huggingface dataset:
openapigateway 0.2.1
AWS CDK Construct that creates an Amazon API Gateway HttpApi based on a parameterized OpenAPI 3 Document.
Requires Python: >=3.6

# openapigateway
> Create an Amazon API Gateway from an OpenAPI 3 Document.

![PyPI](https://img.shields.io/pypi/v/openapigateway)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/openapigateway)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
![PyPI - License](https://img.shields.io/pypi/l/openapigateway)

AWS CDK Construct that creates an Amazon API Gateway HttpApi based on a
parameterized OpenAPI 3 Document.

## Installation

```sh
pip install openapigateway
```

## Usage

### Example 1: API backed by Lambda Function

*openapi.yaml:*
```yaml
[...]
paths:
  /pets:
    get:
      summary: List all pets
      responses:
        [...]
      x-amazon-apigateway-integration:
        uri: "${API_LAMBDA_ARN}"
        type: "AWS_PROXY"
        httpMethod: "POST"
        connectionType: "INTERNET"
        payloadFormatVersion: "2.0"
      x-amazon-apigateway-request-validator:
        validateRequestBody: true
        validateRequestParameters: true
[...]
```

*open_api_stack.py:*
```python
from aws_cdk import core, aws_iam as iam, aws_lambda as _lambda
from openapigateway import OpenApiGateway


class OpenApiStack(core.Stack):
    def __init__(
        self, scope: core.Construct, construct_id: str, **kwargs
    ) -> None:
        super().__init__(scope, construct_id, **kwargs)

        # function that handles api request(s)
        api_lambda = _lambda.Function([...])

        # create api from openapi document and replace params
        openapi = OpenApiGateway(
            self,
            "OpenAPI Gateway",
            openapi_path="openapi.yaml",
            param_value_dict={"API_LAMBDA_ARN": api_lambda.function_arn},
            fail_on_warnings=True,
        )

        # grant HttpApi permission to invoke api lambda function
        api_lambda.add_permission(
            f"Invoke By {openapi.http_api.node.id} Permission",
            principal=iam.ServicePrincipal("apigateway.amazonaws.com"),
            action="lambda:InvokeFunction",
            source_arn=openapi.http_api_arn,
        )
```

## [Documentation](https://suud.github.io/cdk-openapigateway)

## Development setup

### optional: use virtualenv

```sh
# create virtualenv on MacOS and Linux
python3 -m venv .venv
# activate virtualenv
source .venv/bin/activate
```

### install dependencies

To install this package, along with the tools you need to develop and publish
it, run the following:

```sh
pip install -e ".[dev]"
```

## Contributing

1. [Fork this repository](https://github.com/suud/cdk-openapigateway/fork)
2. Create your feature branch (`git checkout -b feature/fooBar`)
3. Commit your changes (`git commit -am 'Add some fooBar'`)
4. Push to the branch (`git push origin feature/fooBar`)
5. Create a new Pull Request

## License

MIT
Ftntconfig 1.2
Package Ftntconfig
Requires Python: >=3.5

# Ftntconfig

##### Disclaimer :
This is not a Fortinet official product. It is provided as-is without official support.  
I have made this tool for my own use. It can be used at your own risk.  

##### Author :
Cedric GUSTAVE

#### Description :
Ftntconfig is a simple python library to automate Fortinet device configuration. 
It has been created for lab testing scenario where Fortinet devices requires configuration loops.
All configuration is done through an SSH connection.
It is an evolutive framework where each new configuration requirement can be added in an organized framework. 
Each device configuration section is accessed through a corresponding attribut:
Example to access 'config firewall policy' section:
~~~
from Ftntconfig import Ftntconfig
fgt = Ftntconfig(ip='10.5.51.200', port='22', user='admin', password='', debug=True)
fgt.firewall.policy()
~~~

For more details on the configuration syntax, refer to corresponding module:

Ftntconfig_firewall.py : `config firewall`