이 콘텐츠는 선택한 언어로 제공되지 않습니다.

8.2. Gluster Hooks


The glusterhooks collection provides information about Gluster Hooks in a Red Hat Storage environment. An API user accesses this information through the rel="glusterhooks" link obtained from the entry point URI (see Chapter 5, Entry Point).

Note

Gluster Hooks data from the storage cluster is collected periodically every two hours.
The following table shows specific elements contained in a Gluster Hooks resource representation.
Expand
Table 8.2. Gluster Hooks elements
Element Type Description Properties
cluster relationship A reference to the cluster that includes this hook. locked
name string The name of the hook script Read only
gluster_command string gluster volume command for which the hook is executed read only
stage string stage of the command; PRE or POST read only
content_type string TEXT or BINARY read only
checksum string md5 checksum of the hook script read only
content string content of the hook script read only
conflict_status integer bit representation of the conflict detected for the hook. First bit is for content, second is for status and third is for missing hooks. read only
conflicts string comma separated list of conflict read only
status One of enabled or disabled The status of the hook. update

Example 8.8. An XML representation of Gluster Hook Collection

<glusterhooks>
    <gluster_hook href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glusterhooks/8ead05b0-3085-41a3-8693-9a7dfd6761a6" id="8ead05b0-3085-41a3-8693-9a7dfd6761a6">
        <actions>
            <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glusterhooks/8ead05b0-3085-41a3-8693-9a7dfd6761a6/resolve" rel="resolve"/>
            <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glusterhooks/8ead05b0-3085-41a3-8693-9a7dfd6761a6/enable" rel="enable"/>
            <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glusterhooks/8ead05b0-3085-41a3-8693-9a7dfd6761a6/disable" rel="disable"/>
        </actions>        <name>add-brick-PRE-28Quota-enable-root-xattr-heal.sh</name>        <cluster href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59" id="419590b8-5aa0-473b-9651-aa41f1372c59">
            <name>Cluster_3_3</name> ...
        </cluster>
        <gluster_command>add-brick</gluster_command>
        <stage>PRE</stage>
        <content_type>TEXT</content_type>        <checksum>f08a82c0ac88b2565842d1de7cdb14c0</checksum>
        <conflict_status>0</conflict_status>
        <conflicts></conflicts>
        <status>
            <state>enabled</state>
        </status>
    </gluster_hook>
Copy to Clipboard Toggle word wrap
22632%2C+Console+Developer+Guide-322-09-2014+17%3A11%3A35Report a bug

8.2.1. Managing Gluster Hooks

This section describes the Gluster Hooks operations of the Red Hat Storage Console API such as listing, enabling, resolving, and removing them from a cluster.
22632%2C+Console+Developer+Guide-322-09-2014+17%3A11%3A35Report a bug

8.2.1.1. Listing Gluster Hooks

A listing of hooks in the cluster along with conflict status is obtained by issuing a GET request on the volume URI.
GET /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glusterhooks HTTP/1.1
Accept: application/xml
Copy to Clipboard Toggle word wrap
The API returns the following representation:
HTTP/1.1 200 OK
Accept: application/xml
<glusterhooks>
    <gluster_hook href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glusterhooks/8ead05b0-3085-41a3-8693-9a7dfd6761a6" id="8ead05b0-3085-41a3-8693-9a7dfd6761a6">
        <actions>
            <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glusterhooks/8ead05b0-3085-41a3-8693-9a7dfd6761a6/resolve" rel="resolve"/>
            <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glusterhooks/8ead05b0-3085-41a3-8693-9a7dfd6761a6/enable" rel="enable"/>
            <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glusterhooks/8ead05b0-3085-41a3-8693-9a7dfd6761a6/disable" rel="disable"/>
        </actions>
        <name>add-brick-PRE-28Quota-enable-root-xattr-heal.sh</name>
        <cluster href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59" id="419590b8-5aa0-473b-9651-aa41f1372c59">
            <name>Cluster_3_3</name>
            <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/networks" rel="networks"/>
            <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/permissions" rel="permissions"/>

            <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glustervolumes" rel="glustervolumes"/>
            <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glusterhooks" rel="glusterhooks"/>
            <memory_policy>
                <overcommit percent="100"/>
                <transparent_hugepages>
                    <enabled>true</enabled>
                </transparent_hugepages>
            </memory_policy>
            <scheduling_policy>
                <policy>none</policy>
            </scheduling_policy>
            <error_handling>
                <on_error>migrate</on_error>
            </error_handling>
            <virt_service>false</virt_service>
            <gluster_service>true</gluster_service>
            <threads_as_cores>false</threads_as_cores>
            <tunnel_migration>false</tunnel_migration>
            <trusted_service>false</trusted_service>
            <ballooning_enabled>false</ballooning_enabled>
 </cluster>
        <gluster_command>add-brick</gluster_command>
        <stage>PRE</stage>
        <content_type>TEXT</content_type>
        <checksum>f08a82c0ac88b2565842d1de7cdb14c0</checksum>
        <conflict_status>0</conflict_status>
        <conflicts></conflicts>
        <status>
            <state>enabled</state>
        </status>
    </gluster_hook>
