本文整理汇总了TypeScript中core/account/AccountService.AccountService类的典型用法代码示例。如果您正苦于以下问题:TypeScript AccountService类的具体用法?TypeScript AccountService怎么用?TypeScript AccountService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AccountService类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: getRegions
public static getRegions(provider: string): IPromise<string[]> {
if (has(SETTINGS, `providers.${provider}.bakeryRegions`)) {
return $q.when(get(SETTINGS, `providers.${provider}.bakeryRegions`));
}
return AccountService.getUniqueAttributeForAllAccounts(provider, 'regions').then((regions: string[]) =>
regions.sort(),
);
}
开发者ID:emjburns,项目名称:deck,代码行数:8,代码来源:BakeryReader.ts
示例2: restoreSnapshot
public static restoreSnapshot(app: Application, account: string, timestamp: number): IPromise<ITask> {
return AccountService.getAccountDetails(account).then(accountDetail => {
const jobs = this.buildRestoreSnapshotJob(app, accountDetail, timestamp);
return TaskExecutor.executeTask({
job: jobs,
application: app,
description: `Restore Snapshot ${timestamp} of application: ${app.name} for account: ${accountDetail.name}`,
});
});
}
开发者ID:emjburns,项目名称:deck,代码行数:10,代码来源:SnapshotWriter.ts
示例3: normalizeSecurityGroup
public normalizeSecurityGroup(securityGroup: ISecurityGroup): IPromise<ISecurityGroup> {
return AccountService.getAccountDetails(securityGroup.account).then((accountDetails: IAccountDetails) => {
return this.providerServiceDelegate
.getDelegate<any>(
securityGroup.provider || securityGroup.type,
'securityGroup.transformer',
accountDetails && accountDetails.skin,
)
.normalizeSecurityGroup(securityGroup);
});
}
开发者ID:mizzy,项目名称:deck,代码行数:11,代码来源:securityGroupTransformer.service.ts
示例4: selectSkin
public selectSkin(provider: string): IPromise<string> {
return AccountService.getAllAccountDetailsForProvider(provider).then(accounts => {
const skins = uniq(accounts.map(a => a.skin).filter(v => !isNil(v)));
if (skins.length === 0) {
return CloudProviderRegistry.getProvider(provider).skin;
} else if (skins.length === 1) {
return skins[0];
} else {
return this.$uibModal.open({
templateUrl: require('./skinSelector.html'),
controller: 'skinSelectorCtrl as ctrl',
resolve: {
skinOptions: () => skins,
},
}).result;
}
});
}
开发者ID:mizzy,项目名称:deck,代码行数:19,代码来源:skinSelection.service.ts
示例5: function
controller: function(artifact: IArtifact) {
this.artifact = artifact;
this.artifact.type = 'helm/chart';
this.onAccountChange = () => {
this.artifact.artifactAccount = this.selectedArtifactAccount;
this.artifact.reference = this.selectedArtifactAccount;
ArtifactService.getArtifactNames('helm/chart', this.artifact.artifactAccount).then(names => {
this.chartNames = names;
});
this.chartVersions = [];
};
this.onNameChange = () => {
ArtifactService.getArtifactVersions('helm/chart', this.artifact.artifactAccount, this.artifact.name).then(
versions => {
this.chartVersions = versions;
},
);
};
AccountService.getArtifactAccounts().then(accounts => {
this.artifactAccounts = accounts
.filter(account => account.types.includes('helm/chart'))
.map(account => account.name);
if (artifact.artifactAccount) {
this.selectedArtifactAccount = accounts.filter(
account => account.types.includes('helm/chart') && account.name === this.artifact.artifactAccount,
)[0].name;
}
});
if (artifact.artifactAccount) {
ArtifactService.getArtifactNames('helm/chart', this.artifact.artifactAccount).then(names => {
this.chartNames = names;
});
if (artifact.name) {
ArtifactService.getArtifactVersions('helm/chart', this.artifact.artifactAccount, this.artifact.name).then(
versions => {
this.chartVersions = versions;
},
);
}
}
},
开发者ID:emjburns,项目名称:deck,代码行数:43,代码来源:helm.artifact.ts
示例6: selectProvider
public selectProvider(
application: Application,
feature: string,
filterFn?: IProviderSelectionFilter,
): IPromise<string> {
return AccountService.applicationAccounts(application).then((accounts: IAccountDetails[]) => {
let reducedAccounts: IAccountDetails[] = [];
if (feature) {
reducedAccounts = accounts.filter(a => CloudProviderRegistry.hasValue(a.cloudProvider, feature));
}
if (filterFn) {
reducedAccounts = reducedAccounts.filter((acc: IAccountDetails) => {
return filterFn(application, acc, CloudProviderRegistry.getProvider(acc.cloudProvider, acc.skin));
});
}
// reduce the accounts to the smallest, unique collection taking into consideration the useProvider values
const reducedProviders = uniq(
reducedAccounts.map(a => {
const providerFeature = CloudProviderRegistry.getProvider(a.cloudProvider)[feature] || {};
return providerFeature.useProvider || a.cloudProvider;
}),
);
let provider;
if (reducedProviders.length > 1) {
provider = this.$uibModal.open({
templateUrl: require('./providerSelection.html'),
controller: 'ProviderSelectCtrl as ctrl',
resolve: {
providerOptions: () => reducedProviders,
},
}).result;
} else if (reducedProviders.length === 1) {
provider = this.$q.when(reducedProviders[0]);
} else {
provider = this.$q.when(SETTINGS.defaultProvider || 'aws');
}
return provider;
});
}
开发者ID:mizzy,项目名称:deck,代码行数:42,代码来源:providerSelection.service.ts
示例7:
const accountDetailPromises = accounts.map(account => AccountService.getAccountDetails(account));
开发者ID:emjburns,项目名称:deck,代码行数:1,代码来源:SnapshotWriter.ts
示例8:
public $onInit(): void {
AccountService.challengeDestructiveActions(this.account).then(isProdAccount => {
this.accountType = isProdAccount ? 'prod' : this.account;
});
}
开发者ID:emjburns,项目名称:deck,代码行数:5,代码来源:accountTag.component.ts
注:本文中的core/account/AccountService.AccountService类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论