GitProject
TM1Project(version=1.0, name='', settings=None, tasks=None, objects=None, ignore=None, files=None, deployment=None, pre_push=None, post_push=None, pre_pull=None, post_pull=None)
Bases: TM1Object
Abstraction of Git tm1project
Args: version (int): description settings (dict, optional): description. Defaults to None. tasks (dict, optional): description. Defaults to None. objects (dict, optional): description. Defaults to None. ignore (list, optional): description. Defaults to None. files (list, optional): description. Defaults to None. deployment (dict, optional): description. Defaults to None. pre_push (list, optional): description. Defaults to None. post_push (list, optional): description. Defaults to None. pre_pull (list, optional): description. Defaults to None. post_pull (list, optional): description. Defaults to None.
Source code in TM1py/Objects/GitProject.py
body
property
body_as_dict
property
deployment
property
writable
ignore
property
writable
name
property
writable
objects
property
writable
post_pull
property
writable
post_push
property
writable
pre_pull
property
writable
pre_push
property
writable
settings
property
writable
tasks
property
writable
version
property
writable
add_deployment(deployment)
"Deployment is an OPTIONAL property. Each of its property defines a named deployment and its specific properties. All the tm1project properties can be redefined for a deployment, except Version. Those properties override the tm1project properties for the specific deployment.
Current deployment is set by action GitInit."
Source code in TM1py/Objects/GitProject.py
add_ignore(object_class, object_name)
Ignore is an optional property in the tm1project It specifies the objects to be excluded from the source, if the object is newly created.
Args: object_class: class of the object e.g., "Dimensions" object_name: name of the object e.g., "Product"
For the object_type pass value like Dimensions or Cubes/Views
Wildcards (*) can be used in the object_name, if the object is not a control object.
Example of the ignore property in the tm1project:
Exclude all the new Cubes and Views in the source, except Cube_A;
include control Process }Drill_Drill_A;
and exclude all the new Dimensions which has a name starting with 'Dim'
"Ignore":
[
"Cubes/Views",
"!Cubes('Cube_A')",
"!Processes('}Drill_Drill_A')",
"Dimensions('Dim*')"
]
Source code in TM1py/Objects/GitProject.py
add_ignore_exceptions(object_class, object_names)
Specify exceptions to ignore policy.
Wildcards (*) can not be used in the object_name
Args: object_class: class of the object e.g., "Dimensions" object_names: names of the objects e.g., ["Product", "Customer", "Region"]
Example of the ignore property in the tm1project: Exclude all Dimensions that start with 'Dim', except for dimension 'DimB', 'DimA'
"Ignore":
[
"Dimensions('Dim*')",
"!Dimensions('DimA')",
"!Dimensions('DimB')"
]
Source code in TM1py/Objects/GitProject.py
add_task(project_task)
Source code in TM1py/Objects/GitProject.py
from_dict(tm1project_as_dict)
classmethod
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tm1project_as_dict
|
Dict
|
Dictionary, tm1project as dictionary |
required |
Returns:
| Type | Description |
|---|---|
TM1Project
|
an instance of this class |
Source code in TM1py/Objects/GitProject.py
from_file(filename)
classmethod
from_json(tm1project_as_json)
classmethod
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tm1project_as_json
|
str
|
response of /!tm1project |
required |
Returns:
| Type | Description |
|---|---|
TM1Project
|
an instance of this class |
Source code in TM1py/Objects/GitProject.py
include_all_attribute_dimensions(tm1)
Add an ignore-exception for each attribute dimension
Source code in TM1py/Objects/GitProject.py
remove_deployment(deployment_name)
remove_ignore(ignore_entry)
TM1ProjectDeployment(deployment_name, settings=None, tasks=None, objects=None, ignore=None, files=None, pre_push=None, post_push=None, pre_pull=None, post_pull=None)
Bases: TM1Project
Source code in TM1py/Objects/GitProject.py
body
property
body_as_dict
property
construct_body()
Source code in TM1py/Objects/GitProject.py
from_dict(deployment_name, deployment)
classmethod
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
deployment
|
Dict
|
Deployment as dictionary |
required |
Returns:
| Type | Description |
|---|---|
TM1ProjectDeployment
|
an instance of this class |
Source code in TM1py/Objects/GitProject.py
TM1ProjectTask(task_name, chore=None, process=None, parameters=None, dependencies=None, precondition=None)
Defines an action that executes a Process or a Chore with certain parameters.
A Task MUST either have a Process or a Chore property. The property specifies the reference of the Process or Chore to be executed. The Process or Chore MUST be visible.
A Task MAY have a Parameters property. The property specifies the parameters to be passed to the Process. This property MUST NOT be specified if the task is to execute a Chore.
A Task MAY have a Dependencies property. The property specifies an array of URIs of tasks or objects, which will be executed or loaded, respectively, before executing the current task. E.g.: ["Cubes('Cube_A')", "Dimensions('Dimension_C')"]
A Task MAY have a Precondition property. The server only executes a Task when either the precondition is not specified, or it is evaluated to TRUE.
The server only executes a Task one time during a deployment.