API setting min and max instances

Jim Hill's Avatar

Jim Hill

01 Jan, 2015 01:22 AM

We use the API successfully for many functions but cannot set min or max instances. The code we are using is listed below.

        $params = array(
            'Action' => 'FarmUpdateRole',
            'Version' => API_VERSION,
            'Timestamp' => date("Y-m-d H:i:s"),
            'KeyID' => SCALR_API_KEY,
            'AuthVersion' => API_AUTH_VERSION,
            'FarmRoleID' => $farmRoleId,
            'Configuration.scaling.max_instances' => 5
            'Configuration.scaling.min_instances' => 5
        );

        $string_to_sign = $params['Action'] . ":" . $params['KeyID'] . ":" . $params['Timestamp'];
        $params['Signature'] = base64_encode(hash_hmac('SHA256', $string_to_sign, SCALR_SECRET_KEY, 1));

        $query = http_build_query($params);

        $c = file_get_contents(API_URL."?{$query}");

  1. 1 Posted by Jim Hill on 02 Jan, 2015 07:35 AM

    Jim Hill's Avatar

    Trial and error.

    I didn't see Configuration is an associative array so it needed to contain the elements in brackets...

     'Configuration[scaling.max_instances]' => 1

  2. Jim Hill closed this discussion on 02 Jan, 2015 07:35 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac