Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Add vc bonus support in rest api #2147

Merged
merged 3 commits into from
Feb 18, 2019
Merged

Add vc bonus support in rest api #2147

merged 3 commits into from
Feb 18, 2019

Conversation

mzmssg
Copy link
Member

@mzmssg mzmssg commented Feb 15, 2019

Add vc bonus support:

bonus = unguaranteed resource = VC_MAX_CAPACITY- VC_CAPACITY

If configured, vc can use no more than VC_MAX_CAPACITY quota. Quota between VC_CAPACITY and VC_MAX_CAPACITY is borrowed from others, might be preempted. Quota under VC_CAPACITY is guaranteed.

Currently only implement rest api, will implement webportal in the future.

Step1: get admin token

curl -H "Content-Type: application/x-www-form-urlencoded" \
     -X POST http://restserver/api/v1/token \
     -d "username=YOUR_USERNAME" -d "password=YOUR_PASSWORD"

Step2: add or update vc

curl -H "Content-Type: application/x-www-form-urlencoded" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -X PUT http://restserver/api/v1/virtual-clusters/:vcName \
     -d "vcCapacity=CAPACITY" -d "vcMaxCapacity=MAX_CAPACITY"

For backward compatibility, if no maxCapacity provided, bonus token will be disabled

TODO:
webportal:

  1. expose vcMaxCapacity box when add or edit VC.
  2. show maxCapacity info in VC page.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 52.629% when pulling eaa49ab on zimiao/expose_vc_bonus into 055c78e on master.

@mzmssg mzmssg requested review from fanyangCS and Gerhut February 15, 2019 04:42
@mzmssg mzmssg merged commit b234adf into master Feb 18, 2019
@mzmssg mzmssg changed the title Support configure vc bonus Add vc bonus support in rest api Feb 20, 2019
@mzmssg mzmssg deleted the zimiao/expose_vc_bonus branch March 18, 2019 07:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants