FeatureManagementRestClient class
Base class that should be used (derived from) to make requests to VSS REST apis
- Extends
Constructors
Feature |
Methods
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 |
Constructor Details
FeatureManagementRestClient(IVssRestClientOptions)
new FeatureManagementRestClient(options: IVssRestClientOptions)
Parameters
- options
- IVssRestClientOptions
Method Details
getFeature(string)
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>
getFeatures(string)
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[]>
getFeatureState(string, string)
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>
getFeatureStateForScope(string, string, string, string)
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>
queryFeatureStates(ContributedFeatureStateQuery)
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>
queryFeatureStatesForDefaultScope(ContributedFeatureStateQuery, string)
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>
queryFeatureStatesForNamedScope(ContributedFeatureStateQuery, string, string, string)
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>
setFeatureState(ContributedFeatureState, string, string, string, string)
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>
setFeatureStateForScope(ContributedFeatureState, string, string, string, string, string, string)
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>