Intel AMT Features > Storage Administration and Operations > Use Cases > Storage: Retrieve all Permission Groups Associated with a Block
CollapseAll image

Storage: Retrieve all Permission Groups Associated with a Block

To work with a permissions group, you must retrieve the permissions group’s handle. This flow describes how to do that, and optionally, how to retrieve information associated with a permissions group.

1.  Register the application, as described in the Storage: Register Application, Perform Task, Unregister Application flow. You should have the session handle and application handle available.

2.  Retrieve the block handle for the block of interest, as described in the Storage: Get the Block Handles for an Application flow.

3.  Retrieve all the permissions group handles associated with the block by invoking AMT_ThirdPartyDataStorageService.GetPermissionsGroups with the following input parameters:

Parameter

Description/Value

SessionHandle

The session handle.

BlockHandle

The handle of the block.

 

The method returns an array of permissions group handles as an output parameter.

Click here for a snippet demonstrating this step

You can execute this snippet by inserting it into the execution template found here.

  

$thirdPartyDataStorageServiceRef =$wsmanConnectionObject.NewReference("SELECT * FROM AMT_ThirdPartyDataStorageService WHERE Name='Intel(r) AMT Third Party Data Storage Service'")

$inputObject =$thirdPartyDataStorageServiceRef.CreateMethodInput("GetPermissionsGroups")

# $sessionHandle is the session handle returned by 'RegisterApplication' method.

$inputObject.SetProperty("SessionHandle",$sessionHandle.ToString())

# $blockHandle is the block handle returned by 'Create a block for the registered application' use case.

$inputObject.SetProperty("BlockHandle",$blockHandle.ToString())

$outputObject =$thirdPartyDataStorageServiceRef.InvokeMethod($inputObject)

$returnValue =$outputObject.GetProperty("ReturnValue")

if($returnValue -like "0")

{

    $groupHandles =$outputObject.GetProperty("GroupHandles")

}

 

 

4.  For each of the permissions group handles, you can retrieve information related to the permissions group as follows:

a.   Retrieve the permissions group name and the permission value by invoking AMT_ThirdPartyDataStorageService.GetPermissionsGroupAttributes with the following input parameters:

Parameter

Description/Value

SessionHandle

The session handle.

BlockHandle

The handle of the block.

GroupHandle

The permissions group handle.

 

The method returns the name and permission values as output parameters.

Click here for a snippet demonstrating this step

You can execute this snippet by inserting it into the execution template found here.

  

$thirdPartyDataStorageServiceRef =$wsmanConnectionObject.NewReference("SELECT * FROM AMT_ThirdPartyDataStorageService WHERE Name='Intel(r) AMT Third Party Data Storage Service'")

# $groupHandles contains one or more group handles returned by 'GetPermissionsGroup' method.

for($i = 0;$i -lt $groupHandles.Count;$i++)

{

    $inputObject =$thirdPartyDataStorageServiceRef.CreateMethodInput("GetPermissionsGroupAttributes")

    # $sessionHandle is the session handle returned by 'RegisterApplication' method.

    $inputObject.SetProperty("SessionHandle",$sessionHandle.ToString())

    # $blockHandle is the block handle returned by 'Create a block for the registered application' use case.

    $inputObject.SetProperty("BlockHandle",$blockHandle.ToString())

    $inputObject.SetProperty("GroupHandle",$groupHandles.Item($i).ToString())

    $outputObject =$thirdPartyDataStorageServiceRef.InvokeMethod($inputObject)

    $returnValue =$outputObject.GetProperty("ReturnValue")

    if($returnValue -like "0")

    {

          $name =$outputObject.GetProperty("Name")

          $permissions =$outputObject.GetProperty("Permissions")

    }

}

 

 

b.   Retrieve the array of application handles in the permissions group by invoking AMT_ThirdPartyDataStorageService.GetPermissionsGroupMembers with the following input parameters:

Parameter

Description/Value

SessionHandle

The session handle.

BlockHandle

The handle of the block.

GroupHandle

The permissions group handle.

 

The method returns an array of application handles as an output parameter.

Click here for a snippet demonstrating this step

You can execute this snippet by inserting it into the execution template found here.

  

$thirdPartyDataStorageServiceRef =$wsmanConnectionObject.NewReference("SELECT * FROM AMT_ThirdPartyDataStorageService WHERE Name='Intel(r) AMT Third Party Data Storage Service'")

# $groupHandles contains one or more group handles returned by 'GetPermissionsGroup' method.

for($i = 0;$i -lt $groupHandles.Count;$i++)

{

    $inputObject =$thirdPartyDataStorageServiceRef.CreateMethodInput("GetPermissionsGroupMembers")

    # $sessionHandle is the session handle returned by 'RegisterApplication' method.

    $inputObject.SetProperty("SessionHandle",$sessionHandle.ToString())

    # $blockHandle is the block handle returned by 'Create a block for the registered application' use case.

    $inputObject.SetProperty("BlockHandle",$blockHandle.ToString())

    $inputObject.SetProperty("GroupHandle",$groupHandles.Item($i).ToString())

    $outputObject =$thirdPartyDataStorageServiceRef.InvokeMethod($inputObject)

    $returnValue =$outputObject.GetProperty("ReturnValue")

    if($returnValue -like "0")

    {

          $memberHandles =$outputObject.GetProperty("MemberHandles")

    }

}

 

 

5.  Unregister the application when done. See Storage: Register Application, Perform Task, Unregister Application.

Instance Diagram

Not applicable

Classes Used in This Flow

SDK Sample

If there is a sample demonstrating this flow, it is included in the SDK installation file. See SDK Installation Layout for details.

 

See Also:

   Storage Concepts and Objects

   Application Development Guidelines

   Examples of Using the Storage Feature

Copyright © 2006-2022, Intel Corporation. All rights reserved.