Scalr\Service\Azure::getRoleAssignmentInfo PHP Method

getRoleAssignmentInfo() public method

Get Role Assignment info in specified subscription.
public getRoleAssignmentInfo ( string $subscriptionId, string $roleAssignmentId ) : Scalr\Service\Azure\DataType\RoleAssignmentData
$subscriptionId string subscription::subscriptionId value of one of user's subscriptions
$roleAssignmentId string Role assignment id
return Scalr\Service\Azure\DataType\RoleAssignmentData Server response body (JSON)
    public function getRoleAssignmentInfo($subscriptionId, $roleAssignmentId)
    {
        $result = null;
        $path = '/subscriptions/' . $subscriptionId . '/providers/Microsoft.Authorization/roleAssignments/' . $roleAssignmentId;
        $headers = ['Authorization' => 'Bearer ' . $this->getAccessToken()->token];
        $request = $this->getClient()->prepareRequest($path, 'GET', self::RESOURCE_API_VERSION, Azure::URL_MANAGEMENT_WINDOWS, [], [], $headers);
        $response = $this->getClient()->call($request);
        if (!$response->hasError()) {
            $result = RoleAssignmentData::initArray($response->getResult());
        }
        return $result;
    }