resource (Experimental)

Load your resource

abtasty-cli feature-experimentation resource load

NAME

abtasty-cli feature-experimentation resource load - Load your resource file

SYNOPSIS

abtasty-cli feature-experimentation resource load [--file Resource_File]

DESCRIPTION

    Load resources from your file

EXAMPLES

abtasty-cli feature-experimentation resource load --file loadResource.json

❗️

No confirmation step

There is no confirmation step to create Flagship resources

REQUIRED FLAGS

--file = _RESOURCE_FILE_

    The raw data contains all the info about flagship resources, check the Remote Control documentation for more details

--input-params = _INPUT_PARAMS_

     Params to replace resource loader file

--input-params-file = _INPUT_PARAMS_FILE_

     File that contains params to replace resource loader file

--output-file = _OUTPUT_FILE_

     Result of the command that contains all resource information

Here is an example of the resource file JSON

{
    "resources": [
        {
            "name": "project",
            "resourceVariable": "p1",
            "method": "create",
            "data": {
                "name": "Resource loader Project"
            }
        },
        {
            "name": "campaign",
            "resourceVariable": "c1",
            "method": "create",
            "data": {
                "project_id": "$p1.id",
                "name": "Resource loader Campaign",
                "description": "Loaded from resource loader",
                "type": "ab",
                "variation_groups": [
                    {
                        "variations": [
                            {
                                "name": "Original",
                                "reference": true,
                                "allocation": 50,
                                "modifications": {
                                    "type": "FLAG",
                                    "value": {
                                        "color": "red"
                                    }
                                }
                            },
                            {
                                "name": "Variation 1",
                                "reference": false,
                                "allocation": 50,
                                "modifications": {
                                    "type": "FLAG",
                                    "value": {
                                        "color": "blue"
                                    }
                                }
                            }
                        ],
                        "targeting": {
                            "targeting_groups": [
                                {
                                    "targetings": [
                                        {
                                            "operator": "EQUALS",
                                            "key": "device",
                                            "value": "firefox"
                                        }
                                    ]
                                }
                            ]
                        }
                    }
                ]
            }
        },
        {
            "name": "flag",
            "resourceVariable": "f1",
            "data": {
                "name": "flag_created_with_resource_loader",
                "type": "string",
                "description": "Loaded from resource loaderr",
                "source": "manual"
            }
        },
        {
            "name": "goal",
            "resourceVariable": "g1",
            "data": {
                "type": "screenview",
                "label": "goal_created_with_resource_loader",
                "operator": "contains",
                "value": "Performance"
            }
        },
        {
            "name": "targeting_key",
            "resourceVariable": "t1",
            "data": {
                "type": "string",
                "name": "targeting_key_created_with_resource_loader",
                "description": "Loaded from resource loader"
            }
        }
    ]
}

Scripting in the resource file

This resource command uses scripting language to assign the result of an HTTP Request to a variable.
When the resource command is executed, the resources are created in sequential order and each resource's HTTP result is assigned to its resourceVariable property, to access the HTTP result in the JSON file use $ followed by resourceVariable value, for example in the example JSON above you can access the result of the object project created using $p1.