Child pages
  • WHM API 1 Functions - manage_features
Skip to end of metadata
Go to start of metadata

Description


This function lists and manages items in the Feature Showcase.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/manage_features?api.version=1&action=list
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/manage_features?api.version=1&action=list
 Command Line
whmapi1 manage_features action=list


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)

If the action parameter's value is info, the function's output will resemble the following example:

{
    "data": {
        "feature": [
            {
                "link": "http://go.cpanel.net/featureshowcasefeatured_example1",
                "feature_key": "featured_example1",
                "since": "cPanel™ 11.32.4",
                "name": "Featured Example",
                "description": "This feature does things automagically.",
                "vendor": "Third Party, Inc.",
                "recommended": 1,
                "enabled": 1
            },
            {
                "link": "http://go.cpanel.net/featureshowcasefeatured_example2",
                "feature_key": "featured_example2",
                "name": "Featured Example 2",
                "description": "This feature also does everything automagically.",
                "vendor": "cPanel, Inc.",
                "recommended": 1,
                "enabled": "1"
            },
        ]
    },
    "metadata": {
        "version": 1,
        "reason": "OK",
        "result": 1,
        "command": "manage_features"
    }
}

If the action parameter's value is enable and you only specified a single feature, the function's output will resemble the following example:

{
    "data": {
        "action": [
            {
                "feature": "featured_example1",
                "status": "enabled"
            }
        ]
    },
    "metadata": {
        "version": 1,
        "reason": "OK",
        "result": 1,
        "command": "manage_features"
    }
}

If the action parameter's value is enable and you specified multiple features, the function's output will resemble the following example:

{
    "data": {
        "action": [
            {
                "feature": "non_existent",
                "status": "skipped"
            },
            {
                "feature": "featured_example1",
                "status": "enabled"
            }
        ]
    },
    "metadata": {
        "version": 1,
        "reason": "OK",
        "result": 1,
        "command": "manage_features"
    }
}

If the action parameter's value is enable and the function encountered errors, the function's output will resemble the following example:

{
    "data": {
        "action": [
            {
                "feature": "non_existent",
                "status": "skipped"
            },
            {
                "feature": "featured_example1",
                "status": "enabled"
            }
        ]
    },
    "metadata": {
        "errors": {
            "error": [
                "non_existent is not a valid feature."
            ]
        },
        "version": 1,
        "reason": "errors recorded",
        "result": 0,
        "command": "manage_features"
    }
}
 Output (XML)

If the action parameter's value is info, the function's output will resemble the following example:

<result>
  <data>
    <feature>
      <link>http://go.cpanel.net/featureshowcasefeatured_example1</link>
      <feature_key>featured_example1</feature_key>
      <since>cPanel® 11.32.4</since>
      <name>Featured Example</name>
      <description>This feature does things automagically.</description>
      <vendor>Third Party, Inc.</vendor>
      <recommended>1</recommended>
      <enabled>1</enabled>
    </feature>
    <feature>
      <link>http://go.cpanel.net/featureshowcasefeatured_example2</link>
      <feature_key>featured_example2</feature_key>
      <name>Featured Example 2</name>
      <description>This feature also does everything automagically.</description>
      <vendor>cPanel, Inc.</vendor>
      <recommended>1</recommended>
      <enabled>1</enabled>
    </feature>
  </data>
  <metadata>
    <version>1</version>
    <reason>OK</reason>
    <result>1</result>
    <command>manage_features</command>
  </metadata>
</result>

If the action parameter's value is enable and you only specified a single feature, the function's output will resemble the following example:

<result>
  <data>
    <action>
      <feature>featured_example1</feature>
      <status>enabled</status>
    </action>
  </data>
  <metadata>
    <version>1</version>
    <reason>OK</reason>
    <result>1</result>
    <command>manage_features</command>
  </metadata>
</result>

If the action parameter's value is enable and you specified multiple features, the function's output will resemble the following example:

<result>
  <data>
    <action>
      <feature>featured_example1</feature>
      <status>enabled</status>
    </action>
    <action>
      <feature>featured_example2</feature>
      <status>enabled</status>
    </action>
  </data>
  <metadata>
    <version>1</version>
    <reason>OK</reason>
    <result>1</result>
    <command>manage_features</command>
  </metadata>
</result>

If the action parameter's value is enable and the function encountered errors, the function's output will resemble the following example:

<result>
  <data>
    <action>
      <feature>non_existent</feature>
      <status>skipped</status>
    </action>
    <action>
      <feature>featured_example1</feature>
      <status>enabled</status>
    </action>
  </data>
  <metadata>
    <errors>
      <error>non_existent is not a valid feature.</error>
    </errors>
    <version>1</version>
    <reason>errors recorded</reason>
    <result>0</result>
    <command>manage_features</command>
  </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
actionstring

Required

The function's action.

  • info — List full details for all available features.
  • list — List the feature IDs for all available features.
  • enable — Enable the feature or features in the features variable.
  • disable — Disable the feature or features in the features variable.
info

features

string

The feature's ID.

Notes:

This parameter is required if the action parameter's value is enable or disable.
A comma-separated list of features.
features_example1

Returns

Additional info returns

ReturnTypeDescriptionPossible valuesExample
featurearray of hashesAn array of hashes of feature information.This array includes hashes of feature information. Each hash includes the link, feature_key, since, name, vendor, description, recommended, and enabled returns.
 

link

string

The feature's documentation link.

The function returns this value in the feature array.

A valid URL.
http://example.com/cpanelfeature

feature_key

string

The feature's ID.

The function returns this value in the feature array.

A valid string.example_catalog

since

string

The cPanel & WHM version that introduced this feature.

The function returns this value in the feature array.

A valid cPanel & WHM version.
cPanel® 11.52.4

name

string

The feature's name.

The function returns this value in the feature array.

A valid string.
Example Catalog

description

string

The feature's description.

The function returns this value in the feature array.

A valid string.
This feature provides access to a catalog of coyote-killing gadgets.

vendor

string

The feature's vendor.

The function returns this value in the feature array.

A valid string.
example, Inc.

recommended

Boolean

Whether we recommend that you install the feature.

The function returns this value in the feature array.

  • 1 — We recommend this feature.
  • 0 — We do not recommend this feature.
0

enabled

Boolean

Whether the feature is enabled.

The function returns this value in the feature array.

  • 1 — The feature is enabled.
  • 0 — The feature is disabled.
1

Additional list returns

ReturnTypeDescriptionPossible valuesExample
featurearray of hashesAn array of hashes of feature information.This array includes hashes of feature information. Each hash includes the feature_key and enabled returns.
 

feature_key

string

The feature's ID.

The function returns this value in the feature array.

A valid string. example_catalog

enabled

Boolean

Whether the feature is enabled.

The function returns this value in the feature array.

  • 1 — The feature is enabled.
  • 0 — The feature is disabled.
1

Additional enable or disable returns

ReturnTypeDescriptionPossible valuesExample
actionarray of hashesAn array of hashes of feature information.This array returns hashes of feature information. Each hash includes the feature and status returns.
 

feature

string

The feature's ID.

The function returns this value in the action array.

A valid string. example_catalog

status

string

The feature's state.

The function returns this value in the action array.

  • disabled — The feature is disabled.
  • skipped  — The system did not perform any action.
disabled