Package: quip-cli
QUIP - Quick Universal Integration Development ToolQUIP - Quick Universal Integration Development ToolDescriptionSetupTroubleshootingSample ConfigHelpUniversal Extension OperationsCreate empty extensionBootstrap an extensionClone existing extensionUpdate Existing ExtensionDelete an extension folderCreate ICON fileUniversal Template OperationsCreate empty templateBootstrap a Universal TemplateClone existing templateDownload a Universal TemplateUpload Universal TemplateUpdate Existing TemplateDelete a template folderBuild an Universal TemplateCreate ICON fileUsing different config fileDisplay and update the version of the template/extensionVersion Files configurationUpdating Universal Template/Extesion FieldsUpdate FieldsDump FieldsPrint Sample CodeFormat of fields.yml fileDescriptionThis tool is for rapid universal extension and universal template project creation. This tool is written on Python and can work on Windows or Linux platforms.All the configuration is located in .uip_config.yml file located on the script folder or home folder of the user or you can use a configuration by using --config option.SetupInstall quip from pippip install --upgrade quip-cliCheck the versionquip --versionCheck configurationquip configSet the path of the baseline projects tosource:andtemplate_source:fields in.uip_config.ymlfile. Folder paths must be full path not relative paths.Update the fields in the.uip_config.ymlfileTroubleshootingContact:huseyin.gomleksizoglu@stonebranch.comfor any questions.Sample Configdefaults:# Default valuestemplate:ue-task# default template for uip init commandbootstrap:source:/projects/dev/ue/ue-baseline# path of extension baseline projecttemplate_source:/projects/dev/ut/ut-baseline# path of universal template baseline projectexclude:# folders that will be excluded for extension-.git-.uiptemplate-exclude:# folders that will be excluded for universal template-.giticon_font:cour.ttf# Font for the default iconuse_keyring:true# Keep the passwords in OS level Keyring [Recommended]project_prefix:cs# This keyword will be added to the folder name and repositoriesexternal:gitlab:url:https://gitlab.stonebranch.comssl_verify:falseusername:<username>default_group:cs-uac# default group for new repositoriesgroups:# List of repositories that can be used for new repositories-integration-prototypes-cs-uacprotected_branch:# information about protected branchname:mainmerge:DEVELOPER# possible options are:push:NO_ACCESS# DEVELOPER, MAINTAINER, ADMIN, GUEST, NO_ACCESS, OWNER, REPORTERdefault_branch:develop# Name of the default branchgit-init:true# it will run some git commands to initialize default branchjenkins:url:https://jenkins.stonebranch.com/ssl_verify:falseusername:<username>default_group:cs-uacgroups:# Group mapping between GitLab and Jenkinsintegration-prototypes:integration-prototypescs-uac:cs-uacsonarqube:url:https://sonarqube.stonebranch.comusername:<username>use_token:true# Use Username/Password or Tokenssl_verify:falsegroups:# Group mapping between Jenkins and SonarQubecs-uac:cs-uacextension.yml:# default values for extension.ymlextension:name:""version:"1.0.0"api_level:"1.2.0"requires_python:">=3.7"owner:name:Developer Nameorganization:Stonebranch Inc.comments:Created using ue-task templateuip.yml:# dafault values for .uip/config/uip.ymluserid:ops.adminurl:http://localhost:8090/ucHelpquip --help======= QUIP (v.1.7.0-BETA) =======
usage: quip [-h] [--version] [--config CONFIG] [--debug] {new,update,u,up,fields,f,fi,delete,d,del,clone,c,cl,copy,bootstrap,bs,boot,bst,baseline,upload,push,download,pull,build,b,dist,zip,icon,resize-icon,ri,resize,clean,clear,setup,version,config} ...

Wrapper for UIP command.

positional arguments:
  {new,update,u,up,fields,f,fi,delete,d,del,clone,c,cl,copy,bootstrap,bs,boot,bst,baseline,upload,push,download,pull,build,b,dist,zip,icon,resize-icon,ri,resize,clean,clear,setup,version,config}
    new                 Creates new integration
    update (u, up)      Updates existing integration
    fields (f, fi)      Updates or dumps template.json fields.
    delete (d, del)     Deletes the integration folder
    clone (c, cl, copy)
                        Clones existing integration with a new name
    bootstrap (bs, boot, bst, baseline)
                        Bootstrap new integration from baseline project
    upload (push)       Uploads the template to Universal Controller. (Template Only)
    download (pull)     Download the template from Universal Controller. (Template Only)
    build (b, dist, zip)
                        Builds a zip file to import to Universal Controller. (Template Only)
    icon (resize-icon, ri, resize)
                        Resize the images to 48x48 in src/templates/
    clean (clear)       Clears the dist folders
    setup               Setup External Systems
    version             shows the version of the template/extension
    config              show the configuration

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --config CONFIG, -c CONFIG
                        path of the global config. Default is ~/.uip_config.yml
  --debug, -v           show debug logsUniversal Extension OperationsCreate empty extensionquip new ue-new-extensionBootstrap an extensionThis command willinitialize a new extensioncopy all files from ue-baseline project (except some folders)update the config filesupdate the SysID of the template.json filecreate fields.yml filequip bootstrap ue-bs-extensionClone existing extensionThis command willinitialize a new extensioncopy thesrcfolder from the source projectupdate the config filesupdate the SysID of the template.json filequip clone ue-cloned-extension ..\ue\ue-aws-m2Update Existing Extensionquip update ue-cloned-extensionTo update the SysID values add --update-uuid (or -u) parameterquip update ue-cloned-extension --uuidTo update the new_uuid values add --new-uuid (or -n) parameter. For any new object you can use a keyword like "new_uuid" as value and it will be automatically updated with this command.quip update ue-cloned-extension --new-uuidDelete an extension folderquip delete ue-cloned-extensionCreate ICON fileThis command will find all the image files undersrc/templates/folder (it will ignore template_icon.png and any file that ends with "_48x48.png") and convert them to 48x48 size PNG files. quip will create new files with name *_48x48.png for each image file. If there is only one image file than it will also update the template_icon.png file.quip iconIf you don't have any image file, you can also create one by using--generateparameter.Universal Template OperationsCreate empty templatequip new ue-new-extensionBootstrap a Universal TemplateThis command willcopy all files from ut-baseline project (except some folders)update the config filesupdate the SysID of the template.json fileUpload the new template to controllercreate fields.yml filequip bootstrap ut-bs-extension --templateClone existing templateThis command willinitialize a new templatecopy thesrcfolder from the source projectupdate the config filesupdate the SysID of the template.json filecreate fields.yml filequip clone ut-cloned-extension ..\ue\ut-aws-m2 --templateDownload a Universal TemplateThis command will download the template.json, script files and ICON of the template.This command willif the folder does not existsbootstrap a new universal templatedownload the teplate zipextract template.json and template_icon.png from zipcreate script filescreate fields.yml filequip download Snowflake --templateUpload Universal TemplateThis command will not update the Universal Template and the ICON.quip upload Snowflake --templateUpdate Existing Templatequip update ut-cloned-extensionTo update the SysID values add --update-uuid (or -u) parameterquip update ut-cloned-extension --uuidTo update the new_uuid values add --new-uuid (or -n) parameter. For any new object you can use a keyword like "new_uuid" as value and it will be automatically updated with this command.quip update ut-cloned-extension --new-uuidDelete a template folderquip delete ut-cloned-extensionBuild an Universal TemplateThis command will create a zip file for universal templates. This command will not work for universal extensions becauseuip buildcommand already has this function.The zip file will be created underbuildfolder.quip build ut-databricks -tCreate ICON fileThis command will find all the image files undersrc/templates/folder (it will ignore template_icon.png and any file that ends with "_48x48.png") and convert them to 48x48 size PNG files. quip will create new files with name *_48x48.png for each image file. If there is only one image file than it will also update the template_icon.png file.quip iconIf you don't have any image file, you can also create one by using--generateparameter.Using different config fileYou can use--configoption to select the config file you want to use. This option will allow to use different controllers while downloading or uploading or using different baseline projects based on the project you will create. For example in the following example, quip will download Snowflake universal template from Atlanta Controller.quip download Snowflake --template --config ~/.uip_config_atlanta.ymlDisplay and update the version of the template/extensionThis command will look for multiple files and will try to find the version information. It will show the versions in the files and also will display the possible new versions.quip versionYou can update the version by using 3 different update level: minor, major or release. Minor will update the last part of the version, major will update the middle value and release will update the first value. For example if the current version is 5.22.0, these are the possible next versions;RELEASE:  6.0.0
MAJOR:  5.23.0
MINOR:  5.22.1To update the version you can use this command.quip version minorif you want to change the version to a specific value, you can use the--forceoption. For example the following command will change the version to 5.22.4quip version --force 5.22.4If you have different version in the different files, in this case you can also use--forceoption to update them to a specific version. If there are multiple versions you can not use minor, major or release options.Version Files configurationBy defaultquipwill check the following files.src/extension.ymlscript.ymlsrc/extension.pysrc/init.pysrc/templates/script*You can change this configuration in your.uip_config.ymlfile. Here is a sample configuration. Quip will use the default configuration if you don't have any configuration in the config.defaults:# Default valuestemplate:ue-task# default template for uip init commandbootstrap:source:/Users/HuseyinGomleksizoglu/SE_Projects/dev/ue/ue-baseline# path of extension baseline projecttemplate_source:/Users/HuseyinGomleksizoglu/SE_Projects/dev/ut/ut-baseline# path of universal template baseline projectexclude:# folders that will be excluded for extension-.git-.uiptemplate-exclude:# folders that will be excluded for universal template-.gitextension.yml:# default values for extension.ymlextension:name:""version:"1.0.0"api_level:"1.2.0"requires_python:">=3.7"owner:name:Huseyin Gomleksizogluorganization:Stonebranch Inc.comments:Created using ue-task templateuip.yml:# dafault values for .uip/config/uip.ymluserid:ops.adminurl:http://localhost:8090/ucversion_files:-file:"src/extension.yml"format:"yml"location:"extension.version"-file:"script.yml"format:"yml"location:"script.version"-file:"src/extension.py"format:"regex"location:"^\\s*(gl_version|version|__version__)\\s*=\\s*[\\\"']+([^\\\"']+)[\\\"']+"group:2-file:"src/__init__.py"format:"regex"location:"^\\s*(gl_version|version|__version__)\\s*=\\s*[\\\"']+([^\\\"']+)[\\\"']+"group:2-file:"src/templates/script*"format:"regex"location:"^\\s*(gl_version|version|__version__)\\s*=\\s*[\\\"']+([^\\\"']+)[\\\"']+"group:2-file:"quip/__init__.py"format:"regex"location:"^\\s*(gl_version|version|__version__)\\s*=\\s*[\\\"']+([^\\\"']+)[\\\"']+"group:2-file:src/templates/template.jsonformat:"regex"location:"\"description\"\\s*:\\s*\"v([\\d\\.]+)"group:1You can also use different configuration files if needed.quip -c ~/.uip_config_sample.yml versionUpdating Universal Template/Extesion Fieldsquip will automatically create a file calledfields.ymlon the root of the project folder. This will will have yaml representation of the fields. You can modify this file and update the template.json file with the new values.Update FieldsThis command willConvert the yaml file into json formatUpdate the template.json fileDump the new fields back to fields.yml file to add the Field Mapping valuesquip fields --updateDump FieldsThis command will convert the fields information from template.json file and create/update fields.yml file.quip fields --dumpPrint Sample CodeThis command will print some sample code to assign the fields or define dynamic choice fields.quip fields --update --codeOutput:self.action = fields.get("action", [None])[0]
self.credentials = { "user": fields.get("credentials.user", None), "password": fields.get("credentials.password", None) }
self.end_point = fields.get("end_point", None)
self.region = fields.get("region", None)
self.application = fields.get("application", [None])[0]
self.batch_format = fields.get("batch_format", [None])[0]
self.jcl_file_name = fields.get("jcl_file_name", None)
self.jcl_file_path = fields.get("jcl_file_path", None)
self.script_name = fields.get("script_name", None)
self.jcl_file_name_temp = fields.get("jcl_file_name_temp", None)
self.application_id = fields.get("application_id", None)
self.batch_execution_id = fields.get("batch_execution_id", None)
self.step_name = fields.get("step_name", None)
self.procstep_name = fields.get("procstep_name", None)
self.templib = fields.get("templib", None)
self.parameters = fields.get("parameters", None)

@dynamic_choice_command("application")
def get_application(self, fields):
    _fields = []
    return ExtensionResult(
    rc = 0,
    message = "Available Fields: '{}'".format(_fields),
    values = _fields
    )Format of fields.yml fileA simple file will look like this.name:AWS Mainframe Modernizationtemplate_type:Extensionagent_type:Anydescription:AWS M2 - Mainframe Modernizationextension:aws-m2min_release:7.0.0.0var_prefix:extsys_id:fb7fc3a05eac4d57a74fe1b1342b3938fields:-action:Choicehint:Select the action you want to runstart:truefield_mapping:Choice Field 1items:-list-environments-list-applications-start-batch-sync-start-batch-credentials:Credentialhint:Put Access key to Runtime User and Secret Key to Password fieldslabel:AWS Credentialsend:truefield_mapping:Credential Field 1-end_point:Texthint:This field is optional. If you don't put the value it will be generated byusing the region value.start:truedefault:https://m2.us-east-1.amazonaws.comfield_mapping:Text Field 4-application:Choicehint:Application will be retrieved from AWS automaticallyspan:2dynamic:truefield_mapping:Choice Field 2items:[]dependencies:-end_point-region-credentialsshow_if:action:start-batch,sync-start-batchrequired:true-application_id:Textstart:truerestriction:Output Onlyfield_mapping:Text Field 1show_if:action:start-batch,sync-start-batch-parameters:Arraystart:truename_title:Parameter Namevalue_title:Parameter Valuefield_mapping:Array Field 1span:2values:-task_name-template:Value-variable_1:Value 1-variable_2:Value 2Format of the child elements are like this.First value will be the name of the field and the value of that element will be the type of the field.Field Types can be one of these itemsTextLarge Text (aliases: large, largetext, textarea, text area)IntegerBoolean (aliases: bool, check, checkbox, check box)Choice (aliases: items, select, option, options, list)Credential (aliases: creds, cred, credentials)ScriptArray (aliases: grid)FloatOther Fields:label: By default field name will be converted as a label but if you want to overwrite that value you can use that fieldhint: The hint message of the fieldfield_mapping: This is the mapping for the database fields. If this value is missing, quip will automatically assign the next available field. It is safe to not provide this value for new extension/template. The assigned values will be automatically added to the file.default: If there is a default value, you can use that field.required: If the field is required, you can use that field. Default: falsestart: If you want the field to be in the left side of the row, set value to true. Default: falseend: If you want the field to be on the right side of the row, set value to true. Default: falsespan: If you want the field to fill the row set value to 2. Default: 1text_type: If the text field has YAML or JSON content, set value to YAML or JSON. Default: Plaindynamic: If the field is a dynamic choice field, set the value to true. Default: falserestriction: If the field has restrictions like output only, set the value to "Output Only". Default: No Restrictionname_title: This field is only for Array types. This field is the label of the first field.value_title: This field is only for Array types. This field is the label of the second field.titles: (alias: headers) This field is another representation of the name_title and value_title fields. You can set the name and value field title in a comma seperated string. For example:titles: Field Name, Field Valuevalues: Default values of an Array field.allow_multiple: This field is only for Choice types. To allow selecting multiple values, set value to true. Default: falseallow_empty: This field is only for Choice types. To allow not selecting any value, set value to true. Default: falselength: Sets the max lenght of the field.max: Sets the maximum allowed number for that field.min: Set the minimum allowed number for that field.itemsThis field is required for Choice type. This field will include the items of the choice field. Items can be a simple string without a space and it will be used as the name of the item and label will be generated from the names. If you want to give a specific label, in this case set it like this.- use_ssl: Use SSL-action:Choicehint:Select the action you want to runstart:truefield_mapping:Choice Field 1items:-list-environments-list-applications-start-batch-sync-start-batch:Start Batch and WaitDependenciesThis field is only for dynamic choice fields. This field will include the list of dependencies of the the dynamic choice field. Dependencies will be the list of field names.-application:Choicehint:Application will be retrieved from AWS automaticallyspan:2dynamic:truefield_mapping:Choice Field 2items:[]dependencies:-end_point-region-credentialsShow IfIf the field will be displayed based on another field, in this case you can use theshow_ifoption. First element will be name of the dependent field and value of the element will be the condition. If the field will be required if it is visible, thanrequired: trueoption must be added.The following example will show theapplication_idfield if theactionfield isstart-batchorsync-start-batch-application_id:Textstart:truerestriction:Output Onlyfield_mapping:Text Field 1show_if:action:start-batch,sync-start-batchOther options:required: If the field will be required if visible, set the value to true.no_space: If the field will not reserve any space if hidden, set the value to false. Default: truepreserve_value: The value of this field will be stored even the field is not visible. Default: falseRequire IfIf the field will be required based on another field, in this case you can use therequire_ifoption. First element will be name of the dependent field and value of the element will be the condition.-task_name:Textstart:truefield_mapping:Text Field 1require_if:action:start-batch,sync-start-batchRaw ValuesSome of the options not implemented in quip because they are not common options. For these options you can use theraw:option. This item will include the list of items and values of them.-backup_folder:Textfield_mapping:Text Field 6show_if:backup:truerequired:trueraw:preserveOutputOnRerun:trueList of raw options:booleanNoValuebooleanValueTypebooleanYesValuechoiceSortOptiondefaultListViewpreserveOutputOnRerunSetup External SystemsQuip will automatically create Repositories or Jobs in external systems. The main purpose is to have GitLab Repository, Jenkins Job, SonarQube Project and WebHook configuration between GitLab and Jenkins.quip setupThe output of the command will be similar to that one.======= QUIP (v.1.7.0-BETA) =======
Namespace(action='setup', config=None, debug=False, sonarqube=False, name=None)
INFO:root:Reading template.json file
INFO:root:Project name: ue-AWS Mainframe Modernization
INFO:root:Using config from file : C:\Users\HuseyinGomleksizoglu\.uip_config.yml

==== GITLAB SETUP ====
There is a saved password. To used the saved password just press [Enter]
Please enter Personal Access Key:
Do you want to create Gitlab repository?(Y/n): 
INFO:root:Creating GitLab Repository.
Gitlab Groups
=============
(1) cs-uac
(2) integration-prototypes
(3) uac-extensions
(4) uac-extensions/community
(5) uac-extensions/onboarding
(6) uac-extensions/universal-extensions-frameworks
Choose one (1-6) [1]:  1
INFO:root:Checking GitLab if the repository exists.
Repository created cs-uac/ue-aws-mainframe-modernization
Run `git init`
Run `git remote add origin https://gitlab.stonebranch.com/cs-uac/ue-aws-mainframe-modernization.git`

==== JENKINS SETUP ====
INFO:root:Connecting to Jenkins Server.
There is a saved password. To used the saved password just press [Enter]
Please enter Jenkins Password for (h.gomleksizoglu):
INFO:root:Repository doesn't exist and will be created. cs-uac/ue-aws-mainframe-modernization
Do you want to create Jenkins pipeline?(Y/n):

==== SONARQUBE SETUP ====
Do you want to create SonarQube projects?(Y/n):
There is a saved password. To used the saved password just press [Enter]
Please enter Personal Access Key:
INFO:root:URL = https://sonarqube.stonebranch.com/api/projects/create?project=cs-uac-ue-aws-mainframe-modernization&name=cs-uac-ue-aws-mainframe-modernization
SonarQube project created: cs-uac-ue-aws-mainframe-modernization
INFO:root:URL = https://sonarqube.stonebranch.com/api/qualitygates/select?gateName=CS UAC and Community QG&projectKey=cs-uac-ue-aws-mainframe-modernization
SonarQube Quality Gate changed.GitLab SetupThe processing logic ofquipis like thisCheck if there is .git/config file.If so,check the repository name of remote system with nameoriginCheck if the repository exists in GitLabIf not create the repositoryAsk for new repository group. It will list the group from GitLab system.Check if there is a repository already exists in GitLabIf so,Print information how to add a remote systemIf not create the repositoryJenkins SetupThe processing logic ofquipis like thisMap the GitLab group to group in Jenkins. This will be importan if the group names are different GitLab and Jenkins.Check if Jenkin Job existsIf not,Create the Jenkins Job. Job will be created with some default values. They are hard coded for now. Planning to have configuration in future.Create WebHook from GitLab to Jenkins Job for any Push, Merge Request and Comment event.SonarQube SetupThe processing logic ofquipis like thisCheck if there is a mapping for the Jenkins GroupIf so,Create the Project if it doesn't existsUpdate Security Gate of the ProjectIf not,No need to create SonarQube project for that group