Download the PHP package keboola/kbc-manage-api-php-client without Composer
On this page you can find all versions of the php package keboola/kbc-manage-api-php-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download keboola/kbc-manage-api-php-client
More information about keboola/kbc-manage-api-php-client
Files in keboola/kbc-manage-api-php-client
Package kbc-manage-api-php-client
Short Description Keboola Management API Client
License MIT
Informations about the package kbc-manage-api-php-client
Keboola Manage API PHP client
Simple PHP wrapper library for Keboola Management REST API
Installation
Library is available as composer package. To start using composer in your project follow these steps:
Install composer
Create composer.json file in your project root folder:
Install package:
Add autoloader in your bootstrap script:
Read more in Composer documentation
Usage examples
Tests
The main purpose of these test is "black box" test driven development of Keboola Connection. These test guards the API implementation. You can run these tests only against non-production environments.
Tests requires valid Keboola Management API tokens and an endpoint URL of the API test environment.
Note: For automated tests, the tests are run again three times by default if they fail. For local development this would be quite annoying,
so you can disable this by creating new file phpunit-retry.xml
from phpunit-retry.xml.dist
Note: The test environment should be running a cronjob for token-expirator
otherwise the testTemporaryAccess
test will fail.
Create file .env
with environment variables`:
Run tests
File Storage tests
Setup cloud resources for File Storage tests
Prerequisites:
- configured and logged in az, aws and gcp CLI tools
az login
aws sso login --profile=<your_profile>
gcloud auth application-default login
- installed terraform (https://www.terraform.io) and jq (https://stedolan.github.io/jq) to setup local env
Required variables for File Storage tests
These variables are used for testing file storage. You have to copy these values from Azure and AWS portal.
TEST_ABS_ACCOUNT_KEY
- First secret key for Azure Storage accountTEST_ABS_ACCOUNT_NAME
- Name of Azure Storage accountTEST_ABS_CONTAINER_NAME
- Name of container created inside Azure Storage AccountTEST_ABS_REGION
- Name of region where Azure Storage Account is located. (Note: AWS region list is used)TEST_ABS_ROTATE_ACCOUNT_KEY
- Second secret key for Azure Storage accountTEST_S3_ROTATE_KEY
- Second AWS keyTEST_S3_ROTATE_SECRET
- Second AWS secretTEST_S3_FILES_BUCKET
- Name of file bucket on S3TEST_S3_KEY
- First AWS keyTEST_S3_REGION
- Region where your S3 is locatedTEST_S3_SECRET
- First AWS secretTEST_GCS_KEYFILE_JSON
- First GCS key file contents as json stringTEST_GCS_KEYFILE_ROTATE_JSON
- Second GCS key file contents as json string used for testing rotationTEST_GCS_FILES_BUCKET
- Name of file bucket on GCS-
TEST_GCS_REGION
- Region whare GCS is locatedVariable prefixed with ROTATE are used for rotating credentials and they MUST be working credentials.
Run File Storage tests
Build OpenAPI document
Currently, we mainly document APIs in apiary.apib file. But we want to move to OpenAPI format. By calling following commands, the apiary.apib file will be translated to OpenAPI format and stored in file openapi.yml. Then you can commit it. We should put it in CI.
You need to install apib2swagger
tool .
Then run following commands
License
MIT licensed, see LICENSE file.