FeatureManagementRestClient class
Base class that should be used (derived from) to make requests to VSS REST apis
- Extends
get |
Get a specific feature by its id |
get |
Get a list of all defined features |
get |
Get the state of the specified feature for the given user/all-users scope |
get |
Get the state of the specified feature for the given named scope |
query |
Get the effective state for a list of feature ids |
query |
Get the states of the specified features for the default scope |
query |
Get the states of the specified features for the specific named scope |
set |
Set the state of a feature |
set |
Set the state of a feature at a specific scope |
new FeatureManagementRestClient(options: IVssRestClientOptions)
Parameters
- options
- IVssRestClientOptions
Get a specific feature by its id
function getFeature(featureId: string): Promise<ContributedFeature>
Parameters
- featureId
-
string
The contribution id of the feature
Returns
Promise<ContributedFeature>
Get a list of all defined features
function getFeatures(targetContributionId?: string): Promise<ContributedFeature[]>
Parameters
- targetContributionId
-
string
Optional target contribution. If null/empty, return all features. If specified include the features that target the specified contribution.
Returns
Promise<ContributedFeature[]>
Get the state of the specified feature for the given user/all-users scope
function getFeatureState(featureId: string, userScope: string): Promise<ContributedFeatureState>
Parameters
- featureId
-
string
Contribution id of the feature
- userScope
-
string
User-Scope at which to get the value. Should be "me" for the current user or "host" for all users.
Returns
Promise<ContributedFeatureState>
Get the state of the specified feature for the given named scope
function getFeatureStateForScope(featureId: string, userScope: string, scopeName: string, scopeValue: string): Promise<ContributedFeatureState>
Parameters
- featureId
-
string
Contribution id of the feature
- userScope
-
string
User-Scope at which to get the value. Should be "me" for the current user or "host" for all users.
- scopeName
-
string
Scope at which to get the feature setting for (e.g. "project" or "team")
- scopeValue
-
string
Value of the scope (e.g. the project or team id)
Returns
Promise<ContributedFeatureState>
Get the effective state for a list of feature ids
function queryFeatureStates(query: ContributedFeatureStateQuery): Promise<ContributedFeatureStateQuery>
Parameters
Features to query along with current scope values
Returns
Promise<ContributedFeatureStateQuery>
Get the states of the specified features for the default scope
function queryFeatureStatesForDefaultScope(query: ContributedFeatureStateQuery, userScope: string): Promise<ContributedFeatureStateQuery>
Parameters
Query describing the features to query.
- userScope
-
string
Returns
Promise<ContributedFeatureStateQuery>
Get the states of the specified features for the specific named scope
function queryFeatureStatesForNamedScope(query: ContributedFeatureStateQuery, userScope: string, scopeName: string, scopeValue: string): Promise<ContributedFeatureStateQuery>
Parameters
Query describing the features to query.
- userScope
-
string
- scopeName
-
string
- scopeValue
-
string
Returns
Promise<ContributedFeatureStateQuery>
Set the state of a feature
function setFeatureState(feature: ContributedFeatureState, featureId: string, userScope: string, reason?: string, reasonCode?: string): Promise<ContributedFeatureState>
Parameters
- feature
- ContributedFeatureState
Posted feature state object. Should specify the effective value.
- featureId
-
string
Contribution id of the feature
- userScope
-
string
User-Scope at which to set the value. Should be "me" for the current user or "host" for all users.
- reason
-
string
Reason for changing the state
- reasonCode
-
string
Short reason code
Returns
Promise<ContributedFeatureState>
Set the state of a feature at a specific scope
function setFeatureStateForScope(feature: ContributedFeatureState, featureId: string, userScope: string, scopeName: string, scopeValue: string, reason?: string, reasonCode?: string): Promise<ContributedFeatureState>
Parameters
- feature
- ContributedFeatureState
Posted feature state object. Should specify the effective value.
- featureId
-
string
Contribution id of the feature
- userScope
-
string
User-Scope at which to set the value. Should be "me" for the current user or "host" for all users.
- scopeName
-
string
Scope at which to get the feature setting for (e.g. "project" or "team")
- scopeValue
-
string
Value of the scope (e.g. the project or team id)
- reason
-
string
Reason for changing the state
- reasonCode
-
string
Short reason code
Returns
Promise<ContributedFeatureState>