當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript core.FirewallLabels類代碼示例

本文整理匯總了TypeScript中@spinnaker/core.FirewallLabels的典型用法代碼示例。如果您正苦於以下問題:TypeScript FirewallLabels類的具體用法?TypeScript FirewallLabels怎麽用?TypeScript FirewallLabels使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了FirewallLabels類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: validateLength

 private validateLength(name: string, warnings: string[], errors: string[]) {
   if (name.length > 250) {
     errors.push('The maximum length for an application in Amazon is 250 characters.');
     return;
   }
   if (name.length > 240) {
     if (name.length >= 248) {
       warnings.push(
         `You will not be able to include a stack or detail field for clusters or ${FirewallLabels.get('firewalls')}.`,
       );
     } else {
       const remaining = 248 - name.length;
       warnings.push(`If you plan to include a stack or detail field for clusters, you will only
           have ~${remaining} characters to do so.`);
     }
   }
   if (name.length > 20) {
     if (name.length > 32) {
       warnings.push(`You will not be able to create an Amazon load balancer for this application if the
           application's name is longer than 32 characters (currently: ${name.length} characters)`);
     } else {
       if (name.length >= 30) {
         warnings.push(`If you plan to create load balancers for this application, be aware that the character limit
             for load balancer names is 32 (currently: ${name.length} characters). With separators ("-"), you will not
             be able to add a stack and detail field to any load balancer.`);
       } else {
         const remaining = 30 - name.length;
         warnings.push(`If you plan to create load balancers for this application, be aware that the character limit
             for load balancer names is 32. You will only have ~${remaining} characters to add a stack or detail
             field to any load balancer.`);
       }
     }
   }
 }
開發者ID:emjburns,項目名稱:deck,代碼行數:34,代碼來源:ApplicationNameValidator.ts

示例2: validateClassicLock

 private validateClassicLock(warnings: string[]): void {
   const lockoutDate = AWSProviderSettings.classicLaunchLockout;
   if (lockoutDate && lockoutDate < new Date().getTime()) {
     warnings.push(
       `New applications deployed to AWS are restricted to VPC; you cannot create server groups,
         load balancers, or ${FirewallLabels.get('firewalls')} in EC2 Classic.`,
     );
   }
 }
開發者ID:emjburns,項目名稱:deck,代碼行數:9,代碼來源:ApplicationNameValidator.ts

示例3: getHelpTextForTag

 public getHelpTextForTag(tag: string, tagType: 'source' | 'target'): string {
   const serverGroups = this.getServerGroupsWithTag(tag);
   let text: string;
   switch (serverGroups.length) {
     case 0:
       text = null;
       break;
     case 1:
       text = `This ${tagType} tag associates this ${FirewallLabels.get('firewall')} with the server group <em>${
         serverGroups[0]
       }</em>.`;
       break;
     default:
       text = `This ${tagType} tag associates this ${FirewallLabels.get('firewall')} with the server groups
               ${serverGroups.map(serverGroup => `<em>${serverGroup}</em>`).join(', ')}.`;
       break;
   }
   return text;
 }
開發者ID:emjburns,項目名稱:deck,代碼行數:19,代碼來源:securityGroupHelpText.service.ts

示例4: validateLength

 private validateLength(name: string, warnings: string[], errors: string[]): void {
   if (name.length > 250) {
     errors.push('The maximum length for an application in Titus is 250 characters.');
     return;
   }
   if (name.length > 240) {
     if (name.length >= 248) {
       warnings.push(
         `You will not be able to include a stack or detail field for clusters or ${FirewallLabels.get('firewalls')}.`,
       );
     } else {
       const remaining = 248 - name.length;
       warnings.push(`If you plan to include a stack or detail field for clusters, you will only
           have ~${remaining} characters to do so.`);
     }
   }
 }
開發者ID:emjburns,項目名稱:deck,代碼行數:17,代碼來源:ApplicationNameValidator.ts


注:本文中的@spinnaker/core.FirewallLabels類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。