Air Commands

1. How to perform checkin?
Ans. 
  • To checkin full project : -
          air project import /Projects/class/maths -basedir /abinitio/id/class/maths -comment "" -dry-run

  • To checkin specific artifact : -
          air project import /Projects/class/maths -basedir /abinitio/id/class/maths -files dml/xyz.dml -comment "" -dry-run

  • To checkin full project and resolve conflicts : -
          air project import /Projects/class/maths -basedir /abinitio/id/class/maths -force -comment "" -dry-run

  • To checkin specific artifact and resolve conflicts : -
           air project import /Projects/class/maths -basedir /abinitio/id/class/maths -files mp/xyz.mp -force -comment "" -dry-run

  • To checkin specific artifact with required files :-
           air project import /Projects/class/maths -basedir /abinitio/id/class/maths -files pset/xyz.pset -find-required-files -comment "" -dry-run

There are several other options which can be added during checkin:
-analyze-referencing-files --> Analyze all objects that reference the objects being checked in and analyzed; for example, psets for a graph.
-exclude-files --> Excludes the specified sandbox files from checkin. Express file as a sandbox-relative path. If a directory is specified, its contents are excluded.
-fast-dry-run --> Determines the files to be checked in but does no further error checking. This argument makes no changes to the sandbox or technical repository.
-noanalysis --> Disables dependency analysis, which is otherwise performed by default during checkin
-import-commons --> Imports the common projects for the current project. If the project doesn't exist, this argument creates the project in the same technical repository directory as the specified project.


2. How to perform checkout?
Ans. 
  • To checkout full project : -
          air project export /Projects/class/maths -basedir /abinitio/id/class/maths -dry-run

  • To checkout specific artifact : -
          air project export /Projects/class/maths -basedir /abinitio/id/class/maths -files dml/xyz.dml -dry-run

  • To checkout full project and resolve conflicts : -
          air project export /Projects/class/maths -basedir /abinitio/id/class/maths -force -dry-run

  • To checkout specific artifact and resolve conflicts : -
          air project export /Projects/class/maths -basedir /abinitio/id/class/maths -files mp/xyz.mp -force -dry-run

  • To checkout a new project which has common sandboxes : -
          air project export /Projects/class/maths -basedir /abinitio/id/class/maths -common/Projects/stdenv /abinitio/id/stdenv /Projects/class/XYX_COMMON /abinitio/id/class/XYX_COMMON -dry-run

  • To checkout a new project artifacts along with common sandbox artifacts :-
          air project export /Projects/class/maths -basedir /abinitio/id/class/maths -common /Projects/class/XYX_COMMON /abinitio/id/class/XYX_COMMON -export-commons -dry-run

There are several other options which can be added during checkin:
-merge --> Optional. Performs automatic merging of files that have been modified in both the repository and the sandbox and are therefore in a conflict state.
-find-required-files --> Optional. Specifies that the list of checked-out files should include those required by the files named in the -files argument. Only required files in the local project are included.
-required-common-files --> Optional. Similar to -find-required-files, but also includes required files in common projects.
-exclude project --> Optional. Excludes the specified project from export. This option is valid only for multiproject exports
-from-tag --> Only the files listed in tag are checked out and they are exported at their version in the tag


3. How to see the lock objects?
Ans. 
air lock show
    -user username -object object -project project } ... | -all }

e.g., air lock show -user xyz
e.g., air lock show -all

4. How to release the lock from a specific object?
Ans. 
air lock release
    -object object -project project -user username } ... | -all }
    -quiet ]

e.g., air lock release -all
e.g., air lock release -object /Projects/class/math/mp/xyz.mp
e.g., air lock release -project  /Projects/class/math/

5. How to set lock on a object?
Ans. 
air lock set -force ]
    -breakable -unbreakable ]
    -auto-release -manual-release ]
    -modify attribute ] ...
    -object object } ...

e.g., air lock set -unbreakable -manual-release -object /Projects/lesson/mp/JoinCustomers.mp -object /Projects/lesson/mp/LoadJoinedCustomers.mp

e.g., air lock set -modify -unbreakable -auto-release -object /Projects/lesson/mp/Transactions.mp

6. How to break the lock of a specific object?
Ans. 

air lock break
    -object object -project project -user username } ... | -all }
    -quiet ]

e.g., air lock break -project dev_project -user Alberto -user Sarah

e.g., air lock break -object /Projects/class/maths/dml/xyz.dml



7. How to rollback the code in technical repository?
Ans. air object rollback -to-version <version number> /Projects/class/math/mp/xyz.mp

8. How to see the version of the specific object or project?
Ans. 
To check particular object version :-
e.g., air versions /Projects/lesson/mp/JoinCustomers.mp 

To check version of complete project :-
e.g., air versions /Projects/lesson/

9. How to list the projects of technical repository?
Ans. air ls /Projects/

10. How to remove a sandbox from technical repository?
Ans. air rm -r /Projects/class/math/

11. How to see the content of a object from technical repository?
Ans. air object cat /Projects/class/math/dml/xyz.dml

12. How to compare the sandbox level object to technical repository?
Ans. air sandbox diff -version <version number> /abinitio/class/math/mp/xyz.mp

13. How to create a tag?
Ans. 
Syntax : air tag create tag-name { rpath ... | -file object-list }
    [ -project-only | -all-required | -exact ] 
    [ -dry-run ] 
    [ -exclude rpath ... ] 
    [ -add ] 
    [ -strict ] 
    [ -no-annotations ]
    [ -ignore-generated-by ] 
    [ -analysis-only-datasets ] 
    [ -exclude-tests ]
    [ -full-commons | -no-full-commons ] 
    [ { -comment comment | -comment-file comment-filename }
    [ -overwrite-comment ] ] 
    [ -include-commons ]
    [ -rtag { rtag-name | version } ]

-project-only | -all-required | -exact -->  Specifies which objects should be tagged along with the primary object (specified by rpath or -file file-list). You can specify one of the following:
  • -project-only (or -p) — Includes only required objects in the same projects as the objects specified by rpath  or -file object-list.

  • -all-required (or -all) — Includes all objects required by the objects to be tagged (specified by rpath or -file object-list).

  • -exact (or -e) — Includes only the objects specified by rpath or -file object-list. This argument does not tag objects that these objects depend on. If the object to be tagged is a directory, the command recursively tags its contents.

    If none of these arguments are specified, the air tag create command uses -exact by default.

-strict --> Treats any warning situations encountered during the discovery of required objects as errors. For example, if a record format (.dml) file required by a graph were missing or had syntax errors, this argument would generate an error.

-include-commons --> When you are tagging a project, include the full contents of all common projects. Using this option automatically creates an exact tag.

Examples:
1. This example adds the prod456_tag tag to the /Projects/production project and all its required files:
air tag create prod456_tag /Projects/production -all-required

2. This example adds the prod457_tag tag to only the POC project’s mp directory:
air tag create prod456_tag /Projects/customer/POC/mp -exact

3. This example passes a file to the command that lists the two graph objects to be tagged:
air tag create prod458_tag -file tagfile
The tagfile file contains the following lines:
/Projects/test/mp/devo4.mp
/Projects/test/mp/devo5.mp
14. How to combine one or more tags?
Ans. Combines the objects tagged by one or more tags under a single tag. This command is branch-specific.

Syntax: air tag combine [-dry-run] [-create new-tag]
        [-latest | -list-order]
        tag1 tag2 ... 
Examples:
1. To create a new tag called prod that has the same contents as an existing tag dev, use the -create option to create prod and then specify dev as the only tag to “combine”:
air tag combine -create prod dev

2. In this example, the command automatically resolves any object conflicts by adding the most recent version of that object to the new tag:
air tag combine -create super-tag -latest prod12 prod14 prod16
If the tag prod 14 contains the latest version of my-graph.mp, it will be used instead of the object in prod16.

3. In this example, the command automatically resolves any object conflicts by using the version of that object found in the left-most tag.:
air tag combine -create super-tag -list-order prod14 prod12 prod16
If my-graph.mp exists in prod14, that tagged version is used even if a more recent version exists in prod12 or prod16. If my-graph.mp exists in prod12 or prod16 but not in prod14, the object in prod12 is used because it is the left-most tag in the list.
15. How to delete a tag?
Ans. Deletes a tag. Deleting a tag has no effect on the objects it was applied to. This command is branch-specific. 

Syntax:
air tag delete [-q] tag-name 
-q --> Suppresses error if the tag does not exist.
Example: air tag delete -q super-tag

16. How to see the differences of two tags?
Ans. Lists the differences between the version and objects in two tags. This command is branch-specific.

Syntax : air tag diff [-show-all] tag1 tag2

Example: To see the differences between tag-dir1 and tag-dir2, type the following:
air tag diff tag-dir1 tag-dir2
The output lists each tagged object where the version differs. The first specified tag (tag-dir1) is V1, and the second (tag-dir1) is V2. In the output below, b.txt does not exist in tag-dir1, so V1 is blank.
Object        V1    V2
/dir/a.txt   308   310
/dir/b.txt         310

17. How to freeze a tag?
Ans. Freezes a tag, so that you cannot add to, move, delete, or rename it. This command is branch-specific.

Syntax: air tag freeze tag

CAUTION!

A frozen tag cannot be unfrozen, so this command should be used with caution.


18. How to create a duplicate tag?
Ans. Creates a new tag from an existing tag, optionally updating the versions of the tag’s primary objects to the current version of the technical repository and recomputing the tag’s secondary objects. This command is branch-specific.

Syntax:
air tag duplicate tag-name new-tag-name
        [-update-to-current]
        [-comment comment | -comment-file comment-filename]
        [-exclude rpath ...]
        [-exclude-tests]

Argument

Description

tag-name

Name of an existing tag you want to duplicate.

new-tag-name

Name of the new tag.

-update-to-current

Specifies that the new tag will have all primary objects moved to the current version and that all secondary objects will be recomputed at the current version.

-comment  comment | -comment-file comment-filename

You may choose one of these:

  • -comment comment specifies the text of a comment to be associated with the tag. Express the comment as a string.

  • comment-file comment-filename specifies the name of the file containing the text of a comment to be associated with the tag.

-exclude rpath ...

If the -update-to-current argument is present, the command ignores the specified objects or any objects contained in the specified directories when it recomputes which secondary objects to tag.

-exclude-tests

If specified, test objects are not included in the tag. Test objects are technical repository elements whose class is testobj (for example, graph unit test (.tst) files). You can view an object’s class by using air object ls.

19. How to rename a tag?
Ans. Renames a tag. This command is branch-specific.

Syntax: air tag rename tag-name new-name

20. How to remove an object from a tag?
Ans. Removes the specified object from a tag. The object must have been previously tagged by the air tag create command. This command is branch-specific.

Syntax: air tag remove [-q] tag-name object

21. How to list the tags and how can we see the objects in a tag?
Ans. Lists information about tags in the technical repository. This command is branch-specific.

Syntax: air tag list [flags] [-from fromtime] [-to totime] [-user username] [tag | object]

flags --> Possible flags are as follows:
  • -l — Lists user and time information about the tag tag.

  • -o — Lists all the tags on the object object.

  • -c — Lists the comments on the tag tag.

  • -p — Lists the primary tagged objects in the tag tag.

  • -e — Lists everything tagged by the tag tag (at the domain level).

  • -n — Lists only the names of the objects in the tag tag.

  • -t — Lists the type and state of tag tag. F

  • -s — For tags that were created by loading a save file, lists information about the source tag.

22. How to compare objects of technical repository?
Ans. Compares two branches or versions of a single technical repository or two repositories, and identifies which objects have changed. Optionally, describes the differences between modified objects. This command is branch-specific.

Syntax:
air object changed [ rpath ... ]
    [ -root1 eme1 ] [ -branch1 branch1 ] [ {-version1 v1 | tag1 timestamp1} ] 
    [ -root2 eme2 ] [ -branch2 branch2 ] [ {-version2 v2tag2 timestamp2} ]
    [ -show-all ]
    [ -tagged-only ]
    [ -diff [ -terse | -verbose | -wizard ] [ -ignore-param-order ] [ -text ]
    [ -ignore-dep-analysis ] [ -original-format ] ]
    [ -files-with-diff [ -terse | -verbose ] ]
    [ -m ] [ -dml ]
Examples: 
1. The following command determines the differences between technical repository version 4849 and the latest version of the same repository and branch:
air object changed /Projects/myproj -version1 4849

The output shows among other things that transform.xfr and mygraph.mp have not changed between version 4849 and the latest version, whereas records.dml was added after version 4849 and .project.pset has been modified:

A dml/records.dml
S xfr/transform.xfr
S mp/mygraph.mp
M .project.pset

2. The following command determines the differences between the latest versions of the myproj project on two different branches in the same technical repository — release-20150428 and main:
air object changed /Projects/myproj \
    -branch1 release-20150428 -branch2 main
  A dml/stuff.dml
  M mp/output_data.mp
  M mp/process_data.mp

tag creation, listing, save file, history file creation examples:

air tag create my_first_tag /Projects/xyz/sandbox_name -all-required
air tag create my_first_tag /Projects/xyz/sandbox_name/mp -exact -strict
air tag list -t my_first_tag
air tag list -l my_first_tag
air tag list -n my_first_tag
air promote save my_first_tag.save my_first_tag -comment "creating first save file"
air promote load-history-file history-filename
air promote remove-history {-load name | -save name }
air promote load graph1.save -history-file history-graph1 -comment "load of graph1" -no-analyze
air tag remove -q my_first_tag /Projects/xyz/sandbox/mp/abc.mp
air tag diff my_first_tag my_second_tag
air tag rename my_second_tag my_other_tag


Comments