Alias

View as Markdown

Alias

An alias acts as a pointer to a particular branch. You can specify the alias ID in your frontend code to pull content from the target branch associated with an alias.

assign

The assign method creates a new alias in a particular stack of the organization.

NameTypeDescription
data (required)Dict

The data you want to send to the server when creating a folder.

import contentstack_management

body = {

       "branch_alias": {

           "target_branch": "test"

           }

       }

branch = contentstack_management.Client(authtoken='auth_token').stack(api_key='api_key').alias("alias_uid")

response = branch.assign(data)

delete

The delete method removes an alias permanently from the stack

NameTypeDescription
branch_uid (required)str

UID of the branch

import contentstack_management
branch = contentstack_management.Client(authtoken='auth_token').stack(api_key='api_key').branch(branch_uid="branch_uid")
response = branch.delete()

fetch

The fetch method retrieves the details of a particular alias.

NameTypeDescription
branch_alias_uid (required)str

UID of the alias

import contentstack_management
branch = contentstack_management.Client(authtoken='auth_token').stack(api_key='api_key').branch_alias('branch_alias_uid')
response = branch.fetch()

find

The find method retrieves the details of all aliases available in the particular stack.

NameTypeDescription
limit (required)Number

A limit on the number of objects to return

skip (required)Number

The number of objects to skip before return

include_count (required)Boolean

To retrieve the count of results in response

import contentstack_management

branch = contentstack_management.Client(authtoken='auth_token').stack(api_key='api_key').branch_alias()

response = branch.find()