Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface EnvironmentAlias

Hierarchy

Index

Properties

Methods

Properties

environment

environment: MetaLinkProps

sys

System meta data

Methods

toPlainObject

update

  • Sends an update to the server with any changes made to the object's properties. Currently, you can only change the id of the alias's underlying environment. See the example below.

    memberof

    EnvironmentAlias

    func

    update

    Parameters

    Returns Promise<EnvironmentAlias>

    Object returned from the server with updated changes.

    const contentful = require('contentful-management')
    
    const client = contentful.createClient({
      accessToken: '<content_management_api_key>'
    })
    
    client.getSpace('<space_id>')
    .then((space) => space.getEnvironmentAlias('<environment_alias_id>'))
    .then((alias) => {
      alias.environment.sys.id = '<environment_id>'
      return alias.update()
    })
    .then((alias) => console.log(`alias ${alias.sys.id} updated.`))
    .catch(console.error)