Skip to main content

"publication"

The publication object is used to create, delete, and list publications

Abstract

The publication object is used to create, delete, and list publications

The publication object is used to create, delete and list publications. The publication JSON object can be specified as the main target for the JSON input file or it can be used inside plan or group targets to define a publication during the creation of another target.

Properties summary

Table 1. "publication" object properties summary

Property

Description

Type

create

creates a new publication

object

delete

deletes the publication specified with the "name" parameter under the engine specified with the "engine" parameter

object

list

lists the files published by a publication specified with the "name" parameter under the engine specified with the "engine" parameter

object



When the mode is "db", a "dbname" parameter is specified. Additional folders will also be published. This feature is used because SQL databases may contain files from different folders.

{
    "memphis": {
     "name": "MEMPHIS",
     "host": "localhost",
     "port": "7597",
     "uid": "admin",
    "pwd": "ADMIN"
    },
    "options": {
      "profile": true,
      "replace": true,
      "ignoredeploy": false,
      "recursivedel": false,
      "recursivesearch": true
    },
    "publication": {
      "actions": [
        "create"
      ],
      "name": "pubdb",
      "engine": "FAIRCOMS@HOST001",
      "mode": "db",
      "dbname": "ctreeSQL",
      "wildcards": ["*dat"],
      "items":[ 
        "E:\\sw\\eu_database\\dbf\\ML\\data\\c"
        ]
    }
  }
{
    "memphis": {
      "name": "MEMPHIS",
      "host": "localhost",
      "port": "7597",
      "uid": "admin",
      "pwd": "ADMIN"
    },
    "options": {
      "profile": true,
      "replace": true,
      "ignoredeploy": false,
      "recursivedel": false,
      "recursivesearch": true
    },
    "publication": {
      "actions": [
        "create"
        ],
        "name": "pubfolder",
        "engine": "FAIRCOMS@HOST001",
        "mode": "folder",
        "item": "E:\\sw\\eu_database\\dbf\\ML\\data\\d",
        "wildcards": ["*dat"],
        "recursive": false
    }
}
{  
  "memphis": {
    "name": "MEMPHIS",
    "host": "localhost",
    "port": "7597",
    "uid": "admin",
    "pwd": "ADMIN"
  },
  "options": {
    "profile": true,
    "replace": true,
    "ignoredeploy": false,
    "recursivedel": false,
    "recursivesearch": true
  },
  "publication": {
    "actions": [
      "create"
    ],
    "name": "pubFiles",
    "engine": "FAIRCOMS@HOST001",
    "mode": "files",
    "items": [
      "E:\\sw\\eu_ldf\\dbf\\ML\\*.*dat",
      "E:\\sw\\usa_ldf\\dbf\\ML\\*.*dat",
    ]
  }
}

This is an example to create a "plan" ( the target) with the "create" property value of "false".

In this example, a new "plan" is created as our main target. The publication definition under "subscriptions" has the "create" property value set to "false" because the "pubFiles" publication file already exists on the source server engine and does not need to be created.

{
  "memphis": {
    "name": "MEMPHIS",
    "uid": "admin",
    "pwd": "ADMIN"
  },
  "plan": {
    "actions": [
      "create",
      "deploy",
      "start"
    ],
    "name": "planFiles",
    "sourceEngine": "FAIRCOMS@MAURO-PC",
    "destEngine": "FAIRCOM2@MAURO-PC",
    "subscriptions": [
      {
        "name": "subFiles",
        "bidirectional": false,
        "publication": {
          "name": "pubFiles",
          "create": false
        }
      }
    ]
  }
}

This is an example to create a "plan" ( the target) with the "create" property value of "true".

In this example, a new "plan" is created as our main target. The publication definition under "subscriptions" has the "create" property value set to "true" because the "pubFiles" publication file does not exist on the source server engine and needs to be created. The creation specifications, such as mode and items, must be provided.

{
  "memphis": {
    "name": "MEMPHIS",
    "uid": "admin",
    "pwd": "ADMIN"
  },
  "plan": {
    "actions": [
      "create"
    ],
    "name": "planFiles",
    "sourceEngine": "FAIRCOMS@MAURO-PC",
    "destEngine": "FAIRCOM2@MAURO-PC",
    "subscriptions": [
      {
        "name": "subFiles",
        "bidirectional": false,
        "publication": {
          "name": "pubFiles",
          "create": true,
          "mode": "files",
          "items": [
            "E:\\sw\\eu_ldf\\dbf\\ML\\*.*dat"
          ]
        }
      }
    ]
  }
}

Note

Beginning with FairCom DB version 13.0.2 the "create" property is obsolete. The following example creates a "plan" and "publication" if the publication file does not already exist.

{
  "memphis": {
    "name": "MEMPHIS",
    "uid": "admin",
    "pwd": "ADMIN"
  },
  "plan": {
    "actions": [
      "create"
    ],
    "name": "planFiles",
    "sourceEngine": "FAIRCOMS@MAURO-PC",
    "destEngine": "FAIRCOM2@MAURO-PC",
    "subscriptions": [
      {
        "name": "subFiles",
        "bidirectional": false,
        "publication": {
          "name": "pubFiles",
          "mode": "files",
          "items": [
            "E:\\sw\\eu_ldf\\dbf\\ML\\*.*dat"
          ]
        }
      }
    ]
  }
}
{
  "memphis": {
     "name": "MEMPHIS",
     "host": "localhost",
     "port": "7597",
     "uid": "admin",
    "pwd": "ADMIN"
  },
  "options": {
    "profile": true,
    "replace": true,
    "ignoredeploy": false,
    "recursivedel": false,
    "recursivesearch": true
  },
  "publication": {
    "actions": [
      "delete"
    ],
    "name": "pubFiles",
    "engine": "FAIRCOMS@HOST001"
  }
}
{
  "memphis": {
    "name": "MEMPHIS",
    "uid": "admin",
    "pwd": "ADMIN"
  },
  "publication": {
    "actions": [
      "list"
    ],
    "name": "pubFiles",
    "engine": "FAIRCOMS@HOST001"
  }
}

The "create" action creates a new publication, plan, or group.

Note

The "create" action with "plan" targeted always takes a list of subscriptions and each subscription is associated with an existing or new publication. The "create" action with "publication" targeted defines new publications.

Properties summary

Table 2. "create" actions summary

Property

Description

Type

Limits (inclusive)

create

When "publication" is not the main target, this property indicates whether to find an existing publication ("false") or create a new one ("true").

Note

Beginning with FairCom DB version 13.0.2, this property is no longer used. If the named publication exists, it is used and other publication properties are ignored.

If the publication does not exist it will be created with the specified properties. If the properties are not sufficient, an error is returned.

Boolean

"true"
"false"

dbExcludes

specifies wildcards that are used to exclude files in the designated folder, when the mode is "db". Each object is composed of an “item” which is a folder specified in the “items” array, and a mask which specifies the wildcard for the files to exclude.

array of JSON Objects

dbname

contains the name of the database to be published

Note

This is for when the "mode" is "db".

string

engine

specifies the logical name of the publication

string

folderExcludes

specifies wildcards that are used to exclude files in the designated folder, when the mode is "folder".

array of strings

items

contains a list of the objects to be published

Note

Depending on the "mode" this is a list of databases, folders, or files.

array of strings

mode

specifies the mode of the publication

string

"db"
"folder"
"files"

name

specifies the name of the publication

string

recursive

specifies whether the files matching the wildcard are matched recursively in sub-folders or just in the specified root

Note

This is for when the mode is "db" or "folder".

Boolean

wildcards

specifies that the specified wildcards are used to match the files in the specified folders

Note

This is for when the mode is "db" or "folder".

array of strings