Copy to Clipboard Toggle word wrap
22632%2C+Console+Developer+Guide-322-09-2014+17%3A11%3A35Report a bug

8.2.1.2. Enabling Gluster Hooks

A Gluster Hook is enabled by issuing a POST request to its URI.
POST /api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glusterhooks/747bbb9e-ace6-424b-be31-16b33e02d882/enable 
HTTP/1.1
Accept: application/xml
Copy to Clipboard Toggle word wrap
cURL command:
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHSC HOST]/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glusterhooks/747bbb9e-ace6-424b-be31-16b33e02d882/enable -d "<action/>"
The API returns the following representation:
<action>
    <job href="/api/jobs/58584575-6089-4cef-bdae-a2fc5f406bbd" id="58584575-6089-4cef-bdae-a2fc5f406bbd"/>
    <status>
        <state>complete</state>
    </status>
</action>
Copy to Clipboard Toggle word wrap
22632%2C+Console+Developer+Guide-322-09-2014+17%3A11%3A35Report a bug

8.2.1.3. Resolving Gluster Hook Conflict

Gluster Hooks conflict is resolved by issuing a POST request. MISSING_HOOK, CONTENT_CONFLICT, and STATUS_CONFLICT are the types of conflict that can be resolved on a cluster.
  • Missing Hook Conflict:
    MISSING_HOOK conflict can be resolved either by adding the hook to the host where it is missing or by removing it from all hosts and from the Red Hat Storage Console by issuing a DELETE request.
    cURL command to resolve missing hook conflict by adding hook:
    curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHSC HOST]/api/clusters/44571c63-a110-4fba-9a8c-7b30446ba8bf/glusterhooks/59ecbacb-1ce3-43f7-82e4-55db8ed74f56/resolve -d "<action><resolution_type>ADD</resolution_type></action>"
    The API returns the following representation:
    <action>
        <resolution_type>ADD</resolution_type>
        <job href="/api/jobs/46d89857-37a1-492a-9327-78922884a778" id="46d89857-37a1-492a-9327-78922884a778"/>
        <status>
            <state>complete</state>
        </status>
    </action>
    Copy to Clipboard Toggle word wrap
    cURL command to resolve missing hook conflict by deleting hook:
    curl -X DELETE -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHSC HOST]/api/clusters/44571c63-a110-4fba-9a8c-7b30446ba8bf/glusterhooks/18782869-3e62-42a5-a59d-91f896afd5d7
    <action>
      <job href="/api/jobs/3dd9800f-a8c6-4f58-a3cf-dff190d2f06f" id="3dd9800f-a8c6-4f58-a3cf-dff190d2f06f"/>
      <status><state>complete</state>
       </status>
    </action>
    Copy to Clipboard Toggle word wrap
  • Content Conflict
    This conflict can be resolved with the resolution_type = copy. If the version of the hook is incorrect in Red Hat Storage Console, the content is copied from a host by passing the host.name parameter. If the host.name parameter is empty, then the content is copied from Red Hat Storage Console to all host where content is different
    cURL command:
    curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHSC HOST]/api/clusters/44571c63-a110-4fba-9a8c-7b30446ba8bf/glusterhooks/59ecbacb-1ce3-43f7-82e4-55db8ed74f56/resolve -d "<action><resolution_type>COPY</resolution_type><host><name>host.name</name></host></action>"
    The API returns the following representation:
    <action>
        <host>
            <name>host.name</name>
        </host>
        <resolution_type>COPY</resolution_type>
        <job href="/api/jobs/75486b97-ee5b-4a61-af6e-960b874985fc" id="75486b97-ee5b-4a61-af6e-960b874985fc"/>
        <status>
            <state>complete</state>
        </status>
    </action>
    Copy to Clipboard Toggle word wrap
  • Status Conflict
    This conflict is resolved by either enabling or disabling a hook in a cluster.
22632%2C+Console+Developer+Guide-322-09-2014+17%3A11%3A35Report a bug
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat