Package: akinoncli
Akinon Cloud Commerce CLIAkinon CLI is an application designed to manage projects and applications
in Akinon Cloud Commerce through a command line interface.InstallationAfter installing python 3.8+, run the following command.
Then the Akinon CLI would be ready to be used.$ pip install --user akinoncliUsageEvery cloud commerce user is registered to anAccount. For a fresh user anAccountwould be
created automatically. The authorized users who are registered toAccountcan create users
for the sameAccountusing the CLI or UI. (Registration is not currently available on the CLI)-hcommand argument can be used in order to know more about the command.
(Command's required parameters, information about what it does, etc.)Example:akinoncli user -hCommandsAuthenticationIn order to use Akinon CLI, the user must authenticate first.akinoncli loginAuthentication is achieved by submitting e-mail and password.akinoncli logoutBy logging out the previous credentials can be deleted.Public KeysIn order to access theProjectApp's repositories, public keys are required.akinoncli publickey create {key}Creates public key.ParameterDescriptionRequiredkeythe text inside .ssh/id_rsa.pubYesExampleakinoncli publickey create "ssh-rsa AAAAB..."akinoncli publickey listLists the public keys.akinoncli publickey delete {ID}Deletes the public key.ParameterDescriptionRequiredIDPublic Key IDYesApplicationsUsers can create their own application and publish it so other users
can set up for their project and use it.The application which you'd like to publish needs to be managed by GIT version control system.
In order to have read/write access to application's repository, the application needed to be
created in the Akinon Cloud Commerce and a public key must be created.For an application to be distributed and compiled by the Akinon Cloud Commerce, it needed to have
a file namedakinon.jsonin its home directory.TODO: add the link to documentation of akinon.jsonakinoncli applicationtype listLists the application types.akinoncli application create {name} {slug} {application_type_id}Creates an application.ParameterDescriptionRequirednameApplication NameYesslugApplication Slug (must be unique)Yesapplication_type_idApplication Type ID (akinoncli applicationtype list)YesTo see the git address you should run thelistafter creation of the application.
It can be seen asClone URLcolumn.akinoncli application listLists the applications.akinoncli application get {app_id}Prints the details of an application.In order to upload the source code of application run the following commands:$ git remote add akinon {CLONE_URL}
$ git push akinon {branch_name}In order to deploy an application for a project, it needs to be built by Akinon Cloud
Commerce. A stable version is required for such an action. One can create a tag
usinggit tagcommands. After that, the tag needs to be pushed to the
remote repository in the Akinon Cloud Commerce system.Example$ git tag 1.0
$ git push akinon --tagsThe building process can be started by CLI when the tag is pushed.akinoncli application build {app_id} {tag} {--note}Starts the building process for the given tag.ParameterDescriptionRequiredapp_idApplication IDYestagTagYes--noteNoteNoExample$ akinoncli application build 1 1.0 --note="test note for the build"akinoncli application versions {app_id}Lists the built versions of the application.ParameterDescriptionRequiredapp_idApplication IDYesThe status of version beingcompletedindicates that the version is ready for deployment.akinoncli application version-logs <app_id> <version_id>Lists application version logs.ParameterDescriptionRequiredidApplication IDYesversion_idVersion IDYesExample$ akinoncli application version-logs 27 518ProjectsThe projects are the ecosystem of applications working together and integrated. When a project is createdOmnitronapplication is automatically being added to project and starts running.akinoncli project listLists the projects.akinoncli project create {name} {slug}Creates project.ParameterDescriptionRequirednameProject NameYesslugProject Slug (Must be unique.)YesProject ApplicationsThe applications cannot be run without a project in the Akinon Cloud Commerce.
They should be related to a project and that relation can be assured with the
creation of aProjectApp.akinoncli projectapp add {project_id} {app_id}Adds the application to project by creatingProjectApp.ParameterDescriptionRequiredproject_idProject IDYesapp_idApp IDYesakinoncli projectapp list {project_id}Lists the applications of the relevant project.ParameterDescriptionRequiredproject_idProject IDYesEnvironment ParametersThe applications are able to run with different configurations on the various projects.
The same application running with different default language on two different projects can be given as example.
For this kind of requirements, Environment Parameters can be used.
These parameters could be seen in theENV Variablescolumn when listing the applications.akinoncli projectapp add-env {project_id} {project_app_id} {ENV_KEY}={ENV_VALUE} {ANOTHER_ENV_KEY}={ANOTHER_ENV_VALUE}Adds the environment parameter on the application.ParameterDescriptionRequiredproject_idProject IDYesproject_app_idApplication IDYesENV_KEYThe key of relevant environment parameterYesENV_VALUEThe value of relevant environment parameterYes--deployRedeploy the current version to activate environment variable changes.NoThe same command can also be used for updating.Example$ akinoncli projectapp add-env 1 32 LANGUAGE_CODE=en-usIt's also possible to use complex (i.e. non-string) values by encoding them as JSON. The value must be quoted properly
to function correctly.$ akinoncli projectapp add-env 1 32 MIDDLEWARE='["my.custom.MiddlewareClass", "django.middleware.security.SecurityMiddleware", "whitenoise.middleware.WhiteNoiseMiddleware", "django.contrib.sessions.middleware.SessionMiddleware"]'
$ akinoncli projectapp add-env 1 32 THUMBNAIL_OPTIONS='{"product-list": {"width": 273, "height": 210}, "product-detail__slider_zoom": {"quality": 90}}'For larger or dynamic payloads you can useEOFoperator insh-based terminals. This also allows string interpolation without having to escape
double quotes.img_quality=90opts=$(cat<<EOF{"product-list": {"width": 273,"height": 210,"quality": $img_quality},"product-detail__slider_zoom": {"quality": $img_quality}}EOF)akinoncliprojectappadd-env132THUMBNAIL_OPTIONS="$opts"This environment variable can then be deserialized usingdjango-environpackage, orjson.loads:fromenvironimportEnvenv=Env()DEFAULT_MIDDLEWARE=["django.middleware.security.SecurityMiddleware","whitenoise.middleware.WhiteNoiseMiddleware","django.middleware.common.CommonMiddleware",]MIDDLEWARE=env.json('MIDDLEWARE',default=DEFAULT_MIDDLEWARE)# omit `default` to throw an error if it's not setTHUMBNAIL_OPTIONS=env.json('THUMBNAIL_OPTIONS')# throws error if THUMBNAIL_OPTIONS is not set# print(MIDDLEWARE[0])  # prints "my.custom.MiddlewareClass"# print(list(THUMBNAIL_OPTIONS))  # prints ["product-list", "product-detail__slider_zoom"]Refer todjango-environdocumentationfor further information.akinoncli projectapp remove-env {project_id} {app_id} {ENV_KEY} {ANOTHER_ENV_KEY}Deletes the environment parameter from the application.ParameterDescriptionRequiredproject_idProject IDYesproject_app_idApplication IDYesENV_KEYThe key of relevant environment parameterYes--deployRedeploy the current version to activate environment variable changes.NoDeploying the ApplicationIn order to deploy an application it needed to be built firstly.
(Those steps are explained in Applications section.)akinoncli projectapp deploy {project_id} {project_app_id} {tag}Deploys the relevant tag to the relevant project application. (That process
might take some time.)ParameterDescriptionRequiredproject_idProject IDYesproject_app_idApplication IDYestagTag of the versionYesakinoncli projectapp deploy-multiple {app_id} {tag}Deploys multiple project applications with given tagParameterDescriptionRequiredapp_idApplication IDYestagTag of the versionYes--project-appsProject App IDsIf--deploy-allis not used Yes otherwise No--deploy-allDeploys all project apps with given tagIf--project-appsis not used Yes otherwise Noakinoncli projectapp deployments list {project_id} {app_id}Lists the deployments of the relevant application.
The status of deployment can be seen in thestatuscolumn.ParameterDescriptionRequiredproject_idProject IDYesproject_app_idApplication IDYesakinoncli projectapp deployment-logs project_id project_app_id deployment_idLists deployment logs.ParameterDescriptionRequiredproject_idProject IDYesproject_app_idProject App IDYesdeployment_idDeployment IDYesExample$ akinoncli projectapp deployment-logs 1 1 1Application LogThe applications logs can be seen following commands.
process type parameter is optional.akinoncli projectapp logs {project_id} {project_app_id}ParameterDescriptionRequiredproject_idProject IDYesproject_app_idApplication IDYes-pProcess type (If that parameter is passed the relevant process typed logs would be returned) (By default returns logs with any process types )NoExampleThe following command returns a hundred logs created in the last minute.akinoncli projectapp logs 1 1The following command returns a hundred logs created in the last minute.akinoncli projectapp logs 1 1 -p webExporting Application LogsThe application logs can be exported with following commands.ParameterDescriptionRequiredproject_idProject IDYesapp_idApplication IDYes-dFilters logs that were created on the specified dates. Dates must be separated by commas. Date format must be YYYY-MM-DD.No-sFilters logs that were created after the given specified date. Date format must be YYYY-MM-DD.No-eFilters logs that were created before the given specified date. Date format must be YYYY-MM-DD.No-pProcess type (If that parameter is passed the relevant process typed logs would be returned) (By default returns logs with any process types )NoExampleThe following command exports all the logs of the given application.akinoncli projectapp export-logs 1 1The following command exports all the logs of the given application which were created in 2021-09-23 and 2021-09-24 dates.*akinoncli projectapp export-logs 1 1 -d 2021-09-23,2021-09-24The following command exports all the logs of the given application which were created with web and beat process types.akinoncli projectapp export-logs 1 1 -p web,beatThe following command exports all the logs of the given application which were created between 2021-09-23 and 2021-09-28 dates.akinoncli projectapp export-logs 1 1 -s 2021-09-23 -e 2021-09-28Attaching certificate to Project ApplicationIn order to deploy an application with certain domain and ssl certificate, that command can be used.
One certificate can only be attached to one Project Application.Attaches certificate to Project Application.akinoncli projectapp attach-certificate {project_id} {project_app_id} {certificate_id}ParameterDescriptionRequiredproject_idProject IDYesproject_app_idApplication IDYescertificate_idCertificate IDYesExample$ akinoncli projectapp attach-certificate 1 1 1Domain and CertificateAkinon Cloud Commerce sistemine bir uygulamayı dağıtıma çıkarırken uygulamanın ssl sertifikası ile belirli bir alan adı ile çalışmasını istediğimiz durumlarda alan adı ve sertifika oluşturarak oluşturulan sertifikayı proje uygulamasına bağlayabiliriz.DomainLists the domains.akinoncli domain listCreates domain.akinoncli domain create {hostname} {is_managed}ParameterDescriptionRequiredhostnameHostnameYesis_managedAlan adının akinon cloud tarafından yönetilmesini belirtir. (true, false değerlerinden biri olmalıdır)YesExample$ akinoncli domain create akinoncloud.net trueCertificateLists the certificates of the relevant domain.akinoncli certificate list {domain_id}Creates a certificate.akinoncli certificate create {domain_id} {fqdn}ParameterDescriptionRequireddomain_idDomain IDYesfqdnFully Qualified Domain NameYesExample$ akinoncli certificate create 1 test.akinoncloud.netAddonsAddons are the third-party technologies such as Redis, Sentry, PostgreSQL etc.Lists the addons.akinoncli addon list {project_id} {project_app_id}ParameterDescriptionRequiredproject_idProject IDYesproject_app_idProject Application IDYesExample$ akinoncli addon list 1 1Kube Metric MonitorCPU and memory metrics of the applications running in the relevant Kubernetes cluster and namespace
can be seen with the following command.Lists the metrics.akinoncli addon list {project_id} {project_app_id}ParameterDescriptionRequiredclusterCluster NameYesnamespaceNamespaceYesExample$ akinoncli metrics list cluster1 namespace1