Skip to content

Commit ce5171e

Browse files
author
daniele.cina
committed
feat: Add import configuration command for JSON files
- Introduced a new command `import-config` to import various configuration files (Flow Manager, RBAC Manager, Backoffice, Fast Data, API Console) into a Mia-Platform project. - Created example configuration files for Flow Manager, RBAC Manager, Fast Data, and Extensions. - Implemented file validation and JSON reading functions to ensure proper configuration structure. - Added confirmation prompt before executing the import to prevent accidental changes. - Developed unit tests to validate the functionality of the import command and its components.
1 parent 564200c commit ce5171e

11 files changed

+1712
-0
lines changed

docs/30_commands.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,36 @@ Available flags for the command:
624624
- `--context`, to specify a different context from the currently selected one
625625
- `--company-id`, to set the ID of the desired Company
626626

627+
### import-config
628+
629+
The `project import-config` subcommand allows you to import specific configuration files in a Mia-Platform Console project.
630+
This command can be used to import one or more configuration files at the same time.
631+
632+
Usage:
633+
634+
```sh
635+
miactl project import-config [flags]
636+
```
637+
638+
Available flags for the command:
639+
640+
- `--revision`, to specify the revision of the commit to import the configuration (mutually exclusive with --environment)
641+
- `--environment`, to specify the environment where to import the configuration (mutually exclusive with --revision)
642+
- `--flow-manager-config`, path to the flowManagerConfig.json file
643+
- `--rbac-manager-config`, path to the rbacManagerConfig.json file
644+
- `--backoffice-config`, path to the backofficeConfigurations.json file
645+
- `--fast-data-config`, path to the fast-data-config.json file
646+
- `--api-console-config`, path to the api-console-config.json file
647+
- `--yes` (`-y`), skip interactive confirmation and proceed with import
648+
649+
- `--project-id`, to set the ID of the desired Project
650+
- `--auth-name`, the name of the miactl auth to use
651+
- `--endpoint`, to set the Console endpoint
652+
- `--certificate-authority`, to provide the path to a custom CA certificate
653+
- `--insecure-skip-tls-verify`, to disallow the check the validity of the certificate of the remote endpoint
654+
- `--context`, to specify a different context from the currently selected one
655+
- `--company-id`, to set the ID of the desired Company
656+
627657
## deploy
628658

629659
The `deploy` command allows you to manage the deployment of your Projects.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"projectId": "6821c8de556438a553188a10",
3+
"tenantId": "33f78781-4f21-40eb-8a25-e3c6b09d3236",
4+
"ref": "branches/demo-self-service",
5+
"parentChangesId": "589b6904-742a-4f58-9f8c-4a0db5d418e7",
6+
"configType": "backofficeConfigurations",
7+
"config": {
8+
"services": "...",
9+
"version": "1.8.0"
10+
},
11+
"hash": "8e68e94dfb9af7f65e91aac2a08d5d49415924962e335ffa753c123063d89a9b",
12+
"changesId": "3925c607-2cef-4b5d-934d-36a7102ef872",
13+
"snapshotInfo": {
14+
"message": "backup from {tenantId}-{projectId}-{ref}-{gg:mm:aaaa:hh:ss:ms} of Backoffice configuration document"
15+
},
16+
"__STATE__": "PUBLIC"
17+
}

0 commit comments

Comments
 (0)