| Required role: | TenantReader |
| GET | /api/resourceproviders/{Id} | Returns a resourceprovider | |
|---|---|---|---|
| GET | /resourceproviders/{Id} | Returns a resourceprovider |
import 'package:servicestack/servicestack.dart';
enum ObjectTypes
{
None,
ConfigItem,
Tenant,
Collection,
Resource,
ComputeNode,
VirtualMachine,
PhysicalMachine,
Disk,
Subnet,
IPAddress,
Job,
JobEvent,
FreezePeriod,
ResourceGroup,
Deployment,
ResourceGroupTemplate,
DeploymentTemplate,
ResourceProvider,
GenericResource,
Role,
Permission,
User,
PatchingWindow,
Update,
ReportDefinition,
TimeSeries,
DataPoint,
Action,
ActionAssignment,
UserNote,
}
class TagDto implements IConvertible
{
String name = "";
String? value;
bool isProtected;
TagDto({this.name,this.value,this.isProtected});
TagDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
name = json['name'];
value = json['value'];
isProtected = json['isProtected'];
return this;
}
Map<String, dynamic> toJson() => {
'name': name,
'value': value,
'isProtected': isProtected
};
getTypeName() => "TagDto";
TypeContext? context = _ctx;
}
class PathItemDto implements IConvertible
{
String label = "";
String link = "";
ObjectTypes objectType;
String objectId = "";
PathItemDto({this.label,this.link,this.objectType,this.objectId});
PathItemDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
label = json['label'];
link = json['link'];
objectType = JsonConverters.fromJson(json['objectType'],'ObjectTypes',context!);
objectId = json['objectId'];
return this;
}
Map<String, dynamic> toJson() => {
'label': label,
'link': link,
'objectType': JsonConverters.toJson(objectType,'ObjectTypes',context!),
'objectId': objectId
};
getTypeName() => "PathItemDto";
TypeContext? context = _ctx;
}
class LinkDto implements IConvertible
{
String caption = "";
String rel = "";
String hRef = "";
String method = "";
LinkDto({this.caption,this.rel,this.hRef,this.method});
LinkDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
caption = json['caption'];
rel = json['rel'];
hRef = json['hRef'];
method = json['method'];
return this;
}
Map<String, dynamic> toJson() => {
'caption': caption,
'rel': rel,
'hRef': hRef,
'method': method
};
getTypeName() => "LinkDto";
TypeContext? context = _ctx;
}
class ConfigItemDto implements IConfigItem, IConvertible
{
String id = "";
String name = "";
String displayName = "";
String? description;
ObjectTypes objectType;
String selfLink = "";
List<TagDto>? tags;
List<PathItemDto>? path;
DateTime created = DateTime(0);
String createUser = "";
String createUserId = "";
DateTime modified = DateTime(0);
String modifyUser = "";
String modifyUserId = "";
bool isDeleted;
DateTime? deleted;
String? deleteUser;
String? deleteUserId;
List<LinkDto>? links;
ConfigItemDto({this.id,this.name,this.displayName,this.description,this.objectType,this.selfLink,this.tags,this.path,this.created,this.createUser,this.createUserId,this.modified,this.modifyUser,this.modifyUserId,this.isDeleted,this.deleted,this.deleteUser,this.deleteUserId,this.links});
ConfigItemDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
displayName = json['displayName'];
description = json['description'];
objectType = JsonConverters.fromJson(json['objectType'],'ObjectTypes',context!);
selfLink = json['selfLink'];
tags = JsonConverters.fromJson(json['tags'],'List<TagDto>',context!);
path = JsonConverters.fromJson(json['path'],'List<PathItemDto>',context!);
created = JsonConverters.fromJson(json['created'],'DateTime',context!);
createUser = json['createUser'];
createUserId = json['createUserId'];
modified = JsonConverters.fromJson(json['modified'],'DateTime',context!);
modifyUser = json['modifyUser'];
modifyUserId = json['modifyUserId'];
isDeleted = json['isDeleted'];
deleted = JsonConverters.fromJson(json['deleted'],'DateTime',context!);
deleteUser = json['deleteUser'];
deleteUserId = json['deleteUserId'];
links = JsonConverters.fromJson(json['links'],'List<LinkDto>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'displayName': displayName,
'description': description,
'objectType': JsonConverters.toJson(objectType,'ObjectTypes',context!),
'selfLink': selfLink,
'tags': JsonConverters.toJson(tags,'List<TagDto>',context!),
'path': JsonConverters.toJson(path,'List<PathItemDto>',context!),
'created': JsonConverters.toJson(created,'DateTime',context!),
'createUser': createUser,
'createUserId': createUserId,
'modified': JsonConverters.toJson(modified,'DateTime',context!),
'modifyUser': modifyUser,
'modifyUserId': modifyUserId,
'isDeleted': isDeleted,
'deleted': JsonConverters.toJson(deleted,'DateTime',context!),
'deleteUser': deleteUser,
'deleteUserId': deleteUserId,
'links': JsonConverters.toJson(links,'List<LinkDto>',context!)
};
getTypeName() => "ConfigItemDto";
TypeContext? context = _ctx;
}
enum Environments
{
Lab,
Poc,
Dev,
Test,
Int,
Uat,
Prod,
}
enum ResourceProviderTypes
{
Azure,
AmazonWebServices,
GoogleCloudPlatform,
ActiveDirectoryServices,
DomainNameSystem,
SwisscomESC,
AzureKeyVault,
}
class ProviderConfigEntryDto implements IConvertible
{
String name = "";
String value = "";
bool isSecure;
ProviderConfigEntryDto({this.name,this.value,this.isSecure});
ProviderConfigEntryDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
name = json['name'];
value = json['value'];
isSecure = json['isSecure'];
return this;
}
Map<String, dynamic> toJson() => {
'name': name,
'value': value,
'isSecure': isSecure
};
getTypeName() => "ProviderConfigEntryDto";
TypeContext? context = _ctx;
}
class ResourceProviderDto extends ConfigItemDto implements IHasTenantId, IConvertible
{
String tenantId = "";
/**
* If environment cannot be detected while scanning, default environment will be used
*/
Environments defaultEnvironment;
/**
* List off all allowed environments for this resource provider
*/
List<Environments>? allowedEnvironments;
/**
* Defines the provider type (e.g. Azure, Aws)
*/
ResourceProviderTypes type;
/**
* Additional generic data which varies depending on ProviderType
*/
List<ProviderConfigEntryDto>? config;
/**
* Disabled ResourceProviders cannot be selected for new deployments
*/
bool isDisabled;
/**
* Shows if a ResourceProvider has been initialized and can accept deployments (resources)
*/
bool isReadyForDeployments;
/**
* The cost for the current month
*/
double costCurrentMonth = 0;
/**
* The cost for the last month
*/
double costLastMonth = 0;
/**
* The cost currency
*/
String costCurrency = "";
ResourceProviderDto({this.tenantId,this.defaultEnvironment,this.allowedEnvironments,this.type,this.config,this.isDisabled,this.isReadyForDeployments,this.costCurrentMonth,this.costLastMonth,this.costCurrency});
ResourceProviderDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
tenantId = json['tenantId'];
defaultEnvironment = JsonConverters.fromJson(json['defaultEnvironment'],'Environments',context!);
allowedEnvironments = JsonConverters.fromJson(json['allowedEnvironments'],'List<Environments>',context!);
type = JsonConverters.fromJson(json['type'],'ResourceProviderTypes',context!);
config = JsonConverters.fromJson(json['config'],'List<ProviderConfigEntryDto>',context!);
isDisabled = json['isDisabled'];
isReadyForDeployments = json['isReadyForDeployments'];
costCurrentMonth = JsonConverters.toDouble(json['costCurrentMonth']);
costLastMonth = JsonConverters.toDouble(json['costLastMonth']);
costCurrency = json['costCurrency'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'tenantId': tenantId,
'defaultEnvironment': JsonConverters.toJson(defaultEnvironment,'Environments',context!),
'allowedEnvironments': JsonConverters.toJson(allowedEnvironments,'List<Environments>',context!),
'type': JsonConverters.toJson(type,'ResourceProviderTypes',context!),
'config': JsonConverters.toJson(config,'List<ProviderConfigEntryDto>',context!),
'isDisabled': isDisabled,
'isReadyForDeployments': isReadyForDeployments,
'costCurrentMonth': costCurrentMonth,
'costLastMonth': costLastMonth,
'costCurrency': costCurrency
});
getTypeName() => "ResourceProviderDto";
TypeContext? context = _ctx;
}
/**
* Returns a single resourceprovider by its id
*/
// @Api(Description="Returns a single resourceprovider by its id")
// @ApiResponse(Description="The request endend successful", IsDefaultResponse=true, ResponseType=typeof(ResourceProviderDto), StatusCode=200)
class GetResourceProvider implements IGetSingleRequest, IHasId, IHasTenantName, IGet, IConvertible
{
/**
* The primary key of every config item
*/
// @ApiMember(DataType="string", Description="The primary key of every config item", Format="guid", IsRequired=true, ParameterType="path")
String id = "";
// @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
// @Validate(Validator="NotEmpty")
String tenantName = "";
/**
* If true, also soft deleted items will be returned
*/
// @ApiMember(Description="If true, also soft deleted items will be returned", ParameterType="query")
bool? includeDeleted;
// @ApiMember(ParameterType="query", Verb="GET")
bool? includeReferencedObjects;
GetResourceProvider({this.id,this.tenantName,this.includeDeleted,this.includeReferencedObjects});
GetResourceProvider.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
tenantName = json['tenantName'];
includeDeleted = json['includeDeleted'];
includeReferencedObjects = json['includeReferencedObjects'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'tenantName': tenantName,
'includeDeleted': includeDeleted,
'includeReferencedObjects': includeReferencedObjects
};
getTypeName() => "GetResourceProvider";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'duneframework.com', types: <String, TypeInfo> {
'ObjectTypes': TypeInfo(TypeOf.Enum, enumValues:ObjectTypes.values),
'TagDto': TypeInfo(TypeOf.Class, create:() => TagDto()),
'PathItemDto': TypeInfo(TypeOf.Class, create:() => PathItemDto()),
'LinkDto': TypeInfo(TypeOf.Class, create:() => LinkDto()),
'ConfigItemDto': TypeInfo(TypeOf.Class, create:() => ConfigItemDto()),
'List<TagDto>': TypeInfo(TypeOf.Class, create:() => <TagDto>[]),
'List<PathItemDto>': TypeInfo(TypeOf.Class, create:() => <PathItemDto>[]),
'List<LinkDto>': TypeInfo(TypeOf.Class, create:() => <LinkDto>[]),
'Environments': TypeInfo(TypeOf.Enum, enumValues:Environments.values),
'ResourceProviderTypes': TypeInfo(TypeOf.Enum, enumValues:ResourceProviderTypes.values),
'ProviderConfigEntryDto': TypeInfo(TypeOf.Class, create:() => ProviderConfigEntryDto()),
'ResourceProviderDto': TypeInfo(TypeOf.Class, create:() => ResourceProviderDto()),
'List<Environments>': TypeInfo(TypeOf.Class, create:() => <Environments>[]),
'List<ProviderConfigEntryDto>': TypeInfo(TypeOf.Class, create:() => <ProviderConfigEntryDto>[]),
'GetResourceProvider': TypeInfo(TypeOf.Class, create:() => GetResourceProvider()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/resourceproviders/{Id} HTTP/1.1
Host: core.starburst.svc
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"tenantId":"00000000-0000-0000-0000-000000000000","defaultEnvironment":"Lab","allowedEnvironments":null,"type":"Azure","config":null,"isDisabled":false,"isReadyForDeployments":false,"costCurrentMonth":0,"costLastMonth":0,"costCurrency":"String","id":"00000000-0000-0000-0000-000000000000","name":"String","displayName":"String","description":"String","objectType":"None","selfLink":"String","tags":null,"path":null,"created":"0001-01-01T00:00:00.0000000Z","createUser":"String","createUserId":"String","modified":"0001-01-01T00:00:00.0000000Z","modifyUser":"String","modifyUserId":"String","isDeleted":false,"deleted":"0001-01-01T00:00:00.0000000Z","deleteUser":"String","deleteUserId":"String","links":null}