You can find our user documentation at docs.cpanel.net.

Check out our new API beta site!

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=info
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/manage_features?api.version=1&action=info
 Command Line
whmapi1 manage_features action=info


Notes:

  • Unless otherwise noted, 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",
                "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, L.L.C.",
                "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, L.L.C.</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
action string

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

ReturnTypeDescriptionPossible valuesExample
featurearray of hashes

An array of hashes of feature information.

Note:

The function only returns this array if you pass the info or list values to the action parameter.

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.

Note:

The function only returns this value if you pass the info value to the action parameter.

The function returns this value in the feature array.

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

feature_key

string

The feature's ID.

Note:

The function only returns this value if you pass the info or list values to the action parameter.

The function returns this value in the feature array.

A valid string.example_catalog

since

string

The cPanel & WHM version that introduced this feature.

Note:

  • The function only returns this value if you pass the info value to the action parameter.
  • We removed this return in cPanel & WHM version 78.

The function returns this value in the feature array.

A valid cPanel & WHM version.
cPanel® 11.52.4

name

string

The feature's name.

Note:

The function only returns this value if you pass the info value to the action parameter.

The function returns this value in the feature array.

A valid string.
Example Catalog

description

string

The feature's description.

Note:

The function only returns this value if you pass the info value to the action parameter.

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.

Note:

The function only returns this value if you pass the info value to the action parameter.

The function returns this value in the feature array.

A valid string.
example, Inc.

recommended

Boolean

Whether we recommend that you install the feature.

Note:

The function only returns this value if you pass the info value to the action parameter.

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.

Note:

The function only returns this value if you pass the info or list values to the action parameter.

The function returns this value in the feature array.

  • 1 — The feature is enabled.
  • 0 — The feature is disabled.
1
actionarray of hashes

An array of hashes of feature information.

Note:

The function only returns this array if you pass the enabled or disabled values to the action parameter.

An array of hashes of feature information. Each hash includes the feature and status returns.

feature

string

The feature's ID.

Note:

The function only returns this value if you pass the enabled or disabled values to the action parameter.

The function returns this value in the action array.

A feature name.example_catalog

status

string

The feature's state.

Note:

The function only returns this value if you pass the enabled or disabled values to the action parameter.

The function returns this value in the action array.

A valid string.

Successfully performed 'enable' for dnssec