code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
/** * JBoss, Home of Professional Open Source. * Copyright 2014 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jboss.pnc.model; import org.hibernate.annotations.Type; import java.util.HashSet; import java.util.Set; import javax.persistence.*; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; /** * @author avibelli * */ @Entity public class Product implements GenericEntity<Integer> { private static final long serialVersionUID = -9022966336791211855L; public static final String DEFAULT_SORTING_FIELD = "name"; public static final String SEQUENCE_NAME = "product_id_seq"; @Id @SequenceGenerator(name = SEQUENCE_NAME, sequenceName = SEQUENCE_NAME, allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SEQUENCE_NAME) private Integer id; @Column(unique = true) @NotNull @Size(max=255) private String name; @Lob @Type(type = "org.hibernate.type.TextType") private String description; @Column(unique = true) @Size(max=20) private String abbreviation; @Column(unique = true) @Size(max=50) private String productCode; @Column(unique = true) @Size(max=50) private String pgmSystemName; @OneToMany(mappedBy = "product", cascade = { CascadeType.REFRESH, CascadeType.DETACH, CascadeType.REMOVE }) private Set<ProductVersion> productVersions; /** * Instantiates a new product. */ public Product() { productVersions = new HashSet<>(); } public Product(String name, String description) { this(); this.name = name; this.description = description; } /** * @return the id */ public Integer getId() { return id; } /** * @param id the id to set */ @Override public void setId(Integer id) { this.id = id; } /** * @return the name */ public String getName() { return name; } /** * @param name the name to set */ public void setName(String name) { this.name = name; } /** * @return the description */ public String getDescription() { return description; } /** * @param description the description to set */ public void setDescription(String description) { this.description = description; } /** * @return Shortened informal name of the product */ public String getAbbreviation() { return abbreviation; } public void setAbbreviation(String abbreviation) { this.abbreviation = abbreviation; } /** * @return Product code in internal systems */ public String getProductCode() { return productCode; } public void setProductCode(String productCode) { this.productCode = productCode; } /** * @return Name of the product used by program management planning system */ public String getPgmSystemName() { return pgmSystemName; } public void setPgmSystemName(String pgmSystemName) { this.pgmSystemName = pgmSystemName; } /** * @return the productVersions */ public Set<ProductVersion> getProductVersions() { return productVersions; } /** * @param productVersions the productVersions to set */ public void setProductVersions(Set<ProductVersion> productVersions) { this.productVersions = productVersions; } /** * Add a version for the Product * * @param version Associate a new version with this product * @return True if the product did not already contain this version */ public boolean addVersion(ProductVersion version) { return productVersions.add(version); } public static class Builder { private Integer id; private String name; private String description; private String abbreviation; private String productCode; private String pgmSystemName; private Set<ProductVersion> productVersions; private Builder() { productVersions = new HashSet<>(); } public static Builder newBuilder() { return new Builder(); } public Product build() { Product product = new Product(); product.setId(id); product.setName(name); product.setDescription(description); product.setAbbreviation(abbreviation); product.setProductCode(productCode); product.setPgmSystemName(pgmSystemName); // Set the bi-directional mapping for (ProductVersion productVersion : productVersions) { productVersion.setProduct(product); } product.setProductVersions(productVersions); return product; } public Builder id(Integer id) { this.id = id; return this; } public Builder name(String name) { this.name = name; return this; } public Builder description(String description) { this.description = description; return this; } public Builder abbreviation(String abbreviation) { this.abbreviation = abbreviation; return this; } public Builder productCode(String productCode) { this.productCode = productCode; return this; } public Builder pgmSystemName(String pgmSystemName) { this.pgmSystemName = pgmSystemName; return this; } public Builder productVersion(ProductVersion productVersion) { this.productVersions.add(productVersion); return this; } public Builder productVersions(Set<ProductVersion> productVersions) { this.productVersions = productVersions; return this; } public Builder productVersion(ProductVersion.Builder productVersionBuilder) { this.productVersions.add(productVersionBuilder.build()); return this; } } }
dans123456/pnc
model/src/main/java/org/jboss/pnc/model/Product.java
Java
apache-2.0
6,835
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_40) on Wed Apr 13 18:09:30 UTC 2016 --> <title>Cassandra.Processor.get_indexed_slices (apache-cassandra API)</title> <meta name="date" content="2016-04-13"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Cassandra.Processor.get_indexed_slices (apache-cassandra API)"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10,"i2":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/Cassandra.Processor.get_indexed_slices.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/apache/cassandra/thrift/Cassandra.Processor.get_count.html" title="class in org.apache.cassandra.thrift"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../org/apache/cassandra/thrift/Cassandra.Processor.get_multi_slice.html" title="class in org.apache.cassandra.thrift"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/cassandra/thrift/Cassandra.Processor.get_indexed_slices.html" target="_top">Frames</a></li> <li><a href="Cassandra.Processor.get_indexed_slices.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.apache.cassandra.thrift</div> <h2 title="Class Cassandra.Processor.get_indexed_slices" class="title">Class Cassandra.Processor.get_indexed_slices&lt;I extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.Iface.html" title="interface in org.apache.cassandra.thrift">Cassandra.Iface</a>&gt;</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>org.apache.thrift.ProcessFunction&lt;I,<a href="../../../../org/apache/cassandra/thrift/Cassandra.get_indexed_slices_args.html" title="class in org.apache.cassandra.thrift">Cassandra.get_indexed_slices_args</a>&gt;</li> <li> <ul class="inheritance"> <li>org.apache.cassandra.thrift.Cassandra.Processor.get_indexed_slices&lt;I&gt;</li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Enclosing class:</dt> <dd><a href="../../../../org/apache/cassandra/thrift/Cassandra.Processor.html" title="class in org.apache.cassandra.thrift">Cassandra.Processor</a>&lt;<a href="../../../../org/apache/cassandra/thrift/Cassandra.Processor.html" title="type parameter in Cassandra.Processor">I</a> extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.Iface.html" title="interface in org.apache.cassandra.thrift">Cassandra.Iface</a>&gt;</dd> </dl> <hr> <br> <pre>public static class <span class="typeNameLabel">Cassandra.Processor.get_indexed_slices&lt;I extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.Iface.html" title="interface in org.apache.cassandra.thrift">Cassandra.Iface</a>&gt;</span> extends org.apache.thrift.ProcessFunction&lt;I,<a href="../../../../org/apache/cassandra/thrift/Cassandra.get_indexed_slices_args.html" title="class in org.apache.cassandra.thrift">Cassandra.get_indexed_slices_args</a>&gt;</pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/thrift/Cassandra.Processor.get_indexed_slices.html#get_indexed_slices--">get_indexed_slices</a></span>()</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../../../org/apache/cassandra/thrift/Cassandra.get_indexed_slices_args.html" title="class in org.apache.cassandra.thrift">Cassandra.get_indexed_slices_args</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/thrift/Cassandra.Processor.get_indexed_slices.html#getEmptyArgsInstance--">getEmptyArgsInstance</a></span>()</code>&nbsp;</td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code><a href="../../../../org/apache/cassandra/thrift/Cassandra.get_indexed_slices_result.html" title="class in org.apache.cassandra.thrift">Cassandra.get_indexed_slices_result</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/thrift/Cassandra.Processor.get_indexed_slices.html#getResult-I-org.apache.cassandra.thrift.Cassandra.get_indexed_slices_args-">getResult</a></span>(<a href="../../../../org/apache/cassandra/thrift/Cassandra.Processor.get_indexed_slices.html" title="type parameter in Cassandra.Processor.get_indexed_slices">I</a>&nbsp;iface, <a href="../../../../org/apache/cassandra/thrift/Cassandra.get_indexed_slices_args.html" title="class in org.apache.cassandra.thrift">Cassandra.get_indexed_slices_args</a>&nbsp;args)</code>&nbsp;</td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>protected boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/thrift/Cassandra.Processor.get_indexed_slices.html#isOneway--">isOneway</a></span>()</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.org.apache.thrift.ProcessFunction"> <!-- --> </a> <h3>Methods inherited from class&nbsp;org.apache.thrift.ProcessFunction</h3> <code>getMethodName, process</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="get_indexed_slices--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>get_indexed_slices</h4> <pre>public&nbsp;get_indexed_slices()</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getEmptyArgsInstance--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getEmptyArgsInstance</h4> <pre>public&nbsp;<a href="../../../../org/apache/cassandra/thrift/Cassandra.get_indexed_slices_args.html" title="class in org.apache.cassandra.thrift">Cassandra.get_indexed_slices_args</a>&nbsp;getEmptyArgsInstance()</pre> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code>getEmptyArgsInstance</code>&nbsp;in class&nbsp;<code>org.apache.thrift.ProcessFunction&lt;<a href="../../../../org/apache/cassandra/thrift/Cassandra.Processor.get_indexed_slices.html" title="type parameter in Cassandra.Processor.get_indexed_slices">I</a> extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.Iface.html" title="interface in org.apache.cassandra.thrift">Cassandra.Iface</a>,<a href="../../../../org/apache/cassandra/thrift/Cassandra.get_indexed_slices_args.html" title="class in org.apache.cassandra.thrift">Cassandra.get_indexed_slices_args</a>&gt;</code></dd> </dl> </li> </ul> <a name="isOneway--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isOneway</h4> <pre>protected&nbsp;boolean&nbsp;isOneway()</pre> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code>isOneway</code>&nbsp;in class&nbsp;<code>org.apache.thrift.ProcessFunction&lt;<a href="../../../../org/apache/cassandra/thrift/Cassandra.Processor.get_indexed_slices.html" title="type parameter in Cassandra.Processor.get_indexed_slices">I</a> extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.Iface.html" title="interface in org.apache.cassandra.thrift">Cassandra.Iface</a>,<a href="../../../../org/apache/cassandra/thrift/Cassandra.get_indexed_slices_args.html" title="class in org.apache.cassandra.thrift">Cassandra.get_indexed_slices_args</a>&gt;</code></dd> </dl> </li> </ul> <a name="getResult-org.apache.cassandra.thrift.Cassandra.Iface-org.apache.cassandra.thrift.Cassandra.get_indexed_slices_args-"> <!-- --> </a><a name="getResult-I-org.apache.cassandra.thrift.Cassandra.get_indexed_slices_args-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getResult</h4> <pre>public&nbsp;<a href="../../../../org/apache/cassandra/thrift/Cassandra.get_indexed_slices_result.html" title="class in org.apache.cassandra.thrift">Cassandra.get_indexed_slices_result</a>&nbsp;getResult(<a href="../../../../org/apache/cassandra/thrift/Cassandra.Processor.get_indexed_slices.html" title="type parameter in Cassandra.Processor.get_indexed_slices">I</a>&nbsp;iface, <a href="../../../../org/apache/cassandra/thrift/Cassandra.get_indexed_slices_args.html" title="class in org.apache.cassandra.thrift">Cassandra.get_indexed_slices_args</a>&nbsp;args) throws org.apache.thrift.TException</pre> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code>getResult</code>&nbsp;in class&nbsp;<code>org.apache.thrift.ProcessFunction&lt;<a href="../../../../org/apache/cassandra/thrift/Cassandra.Processor.get_indexed_slices.html" title="type parameter in Cassandra.Processor.get_indexed_slices">I</a> extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.Iface.html" title="interface in org.apache.cassandra.thrift">Cassandra.Iface</a>,<a href="../../../../org/apache/cassandra/thrift/Cassandra.get_indexed_slices_args.html" title="class in org.apache.cassandra.thrift">Cassandra.get_indexed_slices_args</a>&gt;</code></dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>org.apache.thrift.TException</code></dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/Cassandra.Processor.get_indexed_slices.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/apache/cassandra/thrift/Cassandra.Processor.get_count.html" title="class in org.apache.cassandra.thrift"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../org/apache/cassandra/thrift/Cassandra.Processor.get_multi_slice.html" title="class in org.apache.cassandra.thrift"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/cassandra/thrift/Cassandra.Processor.get_indexed_slices.html" target="_top">Frames</a></li> <li><a href="Cassandra.Processor.get_indexed_slices.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &copy; 2016 The Apache Software Foundation</small></p> </body> </html>
elisska/cloudera-cassandra
DATASTAX_CASSANDRA-3.5.0/javadoc/org/apache/cassandra/thrift/Cassandra.Processor.get_indexed_slices.html
HTML
apache-2.0
16,155
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Thu Mar 08 14:17:43 MST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Interface org.wildfly.swarm.config.elytron.LdapRealmConsumer (BOM: * : All 2018.3.3 API)</title> <meta name="date" content="2018-03-08"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.wildfly.swarm.config.elytron.LdapRealmConsumer (BOM: * : All 2018.3.3 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="interface in org.wildfly.swarm.config.elytron">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2018.3.3</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/elytron/class-use/LdapRealmConsumer.html" target="_top">Frames</a></li> <li><a href="LdapRealmConsumer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface org.wildfly.swarm.config.elytron.LdapRealmConsumer" class="title">Uses of Interface<br>org.wildfly.swarm.config.elytron.LdapRealmConsumer</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="interface in org.wildfly.swarm.config.elytron">LdapRealmConsumer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config">org.wildfly.swarm.config</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.elytron">org.wildfly.swarm.config.elytron</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.wildfly.swarm.config"> <!-- --> </a> <h3>Uses of <a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="interface in org.wildfly.swarm.config.elytron">LdapRealmConsumer</a> in <a href="../../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a> with parameters of type <a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="interface in org.wildfly.swarm.config.elytron">LdapRealmConsumer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/wildfly/swarm/config/Elytron.html" title="type parameter in Elytron">T</a></code></td> <td class="colLast"><span class="typeNameLabel">Elytron.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/Elytron.html#ldapRealm-java.lang.String-org.wildfly.swarm.config.elytron.LdapRealmConsumer-">ldapRealm</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;childKey, <a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="interface in org.wildfly.swarm.config.elytron">LdapRealmConsumer</a>&nbsp;consumer)</code> <div class="block">Create and configure a LdapRealm object to the list of subresources</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.wildfly.swarm.config.elytron"> <!-- --> </a> <h3>Uses of <a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="interface in org.wildfly.swarm.config.elytron">LdapRealmConsumer</a> in <a href="../../../../../../org/wildfly/swarm/config/elytron/package-summary.html">org.wildfly.swarm.config.elytron</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../org/wildfly/swarm/config/elytron/package-summary.html">org.wildfly.swarm.config.elytron</a> that return <a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="interface in org.wildfly.swarm.config.elytron">LdapRealmConsumer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>default <a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="interface in org.wildfly.swarm.config.elytron">LdapRealmConsumer</a>&lt;<a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="type parameter in LdapRealmConsumer">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">LdapRealmConsumer.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html#andThen-org.wildfly.swarm.config.elytron.LdapRealmConsumer-">andThen</a></span>(<a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="interface in org.wildfly.swarm.config.elytron">LdapRealmConsumer</a>&lt;<a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="type parameter in LdapRealmConsumer">T</a>&gt;&nbsp;after)</code>&nbsp;</td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../org/wildfly/swarm/config/elytron/package-summary.html">org.wildfly.swarm.config.elytron</a> with parameters of type <a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="interface in org.wildfly.swarm.config.elytron">LdapRealmConsumer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>default <a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="interface in org.wildfly.swarm.config.elytron">LdapRealmConsumer</a>&lt;<a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="type parameter in LdapRealmConsumer">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">LdapRealmConsumer.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html#andThen-org.wildfly.swarm.config.elytron.LdapRealmConsumer-">andThen</a></span>(<a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="interface in org.wildfly.swarm.config.elytron">LdapRealmConsumer</a>&lt;<a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="type parameter in LdapRealmConsumer">T</a>&gt;&nbsp;after)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="interface in org.wildfly.swarm.config.elytron">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2018.3.3</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/elytron/class-use/LdapRealmConsumer.html" target="_top">Frames</a></li> <li><a href="LdapRealmConsumer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2018 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
wildfly-swarm/wildfly-swarm-javadocs
2018.3.3/apidocs/org/wildfly/swarm/config/elytron/class-use/LdapRealmConsumer.html
HTML
apache-2.0
11,417
/* mbed Microcontroller Library * Copyright (c) 2014, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "mbed_assert.h" #include "analogout_api.h" #if DEVICE_ANALOGOUT #include "cmsis.h" #include "pinmap.h" #include "error.h" #define DAC_RANGE (0xFFF) // 12 bits static const PinMap PinMap_DAC[] = { {PA_4, DAC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // DAC_OUT {NC, NC, 0} }; static DAC_HandleTypeDef DacHandle; void analogout_init(dac_t *obj, PinName pin) { DAC_ChannelConfTypeDef sConfig; DacHandle.Instance = DAC; // Get the peripheral name (DAC_1, ...) from the pin and assign it to the object obj->dac = (DACName)pinmap_peripheral(pin, PinMap_DAC); MBED_ASSERT(obj->dac != (DACName)NC); // Configure GPIO pinmap_pinout(pin, PinMap_DAC); // Save the channel for future use obj->pin = pin; // Enable DAC clock __DAC_CLK_ENABLE(); // Configure DAC sConfig.DAC_Trigger = DAC_TRIGGER_NONE; sConfig.DAC_OutputBuffer = DAC_OUTPUTBUFFER_DISABLE; HAL_DAC_ConfigChannel(&DacHandle, &sConfig, DAC_CHANNEL_1); analogout_write_u16(obj, 0); } void analogout_free(dac_t *obj) { // Reset DAC and disable clock __DAC_FORCE_RESET(); __DAC_RELEASE_RESET(); __DAC_CLK_DISABLE(); // Configure GPIO pin_function(obj->pin, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0)); } static inline void dac_write(dac_t *obj, uint16_t value) { HAL_DAC_SetValue(&DacHandle, DAC_CHANNEL_1, DAC_ALIGN_12B_R, value); HAL_DAC_Start(&DacHandle, DAC_CHANNEL_1); } static inline int dac_read(dac_t *obj) { return (int)HAL_DAC_GetValue(&DacHandle, DAC_CHANNEL_1); } void analogout_write(dac_t *obj, float value) { if (value < 0.0f) { dac_write(obj, 0); // Min value } else if (value > 1.0f) { dac_write(obj, (uint16_t)DAC_RANGE); // Max value } else { dac_write(obj, (uint16_t)(value * (float)DAC_RANGE)); } } void analogout_write_u16(dac_t *obj, uint16_t value) { if (value > (uint16_t)DAC_RANGE) { dac_write(obj, (uint16_t)DAC_RANGE); // Max value } else { dac_write(obj, value); } } float analogout_read(dac_t *obj) { uint32_t value = dac_read(obj); return (float)((float)value * (1.0f / (float)DAC_RANGE)); } uint16_t analogout_read_u16(dac_t *obj) { return (uint16_t)dac_read(obj); } #endif // DEVICE_ANALOGOUT
NordicSemiconductor/mbed
libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/analogout_api.c
C
apache-2.0
3,922
<? include_once 'init.php'; use PHPUnit\Framework\TestCase; class MessagesTest extends TestCase {}
kosenkoandrey/mailiq-pult
protected/modules/Messages/test.php
PHP
apache-2.0
99
--- layout: doc title: Profile manager --- The profile manager is meant to deal with the user profile: it can be used to save or restore it. The profile manager is instantiated from the `WebContext` and the `SessionStore`. ## 1) Retrieval You can use the `getProfile()` method to return only one profile and the `getProfiles()` method to retrieve all profiles. The returned profiles are of type `UserProfile`, but they should be at least cast as `CommonProfile` to retrieve the most common attributes that all profiles share or to their real types like a `FacebookProfile` in case of a Facebook authentication. You may also use the `getProfile(class)` if you already know the type of the user profile. ```java CasProfile profile = manager.getProfile(CasProfile.class).get(); ``` ## 2) Custom profile managers By default, the profile manager is the [`ProfileMamager`](https://github.com/pac4j/pac4j/blob/master/pac4j-core/src/main/java/org/pac4j/core/profile/ProfileManager.java) component. In some *pac4j* implementations, there are specific profile managers: `UndertowProfileManager`, `ShiroProfileManager`, etc. A custom profile manager can be instantiated via the following factory: - `setProfileManagerFactory(final ProfileManagerFactory factory)`. It can be set at components level (like for the logics) or at the `Config` level.
pac4j/pac4j
documentation/docs/profile-manager.md
Markdown
apache-2.0
1,348
automerge-plugin ================ [![Build Status](https://gerrit-ci.gerritforge.com/view/Plugins-stable-2.14/job/plugin-automerge-plugin-gh-bazel-stable-2.14/badge/icon)](https://gerrit-ci.gerritforge.com/view/Plugins-stable-2.14/job/plugin-automerge-plugin-gh-bazel-stable-2.14/) A [gerrit](https://www.gerritcodereview.com) plugin that takes care of automatically merging reviews when all approvals are present. Also, it introduces the concept of cross-repository reviews. Cross repository reviews are reviews that share a common topic, and are all in different gerrit repositories. They will be merged at the same time, when all approvals for all reviews are present, and all reviews are mergeable. Requires Gerrit 2.14 or later.
criteo/automerge-plugin
README.md
Markdown
apache-2.0
738
/* * Copyright (c) 2016. Papyrus Electronics, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * you may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.taptrack.tcmptappy.ui.modules.mainnavigationbar.vistas; import android.content.Context; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; import com.taptrack.tappyble.R; import com.taptrack.tcmptappy.data.ActiveTappyWithStatus; import com.taptrack.tcmptappy.tappy.ble.TappyBleDeviceDefinition; import com.taptrack.tcmptappy.ui.modules.mainnavigationbar.MainNavigationPresenter; import com.taptrack.tcmptappy.ui.modules.mainnavigationbar.MainNavigationVista; import com.taptrack.tcmptappy.ui.modules.mainnavigationbar.vistas.delegates.ActiveTappyAdapterDelegate; import com.taptrack.tcmptappy.ui.modules.mainnavigationbar.vistas.delegates.CaptionAdaptorDelegate; import com.taptrack.tcmptappy.ui.modules.mainnavigationbar.vistas.delegates.HeadingAdapterDelegate; import com.taptrack.tcmptappy.ui.modules.mainnavigationbar.vistas.delegates.NavActionAdaptorDelegate; import com.taptrack.tcmptappy.ui.modules.mainnavigationbar.vistas.delegates.NavigationHeaderLayoutDelegate; import com.taptrack.tcmptappy.ui.modules.mainnavigationbar.vistas.delegates.SavedTappyAdapterDelegate; import com.taptrack.tcmptappy.utils.TwoActionTappyListener; import java.util.ArrayList; import java.util.List; public class MainNavigationRecycler extends RecyclerView implements MainNavigationVista{ protected MainNavigationPresenter presenter; protected final TwoActionTappyListener activeTappyListener = new TwoActionTappyListener() { @Override public void onPrimaryAction(TappyBleDeviceDefinition tappyBle) { if(presenter != null) presenter.requestConnectTappy(tappyBle); } @Override public void onSecondaryAction(TappyBleDeviceDefinition tappyBle) { if(presenter != null) presenter.requestRemoveActiveTappy(tappyBle); } }; protected final TwoActionTappyListener savedTappyListener = new TwoActionTappyListener() { @Override public void onPrimaryAction(TappyBleDeviceDefinition tappyBle) { if(presenter != null) presenter.requestSetActive(tappyBle); } @Override public void onSecondaryAction(TappyBleDeviceDefinition tappyBle) { if(presenter != null) presenter.requestRemoveSavedTappy(tappyBle); } }; protected final NavActionListener navActionListener = new NavActionListener() { @Override public void findTappies() { if(presenter != null) presenter.requestSearchTappies(); } @Override public void setCommunicationStatus(boolean isActive) { if(presenter != null) presenter.requestSetCommunication(isActive); } @Override public void setLaunchNdefUrl(boolean launchNdefUrl) { if(presenter != null) presenter.requestSetLaunchScannedUrl(launchNdefUrl); } @Override public void clearMessageDatabase() { if(presenter != null) presenter.requestClearMessageDatabase(); } }; protected List<WrappedNavItem> list = new ArrayList<>(); protected List<ActiveTappyWithStatus> activeTappies = new ArrayList<>(0); protected List<TappyBleDeviceDefinition> savedTappies = new ArrayList<>(0); protected boolean isNdefLaunch = false; protected boolean isCommunicationActive = false; protected MainNavigationAdapter adapter; boolean showNavigationHeader = true; public MainNavigationRecycler(Context context) { super(context); init(); } public MainNavigationRecycler(Context context, AttributeSet attrs) { super(context, attrs); init(); } public MainNavigationRecycler(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(); } public void init() { setLayoutManager(new LinearLayoutManager(getContext())); // TODO: create tablet layout // DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics(); // float dpWidth = displayMetrics.widthPixels / displayMetrics.density; // if(dpWidth >= 600) { // showNavigationHeader = false; // } adapter = new MainNavigationAdapter(activeTappyListener, savedTappyListener, navActionListener); setAdapter(adapter); } @Override public void setActiveTappies(List<ActiveTappyWithStatus> tappies) { activeTappies = tappies; rebuildWrapper(); } @Override public void setSavedTappies(List<TappyBleDeviceDefinition> tappies) { savedTappies = tappies; rebuildWrapper(); } @Override public void setCommunicationActive(boolean isActive) { this.isCommunicationActive = isActive; rebuildWrapper(); } @Override public void setNdefBackground(boolean isNdefBackground) { this.isNdefLaunch = isNdefBackground; rebuildWrapper(); } @Override public void setDisplayData(List<ActiveTappyWithStatus> activeTappies, List<TappyBleDeviceDefinition> savedTappies, boolean communicationActive, boolean ndefLaunch) { this.activeTappies = activeTappies; this.savedTappies = savedTappies; this.isCommunicationActive = communicationActive; this.isNdefLaunch = ndefLaunch; rebuildWrapper(); } public void rebuildWrapper() { int wrapperSize = 4 + (activeTappies.size() >0 ? activeTappies.size() : 1) + (savedTappies.size() >0 ? savedTappies.size() : 1) + (showNavigationHeader ? 1:0); List<WrappedNavItem> wrappedNavItems = new ArrayList<>(wrapperSize); if(showNavigationHeader) wrappedNavItems.add(new NavigationHeaderLayoutDelegate.WrappedHeader()); wrappedNavItems.add(new HeadingAdapterDelegate.WrappedHeading(R.string.active_tappies_heading)); if(activeTappies.size() == 0) { wrappedNavItems.add(new CaptionAdaptorDelegate.WrappedCaption(R.string.no_active_tappies_caption)); } else { for(ActiveTappyWithStatus deviceDefinition : activeTappies) { wrappedNavItems.add(new ActiveTappyAdapterDelegate.WrappedActiveTappyDefinition(deviceDefinition)); } } wrappedNavItems.add(new HeadingAdapterDelegate.WrappedHeading(R.string.saved_tappies_list_heading)); if(savedTappies.size() == 0) { wrappedNavItems.add(new CaptionAdaptorDelegate.WrappedCaption(R.string.no_saved_tappies_caption)); } else { for(TappyBleDeviceDefinition deviceDefinition : savedTappies) { wrappedNavItems.add(new SavedTappyAdapterDelegate.WrappedTappyDefinition(deviceDefinition,false)); } } wrappedNavItems.add(new HeadingAdapterDelegate.WrappedHeading(R.string.actions)); wrappedNavItems.add(new NavActionAdaptorDelegate.WrappedNavActions(isCommunicationActive,isNdefLaunch)); adapter.setItems(wrappedNavItems); adapter.notifyDataSetChanged(); } @Override public void displayTooManyTappies(int maxLimit) { } @Override public void registerPresenter(MainNavigationPresenter presenter) { this.presenter = presenter; } @Override public void unregisterPresenter() { this.presenter = null; } }
TapTrack/TappyBLE
app/src/main/java/com/taptrack/tcmptappy/ui/modules/mainnavigationbar/vistas/MainNavigationRecycler.java
Java
apache-2.0
8,299
package sfxclient import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" "runtime" "strings" "sync/atomic" "time" "unicode" "github.com/golang/protobuf/proto" "github.com/signalfx/com_signalfx_metrics_protobuf" "github.com/signalfx/golib/datapoint" "github.com/signalfx/golib/errors" "golang.org/x/net/context" ) // ClientVersion is the version of this library and is embedded into the user agent const ClientVersion = "1.0" // IngestEndpointV2 is the v2 version of the signalfx ingest endpoint const IngestEndpointV2 = "https://ingest.signalfx.com/v2/datapoint" // DefaultUserAgent is the UserAgent string sent to signalfx var DefaultUserAgent = fmt.Sprintf("golib-sfxclient/%s (gover %s)", ClientVersion, runtime.Version()) // DefaultTimeout is the default time to fail signalfx datapoint requests if they don't succeed const DefaultTimeout = time.Second * 5 // HTTPDatapointSink will accept signalfx datapoints and forward them to signalfx via HTTP type HTTPDatapointSink struct { AuthToken string UserAgent string Endpoint string Client http.Client protoMarshaler func(pb proto.Message) ([]byte, error) stats struct { readingBody int64 } } var _ Sink = &HTTPDatapointSink{} // TokenHeaderName is the header key for the auth token in the HTTP request const TokenHeaderName = "X-Sf-Token" // NewHTTPDatapointSink creates a default NewHTTPDatapointSink using package level constants func NewHTTPDatapointSink() *HTTPDatapointSink { return &HTTPDatapointSink{ UserAgent: DefaultUserAgent, Endpoint: IngestEndpointV2, Client: http.Client{ Timeout: DefaultTimeout, Transport: http.DefaultTransport, }, protoMarshaler: proto.Marshal, } } // AddDatapoints forwards the datapoints to signalfx func (h *HTTPDatapointSink) AddDatapoints(ctx context.Context, points []*datapoint.Datapoint) (err error) { if len(points) == 0 { return nil } if ctx.Err() != nil { return errors.Annotate(ctx.Err(), "context already closed") } body, err := h.encodePostBodyProtobufV2(points) if err != nil { return errors.Annotate(err, "cannot encode datapoints into protocol buffers") } req, err := http.NewRequest("POST", h.Endpoint, bytes.NewBuffer(body)) if err != nil { return errors.Annotatef(err, "cannot parse new HTTP request to %s", h.Endpoint) } req.Header.Set("Content-Type", "application/x-protobuf") req.Header.Set(TokenHeaderName, h.AuthToken) req.Header.Set("User-Agent", h.UserAgent) req.Header.Set("Connection", "Keep-Alive") return h.withCancel(ctx, req) } func (h *HTTPDatapointSink) handleResponse(resp *http.Response, respErr error) (err error) { if respErr != nil { return errors.Annotatef(respErr, "failed to send/recieve http request") } defer func() { closeErr := errors.Annotate(resp.Body.Close(), "failed to close response body") err = errors.NewMultiErr([]error{err, closeErr}) }() atomic.AddInt64(&h.stats.readingBody, 1) respBody, err := ioutil.ReadAll(resp.Body) if err != nil { return errors.Annotate(err, "cannot fully read response body") } if resp.StatusCode != http.StatusOK { return errors.Errorf("invalid status code %d", resp.StatusCode) } var bodyStr string err = json.Unmarshal(respBody, &bodyStr) if err != nil { return errors.Annotatef(err, "cannot unmarshal response body %s", respBody) } if bodyStr != "OK" { return errors.Errorf("invalid response body %s", bodyStr) } return nil } var toMTMap = map[datapoint.MetricType]com_signalfx_metrics_protobuf.MetricType{ datapoint.Counter: com_signalfx_metrics_protobuf.MetricType_CUMULATIVE_COUNTER, datapoint.Count: com_signalfx_metrics_protobuf.MetricType_COUNTER, datapoint.Enum: com_signalfx_metrics_protobuf.MetricType_GAUGE, datapoint.Gauge: com_signalfx_metrics_protobuf.MetricType_GAUGE, datapoint.Rate: com_signalfx_metrics_protobuf.MetricType_GAUGE, datapoint.Timestamp: com_signalfx_metrics_protobuf.MetricType_GAUGE, } func toMT(mt datapoint.MetricType) com_signalfx_metrics_protobuf.MetricType { ret, exists := toMTMap[mt] if exists { return ret } panic(fmt.Sprintf("Unknown metric type: %d\n", mt)) } func datumForPoint(pv datapoint.Value) *com_signalfx_metrics_protobuf.Datum { switch t := pv.(type) { case datapoint.IntValue: x := t.Int() return &com_signalfx_metrics_protobuf.Datum{IntValue: &x} case datapoint.FloatValue: x := t.Float() return &com_signalfx_metrics_protobuf.Datum{DoubleValue: &x} default: x := t.String() return &com_signalfx_metrics_protobuf.Datum{StrValue: &x} } } func mapToDimensions(dimensions map[string]string) []*com_signalfx_metrics_protobuf.Dimension { ret := make([]*com_signalfx_metrics_protobuf.Dimension, 0, len(dimensions)) for k, v := range dimensions { if k == "" || v == "" { continue } // If someone knows a better way to do this, let me know. I can't just take the & // of k and v because their content changes as the range iterates copyOfK := filterSignalfxKey(string([]byte(k))) copyOfV := (string([]byte(v))) ret = append(ret, (&com_signalfx_metrics_protobuf.Dimension{ Key: &copyOfK, Value: &copyOfV, })) } return ret } func filterSignalfxKey(str string) string { return strings.Map(runeFilterMap, str) } func runeFilterMap(r rune) rune { if unicode.IsDigit(r) || unicode.IsLetter(r) || r == '_' { return r } return '_' } func (h *HTTPDatapointSink) coreDatapointToProtobuf(point *datapoint.Datapoint) *com_signalfx_metrics_protobuf.DataPoint { m := point.Metric var ts int64 if point.Timestamp.IsZero() { ts = 0 } else { ts = point.Timestamp.UnixNano() / time.Millisecond.Nanoseconds() } mt := toMT(point.MetricType) v := &com_signalfx_metrics_protobuf.DataPoint{ Metric: &m, Timestamp: &ts, Value: datumForPoint(point.Value), MetricType: &mt, Dimensions: mapToDimensions(point.Dimensions), } return v } func (h *HTTPDatapointSink) encodePostBodyProtobufV2(datapoints []*datapoint.Datapoint) ([]byte, error) { dps := make([]*com_signalfx_metrics_protobuf.DataPoint, 0, len(datapoints)) for _, dp := range datapoints { dps = append(dps, h.coreDatapointToProtobuf(dp)) } msg := &com_signalfx_metrics_protobuf.DataPointUploadMessage{ Datapoints: dps, } body, err := h.protoMarshaler(msg) if err != nil { return nil, errors.Annotate(err, "protobuf marshal failed") } return body, nil }
michaeltrobinson/cadvisor-integration
vendor/github.com/signalfx/golib/sfxclient/httpsink.go
GO
apache-2.0
6,390
// If you want your component to be able to change your global state, follow the pattern below import React from 'react'; import { Link, browserHistory } from 'react-router'; import { connect } from 'react-redux'; import { selectAllProduct, selectAllProductFailed, selectAllProductSuccess, countAllProducts, countAllProductsFailed, countAllProductsSuccess } from '../../actions/productActions'; import { parseQueryString } from '../../helpers/QueryString'; const Pagination = props => { // calculate number of pages depending on the total of records and the // "products per page" property let pagesAmount = Math.ceil(props.productsAmount / props.item_per_page); let itemPerPage = props.item_per_page; let orderBy = props.order_by; let orderType = props.order_type; let search = props.search; let appendUrl = '&name=' + search + '&order_by=' + orderBy + '&order_type=' + orderType + '&item_per_page=' + itemPerPage; const params = { search: search, item_per_page: itemPerPage, order_by: orderBy, order_type: orderType, page: props.page }; // creating page elements, one for each page let pageIndicators = []; for (let i=1; i <= pagesAmount; i++) { pageIndicators.push( <li className={i == props.page ? "active":""} key={i}> <Link to={'?page=' + i + appendUrl} onClick={() => props.changePage({ search: search, item_per_page: itemPerPage, order_by: orderBy, order_type: orderType, page: i })} >{i}</Link> </li> ) } // return paging buttons and 'go to page' form return ( !props.productsAmount ? null : <nav className='overflow-hidden' style={{marginBottom:'20px'}}> { (pagesAmount - 1) <= 0 ? null : <ul className='pagination pull-left margin-zero'> { props.page == 1 ? null : <li> <Link to={'/?page=1' + appendUrl} onClick={() => props.changePage({ search: search, item_per_page: itemPerPage, order_by: orderBy, order_type: orderType, page: 1 })}> <span style={{marginRight: '0 .5em'}}>&laquo;</span> </Link> </li> } { props.page == 1 ? null : <li> <Link to={'/?page='+ (props.page - 1) + appendUrl} onClick={() => props.changePage({ search: search, item_per_page: itemPerPage, order_by: orderBy, order_type: orderType, page: (props.page - 1) })}> <span style={{marginRight: '0 .5em'}}>&lsaquo;</span> </Link> </li> } { pageIndicators } { props.page == pagesAmount ? null : <li> <Link to={'/?page='+ (parseInt(props.page) + 1) + appendUrl} onClick={() => props.changePage({ search: search, item_per_page: itemPerPage, order_by: orderBy, order_type: orderType, page: (parseInt(props.page) + 1) })}> <span style={{marginRight: '0 .5em'}}>&rsaquo;</span> </Link> </li> } { props.page == pagesAmount ? null : <li> <Link to={'/?page=' + pagesAmount + appendUrl} onClick={() => props.changePage({ search: search, item_per_page: itemPerPage, order_by: orderBy, order_type: orderType, page: pagesAmount })}> <span style={{marginRight: '0 .5em'}}>&raquo;</span> </Link> </li> } </ul> } <div> <div className="input-group col-md-2 pull-right"> <input type="hidden" name="s" value="" /> <input type="number" className="form-control" name="page" min='1' max={pagesAmount} required placeholder='Go to page' id="page_input" /> <div className="input-group-btn"> <button className="btn btn-primary" onClick={() => props.gotoPage({ search: search, item_per_page: itemPerPage, order_by: orderBy, order_type: orderType, page: pagesAmount })} > Go </button> </div> </div> <div className="input-group col-md-3 pull-right" style={{marginRight:'10px'}}> <select value={props.productsPerPage} id="item_per_page" className="form-control" onChange={() => props.changeItemPerPage({ search: search, item_per_page: itemPerPage, order_by: orderBy, order_type: orderType, page: pagesAmount })} > <option value="5">Show 5 Products per page</option> <option value="10">Show 10 Products per page</option> <option value="25">Show 25 Products per page</option> </select> </div> </div> </nav> ); }; function mapStateToProps(state, props) { return { order_by: props.order_by, order_type: props.order_type, item_per_page: props.item_per_page, search: props.search, page: props.page }; } const mapDispatchToProps = (dispatch, props) => { return { changePage: (params) => { const products = dispatch(selectAllProduct(params)); products.payload.then((response) => { !response.error ? dispatch(selectAllProductSuccess(response.data)) : dispatch(selectAllProductFailed(response.data)); }); }, gotoPage: (params) => { const pageInput = document.getElementById("page_input"); const pageAmount = Math.ceil(props.productsAmount / props.item_per_page); let destPage = parseInt(pageInput.value); if(destPage > pageAmount) destPage = pageAmount; params.page = destPage; const queryString = parseQueryString(params); browserHistory.push('/' + queryString); const products = dispatch(selectAllProduct(params)); products.payload.then((response) => { !response.error ? dispatch(selectAllProductSuccess(response.data)) : dispatch(selectAllProductFailed(response.data)); }); }, changeItemPerPage: (params) => { const itemPerPageInput = document.getElementById("item_per_page"); params.item_per_page = itemPerPageInput.value; params.page = 1; const queryString = parseQueryString(params); browserHistory.push('/' + queryString); const products = dispatch(selectAllProduct(params)); products.payload.then((response) => { !response.error ? dispatch(selectAllProductSuccess(response.data)) : dispatch(selectAllProductFailed(response.data)); }); } }; }; const PaginationComponent = connect(mapStateToProps, mapDispatchToProps)(Pagination); export default PaginationComponent;
andy1992/react-redux-crud
public/src/containers/products/Pagination.js
JavaScript
apache-2.0
9,726
/* * Copyright 2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.gradle.api.internal.project.taskfactory; import javax.annotation.Nullable; import java.lang.annotation.Annotation; import java.lang.reflect.Field; public interface TaskPropertyActionContext { /** * Returns the name of this property. */ String getName(); /** * Returns the annotation used to mark the property's type. */ @Nullable Class<? extends Annotation> getPropertyType(); /** * Returns the declared type of this property. If the property has an instance variable, * then returns the declared type of the instance variable. Otherwise returns the return * type of the declaring method. */ Class<?> getValueType(); /** * Sets the instance field of the property. */ void setInstanceVariableField(Field field); /** * Record an annotation encountered during parsing the property's methods and instance field. */ void addAnnotation(Annotation annotation); /** * Returns whether the given annotation is present on the field or any of the methods declaring the property. */ boolean isAnnotationPresent(Class<? extends Annotation> annotationType); /** * Returns the given annotation if present on the field or any of the methods declaring the property. */ <A extends Annotation> A getAnnotation(Class<A> annotationType); /** * @return Is this an optional property (value may be null)? */ boolean isOptional(); /** * Returns whether the task type this property belongs to is cacheable. */ boolean isCacheable(); /** * Sets whether the property allows null values. */ void setOptional(boolean optional); /** * Specified the action used to configure the task based on the value of this property. Note that this action is * called before the skip and validation actions. */ void setConfigureAction(UpdateAction action); /** * Process a nested property with the given name. */ void setNestedType(Class<?> type); /** * Records a validation message about this property. */ void validationMessage(String message); }
gstevey/gradle
subprojects/core/src/main/java/org/gradle/api/internal/project/taskfactory/TaskPropertyActionContext.java
Java
apache-2.0
2,798
<!DOCTYPE html> <html> <head> <title>Calculation Graph</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.7.0/vis.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.7.0/vis.min.css"> <script src="data_CHOOSE_Fx__JOIN_ALL.js"></script> </head> <body> <div id="graph"></div> <script type="text/javascript"> // create a network var container = document.getElementById('graph'); var data = { nodes: nodes, edges: edges }; var options = { height: '900px', nodes: { shape: 'box' }, edges: { arrows: {to: {scaleFactor: 1}}, smooth: { enabled: true, type: 'curvedCW', roundness: 0.1 } }, layout: { hierarchical: { enabled: false, direction: 'LR', sortMethod: 'directed' } }, physics: { enabled: true, solver: 'forceAtlas2Based' }, interaction: {dragNodes: true} }; var network = new vis.Network(container, data, options); network.on("stabilizationIterationsDone", function (params) { this.setOptions({physics:{enabled: false}}); }); </script> </body> </html>
DataArt/CalculationEngine
calculation-engine/engine-tests/engine-it-graph/src/test/resources/standardwithconfig_data_js_files/graph_CHOOSE_Fx__JOIN_ALL.html
HTML
apache-2.0
1,446
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.oakeel.ejb.ptpProductTransfer; import com.oakeel.ejb.entityAndEao.eeroot.EntityRoot; import com.oakeel.ejb.entityAndEao.frontUser.FrontUserEntity; import java.math.BigDecimal; import java.util.Date; import javax.persistence.Entity; import javax.persistence.ManyToOne; import javax.persistence.Temporal; import javax.persistence.TemporalType; /** * * @author root */ @Entity public class PtpProductTransferEntity extends EntityRoot { private static final long serialVersionUID = 1L; @ManyToOne private FrontUserEntity fromUser;//出让债权的用户 @ManyToOne private FrontUserEntity toUser;//转到目标用户 private int transferNum;//转让份数 private BigDecimal transferOutProportion;//转让出的收益 @Temporal(TemporalType.DATE) private Date transferDate;//转让时间 /** * @return the fromUser */ public FrontUserEntity getFromUser() { return fromUser; } /** * @param fromUser the fromUser to set */ public void setFromUser(FrontUserEntity fromUser) { this.fromUser = fromUser; } /** * @return the toUser */ public FrontUserEntity getToUser() { return toUser; } /** * @param toUser the toUser to set */ public void setToUser(FrontUserEntity toUser) { this.toUser = toUser; } /** * @return the transferNum */ public int getTransferNum() { return transferNum; } /** * @param transferNum the transferNum to set */ public void setTransferNum(int transferNum) { this.transferNum = transferNum; } /** * @return the transferDate */ public Date getTransferDate() { return transferDate; } /** * @param transferDate the transferDate to set */ public void setTransferDate(Date transferDate) { this.transferDate = transferDate; } /** * @return the transferOutProportion */ public BigDecimal getTransferOutProportion() { return transferOutProportion; } /** * @param transferOutProportion the transferOutProportion to set */ public void setTransferOutProportion(BigDecimal transferOutProportion) { this.transferOutProportion = transferOutProportion; } }
globalptr/ptpEarAll
PtpApplication/PtpApplication-ejb/src/main/java/com/oakeel/ejb/ptpProductTransfer/PtpProductTransferEntity.java
Java
apache-2.0
2,508
(function ($) { function doSearch() { var url = '/v0.1/search/?q=' + document.getElementsByName('q')[0].value; window.location.assign(url); } $(document).ready(function() { $('#searchbox_demo').on('submit', function(e) { e.preventDefault(); doSearch(); }); $('.btn-search').on('click', function(e) { e.preventDefault(); doSearch(); }); function setSearchBoxSize() { var width = screen.width < 1024 ? "20" : "30"; $("input[name='q']").attr("size", width); } var resizeTimeout; function resizeThrottler() { function timeoutHandler() { resizeTimeout = null; actualResizeHandler(); } // ignore resize events as long as an actualResizeHandler execution is in the queue if ( !resizeTimeout ) { resizeTimeout = setTimeout(timeoutHandler, 66); } } function actualResizeHandler() { setSearchBoxSize(); } $(window).on('resize', resizeThrottler); setSearchBoxSize(); }); }(jQuery));
istio/istio.io
archive/v0.1/js/search.js
JavaScript
apache-2.0
1,210
<!doctype html> <html> <head> <meta charset="utf-8"> <title>店主专区</title> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"> <meta name="format-detection" content="telephone=no"> <meta name="apple-mobile-web-app-capable" content="yes"> <script type="text/javascript" src="__PUBLIC__/wap/js/jquery.min.js"></script> <script src="__PUBLIC__/wap/js/flexible.js"></script> <script type="text/javascript" src="__PUBLIC__/js/jquery.form.js"></script> <script src="__PUBLIC__/bootstrap/vendor/jquery-validation/jquery.validate.wap.js"></script> <script type="text/javascript" src="__PUBLIC__/layer/layer.js"></script> <style> html, body, h2, h4, h6, li, div, dl, dt, dd, div { margin: 0; padding: 0; } html,body{background:#d92a58;height:100%;} .clearfix:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; } .clearfix { *zoom:1;} * { box-sizing: border-box; margin: 0; padding: 0; } .top{width:100%;height:100%;padding-top:10rem;} .t1{background:url(__PUBLIC__/wap/img/upgrade/bg1.jpg) top center no-repeat;background-size: 100% auto;} .t2{background:url(__PUBLIC__/wap/img/upgrade/bg2.jpg) top center no-repeat;background-size: 100% auto;} .t3{background:url(__PUBLIC__/wap/img/upgrade/bg3.jpg) top center no-repeat;background-size: 100% auto;} .title{font-size:.8rem;color:#fff;padding:0 .2rem;text-align: center;} .title span{display:block; font-size:.6rem;color:#fc0;} .list{ margin:.2rem; text-align: center;} .list .goods { width: 30%; height:30%; border-radius: 2rem; overflow: hidden; float: left; margin:1.6%; position: relative; box-shadow: 0 0 .2rem rgba(0,0,0,0.2);transition: 0.3s;} .list .goods img{ width: 100%; height: 100%; display: block;transition: 0.3s;border-radius: 2rem;overflow: hidden;} .list.off .goods img{ -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms-filter: grayscale(100%); -o-filter: grayscale(100%); filter: grayscale(100%); filter: gray; transition: 0.3s;border-radius: 2rem;overflow: hidden;} .list.off .goods.on img{ -ms-filter: grayscale(0); -o-filter: grayscale(0); filter: grayscale(0); filter: normal; -webkit-filter: grayscale(0); -moz-filter: grayscale(0);transition: 0.3s;border-radius: 2rem;overflow: hidden;} .list .goods .selected{height:100%;width:100%;background:rgba(255,204,0,0.2); opacity: 0; position: absolute; z-index: 1;transition: 0.3s;text-align: center;border-radius: 2rem;overflow: hidden;} .list .goods .selected img{height:60%;width:auto;margin:.94rem auto;transition: 0.3s;border-radius: 2rem;overflow: hidden;} .list .goods.on .selected{ opacity: 1; transition: 0.3s;border-radius: 2rem;overflow: hidden; } .submit { padding-bottom: .4rem; text-align: center; margin: .4rem .4rem 1rem 0.4rem; z-index: 6; } .submit a { color: #d92a58; font-size: .4rem; background: #ffd409; margin: 0 auto; border-radius: .1rem; padding: .3rem 0; display: block; text-decoration: none;box-shadow: 0 0 .2rem rgba(0,0,0,0.2) } </style> </head> <body class="shopkeeper"> <div class="top t{$goods_num}"> <div class="title"> <eq name="goods_num" value="1"> <div class="title1">精挑细选 钟爱一款 <span>请挑选一款您钟爱的礼品</span></div> </eq> <eq name="goods_num" value="2"> <div class="title2">礼应当先 不二之选 <span>请筛选两款您爱不释手的礼品</span></div> </eq> <eq name="goods_num" value="3"> <div class="title3">三生有幸 钟爱一生 <span>请精选三款您心仪的礼品</span></div> </eq> </div> <form id="form2" role="form" action="" novalidate method="post" onSubmit="return false;"> <div class="list "> <volist name="list" id="vo"> <div class="goods " data_status="0" data_id="{$vo.goods_id}"> <div class="selected"> <img src="__PUBLIC__/wap/img/upgrade/selected.png"/> </div> <img src="{:thumbs_auto($vo['goods_img'],200,200)}"/> <input type="checkbox" name="goods_ids[]" class="check_{$vo.goods_id}" value="{$vo.goods_id}" hidden /> </div> </volist> </div> <input type="hidden" name="level" value="{$level}"/> </form> <div class="clearfix"></div> <div class="submit"><a href="javascript:void (0)" id='submit'>确认礼品,提交开店</a></div> </div> <input type="hidden" value="{$is_binding}" id="is_binding"> <script type="text/javascript"> $(function(){ var vip_type = {$data.member_vip_type}; var goods_num = {$goods_num}; var choos_num = 0; $('.goods').click(function () { var _this = $(this); var choose_status = _this.attr('data_status'); var goods_id = _this.attr('data_id'); if(choose_status == 1 ){ $('.check_'+goods_id).attr("checked", false); _this.attr('data_status','0'); _this.removeClass('on'); choos_num -= 1; }else { if(choos_num >= goods_num){ var msg = '亲 只能选择'+goods_num+'件礼品哟!'; layer.msg(msg,{icon : 7}); }else { $('.check_'+goods_id).attr("checked", true); _this.attr('data_status','1'); _this.addClass('on'); choos_num += 1; } } if(choos_num >= goods_num){ $('.list').addClass('off'); }else { $('.list').removeClass('off'); } }); var is_binding = $('#is_binding').val(); //定义一个产生订单请求的变量 $("#submit").click(function () { if(is_binding == 0 || is_binding == null){ window.location.href = "<?php echo U('wap/start/member_info_full',array('share'=>$share_para,'level'=>$level)); ?>"; }else { setTimeout(function () { $.ajax({ url: "<?php echo U('wap/start/set_order'); ?>", type: "post", data: $('#form2').serialize(), dataType: 'json', target: "#loader", error: function () { layer.msg("服务器没有返回数据,可能服务器忙,请重试", {icon: 5}); }, onwait: "正在处理信息,请稍候...", success: function (response) { /*console.log(response); return false;*/ if (response.status == 1) { window.location.href = "<?php echo U('wap/start/upgrade_pay'); ?>?order_id=" + response.order_id; } else if (response.status == 2) { window.location.href = "<?php echo U('wap/start/member_info_full',array('share'=>$share_para)); ?>"; } else { //alert(response.error); if (response.error) { layer.msg(response.error, {icon: 5}); } else { layer.msg('该订单已提交', {icon: 5}); } } } }); }, 300); } }); }); </script> </body> </html>
JustGrin/yixiuge
Application/Modules/Wap/Tpl/default/Start/shopkeeper_area.html
HTML
apache-2.0
6,673
//Copyright © 2006, Jonathan de Halleux //http://blog.dotnetwiki.org/default,month,2005-07.aspx using System; using System.Collections.Generic; using System.Reflection; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using System.IO; namespace MSBuild.Community.Tasks.Schema { internal static class ReflectionHelper { public static T GetAttribute<T>(ICustomAttributeProvider t) where T : Attribute { object[] attributes = t.GetCustomAttributes(typeof(T), true); if (attributes != null && attributes.Length > 0) return (T)attributes[0]; else return null; } public static bool HasAttribute<T>(ICustomAttributeProvider t) where T : Attribute { object[] attributes = t.GetCustomAttributes(typeof(T), true); return attributes != null && attributes.Length > 0; } public static bool IsOutput(ICustomAttributeProvider t) { return HasAttribute<OutputAttribute>(t); } public static bool IsRequired(ICustomAttributeProvider t) { return HasAttribute<RequiredAttribute>(t); } public static Assembly LoadAssembly(TaskLoggingHelper logger, ITaskItem assemblyItem) { try { string assemblyFullName = assemblyItem.GetMetadata("FullPath"); Assembly taskAssembly = Assembly.LoadFrom(assemblyFullName); return taskAssembly; } catch (FileLoadException ex) { logger.LogErrorFromException(ex); return null; } catch (BadImageFormatException ex) { logger.LogErrorFromException(ex); return null; } catch (TypeLoadException ex) { logger.LogErrorFromException(ex); return null; } } } }
ONLYOFFICE/CommunityServer
redistributable/MSBuild.Community.Tasks/MSBuild.Community.Tasks/Schema/ReflectionHelper.cs
C#
apache-2.0
2,112
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2017-12-07 22:51 from __future__ import unicode_literals import c3nav.mapdata.fields from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Announcement', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True, verbose_name='created')), ('active_until', models.DateTimeField(null=True, verbose_name='active until')), ('active', models.BooleanField(default=True, verbose_name='active')), ('message', c3nav.mapdata.fields.I18nField(verbose_name='Message')), ], options={ 'verbose_name': 'Announcement', 'verbose_name_plural': 'Announcements', 'get_latest_by': 'created', 'default_related_name': 'announcements', }, ), ]
c3nav/c3nav
src/c3nav/site/migrations/0001_announcement.py
Python
apache-2.0
1,128
// ---------------------------------------------------------------------------------- // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ---------------------------------------------------------------------------------- #nullable enable namespace DurableTask.Core { using System; using System.Diagnostics; using System.Threading; using System.Threading.Tasks; using DurableTask.Core.Common; using DurableTask.Core.Exceptions; using DurableTask.Core.History; using DurableTask.Core.Logging; using DurableTask.Core.Middleware; using DurableTask.Core.Tracing; /// <summary> /// Dispatcher for task activities to handle processing and renewing of work items /// </summary> public sealed class TaskActivityDispatcher { readonly INameVersionObjectManager<TaskActivity> objectManager; readonly WorkItemDispatcher<TaskActivityWorkItem> dispatcher; readonly IOrchestrationService orchestrationService; readonly DispatchMiddlewarePipeline dispatchPipeline; readonly LogHelper logHelper; internal TaskActivityDispatcher( IOrchestrationService orchestrationService, INameVersionObjectManager<TaskActivity> objectManager, DispatchMiddlewarePipeline dispatchPipeline, LogHelper logHelper) { this.orchestrationService = orchestrationService ?? throw new ArgumentNullException(nameof(orchestrationService)); this.objectManager = objectManager ?? throw new ArgumentNullException(nameof(objectManager)); this.dispatchPipeline = dispatchPipeline ?? throw new ArgumentNullException(nameof(dispatchPipeline)); this.logHelper = logHelper; this.dispatcher = new WorkItemDispatcher<TaskActivityWorkItem>( "TaskActivityDispatcher", item => item.Id, this.OnFetchWorkItemAsync, this.OnProcessWorkItemAsync) { AbortWorkItem = orchestrationService.AbandonTaskActivityWorkItemAsync, GetDelayInSecondsAfterOnFetchException = orchestrationService.GetDelayInSecondsAfterOnFetchException, GetDelayInSecondsAfterOnProcessException = orchestrationService.GetDelayInSecondsAfterOnProcessException, DispatcherCount = orchestrationService.TaskActivityDispatcherCount, MaxConcurrentWorkItems = orchestrationService.MaxConcurrentTaskActivityWorkItems, LogHelper = logHelper, }; } /// <summary> /// Starts the dispatcher to start getting and processing task activities /// </summary> public async Task StartAsync() { await this.dispatcher.StartAsync(); } /// <summary> /// Stops the dispatcher to stop getting and processing task activities /// </summary> /// <param name="forced">Flag indicating whether to stop gracefully or immediately</param> public async Task StopAsync(bool forced) { await this.dispatcher.StopAsync(forced); } /// <summary> /// Gets or sets flag whether to include additional details in error messages /// </summary> public bool IncludeDetails { get; set; } Task<TaskActivityWorkItem> OnFetchWorkItemAsync(TimeSpan receiveTimeout, CancellationToken cancellationToken) { return this.orchestrationService.LockNextTaskActivityWorkItem(receiveTimeout, cancellationToken); } async Task OnProcessWorkItemAsync(TaskActivityWorkItem workItem) { Task? renewTask = null; using var renewCancellationTokenSource = new CancellationTokenSource(); TaskMessage taskMessage = workItem.TaskMessage; OrchestrationInstance orchestrationInstance = taskMessage.OrchestrationInstance; TaskScheduledEvent? scheduledEvent = null; Activity? diagnosticActivity = null; try { if (string.IsNullOrWhiteSpace(orchestrationInstance?.InstanceId)) { this.logHelper.TaskActivityDispatcherError( workItem, $"The activity worker received a message that does not have any OrchestrationInstance information."); throw TraceHelper.TraceException( TraceEventType.Error, "TaskActivityDispatcher-MissingOrchestrationInstance", new InvalidOperationException("Message does not contain any OrchestrationInstance information")); } if (taskMessage.Event.EventType != EventType.TaskScheduled) { this.logHelper.TaskActivityDispatcherError( workItem, $"The activity worker received an event of type '{taskMessage.Event.EventType}' but only '{EventType.TaskScheduled}' is supported."); throw TraceHelper.TraceException( TraceEventType.Critical, "TaskActivityDispatcher-UnsupportedEventType", new NotSupportedException("Activity worker does not support event of type: " + taskMessage.Event.EventType)); } scheduledEvent = (TaskScheduledEvent)taskMessage.Event; if (scheduledEvent.Name == null) { string message = $"The activity worker received a {nameof(EventType.TaskScheduled)} event that does not specify an activity name."; this.logHelper.TaskActivityDispatcherError(workItem, message); throw TraceHelper.TraceException( TraceEventType.Error, "TaskActivityDispatcher-MissingActivityName", new InvalidOperationException(message)); } this.logHelper.TaskActivityStarting(orchestrationInstance, scheduledEvent); TaskActivity? taskActivity = this.objectManager.GetObject(scheduledEvent.Name, scheduledEvent.Version); if (workItem.LockedUntilUtc < DateTime.MaxValue) { // start a task to run RenewUntil renewTask = Task.Factory.StartNew( () => this.RenewUntil(workItem, renewCancellationTokenSource.Token), renewCancellationTokenSource.Token); } var dispatchContext = new DispatchMiddlewareContext(); dispatchContext.SetProperty(taskMessage.OrchestrationInstance); dispatchContext.SetProperty(taskActivity); dispatchContext.SetProperty(scheduledEvent); // correlation CorrelationTraceClient.Propagate(() => { workItem.TraceContextBase?.SetActivityToCurrent(); diagnosticActivity = workItem.TraceContextBase?.CurrentActivity; }); ActivityExecutionResult? result; try { await this.dispatchPipeline.RunAsync(dispatchContext, async _ => { if (taskActivity == null) { // This likely indicates a deployment error of some kind. Because these unhandled exceptions are // automatically retried, resolving this may require redeploying the app code so that the activity exists again. // CONSIDER: Should this be changed into a permanent error that fails the orchestration? Perhaps // the app owner doesn't care to preserve existing instances when doing code deployments? throw new TypeMissingException($"TaskActivity {scheduledEvent.Name} version {scheduledEvent.Version} was not found"); } var context = new TaskContext(taskMessage.OrchestrationInstance); HistoryEvent? responseEvent; try { string? output = await taskActivity.RunAsync(context, scheduledEvent.Input); responseEvent = new TaskCompletedEvent(-1, scheduledEvent.EventId, output); } catch (Exception e) when (e is not TaskFailureException && !Utils.IsFatal(e) && !Utils.IsExecutionAborting(e)) { // These are unexpected exceptions that occur in the task activity abstraction. Normal exceptions from // activities are expected to be translated into TaskFailureException and handled outside the middleware // context (see further below). TraceHelper.TraceExceptionInstance(TraceEventType.Error, "TaskActivityDispatcher-ProcessException", taskMessage.OrchestrationInstance, e); string? details = this.IncludeDetails ? $"Unhandled exception while executing task: {e}" : null; responseEvent = new TaskFailedEvent(-1, scheduledEvent.EventId, e.Message, details); this.logHelper.TaskActivityFailure(orchestrationInstance, scheduledEvent.Name, (TaskFailedEvent)responseEvent, e); } var result = new ActivityExecutionResult { ResponseEvent = responseEvent }; dispatchContext.SetProperty(result); }); result = dispatchContext.GetProperty<ActivityExecutionResult>(); } catch (TaskFailureException e) { // These are normal task activity failures. They can come from Activity implementations or from middleware. TraceHelper.TraceExceptionInstance(TraceEventType.Error, "TaskActivityDispatcher-ProcessTaskFailure", taskMessage.OrchestrationInstance, e); string? details = this.IncludeDetails ? e.Details : null; var failureEvent = new TaskFailedEvent(-1, scheduledEvent.EventId, e.Message, details); this.logHelper.TaskActivityFailure(orchestrationInstance, scheduledEvent.Name, failureEvent, e); CorrelationTraceClient.Propagate(() => CorrelationTraceClient.TrackException(e)); result = new ActivityExecutionResult { ResponseEvent = failureEvent }; } catch (Exception middlewareException) when (!Utils.IsFatal(middlewareException)) { // These are considered retriable this.logHelper.TaskActivityDispatcherError(workItem, $"Unhandled exception in activity middleware pipeline: {middlewareException}"); throw; } HistoryEvent? eventToRespond = result?.ResponseEvent; if (eventToRespond is TaskCompletedEvent completedEvent) { this.logHelper.TaskActivityCompleted(orchestrationInstance, scheduledEvent.Name, completedEvent); } else if (eventToRespond is null) { // Default response if middleware prevents a response from being generated eventToRespond = new TaskCompletedEvent(-1, scheduledEvent.EventId, null); } var responseTaskMessage = new TaskMessage { Event = eventToRespond, OrchestrationInstance = orchestrationInstance }; await this.orchestrationService.CompleteTaskActivityWorkItemAsync(workItem, responseTaskMessage); } catch (SessionAbortedException e) { // The activity aborted its execution this.logHelper.TaskActivityAborted(orchestrationInstance, scheduledEvent, e.Message); TraceHelper.TraceInstance(TraceEventType.Warning, "TaskActivityDispatcher-ExecutionAborted", orchestrationInstance, "{0}: {1}", scheduledEvent?.Name, e.Message); await this.orchestrationService.AbandonTaskActivityWorkItemAsync(workItem); } finally { diagnosticActivity?.Stop(); // Ensure the activity is stopped here to prevent it from leaking out. if (renewTask != null) { renewCancellationTokenSource.Cancel(); try { // wait the renewTask finish await renewTask; } catch (OperationCanceledException) { // ignore } } } } async Task RenewUntil(TaskActivityWorkItem workItem, CancellationToken cancellationToken) { try { if (workItem.LockedUntilUtc < DateTime.UtcNow) { return; } DateTime renewAt = workItem.LockedUntilUtc.Subtract(TimeSpan.FromSeconds(30)); // service bus clock sku can really mess us up so just always renew every 30 secs regardless of // what the message.LockedUntilUtc says. if the sku is negative then in the worst case we will be // renewing every 5 secs // renewAt = this.AdjustRenewAt(renewAt); while (!cancellationToken.IsCancellationRequested) { await Utils.DelayWithCancellation(TimeSpan.FromSeconds(5), cancellationToken); if (DateTime.UtcNow < renewAt || cancellationToken.IsCancellationRequested) { continue; } try { this.logHelper.RenewActivityMessageStarting(workItem); TraceHelper.Trace(TraceEventType.Information, "TaskActivityDispatcher-RenewLock", "Renewing lock for work item id {0}", workItem.Id); workItem = await this.orchestrationService.RenewTaskActivityWorkItemLockAsync(workItem); renewAt = workItem.LockedUntilUtc.Subtract(TimeSpan.FromSeconds(30)); renewAt = this.AdjustRenewAt(renewAt); this.logHelper.RenewActivityMessageCompleted(workItem, renewAt); TraceHelper.Trace(TraceEventType.Information, "TaskActivityDispatcher-RenewLockAt", "Next renew for work item id '{0}' at '{1}'", workItem.Id, renewAt); } catch (Exception exception) when (!Utils.IsFatal(exception)) { // might have been completed this.logHelper.RenewActivityMessageFailed(workItem, exception); TraceHelper.TraceException(TraceEventType.Warning, "TaskActivityDispatcher-RenewLockFailure", exception, "Failed to renew lock for work item {0}", workItem.Id); break; } } } catch (OperationCanceledException) { // cancellation was triggered } catch (ObjectDisposedException) { // brokered message is already disposed probably through // a complete call in the main dispatcher thread } } DateTime AdjustRenewAt(DateTime renewAt) { DateTime maxRenewAt = DateTime.UtcNow.Add(TimeSpan.FromSeconds(30)); return renewAt > maxRenewAt ? maxRenewAt : renewAt; } } }
Azure/durabletask
src/DurableTask.Core/TaskActivityDispatcher.cs
C#
apache-2.0
16,780
/** * Copyright (C) 2015 Etaia AS (oss@hubrick.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.hubrick.vertx.rest.rx2; /** * @author Emir Dizdarevic * @since 3.0.0 */ public interface Action1<T> { void call(T t); }
hubrick/vertx-rest-client
src/main/java/com/hubrick/vertx/rest/rx2/Action1.java
Java
apache-2.0
759
/* * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at * http://creativecommons.org/publicdomain/zero/1.0/ */ package org.elasticsearch.common.util.concurrent.jsr166e; import java.util.concurrent.atomic.AtomicLong; import java.io.IOException; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; /** * One or more variables that together maintain an initially zero * {@code long} sum. When updates (method {@link #add}) are contended * across threads, the set of variables may grow dynamically to reduce * contention. Method {@link #sum} (or, equivalently, {@link * #longValue}) returns the current total combined across the * variables maintaining the sum. * * <p> This class is usually preferable to {@link AtomicLong} when * multiple threads update a common sum that is used for purposes such * as collecting statistics, not for fine-grained synchronization * control. Under low update contention, the two classes have similar * characteristics. But under high contention, expected throughput of * this class is significantly higher, at the expense of higher space * consumption. * * <p>This class extends {@link Number}, but does <em>not</em> define * methods such as {@code hashCode} and {@code compareTo} because * instances are expected to be mutated, and so are not useful as * collection keys. * * <p><em>jsr166e note: This class is targeted to be placed in * java.util.concurrent.atomic<em> * * @since 1.8 * @author Doug Lea */ public class LongAdder extends Striped64 implements Serializable { private static final long serialVersionUID = 7249069246863182397L; /** * Version of plus for use in retryUpdate */ final long fn(long v, long x) { return v + x; } /** * Creates a new adder with initial sum of zero. */ public LongAdder() { } /** * Adds the given value. * * @param x the value to add */ public void add(long x) { Cell[] as; long b, v; HashCode hc; Cell a; int n; if ((as = cells) != null || !casBase(b = base, b + x)) { boolean uncontended = true; int h = (hc = threadHashCode.get()).code; if (as == null || (n = as.length) < 1 || (a = as[(n - 1) & h]) == null || !(uncontended = a.cas(v = a.value, v + x))) retryUpdate(x, hc, uncontended); } } /** * Equivalent to {@code add(1)}. */ public void increment() { add(1L); } /** * Equivalent to {@code add(-1)}. */ public void decrement() { add(-1L); } /** * Returns the current sum. The returned value is <em>NOT</em> an * atomic snapshot: Invocation in the absence of concurrent * updates returns an accurate result, but concurrent updates that * occur while the sum is being calculated might not be * incorporated. * * @return the sum */ public long sum() { long sum = base; Cell[] as = cells; if (as != null) { int n = as.length; for (int i = 0; i < n; ++i) { Cell a = as[i]; if (a != null) sum += a.value; } } return sum; } /** * Resets variables maintaining the sum to zero. This method may * be a useful alternative to creating a new adder, but is only * effective if there are no concurrent updates. Because this * method is intrinsically racy, it should only be used when it is * known that no threads are concurrently updating. */ public void reset() { internalReset(0L); } /** * Equivalent in effect to {@link #sum} followed by {@link * #reset}. This method may apply for example during quiescent * points between multithreaded computations. If there are * updates concurrent with this method, the returned value is * <em>not</em> guaranteed to be the final value occurring before * the reset. * * @return the sum */ public long sumThenReset() { long sum = base; Cell[] as = cells; base = 0L; if (as != null) { int n = as.length; for (int i = 0; i < n; ++i) { Cell a = as[i]; if (a != null) { sum += a.value; a.value = 0L; } } } return sum; } /** * Returns the String representation of the {@link #sum}. * @return the String representation of the {@link #sum} */ public String toString() { return Long.toString(sum()); } /** * Equivalent to {@link #sum}. * * @return the sum */ public long longValue() { return sum(); } /** * Returns the {@link #sum} as an {@code int} after a narrowing * primitive conversion. */ public int intValue() { return (int)sum(); } /** * Returns the {@link #sum} as a {@code float} * after a widening primitive conversion. */ public float floatValue() { return (float)sum(); } /** * Returns the {@link #sum} as a {@code double} after a widening * primitive conversion. */ public double doubleValue() { return (double)sum(); } private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException { s.defaultWriteObject(); s.writeLong(sum()); } private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); busy = 0; cells = null; base = s.readLong(); } }
jprante/elasticsearch-client
elasticsearch-transport/src/main/java/org/elasticsearch/common/util/concurrent/jsr166e/LongAdder.java
Java
apache-2.0
5,864
# Cocconeis minuta (Cleve) Cleve SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Bacillariophyta/Bacillariophyceae/Acnanthales/Cocconeidaceae/Cocconeis/Cocconeis minuta/README.md
Markdown
apache-2.0
188
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # from collections import OrderedDict import os import re from typing import Dict, Optional, Sequence, Tuple, Type, Union from google.api_core import client_options as client_options_lib from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore from google.ads.googleads.v9.resources.types import account_budget_proposal from google.ads.googleads.v9.services.types import ( account_budget_proposal_service, ) from .transports.base import ( AccountBudgetProposalServiceTransport, DEFAULT_CLIENT_INFO, ) from .transports.grpc import AccountBudgetProposalServiceGrpcTransport class AccountBudgetProposalServiceClientMeta(type): """Metaclass for the AccountBudgetProposalService client. This provides class-level methods for building and retrieving support objects (e.g. transport) without polluting the client instance objects. """ _transport_registry = ( OrderedDict() ) # type: Dict[str, Type[AccountBudgetProposalServiceTransport]] _transport_registry["grpc"] = AccountBudgetProposalServiceGrpcTransport def get_transport_class( cls, label: str = None, ) -> Type[AccountBudgetProposalServiceTransport]: """Return an appropriate transport class. Args: label: The name of the desired transport. If none is provided, then the first transport in the registry is used. Returns: The transport class to use. """ # If a specific transport is requested, return that one. if label: return cls._transport_registry[label] # No transport is requested; return the default (that is, the first one # in the dictionary). return next(iter(cls._transport_registry.values())) class AccountBudgetProposalServiceClient( metaclass=AccountBudgetProposalServiceClientMeta ): """A service for managing account-level budgets via proposals. A proposal is a request to create a new budget or make changes to an existing one. Reads for account-level budgets managed by these proposals will be supported in a future version. Until then, please use the BudgetOrderService from the AdWords API. Learn more at https://developers.google.com/adwords/api/docs/guides/budget- order Mutates: The CREATE operation creates a new proposal. UPDATE operations aren't supported. The REMOVE operation cancels a pending proposal. """ @staticmethod def _get_default_mtls_endpoint(api_endpoint): """Convert api endpoint to mTLS endpoint. Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to "*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively. Args: api_endpoint (Optional[str]): the api endpoint to convert. Returns: str: converted mTLS api endpoint. """ if not api_endpoint: return api_endpoint mtls_endpoint_re = re.compile( r"(?P<name>[^.]+)(?P<mtls>\.mtls)?(?P<sandbox>\.sandbox)?(?P<googledomain>\.googleapis\.com)?" ) m = mtls_endpoint_re.match(api_endpoint) name, mtls, sandbox, googledomain = m.groups() if mtls or not googledomain: return api_endpoint if sandbox: return api_endpoint.replace( "sandbox.googleapis.com", "mtls.sandbox.googleapis.com" ) return api_endpoint.replace(".googleapis.com", ".mtls.googleapis.com") DEFAULT_ENDPOINT = "googleads.googleapis.com" DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore DEFAULT_ENDPOINT ) @classmethod def from_service_account_info(cls, info: dict, *args, **kwargs): """Creates an instance of this client using the provided credentials info. Args: info (dict): The service account private key info. args: Additional arguments to pass to the constructor. kwargs: Additional arguments to pass to the constructor. Returns: AccountBudgetProposalServiceClient: The constructed client. """ credentials = service_account.Credentials.from_service_account_info( info ) kwargs["credentials"] = credentials return cls(*args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): """Creates an instance of this client using the provided credentials file. Args: filename (str): The path to the service account private key json file. args: Additional arguments to pass to the constructor. kwargs: Additional arguments to pass to the constructor. Returns: AccountBudgetProposalServiceClient: The constructed client. """ credentials = service_account.Credentials.from_service_account_file( filename ) kwargs["credentials"] = credentials return cls(*args, **kwargs) from_service_account_json = from_service_account_file @property def transport(self) -> AccountBudgetProposalServiceTransport: """Return the transport used by the client instance. Returns: AccountBudgetProposalServiceTransport: The transport used by the client instance. """ return self._transport def __enter__(self): return self def __exit__(self, type, value, traceback): """Releases underlying transport's resources. .. warning:: ONLY use as a context manager if the transport is NOT shared with other clients! Exiting the with block will CLOSE the transport and may cause errors in other clients! """ self.transport.close() @staticmethod def account_budget_path(customer_id: str, account_budget_id: str,) -> str: """Return a fully-qualified account_budget string.""" return "customers/{customer_id}/accountBudgets/{account_budget_id}".format( customer_id=customer_id, account_budget_id=account_budget_id, ) @staticmethod def parse_account_budget_path(path: str) -> Dict[str, str]: """Parse a account_budget path into its component segments.""" m = re.match( r"^customers/(?P<customer_id>.+?)/accountBudgets/(?P<account_budget_id>.+?)$", path, ) return m.groupdict() if m else {} @staticmethod def account_budget_proposal_path( customer_id: str, account_budget_proposal_id: str, ) -> str: """Return a fully-qualified account_budget_proposal string.""" return "customers/{customer_id}/accountBudgetProposals/{account_budget_proposal_id}".format( customer_id=customer_id, account_budget_proposal_id=account_budget_proposal_id, ) @staticmethod def parse_account_budget_proposal_path(path: str) -> Dict[str, str]: """Parse a account_budget_proposal path into its component segments.""" m = re.match( r"^customers/(?P<customer_id>.+?)/accountBudgetProposals/(?P<account_budget_proposal_id>.+?)$", path, ) return m.groupdict() if m else {} @staticmethod def billing_setup_path(customer_id: str, billing_setup_id: str,) -> str: """Return a fully-qualified billing_setup string.""" return "customers/{customer_id}/billingSetups/{billing_setup_id}".format( customer_id=customer_id, billing_setup_id=billing_setup_id, ) @staticmethod def parse_billing_setup_path(path: str) -> Dict[str, str]: """Parse a billing_setup path into its component segments.""" m = re.match( r"^customers/(?P<customer_id>.+?)/billingSetups/(?P<billing_setup_id>.+?)$", path, ) return m.groupdict() if m else {} @staticmethod def common_billing_account_path(billing_account: str,) -> str: """Return a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @staticmethod def parse_common_billing_account_path(path: str) -> Dict[str, str]: """Parse a billing_account path into its component segments.""" m = re.match(r"^billingAccounts/(?P<billing_account>.+?)$", path) return m.groupdict() if m else {} @staticmethod def common_folder_path(folder: str,) -> str: """Return a fully-qualified folder string.""" return "folders/{folder}".format(folder=folder,) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: """Parse a folder path into its component segments.""" m = re.match(r"^folders/(?P<folder>.+?)$", path) return m.groupdict() if m else {} @staticmethod def common_organization_path(organization: str,) -> str: """Return a fully-qualified organization string.""" return "organizations/{organization}".format(organization=organization,) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: """Parse a organization path into its component segments.""" m = re.match(r"^organizations/(?P<organization>.+?)$", path) return m.groupdict() if m else {} @staticmethod def common_project_path(project: str,) -> str: """Return a fully-qualified project string.""" return "projects/{project}".format(project=project,) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: """Parse a project path into its component segments.""" m = re.match(r"^projects/(?P<project>.+?)$", path) return m.groupdict() if m else {} @staticmethod def common_location_path(project: str, location: str,) -> str: """Return a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( project=project, location=location, ) @staticmethod def parse_common_location_path(path: str) -> Dict[str, str]: """Parse a location path into its component segments.""" m = re.match( r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)$", path ) return m.groupdict() if m else {} def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, transport: Union[ str, AccountBudgetProposalServiceTransport, None ] = None, client_options: Optional[client_options_lib.ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiate the account budget proposal service client. Args: credentials (Optional[google.auth.credentials.Credentials]): The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment. transport (Union[str, ~.AccountBudgetProposalServiceTransport]): The transport to use. If set to None, a transport is chosen automatically. client_options (google.api_core.client_options.ClientOptions): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT environment variable can also be used to override the endpoint: "always" (always use the default mTLS endpoint), "never" (always use the default regular endpoint) and "auto" (auto switch to the default mTLS endpoint if client certificate is present, this is the default value). However, the ``api_endpoint`` property takes precedence if provided. (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "true", then the ``client_cert_source`` property can be used to provide client certificate for mutual TLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not set, no client certificate will be used. client_info (google.api_core.gapic_v1.client_info.ClientInfo): The client info used to send a user-agent string along with API requests. If ``None``, then default info will be used. Generally, you only need to set this if you're developing your own client library. Raises: google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport creation failed for any reason. """ if isinstance(client_options, dict): client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() # Create SSL credentials for mutual TLS if needed. if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in ( "true", "false", ): raise ValueError( "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" ) use_client_cert = ( os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true" ) ssl_credentials = None is_mtls = False if use_client_cert: if client_options.client_cert_source: import grpc # type: ignore cert, key = client_options.client_cert_source() ssl_credentials = grpc.ssl_channel_credentials( certificate_chain=cert, private_key=key ) is_mtls = True else: creds = SslCredentials() is_mtls = creds.is_mtls ssl_credentials = creds.ssl_credentials if is_mtls else None # Figure out which api endpoint to use. if client_options.api_endpoint is not None: api_endpoint = client_options.api_endpoint else: use_mtls_env = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") if use_mtls_env == "never": api_endpoint = self.DEFAULT_ENDPOINT elif use_mtls_env == "always": api_endpoint = self.DEFAULT_MTLS_ENDPOINT elif use_mtls_env == "auto": api_endpoint = ( self.DEFAULT_MTLS_ENDPOINT if is_mtls else self.DEFAULT_ENDPOINT ) else: raise MutualTLSChannelError( "Unsupported GOOGLE_API_USE_MTLS_ENDPOINT value. Accepted values: never, auto, always" ) # Save or instantiate the transport. # Ordinarily, we provide the transport, but allowing a custom transport # instance provides an extensibility point for unusual situations. if isinstance(transport, AccountBudgetProposalServiceTransport): # transport is a AccountBudgetProposalServiceTransport instance. if credentials: raise ValueError( "When providing a transport instance, " "provide its credentials directly." ) self._transport = transport elif isinstance(transport, str): Transport = type(self).get_transport_class(transport) self._transport = Transport( credentials=credentials, host=self.DEFAULT_ENDPOINT ) else: self._transport = AccountBudgetProposalServiceGrpcTransport( credentials=credentials, host=api_endpoint, ssl_channel_credentials=ssl_credentials, client_info=client_info, ) def get_account_budget_proposal( self, request: Union[ account_budget_proposal_service.GetAccountBudgetProposalRequest, dict, ] = None, *, resource_name: str = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> account_budget_proposal.AccountBudgetProposal: r"""Returns an account-level budget proposal in full detail. List of thrown errors: `AuthenticationError <>`__ `AuthorizationError <>`__ `HeaderError <>`__ `InternalError <>`__ `QuotaError <>`__ `RequestError <>`__ Args: request (Union[google.ads.googleads.v9.services.types.GetAccountBudgetProposalRequest, dict]): The request object. Request message for [AccountBudgetProposalService.GetAccountBudgetProposal][google.ads.googleads.v9.services.AccountBudgetProposalService.GetAccountBudgetProposal]. resource_name (:class:`str`): Required. The resource name of the account-level budget proposal to fetch. This corresponds to the ``resource_name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.ads.googleads.v9.resources.types.AccountBudgetProposal: An account-level budget proposal. All fields prefixed with 'proposed' may not necessarily be applied directly. For example, proposed spending limits may be adjusted before their application. This is true if the 'proposed' field has an 'approved' counterpart, e.g. spending limits. Please note that the proposal type (proposal_type) changes which fields are required and which must remain empty. """ # Create or coerce a protobuf request object. # Sanity check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. if request is not None and any([resource_name]): raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a account_budget_proposal_service.GetAccountBudgetProposalRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance( request, account_budget_proposal_service.GetAccountBudgetProposalRequest, ): request = account_budget_proposal_service.GetAccountBudgetProposalRequest( request ) # If we have keyword arguments corresponding to fields on the # request, apply these. if resource_name is not None: request.resource_name = resource_name # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[ self._transport.get_account_budget_proposal ] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata( (("resource_name", request.resource_name),) ), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. return response def mutate_account_budget_proposal( self, request: Union[ account_budget_proposal_service.MutateAccountBudgetProposalRequest, dict, ] = None, *, customer_id: str = None, operation: account_budget_proposal_service.AccountBudgetProposalOperation = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> account_budget_proposal_service.MutateAccountBudgetProposalResponse: r"""Creates, updates, or removes account budget proposals. Operation statuses are returned. List of thrown errors: `AccountBudgetProposalError <>`__ `AuthenticationError <>`__ `AuthorizationError <>`__ `DatabaseError <>`__ `DateError <>`__ `FieldError <>`__ `FieldMaskError <>`__ `HeaderError <>`__ `InternalError <>`__ `MutateError <>`__ `QuotaError <>`__ `RequestError <>`__ `StringLengthError <>`__ Args: request (Union[google.ads.googleads.v9.services.types.MutateAccountBudgetProposalRequest, dict]): The request object. Request message for [AccountBudgetProposalService.MutateAccountBudgetProposal][google.ads.googleads.v9.services.AccountBudgetProposalService.MutateAccountBudgetProposal]. customer_id (:class:`str`): Required. The ID of the customer. This corresponds to the ``customer_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. operation (:class:`google.ads.googleads.v9.services.types.AccountBudgetProposalOperation`): Required. The operation to perform on an individual account-level budget proposal. This corresponds to the ``operation`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.ads.googleads.v9.services.types.MutateAccountBudgetProposalResponse: Response message for account-level budget mutate operations. """ # Create or coerce a protobuf request object. # Sanity check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. if request is not None and any([customer_id, operation]): raise ValueError( "If the `request` argument is set, then none of " "the individual field arguments should be set." ) # Minor optimization to avoid making a copy if the user passes # in a account_budget_proposal_service.MutateAccountBudgetProposalRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance( request, account_budget_proposal_service.MutateAccountBudgetProposalRequest, ): request = account_budget_proposal_service.MutateAccountBudgetProposalRequest( request ) # If we have keyword arguments corresponding to fields on the # request, apply these. if customer_id is not None: request.customer_id = customer_id if operation is not None: request.operation = operation # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[ self._transport.mutate_account_budget_proposal ] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + ( gapic_v1.routing_header.to_grpc_metadata( (("customer_id", request.customer_id),) ), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. return response __all__ = ("AccountBudgetProposalServiceClient",)
googleads/google-ads-python
google/ads/googleads/v9/services/services/account_budget_proposal_service/client.py
Python
apache-2.0
26,197
using System; namespace Railgun.Common.Chat.Events { public class ChatEvent : IEquatable<ChatEvent> { public uint Id { get; set; } public DateTime Date { get; protected set; } = DateTime.Now; public event Action<ChatEventUpdateInfo> OnUpdate; public bool Equals(ChatEvent other) => other != null && other.Id == Id; protected void InvokeOnUpdate(ChatEventUpdateInfo info) => OnUpdate?.Invoke(info); public override string ToString() { return GetType().Name + " " + Id + " <" + Date + ">"; } } }
flashwave/railgun
Railgun.Common/Chat/Events/ChatEvent.cs
C#
apache-2.0
602
// Code generated by go-swagger; DO NOT EDIT. package store // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command import ( "net/http" "github.com/go-openapi/runtime/middleware" ) // PlaceOrderHandlerFunc turns a function with the right signature into a place order handler type PlaceOrderHandlerFunc func(PlaceOrderParams) middleware.Responder // Handle executing the request and returning a response func (fn PlaceOrderHandlerFunc) Handle(params PlaceOrderParams) middleware.Responder { return fn(params) } // PlaceOrderHandler interface for that can handle valid place order params type PlaceOrderHandler interface { Handle(PlaceOrderParams) middleware.Responder } // NewPlaceOrder creates a new http.Handler for the place order operation func NewPlaceOrder(ctx *middleware.Context, handler PlaceOrderHandler) *PlaceOrder { return &PlaceOrder{Context: ctx, Handler: handler} } /* PlaceOrder swagger:route POST /stores/order store placeOrder Place an order for a pet */ type PlaceOrder struct { Context *middleware.Context Handler PlaceOrderHandler } func (o *PlaceOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { *r = *rCtx } var Params = NewPlaceOrderParams() if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params o.Context.Respond(rw, r, route.Produces, route, err) return } res := o.Handler.Handle(Params) // actually handle the request o.Context.Respond(rw, r, route.Produces, route, res) }
go-swagger/go-swagger
examples/generated/restapi/operations/store/place_order.go
GO
apache-2.0
1,603
# Hieracium pulverosiceps Omang SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Hieracium/Hieracium pulverosiceps/README.md
Markdown
apache-2.0
179
package com.hazelcast.aggregation; public final class TimeoutInMillis { private TimeoutInMillis() { } public static final long MINUTE = 60 * 1000; }
lmjacksoniii/hazelcast
hazelcast/src/test/java/com/hazelcast/aggregation/TimeoutInMillis.java
Java
apache-2.0
164
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_112) on Mon May 01 08:43:55 MST 2017 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Class org.wildfly.swarm.config.Datasources.DatasourcesResources (Public javadocs 2017.5.0 API)</title> <meta name="date" content="2017-05-01"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.wildfly.swarm.config.Datasources.DatasourcesResources (Public javadocs 2017.5.0 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/wildfly/swarm/config/Datasources.DatasourcesResources.html" title="class in org.wildfly.swarm.config">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2017.5.0</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/class-use/Datasources.DatasourcesResources.html" target="_top">Frames</a></li> <li><a href="Datasources.DatasourcesResources.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.wildfly.swarm.config.Datasources.DatasourcesResources" class="title">Uses of Class<br>org.wildfly.swarm.config.Datasources.DatasourcesResources</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../org/wildfly/swarm/config/Datasources.DatasourcesResources.html" title="class in org.wildfly.swarm.config">Datasources.DatasourcesResources</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config">org.wildfly.swarm.config</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.wildfly.swarm.config"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/wildfly/swarm/config/Datasources.DatasourcesResources.html" title="class in org.wildfly.swarm.config">Datasources.DatasourcesResources</a> in <a href="../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a> that return <a href="../../../../../org/wildfly/swarm/config/Datasources.DatasourcesResources.html" title="class in org.wildfly.swarm.config">Datasources.DatasourcesResources</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/wildfly/swarm/config/Datasources.DatasourcesResources.html" title="class in org.wildfly.swarm.config">Datasources.DatasourcesResources</a></code></td> <td class="colLast"><span class="typeNameLabel">Datasources.</span><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/config/Datasources.html#subresources--">subresources</a></span>()</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/wildfly/swarm/config/Datasources.DatasourcesResources.html" title="class in org.wildfly.swarm.config">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2017.5.0</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/class-use/Datasources.DatasourcesResources.html" target="_top">Frames</a></li> <li><a href="Datasources.DatasourcesResources.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2017 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
wildfly-swarm/wildfly-swarm-javadocs
2017.5.0/apidocs/org/wildfly/swarm/config/class-use/Datasources.DatasourcesResources.html
HTML
apache-2.0
7,177
package com.jukusoft.jbackendengine.example.localsessionstore; import com.jukusoft.jbackendengine.backendengine.IEditableBackendEngine; import com.jukusoft.jbackendengine.backendengine.factory.BackendEngineFactory; import com.jukusoft.jbackendengine.backendengine.sessionstore.ISession; import com.jukusoft.jbackendengine.backendengine.sessionstore.ISessionStore; import com.jukusoft.jbackendengine.backendengine.sessionstore.exception.SessionNotFoundException; /** * Created by Justin on 10.07.2015. */ public class ExampleMain { public static void main (String[] args) { //create a new backend engine instance IEditableBackendEngine backendEngine = BackendEngineFactory.createNewDefaultBackendEngine(); //get session store ISessionStore sessionStore = backendEngine.getSessionStore(); //create new session ISession session = sessionStore.createNewSession(); //you can add data to session session.putData("userID", 1l + ""); //you have to commit data to write changes session.commitData(); //get userID Long userID = Long.parseLong(session.getData("userID")); //inserted date in ms Long insertedDate = session.getInsertedDate(); //get session key String sessionKey = session.getSessionKey(); /* * You can also get a session by session key */ try { ISession session1 = sessionStore.getSession("session-key"); } catch (SessionNotFoundException e) { backendEngine.getLoggerManager().warn("Couldnt found session with session key " + sessionKey + "."); } //remove session sessionStore.removeSession("session-key"); } }
JuKu/JBackendEngine
examples/localsessionstore/src/main/java/com/jukusoft/jbackendengine/example/localsessionstore/ExampleMain.java
Java
apache-2.0
1,754
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014-2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from __future__ import absolute_import, division, print_function, \ with_statement import sys import os import socket import struct import re import logging from shadowsocks import common, lru_cache, eventloop, shell CACHE_SWEEP_INTERVAL = 30 VALID_HOSTNAME = re.compile(br"(?!-)[_A-Z\d-]{1,63}(?<!-)$", re.IGNORECASE) common.patch_socket() # rfc1035 # format # +---------------------+ # | Header | # +---------------------+ # | Question | the question for the name server # +---------------------+ # | Answer | RRs answering the question # +---------------------+ # | Authority | RRs pointing toward an authority # +---------------------+ # | Additional | RRs holding additional information # +---------------------+ # # header # 1 1 1 1 1 1 # 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 # +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ # | ID | # +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ # |QR| Opcode |AA|TC|RD|RA| Z | RCODE | # +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ # | QDCOUNT | # +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ # | ANCOUNT | # +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ # | NSCOUNT | # +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ # | ARCOUNT | # +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ QTYPE_ANY = 255 QTYPE_A = 1 QTYPE_AAAA = 28 QTYPE_CNAME = 5 QTYPE_NS = 2 QCLASS_IN = 1 def build_address(address): address = address.strip(b'.') labels = address.split(b'.') results = [] for label in labels: l = len(label) if l > 63: return None results.append(common.chr(l)) results.append(label) results.append(b'\0') return b''.join(results) def build_request(address, qtype): request_id = os.urandom(2) header = struct.pack('!BBHHHH', 1, 0, 1, 0, 0, 0) addr = build_address(address) qtype_qclass = struct.pack('!HH', qtype, QCLASS_IN) return request_id + header + addr + qtype_qclass def parse_ip(addrtype, data, length, offset): if addrtype == QTYPE_A: return socket.inet_ntop(socket.AF_INET, data[offset:offset + length]) elif addrtype == QTYPE_AAAA: return socket.inet_ntop(socket.AF_INET6, data[offset:offset + length]) elif addrtype in [QTYPE_CNAME, QTYPE_NS]: return parse_name(data, offset)[1] else: return data[offset:offset + length] def parse_name(data, offset): p = offset labels = [] l = common.ord(data[p]) while l > 0: if (l & (128 + 64)) == (128 + 64): # pointer pointer = struct.unpack('!H', data[p:p + 2])[0] pointer &= 0x3FFF r = parse_name(data, pointer) labels.append(r[1]) p += 2 # pointer is the end return p - offset, b'.'.join(labels) else: labels.append(data[p + 1:p + 1 + l]) p += 1 + l l = common.ord(data[p]) return p - offset + 1, b'.'.join(labels) # rfc1035 # record # 1 1 1 1 1 1 # 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 # +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ # | | # / / # / NAME / # | | # +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ # | TYPE | # +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ # | CLASS | # +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ # | TTL | # | | # +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ # | RDLENGTH | # +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--| # / RDATA / # / / # +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ def parse_record(data, offset, question=False): nlen, name = parse_name(data, offset) if not question: record_type, record_class, record_ttl, record_rdlength = struct.unpack( '!HHiH', data[offset + nlen:offset + nlen + 10] ) ip = parse_ip(record_type, data, record_rdlength, offset + nlen + 10) return nlen + 10 + record_rdlength, \ (name, ip, record_type, record_class, record_ttl) else: record_type, record_class = struct.unpack( '!HH', data[offset + nlen:offset + nlen + 4] ) return nlen + 4, (name, None, record_type, record_class, None, None) def parse_header(data): if len(data) >= 12: header = struct.unpack('!HBBHHHH', data[:12]) res_id = header[0] res_qr = header[1] & 128 res_tc = header[1] & 2 res_ra = header[2] & 128 res_rcode = header[2] & 15 # assert res_tc == 0 # assert res_rcode in [0, 3] res_qdcount = header[3] res_ancount = header[4] res_nscount = header[5] res_arcount = header[6] return (res_id, res_qr, res_tc, res_ra, res_rcode, res_qdcount, res_ancount, res_nscount, res_arcount) return None def parse_response(data): try: if len(data) >= 12: header = parse_header(data) if not header: return None res_id, res_qr, res_tc, res_ra, res_rcode, res_qdcount, \ res_ancount, res_nscount, res_arcount = header qds = [] ans = [] offset = 12 for i in range(0, res_qdcount): l, r = parse_record(data, offset, True) offset += l if r: qds.append(r) for i in range(0, res_ancount): l, r = parse_record(data, offset) offset += l if r: ans.append(r) for i in range(0, res_nscount): l, r = parse_record(data, offset) offset += l for i in range(0, res_arcount): l, r = parse_record(data, offset) offset += l response = DNSResponse() if qds: response.hostname = qds[0][0] for an in qds: response.questions.append((an[1], an[2], an[3])) for an in ans: response.answers.append((an[1], an[2], an[3])) return response except Exception as e: shell.print_exception(e) return None def is_valid_hostname(hostname): if len(hostname) > 255: return False if hostname[-1] == b'.': hostname = hostname[:-1] return all(VALID_HOSTNAME.match(x) for x in hostname.split(b'.')) class DNSResponse(object): def __init__(self): self.hostname = None self.questions = [] # each: (addr, type, class) self.answers = [] # each: (addr, type, class) def __str__(self): return '%s: %s' % (self.hostname, str(self.answers)) STATUS_FIRST = 0 STATUS_SECOND = 1 class DNSResolver(object): def __init__(self, server_list=None, prefer_ipv6=False): self._loop = None self._hosts = {} self._hostname_status = {} self._hostname_to_cb = {} self._cb_to_hostname = {} self._cache = lru_cache.LRUCache(timeout=300) self._sock = None if server_list is None: self._servers = None self._parse_resolv() else: self._servers = server_list if prefer_ipv6: self._QTYPES = [QTYPE_AAAA, QTYPE_A] else: self._QTYPES = [QTYPE_A, QTYPE_AAAA] self._parse_hosts() # TODO monitor hosts change and reload hosts # TODO parse /etc/gai.conf and follow its rules def _parse_resolv(self): self._servers = [] try: with open('/etc/resolv.conf', 'rb') as f: content = f.readlines() for line in content: line = line.strip() if not (line and line.startswith(b'nameserver')): continue parts = line.split() if len(parts) < 2: continue server = parts[1] if common.is_ip(server) == socket.AF_INET: if type(server) != str: server = server.decode('utf8') self._servers.append(server) except IOError: pass if not self._servers: self._servers = ['8.8.4.4', '8.8.8.8'] def _parse_hosts(self): etc_path = '/etc/hosts' if 'WINDIR' in os.environ: etc_path = os.environ['WINDIR'] + '/system32/drivers/etc/hosts' try: with open(etc_path, 'rb') as f: for line in f.readlines(): line = line.strip() parts = line.split() if len(parts) < 2: continue ip = parts[0] if not common.is_ip(ip): continue for i in range(1, len(parts)): hostname = parts[i] if hostname: self._hosts[hostname] = ip except IOError: self._hosts['localhost'] = '127.0.0.1' def add_to_loop(self, loop): if self._loop: raise Exception('already add to loop') self._loop = loop # TODO when dns server is IPv6 self._sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.SOL_UDP) self._sock.setblocking(False) loop.add(self._sock, eventloop.POLL_IN, self) loop.add_periodic(self.handle_periodic) def _call_callback(self, hostname, ip, error=None): callbacks = self._hostname_to_cb.get(hostname, []) for callback in callbacks: if callback in self._cb_to_hostname: del self._cb_to_hostname[callback] if ip or error: callback((hostname, ip), error) else: callback((hostname, None), Exception('unknown hostname %s' % hostname)) if hostname in self._hostname_to_cb: del self._hostname_to_cb[hostname] if hostname in self._hostname_status: del self._hostname_status[hostname] def _handle_data(self, data): response = parse_response(data) if response and response.hostname: hostname = response.hostname ip = None for answer in response.answers: if answer[1] in (QTYPE_A, QTYPE_AAAA) and \ answer[2] == QCLASS_IN: ip = answer[0] break if not ip and self._hostname_status.get(hostname, STATUS_SECOND) \ == STATUS_FIRST: self._hostname_status[hostname] = STATUS_SECOND self._send_req(hostname, self._QTYPES[1]) else: if ip: self._cache[hostname] = ip self._call_callback(hostname, ip) elif self._hostname_status.get(hostname, None) \ == STATUS_SECOND: for question in response.questions: if question[1] == self._QTYPES[1]: self._call_callback(hostname, None) break def handle_event(self, sock, fd, event): if sock != self._sock: return if event & eventloop.POLL_ERR: logging.error('dns socket err') self._loop.remove(self._sock) self._sock.close() # TODO when dns server is IPv6 self._sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.SOL_UDP) self._sock.setblocking(False) self._loop.add(self._sock, eventloop.POLL_IN, self) else: data, addr = sock.recvfrom(1024) if addr[0] not in self._servers: logging.warn('received a packet other than our dns') return self._handle_data(data) def handle_periodic(self): self._cache.sweep() def remove_callback(self, callback): hostname = self._cb_to_hostname.get(callback) if hostname: del self._cb_to_hostname[callback] arr = self._hostname_to_cb.get(hostname, None) if arr: arr.remove(callback) if not arr: del self._hostname_to_cb[hostname] if hostname in self._hostname_status: del self._hostname_status[hostname] def _send_req(self, hostname, qtype): req = build_request(hostname, qtype) for server in self._servers: logging.debug('resolving %s with type %d using server %s', hostname, qtype, server) self._sock.sendto(req, (server, 53)) def resolve(self, hostname, callback): if type(hostname) != bytes: hostname = hostname.encode('utf8') if not hostname: callback(None, Exception('empty hostname')) elif common.is_ip(hostname): callback((hostname, hostname), None) elif hostname in self._hosts: logging.debug('hit hosts: %s', hostname) ip = self._hosts[hostname] callback((hostname, ip), None) elif hostname in self._cache: logging.debug('hit cache: %s', hostname) ip = self._cache[hostname] callback((hostname, ip), None) else: if not is_valid_hostname(hostname): callback(None, Exception('invalid hostname: %s' % hostname)) return arr = self._hostname_to_cb.get(hostname, None) if not arr: self._hostname_status[hostname] = STATUS_FIRST self._send_req(hostname, self._QTYPES[0]) self._hostname_to_cb[hostname] = [callback] self._cb_to_hostname[callback] = hostname else: arr.append(callback) # TODO send again only if waited too long self._send_req(hostname, self._QTYPES[0]) def close(self): if self._sock: if self._loop: self._loop.remove_periodic(self.handle_periodic) self._loop.remove(self._sock) self._sock.close() self._sock = None def test(): dns_resolver = DNSResolver() loop = eventloop.EventLoop() dns_resolver.add_to_loop(loop) global counter counter = 0 def make_callback(): global counter def callback(result, error): global counter # TODO: what can we assert? print(result, error) counter += 1 if counter == 9: dns_resolver.close() loop.stop() a_callback = callback return a_callback assert(make_callback() != make_callback()) dns_resolver.resolve(b'google.com', make_callback()) dns_resolver.resolve('google.com', make_callback()) dns_resolver.resolve('example.com', make_callback()) dns_resolver.resolve('ipv6.google.com', make_callback()) dns_resolver.resolve('www.facebook.com', make_callback()) dns_resolver.resolve('ns2.google.com', make_callback()) dns_resolver.resolve('invalid.@!#$%^&$@.hostname', make_callback()) dns_resolver.resolve('toooooooooooooooooooooooooooooooooooooooooooooooooo' 'ooooooooooooooooooooooooooooooooooooooooooooooooooo' 'long.hostname', make_callback()) dns_resolver.resolve('toooooooooooooooooooooooooooooooooooooooooooooooooo' 'ooooooooooooooooooooooooooooooooooooooooooooooooooo' 'ooooooooooooooooooooooooooooooooooooooooooooooooooo' 'ooooooooooooooooooooooooooooooooooooooooooooooooooo' 'ooooooooooooooooooooooooooooooooooooooooooooooooooo' 'ooooooooooooooooooooooooooooooooooooooooooooooooooo' 'long.hostname', make_callback()) loop.run() if __name__ == '__main__': test()
plus1s/shadowsocks-py-mu
shadowsocks/asyncdns.py
Python
apache-2.0
17,651
/* * Copyright (c) 2013-2015 by appPlant UG. All rights reserved. * * @APPPLANT_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apache License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. Please obtain a copy of the License at * http://opensource.org/licenses/Apache-2.0/ and read it before using this * file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPPLANT_LICENSE_HEADER_END@ */ package de.appplant.cordova.plugin.notification; import android.content.Context; import android.content.res.AssetManager; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.media.RingtoneManager; import android.net.Uri; import android.os.StrictMode; import android.util.Log; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.util.UUID; /** * Util class to map unified asset URIs to native URIs. URIs like file:/// * map to absolute paths while file:// point relatively to the www folder * within the asset resources. And res:// means a resource from the native * res folder. Remote assets are accessible via http:// for example. */ class AssetUtil { // Name of the storage folder private static final String STORAGE_FOLDER = "/localnotification"; // Placeholder URI for default sound private static final String DEFAULT_SOUND = "res://platform_default"; // Ref to the context passed through the constructor to access the // resources and app directory. private final Context context; /** * Constructor * * @param context * Application context */ private AssetUtil(Context context) { this.context = context; } /** * Static method to retrieve class instance. * * @param context * Application context */ static AssetUtil getInstance(Context context) { return new AssetUtil(context); } /** * Parse path path to native URI. * * @param path * Path to path file */ Uri parseSound (String path) { if (path == null || path.isEmpty()) return Uri.EMPTY; if (path.equalsIgnoreCase(DEFAULT_SOUND)) { return RingtoneManager.getDefaultUri(RingtoneManager .TYPE_NOTIFICATION); } return parse(path); } /** * The URI for a path. * * @param path * The given path */ Uri parse (String path) { if (path.startsWith("res:")) { return getUriForResourcePath(path); } else if (path.startsWith("file:///")) { return getUriFromPath(path); } else if (path.startsWith("file://")) { return getUriFromAsset(path); } else if (path.startsWith("http")){ return getUriFromRemote(path); } return Uri.EMPTY; } /** * URI for a file. * * @param path * Absolute path like file:///... * * @return * URI pointing to the given path */ private Uri getUriFromPath(String path) { String absPath = path.replaceFirst("file://", ""); File file = new File(absPath); if (!file.exists()) { Log.e("Asset", "File not found: " + file.getAbsolutePath()); return Uri.EMPTY; } return Uri.fromFile(file); } /** * URI for an asset. * * @param path * Asset path like file://... * * @return * URI pointing to the given path */ private Uri getUriFromAsset(String path) { String resPath = path.replaceFirst("file:/", "www"); String fileName = resPath.substring(resPath.lastIndexOf('/') + 1); File file = getTmpFile(fileName); if (file == null) { Log.e("Asset", "Missing external cache dir"); return Uri.EMPTY; } try { AssetManager assets = context.getAssets(); FileOutputStream outStream = new FileOutputStream(file); InputStream inputStream = assets.open(resPath); copyFile(inputStream, outStream); outStream.flush(); outStream.close(); return Uri.fromFile(file); } catch (Exception e) { Log.e("Asset", "File not found: assets/" + resPath); e.printStackTrace(); } return Uri.EMPTY; } /** * The URI for a resource. * * @param path * The given relative path * * @return * URI pointing to the given path */ private Uri getUriForResourcePath(String path) { String resPath = path.replaceFirst("res://", ""); int resId = getResIdForDrawable(resPath); File file = getTmpFile(); if (resId == 0) { Log.e("Asset", "File not found: " + resPath); return Uri.EMPTY; } if (file == null) { Log.e("Asset", "Missing external cache dir"); return Uri.EMPTY; } try { Resources res = context.getResources(); FileOutputStream outStream = new FileOutputStream(file); InputStream inputStream = res.openRawResource(resId); copyFile(inputStream, outStream); outStream.flush(); outStream.close(); return Uri.fromFile(file); } catch (Exception e) { e.printStackTrace(); } return Uri.EMPTY; } /** * Uri from remote located content. * * @param path * Remote address * * @return * Uri of the downloaded file */ private Uri getUriFromRemote(String path) { File file = getTmpFile(); if (file == null) { Log.e("Asset", "Missing external cache dir"); return Uri.EMPTY; } try { URL url = new URL(path); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); connection.setRequestProperty("Connection", "close"); connection.setConnectTimeout(5000); connection.connect(); InputStream input = connection.getInputStream(); FileOutputStream outStream = new FileOutputStream(file); copyFile(input, outStream); outStream.flush(); outStream.close(); return Uri.fromFile(file); } catch (MalformedURLException e) { Log.e("Asset", "Incorrect URL"); e.printStackTrace(); } catch (FileNotFoundException e) { Log.e("Asset", "Failed to create new File from HTTP Content"); e.printStackTrace(); } catch (IOException e) { Log.e("Asset", "No Input can be created from http Stream"); e.printStackTrace(); } return Uri.EMPTY; } /** * Copy content from input stream into output stream. * * @param in * The input stream * @param out * The output stream */ private void copyFile(InputStream in, OutputStream out) throws IOException { byte[] buffer = new byte[1024]; int read; while ((read = in.read(buffer)) != -1) { out.write(buffer, 0, read); } } /** * Resource ID for drawable. * * @param resPath * Resource path as string */ int getResIdForDrawable(String resPath) { int resId = getResIdForDrawable(getPkgName(), resPath); if (resId == 0) { resId = getResIdForDrawable("android", resPath); } return resId; } /** * Resource ID for drawable. * * @param clsName * Relative package or global android name space * @param resPath * Resource path as string */ int getResIdForDrawable(String clsName, String resPath) { String drawable = getBaseName(resPath); int resId = 0; try { Class<?> cls = Class.forName(clsName + ".R$drawable"); resId = (Integer) cls.getDeclaredField(drawable).get(Integer.class); } catch (Exception ignore) {} return resId; } /** * Convert drawable resource to bitmap. * * @param drawable * Drawable resource name */ Bitmap getIconFromDrawable (String drawable) { Resources res = context.getResources(); int iconId; iconId = getResIdForDrawable(getPkgName(), drawable); if (iconId == 0) { iconId = getResIdForDrawable("android", drawable); } if (iconId == 0) { iconId = android.R.drawable.screen_background_dark_transparent; } return BitmapFactory.decodeResource(res, iconId); } /** * Convert URI to Bitmap. * * @param uri * Internal image URI */ Bitmap getIconFromUri (Uri uri) throws IOException { InputStream input = context.getContentResolver().openInputStream(uri); return BitmapFactory.decodeStream(input); } /** * Extract name of drawable resource from path. * * @param resPath * Resource path as string */ private String getBaseName (String resPath) { String drawable = resPath; if (drawable.contains("/")) { drawable = drawable.substring(drawable.lastIndexOf('/') + 1); } if (resPath.contains(".")) { drawable = drawable.substring(0, drawable.lastIndexOf('.')); } return drawable; } /** * Returns a file located under the external cache dir of that app. * * @return * File with a random UUID name */ private File getTmpFile () { // If random UUID is not be enough see // https://github.com/LukePulverenti/cordova-plugin-local-notifications/blob/267170db14044cbeff6f4c3c62d9b766b7a1dd62/src/android/notification/AssetUtil.java#L255 return getTmpFile(UUID.randomUUID().toString()); } /** * Returns a file located under the external cache dir of that app. * * @param name * The name of the file * @return * File with the provided name */ private File getTmpFile (String name) { File dir = context.getExternalCacheDir(); if (dir == null) { Log.e("Asset", "Missing external cache dir"); return null; } String storage = dir.toString() + STORAGE_FOLDER; //noinspection ResultOfMethodCallIgnored new File(storage).mkdir(); return new File(storage, name); } /** * Package name specified by context. */ private String getPkgName () { return context.getPackageName(); } }
nozelrosario/Dcare
plugins/de.appplant.cordova.plugin.local-notification/src/android/notification/AssetUtil.java
Java
apache-2.0
12,251
# AUTOGENERATED FILE FROM balenalib/aio-3288c-debian:bookworm-build RUN apt-get update \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ \ # .NET Core dependencies libc6 \ libgcc1 \ libgssapi-krb5-2 \ libicu67 \ libssl1.1 \ libstdc++6 \ zlib1g \ && rm -rf /var/lib/apt/lists/* # Configure web servers to bind to port 80 when present ENV ASPNETCORE_URLS=http://+:80 \ # Enable detection of running in a container DOTNET_RUNNING_IN_CONTAINER=true # Install .NET Core ENV DOTNET_VERSION 3.1.21 RUN curl -SL --output dotnet.tar.gz "https://dotnetcli.blob.core.windows.net/dotnet/Runtime/$DOTNET_VERSION/dotnet-runtime-$DOTNET_VERSION-linux-arm.tar.gz" \ && dotnet_sha512='9c3fb0f5f860f53ab4d15124c2c23a83412ea916ad6155c0f39f066057dcbb3ca6911ae26daf8a36dbfbc09c17d6565c425fbdf3db9114a28c66944382b71000' \ && echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ && mkdir -p /usr/share/dotnet \ && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \ && rm dotnet.tar.gz \ && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/44e597e40f2010cdde15b3ba1e397aea3a5c5271/scripts/assets/tests/test-stack@dotnet.sh" \ && echo "Running test-stack@dotnet" \ && chmod +x test-stack@dotnet.sh \ && bash test-stack@dotnet.sh \ && rm -rf test-stack@dotnet.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Debian Bookworm \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \ndotnet 3.1-runtime \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
resin-io-library/base-images
balena-base-images/dotnet/aio-3288c/debian/bookworm/3.1-runtime/build/Dockerfile
Dockerfile
apache-2.0
2,531
package com.gusteauscuter.youyanguan.activity; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.os.Bundle; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.view.MotionEvent; import android.view.View; import android.widget.TextView; import com.gusteauscuter.youyanguan.R; public class SplashActivity extends AppCompatActivity { private Handler handler = new Handler(); private Runnable runnable; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); setContentView(R.layout.activity_splash); PackageManager pm = getPackageManager(); try { PackageInfo pi = pm.getPackageInfo(this.getPackageName(), 0); TextView versionNumber = (TextView) findViewById(R.id.versionNumber); versionNumber.setText("Version: " + pi.versionName); } catch (Exception e) { e.printStackTrace(); } handler.postDelayed(runnable = new Runnable() { @Override public void run() { Intent intent = new Intent(SplashActivity.this, NavigationActivity.class); startActivity(intent); finish(); } }, 1600); } @Override public boolean onTouchEvent(MotionEvent event){ if(event.getAction()==MotionEvent.ACTION_UP){ Intent intent = new Intent(SplashActivity.this, NavigationActivity.class); startActivity(intent); finish(); if (runnable != null) handler.removeCallbacks(runnable); } return super.onTouchEvent(event); } }
GusteauScuter/youyanguan
app/src/main/java/com/gusteauscuter/youyanguan/activity/SplashActivity.java
Java
apache-2.0
1,868
/****************************************************************************** Slack integration *******************************************************************************/ 'use strict'; var _ = require('underscore'), request = require('request'), logger = require('../../server/logger'); var fruum_username = 'Fruum', fruum_icon_url = 'https://fruum.github.io/static/slack.png'; function Slack(options, instance) { // ---------------------------------- COMMANDS ------------------------------- // respond to /fruum slack command instance.server.post('/slack/:app_id', function(req, res) { var app_id = req.params.app_id, text = req.body.text, token = req.body.token; // get app instance.storage.get_app(app_id, function(application) { if (!application) { res.send('*Fruum:* Invalid app_id, check your slack integration'); return; } var app_token = application.getProperty('slack:command_token'); if (app_token && app_token != token) { res.send('*Fruum:* Permission denied, check your slack integration'); logger.error(app_id, 'slack_command_token_failed', { server_token: token, app_token: app_token, }); return; } if (!text) { var fullpage_url = application.get('fullpage_url'); if (!fullpage_url) { res.send('Setup a <https://fruum.github.io/#v/setting-up-full-page-forums|full page fruum> to enable all features'); } else { res.send('Click <' + fullpage_url + '|here> to open Fruum and share your thoughts'); } } else { // perform search instance.storage.search(app_id, { text: text, permission: 1 }, function(results) { if (!results.length) { res.send('*Fruum:* No search results'); return; } var response = 'Fruum search results for: *' + text + '*\n'; _.each(results, function(document) { var link = ''; if (document.get('type') == 'post') { link = application.getShareURL(document.get('parent')); } else { link = application.getShareURL(document.get('id')); } response += '<' + link + '|' + document.get('header') + '>\n'; }); res.send(response); }, { skipfields: ['attachments', 'body'], }); } }); }); // ---------------------------------- WEBHOOKS ------------------------------ // Report to slack when a new document has been added this.afterAdd = function(payload, callback) { // do not block operation callback(null, payload); // check if we have an outgoing webhook registered in the app var document = payload.document, app_id = payload.app_id; // skip chat messages if (document.get('parent_type') == 'channel') return; // get application instance instance.storage.get_app(app_id, function(application) { if (!application) return; var webhook = application.getProperty('slack:incoming_webhook'); if (!webhook) return; var pretext = document.get('user_displayname') || document.get('user_username'), link = ''; if (document.get('type') == 'post') { link = application.getShareURL(document.get('parent')); pretext += ' replied to ' + document.get('parent_type'); } else { link = application.getShareURL(document.get('id')); pretext += ' created new ' + document.get('type'); } var body = document.get('body') || ''; // remove images body = body.replace(/!\[.*?\)/g, ''); // extract links body = body.replace(/\[(.*)]\((.*)\)/, '$2'); var json_payload = { attachments: [{ pretext: pretext, title: document.get('header'), title_link: link, text: body, mrkdwn_in: ['text', 'pretext'], }], }; // add bot details if (!application.getProperty('slack:custom_bot')) { json_payload.username = fruum_username; json_payload.icon_url = fruum_icon_url; } request({ url: webhook, method: 'POST', json: json_payload, }, function(error, response, body) { if (error) logger.error(app_id, 'slack_incoming_webhook_failed', error); }); }); }; } module.exports = Slack;
fruum/fruum
plugins/slack/server.js
JavaScript
apache-2.0
4,439
/* * The MIT License (MIT) * * Copyright (c) 2014-2015 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package com.jy.common.utils.echarts.style; import java.io.Serializable; /** * 区域填充样式 * * */ public class AreaStyle implements Serializable { private static final long serialVersionUID = -6547716731700677234L; /** * 颜色 */ private Object color; /** * 填充样式,目前仅支持'default'(实填充) */ private Object type; /** * 获取color值 */ public Object color() { return this.color; } /** * 设置color值 * * @param color */ public AreaStyle color(Object color) { this.color = color; return this; } /** * 获取type值 */ public Object type() { return this.type; } /** * 设置type值 * * @param type */ public AreaStyle type(Object type) { this.type = type; return this; } /** * 获取typeDefault值 */ public AreaStyle typeDefault() { this.type = "default"; return this; } /** * 获取color值 */ public Object getColor() { return color; } /** * 设置color值 * * @param color */ public void setColor(Object color) { this.color = color; } /** * 获取type值 */ public Object getType() { return type; } /** * 设置type值 * * @param type */ public void setType(Object type) { this.type = type; } }
futureskywei/whale
src/main/java/com/jy/common/utils/echarts/style/AreaStyle.java
Java
apache-2.0
2,658
if __name__ == '__main__': x = int(input()) y = int(input()) z = int(input()) n = int(input()) L = [[a,b,c] for a in range(x+1) for b in range(y+1) for c in range(z+1)] L = list(filter(lambda x : sum(x) != n, L)) print(L)
kakaba2009/MachineLearning
python/src/algorithm/coding/basic/comprehension.py
Python
apache-2.0
240
require 'spec_helper' require File.join(File.dirname(__FILE__), '../../../../build/dsc/resource') require File.join(File.dirname(__FILE__), '../../../../build/dsc/psmodule') fixture_path = File.expand_path(File.join(__FILE__, '..', '..', '..', '..', 'fixtures')) def create_mock_cim_class(name, friendlyname) obj = MockCIMClass.new(name) obj.qualifiers['Friendlyname'] = MockCIMQualifier.new(friendlyname) obj end describe 'Dsc::Resource' do let(:dsc_resource) { Dsc::Resource.new(mof_class, mof_path) } describe '#ps_module' do context 'with a default style DSC Resource module' do let(:mof_class) { create_mock_cim_class('default', 'defaultfriendly') } let(:mof_path) { File.join(fixture_path, 'dsc_modules', 'default', 'DSCResources') } it 'creates a PS Module object' do result = dsc_resource.ps_module expect(result.name).to eq('default') expect(result.module_manifest_path).to match(%r{\/default.psd1$}) end end context 'with a PSD1 file which has different casing than the DSC Resource module ' do let(:mof_class) { create_mock_cim_class('mixedCase', 'mixedCasefriendly') } let(:mof_path) { File.join(fixture_path, 'dsc_modules', 'mixedCase', 'DSCResources') } it 'creates a PS Module object' do result = dsc_resource.ps_module expect(result.name).to eq('mixedCase') expect(result.module_manifest_path).to match(%r{\/MIXEDCase.psd1$}) end end context 'with a multiple PSD1 files which have different casing than the DSC Resource module ' do let(:mof_class) { create_mock_cim_class('multiCase', 'multiCasefriendly') } let(:mof_path) { File.join(fixture_path, 'dsc_modules', 'multiCase', 'DSCResources') } it 'creates a PS Module object' do result = dsc_resource.ps_module expect(result.name).to eq('multiCase') expect(result.module_manifest_path).to match(%r{\/MuLTICase.psd1$}) end end context 'with no PSD1 file in the DSC Resource module ' do let(:mof_class) { create_mock_cim_class('missing', 'missingfriendly') } let(:mof_path) { File.join(fixture_path, 'dsc_modules', 'missing', 'DSCResources') } it 'raises an error' do expect { dsc_resource.ps_module }.to raise_error(%r{module manifest .+ not found}) end end end end
puppetlabs/puppetlabs-dsc
spec/unit/build/dsc/resource_spec.rb
Ruby
apache-2.0
2,367
/* * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: // google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto package com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; public interface AutoMlForecastingInputsOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.AutoMlForecastingInputs) com.google.protobuf.MessageOrBuilder { /** * * * <pre> * The name of the column that the model is to predict. * </pre> * * <code>string target_column = 1;</code> * * @return The targetColumn. */ java.lang.String getTargetColumn(); /** * * * <pre> * The name of the column that the model is to predict. * </pre> * * <code>string target_column = 1;</code> * * @return The bytes for targetColumn. */ com.google.protobuf.ByteString getTargetColumnBytes(); /** * * * <pre> * The name of the column that identifies the time series. * </pre> * * <code>string time_series_identifier_column = 2;</code> * * @return The timeSeriesIdentifierColumn. */ java.lang.String getTimeSeriesIdentifierColumn(); /** * * * <pre> * The name of the column that identifies the time series. * </pre> * * <code>string time_series_identifier_column = 2;</code> * * @return The bytes for timeSeriesIdentifierColumn. */ com.google.protobuf.ByteString getTimeSeriesIdentifierColumnBytes(); /** * * * <pre> * The name of the column that identifies time order in the time series. * </pre> * * <code>string time_column = 3;</code> * * @return The timeColumn. */ java.lang.String getTimeColumn(); /** * * * <pre> * The name of the column that identifies time order in the time series. * </pre> * * <code>string time_column = 3;</code> * * @return The bytes for timeColumn. */ com.google.protobuf.ByteString getTimeColumnBytes(); /** * * * <pre> * Each transformation will apply transform function to given input column. * And the result will be used for training. * When creating transformation for BigQuery Struct column, the column should * be flattened using "." as the delimiter. * </pre> * * <code> * repeated .google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.AutoMlForecastingInputs.Transformation transformations = 4; * </code> */ java.util.List< com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.AutoMlForecastingInputs .Transformation> getTransformationsList(); /** * * * <pre> * Each transformation will apply transform function to given input column. * And the result will be used for training. * When creating transformation for BigQuery Struct column, the column should * be flattened using "." as the delimiter. * </pre> * * <code> * repeated .google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.AutoMlForecastingInputs.Transformation transformations = 4; * </code> */ com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.AutoMlForecastingInputs .Transformation getTransformations(int index); /** * * * <pre> * Each transformation will apply transform function to given input column. * And the result will be used for training. * When creating transformation for BigQuery Struct column, the column should * be flattened using "." as the delimiter. * </pre> * * <code> * repeated .google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.AutoMlForecastingInputs.Transformation transformations = 4; * </code> */ int getTransformationsCount(); /** * * * <pre> * Each transformation will apply transform function to given input column. * And the result will be used for training. * When creating transformation for BigQuery Struct column, the column should * be flattened using "." as the delimiter. * </pre> * * <code> * repeated .google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.AutoMlForecastingInputs.Transformation transformations = 4; * </code> */ java.util.List< ? extends com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition .AutoMlForecastingInputs.TransformationOrBuilder> getTransformationsOrBuilderList(); /** * * * <pre> * Each transformation will apply transform function to given input column. * And the result will be used for training. * When creating transformation for BigQuery Struct column, the column should * be flattened using "." as the delimiter. * </pre> * * <code> * repeated .google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.AutoMlForecastingInputs.Transformation transformations = 4; * </code> */ com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.AutoMlForecastingInputs .TransformationOrBuilder getTransformationsOrBuilder(int index); /** * * * <pre> * Objective function the model is optimizing towards. The training process * creates a model that optimizes the value of the objective * function over the validation set. * The supported optimization objectives: * * "minimize-rmse" (default) - Minimize root-mean-squared error (RMSE). * * "minimize-mae" - Minimize mean-absolute error (MAE). * * "minimize-rmsle" - Minimize root-mean-squared log error (RMSLE). * * "minimize-rmspe" - Minimize root-mean-squared percentage error (RMSPE). * * "minimize-wape-mae" - Minimize the combination of weighted absolute * percentage error (WAPE) and mean-absolute-error (MAE). * * "minimize-quantile-loss" - Minimize the quantile loss at the quantiles * defined in `quantiles`. * </pre> * * <code>string optimization_objective = 5;</code> * * @return The optimizationObjective. */ java.lang.String getOptimizationObjective(); /** * * * <pre> * Objective function the model is optimizing towards. The training process * creates a model that optimizes the value of the objective * function over the validation set. * The supported optimization objectives: * * "minimize-rmse" (default) - Minimize root-mean-squared error (RMSE). * * "minimize-mae" - Minimize mean-absolute error (MAE). * * "minimize-rmsle" - Minimize root-mean-squared log error (RMSLE). * * "minimize-rmspe" - Minimize root-mean-squared percentage error (RMSPE). * * "minimize-wape-mae" - Minimize the combination of weighted absolute * percentage error (WAPE) and mean-absolute-error (MAE). * * "minimize-quantile-loss" - Minimize the quantile loss at the quantiles * defined in `quantiles`. * </pre> * * <code>string optimization_objective = 5;</code> * * @return The bytes for optimizationObjective. */ com.google.protobuf.ByteString getOptimizationObjectiveBytes(); /** * * * <pre> * Required. The train budget of creating this model, expressed in milli node * hours i.e. 1,000 value in this field means 1 node hour. * The training cost of the model will not exceed this budget. The final cost * will be attempted to be close to the budget, though may end up being (even) * noticeably smaller - at the backend's discretion. This especially may * happen when further model training ceases to provide any improvements. * If the budget is set to a value known to be insufficient to train a * model for the given dataset, the training won't be attempted and * will error. * The train budget must be between 1,000 and 72,000 milli node hours, * inclusive. * </pre> * * <code>int64 train_budget_milli_node_hours = 6;</code> * * @return The trainBudgetMilliNodeHours. */ long getTrainBudgetMilliNodeHours(); /** * * * <pre> * Column name that should be used as the weight column. * Higher values in this column give more importance to the row * during model training. The column must have numeric values between 0 and * 10000 inclusively; 0 means the row is ignored for training. If weight * column field is not set, then all rows are assumed to have equal weight * of 1. * </pre> * * <code>string weight_column = 7;</code> * * @return The weightColumn. */ java.lang.String getWeightColumn(); /** * * * <pre> * Column name that should be used as the weight column. * Higher values in this column give more importance to the row * during model training. The column must have numeric values between 0 and * 10000 inclusively; 0 means the row is ignored for training. If weight * column field is not set, then all rows are assumed to have equal weight * of 1. * </pre> * * <code>string weight_column = 7;</code> * * @return The bytes for weightColumn. */ com.google.protobuf.ByteString getWeightColumnBytes(); /** * * * <pre> * Column names that should be used as attribute columns. * The value of these columns does not vary as a function of time. * For example, store ID or item color. * </pre> * * <code>repeated string time_series_attribute_columns = 19;</code> * * @return A list containing the timeSeriesAttributeColumns. */ java.util.List<java.lang.String> getTimeSeriesAttributeColumnsList(); /** * * * <pre> * Column names that should be used as attribute columns. * The value of these columns does not vary as a function of time. * For example, store ID or item color. * </pre> * * <code>repeated string time_series_attribute_columns = 19;</code> * * @return The count of timeSeriesAttributeColumns. */ int getTimeSeriesAttributeColumnsCount(); /** * * * <pre> * Column names that should be used as attribute columns. * The value of these columns does not vary as a function of time. * For example, store ID or item color. * </pre> * * <code>repeated string time_series_attribute_columns = 19;</code> * * @param index The index of the element to return. * @return The timeSeriesAttributeColumns at the given index. */ java.lang.String getTimeSeriesAttributeColumns(int index); /** * * * <pre> * Column names that should be used as attribute columns. * The value of these columns does not vary as a function of time. * For example, store ID or item color. * </pre> * * <code>repeated string time_series_attribute_columns = 19;</code> * * @param index The index of the value to return. * @return The bytes of the timeSeriesAttributeColumns at the given index. */ com.google.protobuf.ByteString getTimeSeriesAttributeColumnsBytes(int index); /** * * * <pre> * Names of columns that are unavailable when a forecast is requested. * This column contains information for the given entity (identified * by the time_series_identifier_column) that is unknown before the forecast * For example, actual weather on a given day. * </pre> * * <code>repeated string unavailable_at_forecast_columns = 20;</code> * * @return A list containing the unavailableAtForecastColumns. */ java.util.List<java.lang.String> getUnavailableAtForecastColumnsList(); /** * * * <pre> * Names of columns that are unavailable when a forecast is requested. * This column contains information for the given entity (identified * by the time_series_identifier_column) that is unknown before the forecast * For example, actual weather on a given day. * </pre> * * <code>repeated string unavailable_at_forecast_columns = 20;</code> * * @return The count of unavailableAtForecastColumns. */ int getUnavailableAtForecastColumnsCount(); /** * * * <pre> * Names of columns that are unavailable when a forecast is requested. * This column contains information for the given entity (identified * by the time_series_identifier_column) that is unknown before the forecast * For example, actual weather on a given day. * </pre> * * <code>repeated string unavailable_at_forecast_columns = 20;</code> * * @param index The index of the element to return. * @return The unavailableAtForecastColumns at the given index. */ java.lang.String getUnavailableAtForecastColumns(int index); /** * * * <pre> * Names of columns that are unavailable when a forecast is requested. * This column contains information for the given entity (identified * by the time_series_identifier_column) that is unknown before the forecast * For example, actual weather on a given day. * </pre> * * <code>repeated string unavailable_at_forecast_columns = 20;</code> * * @param index The index of the value to return. * @return The bytes of the unavailableAtForecastColumns at the given index. */ com.google.protobuf.ByteString getUnavailableAtForecastColumnsBytes(int index); /** * * * <pre> * Names of columns that are available and provided when a forecast * is requested. These columns * contain information for the given entity (identified by the * time_series_identifier_column column) that is known at forecast. * For example, predicted weather for a specific day. * </pre> * * <code>repeated string available_at_forecast_columns = 21;</code> * * @return A list containing the availableAtForecastColumns. */ java.util.List<java.lang.String> getAvailableAtForecastColumnsList(); /** * * * <pre> * Names of columns that are available and provided when a forecast * is requested. These columns * contain information for the given entity (identified by the * time_series_identifier_column column) that is known at forecast. * For example, predicted weather for a specific day. * </pre> * * <code>repeated string available_at_forecast_columns = 21;</code> * * @return The count of availableAtForecastColumns. */ int getAvailableAtForecastColumnsCount(); /** * * * <pre> * Names of columns that are available and provided when a forecast * is requested. These columns * contain information for the given entity (identified by the * time_series_identifier_column column) that is known at forecast. * For example, predicted weather for a specific day. * </pre> * * <code>repeated string available_at_forecast_columns = 21;</code> * * @param index The index of the element to return. * @return The availableAtForecastColumns at the given index. */ java.lang.String getAvailableAtForecastColumns(int index); /** * * * <pre> * Names of columns that are available and provided when a forecast * is requested. These columns * contain information for the given entity (identified by the * time_series_identifier_column column) that is known at forecast. * For example, predicted weather for a specific day. * </pre> * * <code>repeated string available_at_forecast_columns = 21;</code> * * @param index The index of the value to return. * @return The bytes of the availableAtForecastColumns at the given index. */ com.google.protobuf.ByteString getAvailableAtForecastColumnsBytes(int index); /** * * * <pre> * Expected difference in time granularity between rows in the data. * </pre> * * <code> * .google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.AutoMlForecastingInputs.Granularity data_granularity = 22; * </code> * * @return Whether the dataGranularity field is set. */ boolean hasDataGranularity(); /** * * * <pre> * Expected difference in time granularity between rows in the data. * </pre> * * <code> * .google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.AutoMlForecastingInputs.Granularity data_granularity = 22; * </code> * * @return The dataGranularity. */ com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.AutoMlForecastingInputs .Granularity getDataGranularity(); /** * * * <pre> * Expected difference in time granularity between rows in the data. * </pre> * * <code> * .google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.AutoMlForecastingInputs.Granularity data_granularity = 22; * </code> */ com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.AutoMlForecastingInputs .GranularityOrBuilder getDataGranularityOrBuilder(); /** * * * <pre> * The amount of time into the future for which forecasted values for the * target are returned. Expressed in number of units defined by the * `data_granularity` field. * </pre> * * <code>int64 forecast_horizon = 23;</code> * * @return The forecastHorizon. */ long getForecastHorizon(); /** * * * <pre> * The amount of time into the past training and prediction data is used * for model training and prediction respectively. Expressed in number of * units defined by the `data_granularity` field. * </pre> * * <code>int64 context_window = 24;</code> * * @return The contextWindow. */ long getContextWindow(); /** * * * <pre> * Configuration for exporting test set predictions to a BigQuery table. If * this configuration is absent, then the export is not performed. * </pre> * * <code> * .google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig export_evaluated_data_items_config = 15; * </code> * * @return Whether the exportEvaluatedDataItemsConfig field is set. */ boolean hasExportEvaluatedDataItemsConfig(); /** * * * <pre> * Configuration for exporting test set predictions to a BigQuery table. If * this configuration is absent, then the export is not performed. * </pre> * * <code> * .google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig export_evaluated_data_items_config = 15; * </code> * * @return The exportEvaluatedDataItemsConfig. */ com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig getExportEvaluatedDataItemsConfig(); /** * * * <pre> * Configuration for exporting test set predictions to a BigQuery table. If * this configuration is absent, then the export is not performed. * </pre> * * <code> * .google.cloud.aiplatform.v1beta1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig export_evaluated_data_items_config = 15; * </code> */ com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition .ExportEvaluatedDataItemsConfigOrBuilder getExportEvaluatedDataItemsConfigOrBuilder(); /** * * * <pre> * Quantiles to use for minimize-quantile-loss `optimization_objective`. Up to * 5 quantiles are allowed of values between 0 and 1, exclusive. Required if * the value of optimization_objective is minimize-quantile-loss. Represents * the percent quantiles to use for that objective. Quantiles must be unique. * </pre> * * <code>repeated double quantiles = 16;</code> * * @return A list containing the quantiles. */ java.util.List<java.lang.Double> getQuantilesList(); /** * * * <pre> * Quantiles to use for minimize-quantile-loss `optimization_objective`. Up to * 5 quantiles are allowed of values between 0 and 1, exclusive. Required if * the value of optimization_objective is minimize-quantile-loss. Represents * the percent quantiles to use for that objective. Quantiles must be unique. * </pre> * * <code>repeated double quantiles = 16;</code> * * @return The count of quantiles. */ int getQuantilesCount(); /** * * * <pre> * Quantiles to use for minimize-quantile-loss `optimization_objective`. Up to * 5 quantiles are allowed of values between 0 and 1, exclusive. Required if * the value of optimization_objective is minimize-quantile-loss. Represents * the percent quantiles to use for that objective. Quantiles must be unique. * </pre> * * <code>repeated double quantiles = 16;</code> * * @param index The index of the element to return. * @return The quantiles at the given index. */ double getQuantiles(int index); /** * * * <pre> * Validation options for the data validation component. The available options * are: * * "fail-pipeline" - default, will validate against the validation and * fail the pipeline if it fails. * * "ignore-validation" - ignore the results of the validation and continue * </pre> * * <code>string validation_options = 17;</code> * * @return The validationOptions. */ java.lang.String getValidationOptions(); /** * * * <pre> * Validation options for the data validation component. The available options * are: * * "fail-pipeline" - default, will validate against the validation and * fail the pipeline if it fails. * * "ignore-validation" - ignore the results of the validation and continue * </pre> * * <code>string validation_options = 17;</code> * * @return The bytes for validationOptions. */ com.google.protobuf.ByteString getValidationOptionsBytes(); /** * * * <pre> * Additional experiment flags for the time series forcasting training. * </pre> * * <code>repeated string additional_experiments = 25;</code> * * @return A list containing the additionalExperiments. */ java.util.List<java.lang.String> getAdditionalExperimentsList(); /** * * * <pre> * Additional experiment flags for the time series forcasting training. * </pre> * * <code>repeated string additional_experiments = 25;</code> * * @return The count of additionalExperiments. */ int getAdditionalExperimentsCount(); /** * * * <pre> * Additional experiment flags for the time series forcasting training. * </pre> * * <code>repeated string additional_experiments = 25;</code> * * @param index The index of the element to return. * @return The additionalExperiments at the given index. */ java.lang.String getAdditionalExperiments(int index); /** * * * <pre> * Additional experiment flags for the time series forcasting training. * </pre> * * <code>repeated string additional_experiments = 25;</code> * * @param index The index of the value to return. * @return The bytes of the additionalExperiments at the given index. */ com.google.protobuf.ByteString getAdditionalExperimentsBytes(int index); }
googleapis/java-aiplatform
proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/AutoMlForecastingInputsOrBuilder.java
Java
apache-2.0
23,476
# Nageia Roxb. GENUS #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Pinophyta/Pinopsida/Pinales/Podocarpaceae/Nageia/README.md
Markdown
apache-2.0
168
from django import forms from captcha.fields import CaptchaField class CaptchaTestForm(forms.Form): myfield = AnyOtherField() captcha = CaptchaField() def some_view(request): if request.POST: form = CaptchaTestForm(request.POST) # Validate the form: the captcha field will automatically # check the input if form.is_valid(): human = True else: form = CaptchaTestForm() return render_to_response('template.html',locals())
Andrew0701/coursework-web
progress/home/captcha.py
Python
apache-2.0
497
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_75) on Wed Jun 10 23:20:25 IST 2015 --> <meta http-equiv="Content-Type" content="text/html" charset="utf-8"> <title>Uses of Interface org.apache.solr.client.solrj.io.stream.ExpressibleStream (Solr 5.2.1 API)</title> <meta name="date" content="2015-06-10"> <link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.apache.solr.client.solrj.io.stream.ExpressibleStream (Solr 5.2.1 API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../../org/apache/solr/client/solrj/io/stream/ExpressibleStream.html" title="interface in org.apache.solr.client.solrj.io.stream">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?org/apache/solr/client/solrj/io/stream/class-use/ExpressibleStream.html" target="_top">Frames</a></li> <li><a href="ExpressibleStream.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface org.apache.solr.client.solrj.io.stream.ExpressibleStream" class="title">Uses of Interface<br>org.apache.solr.client.solrj.io.stream.ExpressibleStream</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../../org/apache/solr/client/solrj/io/stream/ExpressibleStream.html" title="interface in org.apache.solr.client.solrj.io.stream">ExpressibleStream</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.apache.solr.client.solrj.io.stream">org.apache.solr.client.solrj.io.stream</a></td> <td class="colLast"> <div class="block">Stream implementations for the Streaming Aggregation API</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.apache.solr.client.solrj.io.stream"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../../org/apache/solr/client/solrj/io/stream/ExpressibleStream.html" title="interface in org.apache.solr.client.solrj.io.stream">ExpressibleStream</a> in <a href="../../../../../../../../org/apache/solr/client/solrj/io/stream/package-summary.html">org.apache.solr.client.solrj.io.stream</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../../../../org/apache/solr/client/solrj/io/stream/package-summary.html">org.apache.solr.client.solrj.io.stream</a> that implement <a href="../../../../../../../../org/apache/solr/client/solrj/io/stream/ExpressibleStream.html" title="interface in org.apache.solr.client.solrj.io.stream">ExpressibleStream</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../../../../org/apache/solr/client/solrj/io/stream/CloudSolrStream.html" title="class in org.apache.solr.client.solrj.io.stream">CloudSolrStream</a></strong></code> <div class="block">Connects to Zookeeper to pick replicas from a specific collection to send the query to.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../../../../org/apache/solr/client/solrj/io/stream/MergeStream.html" title="class in org.apache.solr.client.solrj.io.stream">MergeStream</a></strong></code> <div class="block">Unions streamA with streamB ordering the Tuples based on a Comparator.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../../../../org/apache/solr/client/solrj/io/stream/ParallelStream.html" title="class in org.apache.solr.client.solrj.io.stream">ParallelStream</a></strong></code> <div class="block">The ParallelStream decorates a TupleStream implementation and pushes it to N workers for parallel execution.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../../../../org/apache/solr/client/solrj/io/stream/RankStream.html" title="class in org.apache.solr.client.solrj.io.stream">RankStream</a></strong></code> <div class="block">Iterates over a TupleStream and Ranks the topN tuples based on a Comparator.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../../../../org/apache/solr/client/solrj/io/stream/ReducerStream.html" title="class in org.apache.solr.client.solrj.io.stream">ReducerStream</a></strong></code> <div class="block">Iterates over a TupleStream and buffers Tuples that are equal based on a comparator.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../../../../org/apache/solr/client/solrj/io/stream/UniqueStream.html" title="class in org.apache.solr.client.solrj.io.stream">UniqueStream</a></strong></code> <div class="block">The UniqueStream emits a unique stream of Tuples based on a Comparator.</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../../org/apache/solr/client/solrj/io/stream/ExpressibleStream.html" title="interface in org.apache.solr.client.solrj.io.stream">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?org/apache/solr/client/solrj/io/stream/class-use/ExpressibleStream.html" target="_top">Frames</a></li> <li><a href="ExpressibleStream.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <i>Copyright &copy; 2000-2015 Apache Software Foundation. All Rights Reserved.</i> <script src='../../../../../../../../prettify.js' type='text/javascript'></script> <script type='text/javascript'> (function(){ var oldonload = window.onload; if (typeof oldonload != 'function') { window.onload = prettyPrint; } else { window.onload = function() { oldonload(); prettyPrint(); } } })(); </script> </small></p> </body> </html>
freakimkaefig/melodicsimilarity-solr
docs/solr-solrj/org/apache/solr/client/solrj/io/stream/class-use/ExpressibleStream.html
HTML
apache-2.0
9,473
package com.vmware.vim25; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for PhysicalNicLinkInfo complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="PhysicalNicLinkInfo"> * &lt;complexContent> * &lt;extension base="{urn:vim25}DynamicData"> * &lt;sequence> * &lt;element name="speedMb" type="{http://www.w3.org/2001/XMLSchema}int"/> * &lt;element name="duplex" type="{http://www.w3.org/2001/XMLSchema}boolean"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "PhysicalNicLinkInfo", propOrder = { "speedMb", "duplex" }) public class PhysicalNicLinkInfo extends DynamicData { protected int speedMb; protected boolean duplex; /** * Gets the value of the speedMb property. * */ public int getSpeedMb() { return speedMb; } /** * Sets the value of the speedMb property. * */ public void setSpeedMb(int value) { this.speedMb = value; } /** * Gets the value of the duplex property. * */ public boolean isDuplex() { return duplex; } /** * Sets the value of the duplex property. * */ public void setDuplex(boolean value) { this.duplex = value; } }
jdgwartney/vsphere-ws
java/JAXWS/samples/com/vmware/vim25/PhysicalNicLinkInfo.java
Java
apache-2.0
1,654
// <copyright file="Startup.cs" company="OpenTelemetry Authors"> // Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // </copyright> using System.Net.Http; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; namespace TestApp.AspNetCore._6._0 { public class Startup { public Startup(IConfiguration configuration) { this.Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddSingleton<HttpClient>(); services.AddSingleton( new CallbackMiddleware.CallbackMiddlewareImpl()); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseMiddleware<CallbackMiddleware>(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); } } }
open-telemetry/opentelemetry-dotnet
test/TestApp.AspNetCore.6.0/Startup.cs
C#
apache-2.0
2,082
/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package framework import ( "bytes" "context" "encoding/json" "errors" "fmt" "io" "io/ioutil" "math/rand" "net" "net/http" "net/url" "os" "os/exec" "path" "path/filepath" "regexp" "sort" "strconv" "strings" "sync" "syscall" "text/tabwriter" "time" "github.com/golang/glog" "golang.org/x/crypto/ssh" "golang.org/x/net/websocket" "google.golang.org/api/googleapi" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" gomegatypes "github.com/onsi/gomega/types" batch "k8s.io/api/batch/v1" "k8s.io/api/core/v1" extensions "k8s.io/api/extensions/v1beta1" apierrs "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/uuid" "k8s.io/apimachinery/pkg/util/wait" utilyaml "k8s.io/apimachinery/pkg/util/yaml" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" "k8s.io/client-go/dynamic" restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" utilfeature "k8s.io/apiserver/pkg/util/feature" clientset "k8s.io/client-go/kubernetes" scaleclient "k8s.io/client-go/scale" "k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/api/testapi" podutil "k8s.io/kubernetes/pkg/api/v1/pod" appsinternal "k8s.io/kubernetes/pkg/apis/apps" batchinternal "k8s.io/kubernetes/pkg/apis/batch" api "k8s.io/kubernetes/pkg/apis/core" extensionsinternal "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/conditions" "k8s.io/kubernetes/pkg/cloudprovider/providers/azure" gcecloud "k8s.io/kubernetes/pkg/cloudprovider/providers/gce" "k8s.io/kubernetes/pkg/controller" nodectlr "k8s.io/kubernetes/pkg/controller/nodelifecycle" "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/kubectl" "k8s.io/kubernetes/pkg/kubelet/util/format" "k8s.io/kubernetes/pkg/master/ports" "k8s.io/kubernetes/pkg/scheduler/algorithm/predicates" "k8s.io/kubernetes/pkg/scheduler/schedulercache" sshutil "k8s.io/kubernetes/pkg/ssh" "k8s.io/kubernetes/pkg/util/system" taintutils "k8s.io/kubernetes/pkg/util/taints" utilversion "k8s.io/kubernetes/pkg/util/version" "k8s.io/kubernetes/test/e2e/framework/ginkgowrapper" testutil "k8s.io/kubernetes/test/utils" imageutils "k8s.io/kubernetes/test/utils/image" uexec "k8s.io/utils/exec" ) const ( // How long to wait for the pod to be listable PodListTimeout = time.Minute // Initial pod start can be delayed O(minutes) by slow docker pulls // TODO: Make this 30 seconds once #4566 is resolved. PodStartTimeout = 5 * time.Minute // If there are any orphaned namespaces to clean up, this test is running // on a long lived cluster. A long wait here is preferably to spurious test // failures caused by leaked resources from a previous test run. NamespaceCleanupTimeout = 15 * time.Minute // Some pods can take much longer to get ready due to volume attach/detach latency. slowPodStartTimeout = 15 * time.Minute // How long to wait for a service endpoint to be resolvable. ServiceStartTimeout = 1 * time.Minute // How often to Poll pods, nodes and claims. Poll = 2 * time.Second pollShortTimeout = 1 * time.Minute pollLongTimeout = 5 * time.Minute // service accounts are provisioned after namespace creation // a service account is required to support pod creation in a namespace as part of admission control ServiceAccountProvisionTimeout = 2 * time.Minute // How long to try single API calls (like 'get' or 'list'). Used to prevent // transient failures from failing tests. // TODO: client should not apply this timeout to Watch calls. Increased from 30s until that is fixed. SingleCallTimeout = 5 * time.Minute // How long nodes have to be "ready" when a test begins. They should already // be "ready" before the test starts, so this is small. NodeReadyInitialTimeout = 20 * time.Second // How long pods have to be "ready" when a test begins. PodReadyBeforeTimeout = 5 * time.Minute // How long pods have to become scheduled onto nodes podScheduledBeforeTimeout = PodListTimeout + (20 * time.Second) podRespondingTimeout = 15 * time.Minute ServiceRespondingTimeout = 2 * time.Minute EndpointRegisterTimeout = time.Minute // How long claims have to become dynamically provisioned ClaimProvisionTimeout = 5 * time.Minute // How long claims have to become bound ClaimBindingTimeout = 3 * time.Minute // How long claims have to become deleted ClaimDeletingTimeout = 3 * time.Minute // How long PVs have to beome reclaimed PVReclaimingTimeout = 3 * time.Minute // How long PVs have to become bound PVBindingTimeout = 3 * time.Minute // How long PVs have to become deleted PVDeletingTimeout = 3 * time.Minute // How long a node is allowed to become "Ready" after it is restarted before // the test is considered failed. RestartNodeReadyAgainTimeout = 5 * time.Minute // How long a pod is allowed to become "running" and "ready" after a node // restart before test is considered failed. RestartPodReadyAgainTimeout = 5 * time.Minute // Number of objects that gc can delete in a second. // GC issues 2 requestes for single delete. gcThroughput = 10 // Minimal number of nodes for the cluster to be considered large. largeClusterThreshold = 100 // TODO(justinsb): Avoid hardcoding this. awsMasterIP = "172.20.0.9" // ssh port sshPort = "22" // ImagePrePullingTimeout is the time we wait for the e2e-image-puller // static pods to pull the list of seeded images. If they don't pull // images within this time we simply log their output and carry on // with the tests. ImagePrePullingTimeout = 5 * time.Minute ) var ( BusyBoxImage = "busybox" // Label allocated to the image puller static pod that runs on each node // before e2es. ImagePullerLabels = map[string]string{"name": "e2e-image-puller"} // For parsing Kubectl version for version-skewed testing. gitVersionRegexp = regexp.MustCompile("GitVersion:\"(v.+?)\"") // Slice of regexps for names of pods that have to be running to consider a Node "healthy" requiredPerNodePods = []*regexp.Regexp{ regexp.MustCompile(".*kube-proxy.*"), regexp.MustCompile(".*fluentd-elasticsearch.*"), regexp.MustCompile(".*node-problem-detector.*"), } // Serve hostname image name ServeHostnameImage = imageutils.GetE2EImage(imageutils.ServeHostname) ) type Address struct { internalIP string externalIP string hostname string } // GetServerArchitecture fetches the architecture of the cluster's apiserver. func GetServerArchitecture(c clientset.Interface) string { arch := "" sVer, err := c.Discovery().ServerVersion() if err != nil || sVer.Platform == "" { // If we failed to get the server version for some reason, default to amd64. arch = "amd64" } else { // Split the platform string into OS and Arch separately. // The platform string may for example be "linux/amd64", "linux/arm" or "windows/amd64". osArchArray := strings.Split(sVer.Platform, "/") arch = osArchArray[1] } return arch } // GetPauseImageName fetches the pause image name for the same architecture as the apiserver. func GetPauseImageName(c clientset.Interface) string { return imageutils.GetE2EImageWithArch(imageutils.Pause, GetServerArchitecture(c)) } func GetServicesProxyRequest(c clientset.Interface, request *restclient.Request) (*restclient.Request, error) { return request.Resource("services").SubResource("proxy"), nil } // unique identifier of the e2e run var RunId = uuid.NewUUID() type CreateTestingNSFn func(baseName string, c clientset.Interface, labels map[string]string) (*v1.Namespace, error) type ContainerFailures struct { status *v1.ContainerStateTerminated Restarts int } func GetMasterHost() string { masterUrl, err := url.Parse(TestContext.Host) ExpectNoError(err) return masterUrl.Host } func nowStamp() string { return time.Now().Format(time.StampMilli) } func log(level string, format string, args ...interface{}) { fmt.Fprintf(GinkgoWriter, nowStamp()+": "+level+": "+format+"\n", args...) } func Logf(format string, args ...interface{}) { log("INFO", format, args...) } func Failf(format string, args ...interface{}) { FailfWithOffset(1, format, args...) } // FailfWithOffset calls "Fail" and logs the error at "offset" levels above its caller // (for example, for call chain f -> g -> FailfWithOffset(1, ...) error would be logged for "f"). func FailfWithOffset(offset int, format string, args ...interface{}) { msg := fmt.Sprintf(format, args...) log("INFO", msg) ginkgowrapper.Fail(nowStamp()+": "+msg, 1+offset) } func Skipf(format string, args ...interface{}) { msg := fmt.Sprintf(format, args...) log("INFO", msg) ginkgowrapper.Skip(nowStamp() + ": " + msg) } func SkipUnlessNodeCountIsAtLeast(minNodeCount int) { if TestContext.CloudConfig.NumNodes < minNodeCount { Skipf("Requires at least %d nodes (not %d)", minNodeCount, TestContext.CloudConfig.NumNodes) } } func SkipUnlessNodeCountIsAtMost(maxNodeCount int) { if TestContext.CloudConfig.NumNodes > maxNodeCount { Skipf("Requires at most %d nodes (not %d)", maxNodeCount, TestContext.CloudConfig.NumNodes) } } func SkipUnlessAtLeast(value int, minValue int, message string) { if value < minValue { Skipf(message) } } func SkipIfProviderIs(unsupportedProviders ...string) { if ProviderIs(unsupportedProviders...) { Skipf("Not supported for providers %v (found %s)", unsupportedProviders, TestContext.Provider) } } func SkipUnlessLocalEphemeralStorageEnabled() { if !utilfeature.DefaultFeatureGate.Enabled(features.LocalStorageCapacityIsolation) { Skipf("Only supported when %v feature is enabled", features.LocalStorageCapacityIsolation) } } func SkipUnlessSSHKeyPresent() { if _, err := GetSigner(TestContext.Provider); err != nil { Skipf("No SSH Key for provider %s: '%v'", TestContext.Provider, err) } } func SkipUnlessProviderIs(supportedProviders ...string) { if !ProviderIs(supportedProviders...) { Skipf("Only supported for providers %v (not %s)", supportedProviders, TestContext.Provider) } } func SkipUnlessClusterMonitoringModeIs(supportedMonitoring ...string) { if !ClusterMonitoringModeIs(supportedMonitoring...) { Skipf("Only next monitoring modes are supported %v (not %s)", supportedMonitoring, TestContext.ClusterMonitoringMode) } } func SkipUnlessMasterOSDistroIs(supportedMasterOsDistros ...string) { if !MasterOSDistroIs(supportedMasterOsDistros...) { Skipf("Only supported for master OS distro %v (not %s)", supportedMasterOsDistros, TestContext.MasterOSDistro) } } func SkipUnlessNodeOSDistroIs(supportedNodeOsDistros ...string) { if !NodeOSDistroIs(supportedNodeOsDistros...) { Skipf("Only supported for node OS distro %v (not %s)", supportedNodeOsDistros, TestContext.NodeOSDistro) } } func SkipIfContainerRuntimeIs(runtimes ...string) { for _, runtime := range runtimes { if runtime == TestContext.ContainerRuntime { Skipf("Not supported under container runtime %s", runtime) } } } func RunIfContainerRuntimeIs(runtimes ...string) { for _, runtime := range runtimes { if runtime == TestContext.ContainerRuntime { return } } Skipf("Skipped because container runtime %q is not in %s", TestContext.ContainerRuntime, runtimes) } func RunIfSystemSpecNameIs(names ...string) { for _, name := range names { if name == TestContext.SystemSpecName { return } } Skipf("Skipped because system spec name %q is not in %v", TestContext.SystemSpecName, names) } func ProviderIs(providers ...string) bool { for _, provider := range providers { if strings.ToLower(provider) == strings.ToLower(TestContext.Provider) { return true } } return false } func ClusterMonitoringModeIs(monitoringModes ...string) bool { for _, mode := range monitoringModes { if strings.ToLower(mode) == strings.ToLower(TestContext.ClusterMonitoringMode) { return true } } return false } func MasterOSDistroIs(supportedMasterOsDistros ...string) bool { for _, distro := range supportedMasterOsDistros { if strings.ToLower(distro) == strings.ToLower(TestContext.MasterOSDistro) { return true } } return false } func NodeOSDistroIs(supportedNodeOsDistros ...string) bool { for _, distro := range supportedNodeOsDistros { if strings.ToLower(distro) == strings.ToLower(TestContext.NodeOSDistro) { return true } } return false } func ProxyMode(f *Framework) (string, error) { pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "kube-proxy-mode-detector", Namespace: f.Namespace.Name, }, Spec: v1.PodSpec{ HostNetwork: true, Containers: []v1.Container{ { Name: "detector", Image: imageutils.GetE2EImage(imageutils.Net), Command: []string{"/bin/sleep", "3600"}, }, }, }, } f.PodClient().CreateSync(pod) defer f.PodClient().DeleteSync(pod.Name, &metav1.DeleteOptions{}, DefaultPodDeletionTimeout) cmd := "curl -q -s --connect-timeout 1 http://localhost:10249/proxyMode" stdout, err := RunHostCmd(pod.Namespace, pod.Name, cmd) if err != nil { return "", err } Logf("ProxyMode: %s", stdout) return stdout, nil } func SkipUnlessServerVersionGTE(v *utilversion.Version, c discovery.ServerVersionInterface) { gte, err := ServerVersionGTE(v, c) if err != nil { Failf("Failed to get server version: %v", err) } if !gte { Skipf("Not supported for server versions before %q", v) } } func SkipIfMissingResource(clientPool dynamic.ClientPool, gvr schema.GroupVersionResource, namespace string) { dynamicClient, err := clientPool.ClientForGroupVersionResource(gvr) if err != nil { Failf("Unexpected error getting dynamic client for %v: %v", gvr.GroupVersion(), err) } apiResource := metav1.APIResource{Name: gvr.Resource, Namespaced: true} _, err = dynamicClient.Resource(&apiResource, namespace).List(metav1.ListOptions{}) if err != nil { // not all resources support list, so we ignore those if apierrs.IsMethodNotSupported(err) || apierrs.IsNotFound(err) || apierrs.IsForbidden(err) { Skipf("Could not find %s resource, skipping test: %#v", gvr, err) } Failf("Unexpected error getting %v: %v", gvr, err) } } // ProvidersWithSSH are those providers where each node is accessible with SSH var ProvidersWithSSH = []string{"gce", "gke", "aws", "local"} type podCondition func(pod *v1.Pod) (bool, error) // logPodStates logs basic info of provided pods for debugging. func logPodStates(pods []v1.Pod) { // Find maximum widths for pod, node, and phase strings for column printing. maxPodW, maxNodeW, maxPhaseW, maxGraceW := len("POD"), len("NODE"), len("PHASE"), len("GRACE") for i := range pods { pod := &pods[i] if len(pod.ObjectMeta.Name) > maxPodW { maxPodW = len(pod.ObjectMeta.Name) } if len(pod.Spec.NodeName) > maxNodeW { maxNodeW = len(pod.Spec.NodeName) } if len(pod.Status.Phase) > maxPhaseW { maxPhaseW = len(pod.Status.Phase) } } // Increase widths by one to separate by a single space. maxPodW++ maxNodeW++ maxPhaseW++ maxGraceW++ // Log pod info. * does space padding, - makes them left-aligned. Logf("%-[1]*[2]s %-[3]*[4]s %-[5]*[6]s %-[7]*[8]s %[9]s", maxPodW, "POD", maxNodeW, "NODE", maxPhaseW, "PHASE", maxGraceW, "GRACE", "CONDITIONS") for _, pod := range pods { grace := "" if pod.DeletionGracePeriodSeconds != nil { grace = fmt.Sprintf("%ds", *pod.DeletionGracePeriodSeconds) } Logf("%-[1]*[2]s %-[3]*[4]s %-[5]*[6]s %-[7]*[8]s %[9]s", maxPodW, pod.ObjectMeta.Name, maxNodeW, pod.Spec.NodeName, maxPhaseW, pod.Status.Phase, maxGraceW, grace, pod.Status.Conditions) } Logf("") // Final empty line helps for readability. } // errorBadPodsStates create error message of basic info of bad pods for debugging. func errorBadPodsStates(badPods []v1.Pod, desiredPods int, ns, desiredState string, timeout time.Duration) string { errStr := fmt.Sprintf("%d / %d pods in namespace %q are NOT in %s state in %v\n", len(badPods), desiredPods, ns, desiredState, timeout) // Print bad pods info only if there are fewer than 10 bad pods if len(badPods) > 10 { return errStr + "There are too many bad pods. Please check log for details." } buf := bytes.NewBuffer(nil) w := tabwriter.NewWriter(buf, 0, 0, 1, ' ', 0) fmt.Fprintln(w, "POD\tNODE\tPHASE\tGRACE\tCONDITIONS") for _, badPod := range badPods { grace := "" if badPod.DeletionGracePeriodSeconds != nil { grace = fmt.Sprintf("%ds", *badPod.DeletionGracePeriodSeconds) } podInfo := fmt.Sprintf("%s\t%s\t%s\t%s\t%+v", badPod.ObjectMeta.Name, badPod.Spec.NodeName, badPod.Status.Phase, grace, badPod.Status.Conditions) fmt.Fprintln(w, podInfo) } w.Flush() return errStr + buf.String() } // WaitForPodsSuccess waits till all labels matching the given selector enter // the Success state. The caller is expected to only invoke this method once the // pods have been created. func WaitForPodsSuccess(c clientset.Interface, ns string, successPodLabels map[string]string, timeout time.Duration) error { successPodSelector := labels.SelectorFromSet(successPodLabels) start, badPods, desiredPods := time.Now(), []v1.Pod{}, 0 if wait.PollImmediate(30*time.Second, timeout, func() (bool, error) { podList, err := c.CoreV1().Pods(ns).List(metav1.ListOptions{LabelSelector: successPodSelector.String()}) if err != nil { Logf("Error getting pods in namespace %q: %v", ns, err) if IsRetryableAPIError(err) { return false, nil } return false, err } if len(podList.Items) == 0 { Logf("Waiting for pods to enter Success, but no pods in %q match label %v", ns, successPodLabels) return true, nil } badPods = []v1.Pod{} desiredPods = len(podList.Items) for _, pod := range podList.Items { if pod.Status.Phase != v1.PodSucceeded { badPods = append(badPods, pod) } } successPods := len(podList.Items) - len(badPods) Logf("%d / %d pods in namespace %q are in Success state (%d seconds elapsed)", successPods, len(podList.Items), ns, int(time.Since(start).Seconds())) if len(badPods) == 0 { return true, nil } return false, nil }) != nil { logPodStates(badPods) LogPodsWithLabels(c, ns, successPodLabels, Logf) return errors.New(errorBadPodsStates(badPods, desiredPods, ns, "SUCCESS", timeout)) } return nil } // WaitForPodsRunningReady waits up to timeout to ensure that all pods in // namespace ns are either running and ready, or failed but controlled by a // controller. Also, it ensures that at least minPods are running and // ready. It has separate behavior from other 'wait for' pods functions in // that it requests the list of pods on every iteration. This is useful, for // example, in cluster startup, because the number of pods increases while // waiting. All pods that are in SUCCESS state are not counted. // // If ignoreLabels is not empty, pods matching this selector are ignored. func WaitForPodsRunningReady(c clientset.Interface, ns string, minPods, allowedNotReadyPods int32, timeout time.Duration, ignoreLabels map[string]string) error { ignoreSelector := labels.SelectorFromSet(ignoreLabels) start := time.Now() Logf("Waiting up to %v for all pods (need at least %d) in namespace '%s' to be running and ready", timeout, minPods, ns) wg := sync.WaitGroup{} wg.Add(1) var ignoreNotReady bool badPods := []v1.Pod{} desiredPods := 0 notReady := int32(0) if wait.PollImmediate(Poll, timeout, func() (bool, error) { // We get the new list of pods, replication controllers, and // replica sets in every iteration because more pods come // online during startup and we want to ensure they are also // checked. replicas, replicaOk := int32(0), int32(0) rcList, err := c.CoreV1().ReplicationControllers(ns).List(metav1.ListOptions{}) if err != nil { Logf("Error getting replication controllers in namespace '%s': %v", ns, err) if IsRetryableAPIError(err) { return false, nil } return false, err } for _, rc := range rcList.Items { replicas += *rc.Spec.Replicas replicaOk += rc.Status.ReadyReplicas } rsList, err := c.ExtensionsV1beta1().ReplicaSets(ns).List(metav1.ListOptions{}) if err != nil { Logf("Error getting replication sets in namespace %q: %v", ns, err) if IsRetryableAPIError(err) { return false, nil } return false, err } for _, rs := range rsList.Items { replicas += *rs.Spec.Replicas replicaOk += rs.Status.ReadyReplicas } podList, err := c.CoreV1().Pods(ns).List(metav1.ListOptions{}) if err != nil { Logf("Error getting pods in namespace '%s': %v", ns, err) if IsRetryableAPIError(err) { return false, nil } return false, err } nOk := int32(0) notReady = int32(0) badPods = []v1.Pod{} desiredPods = len(podList.Items) for _, pod := range podList.Items { if len(ignoreLabels) != 0 && ignoreSelector.Matches(labels.Set(pod.Labels)) { continue } res, err := testutil.PodRunningReady(&pod) switch { case res && err == nil: nOk++ case pod.Status.Phase == v1.PodSucceeded: Logf("The status of Pod %s is Succeeded which is unexpected", pod.ObjectMeta.Name) badPods = append(badPods, pod) // it doesn't make sense to wait for this pod return false, errors.New("unexpected Succeeded pod state") case pod.Status.Phase != v1.PodFailed: Logf("The status of Pod %s is %s (Ready = false), waiting for it to be either Running (with Ready = true) or Failed", pod.ObjectMeta.Name, pod.Status.Phase) notReady++ badPods = append(badPods, pod) default: if metav1.GetControllerOf(&pod) == nil { Logf("Pod %s is Failed, but it's not controlled by a controller", pod.ObjectMeta.Name) badPods = append(badPods, pod) } //ignore failed pods that are controlled by some controller } } Logf("%d / %d pods in namespace '%s' are running and ready (%d seconds elapsed)", nOk, len(podList.Items), ns, int(time.Since(start).Seconds())) Logf("expected %d pod replicas in namespace '%s', %d are Running and Ready.", replicas, ns, replicaOk) if replicaOk == replicas && nOk >= minPods && len(badPods) == 0 { return true, nil } ignoreNotReady = (notReady <= allowedNotReadyPods) logPodStates(badPods) return false, nil }) != nil { if !ignoreNotReady { return errors.New(errorBadPodsStates(badPods, desiredPods, ns, "RUNNING and READY", timeout)) } Logf("Number of not-ready pods (%d) is below the allowed threshold (%d).", notReady, allowedNotReadyPods) } return nil } func kubectlLogPod(c clientset.Interface, pod v1.Pod, containerNameSubstr string, logFunc func(ftm string, args ...interface{})) { for _, container := range pod.Spec.Containers { if strings.Contains(container.Name, containerNameSubstr) { // Contains() matches all strings if substr is empty logs, err := GetPodLogs(c, pod.Namespace, pod.Name, container.Name) if err != nil { logs, err = getPreviousPodLogs(c, pod.Namespace, pod.Name, container.Name) if err != nil { logFunc("Failed to get logs of pod %v, container %v, err: %v", pod.Name, container.Name, err) } } logFunc("Logs of %v/%v:%v on node %v", pod.Namespace, pod.Name, container.Name, pod.Spec.NodeName) logFunc("%s : STARTLOG\n%s\nENDLOG for container %v:%v:%v", containerNameSubstr, logs, pod.Namespace, pod.Name, container.Name) } } } func LogFailedContainers(c clientset.Interface, ns string, logFunc func(ftm string, args ...interface{})) { podList, err := c.CoreV1().Pods(ns).List(metav1.ListOptions{}) if err != nil { logFunc("Error getting pods in namespace '%s': %v", ns, err) return } logFunc("Running kubectl logs on non-ready containers in %v", ns) for _, pod := range podList.Items { if res, err := testutil.PodRunningReady(&pod); !res || err != nil { kubectlLogPod(c, pod, "", Logf) } } } func LogPodsWithLabels(c clientset.Interface, ns string, match map[string]string, logFunc func(ftm string, args ...interface{})) { podList, err := c.CoreV1().Pods(ns).List(metav1.ListOptions{LabelSelector: labels.SelectorFromSet(match).String()}) if err != nil { logFunc("Error getting pods in namespace %q: %v", ns, err) return } logFunc("Running kubectl logs on pods with labels %v in %v", match, ns) for _, pod := range podList.Items { kubectlLogPod(c, pod, "", logFunc) } } func LogContainersInPodsWithLabels(c clientset.Interface, ns string, match map[string]string, containerSubstr string, logFunc func(ftm string, args ...interface{})) { podList, err := c.CoreV1().Pods(ns).List(metav1.ListOptions{LabelSelector: labels.SelectorFromSet(match).String()}) if err != nil { Logf("Error getting pods in namespace %q: %v", ns, err) return } for _, pod := range podList.Items { kubectlLogPod(c, pod, containerSubstr, logFunc) } } // DeleteNamespaces deletes all namespaces that match the given delete and skip filters. // Filter is by simple strings.Contains; first skip filter, then delete filter. // Returns the list of deleted namespaces or an error. func DeleteNamespaces(c clientset.Interface, deleteFilter, skipFilter []string) ([]string, error) { By("Deleting namespaces") nsList, err := c.CoreV1().Namespaces().List(metav1.ListOptions{}) Expect(err).NotTo(HaveOccurred()) var deleted []string var wg sync.WaitGroup OUTER: for _, item := range nsList.Items { if skipFilter != nil { for _, pattern := range skipFilter { if strings.Contains(item.Name, pattern) { continue OUTER } } } if deleteFilter != nil { var shouldDelete bool for _, pattern := range deleteFilter { if strings.Contains(item.Name, pattern) { shouldDelete = true break } } if !shouldDelete { continue OUTER } } wg.Add(1) deleted = append(deleted, item.Name) go func(nsName string) { defer wg.Done() defer GinkgoRecover() Expect(c.CoreV1().Namespaces().Delete(nsName, nil)).To(Succeed()) Logf("namespace : %v api call to delete is complete ", nsName) }(item.Name) } wg.Wait() return deleted, nil } func WaitForNamespacesDeleted(c clientset.Interface, namespaces []string, timeout time.Duration) error { By("Waiting for namespaces to vanish") nsMap := map[string]bool{} for _, ns := range namespaces { nsMap[ns] = true } //Now POLL until all namespaces have been eradicated. return wait.Poll(2*time.Second, timeout, func() (bool, error) { nsList, err := c.CoreV1().Namespaces().List(metav1.ListOptions{}) if err != nil { return false, err } for _, item := range nsList.Items { if _, ok := nsMap[item.Name]; ok { return false, nil } } return true, nil }) } func waitForServiceAccountInNamespace(c clientset.Interface, ns, serviceAccountName string, timeout time.Duration) error { w, err := c.CoreV1().ServiceAccounts(ns).Watch(metav1.SingleObject(metav1.ObjectMeta{Name: serviceAccountName})) if err != nil { return err } _, err = watch.Until(timeout, w, conditions.ServiceAccountHasSecrets) return err } func WaitForPodCondition(c clientset.Interface, ns, podName, desc string, timeout time.Duration, condition podCondition) error { Logf("Waiting up to %v for pod %q in namespace %q to be %q", timeout, podName, ns, desc) for start := time.Now(); time.Since(start) < timeout; time.Sleep(Poll) { pod, err := c.CoreV1().Pods(ns).Get(podName, metav1.GetOptions{}) if err != nil { if apierrs.IsNotFound(err) { Logf("Pod %q in namespace %q not found. Error: %v", podName, ns, err) return err } Logf("Get pod %q in namespace %q failed, ignoring for %v. Error: %v", podName, ns, Poll, err) continue } // log now so that current pod info is reported before calling `condition()` Logf("Pod %q: Phase=%q, Reason=%q, readiness=%t. Elapsed: %v", podName, pod.Status.Phase, pod.Status.Reason, podutil.IsPodReady(pod), time.Since(start)) if done, err := condition(pod); done { if err == nil { Logf("Pod %q satisfied condition %q", podName, desc) } return err } } return fmt.Errorf("Gave up after waiting %v for pod %q to be %q", timeout, podName, desc) } // WaitForMatchPodsCondition finds match pods based on the input ListOptions. // waits and checks if all match pods are in the given podCondition func WaitForMatchPodsCondition(c clientset.Interface, opts metav1.ListOptions, desc string, timeout time.Duration, condition podCondition) error { Logf("Waiting up to %v for matching pods' status to be %s", timeout, desc) for start := time.Now(); time.Since(start) < timeout; time.Sleep(Poll) { pods, err := c.CoreV1().Pods(metav1.NamespaceAll).List(opts) if err != nil { return err } conditionNotMatch := []string{} for _, pod := range pods.Items { done, err := condition(&pod) if done && err != nil { return fmt.Errorf("Unexpected error: %v", err) } if !done { conditionNotMatch = append(conditionNotMatch, format.Pod(&pod)) } } if len(conditionNotMatch) <= 0 { return err } Logf("%d pods are not %s: %v", len(conditionNotMatch), desc, conditionNotMatch) } return fmt.Errorf("gave up waiting for matching pods to be '%s' after %v", desc, timeout) } // WaitForDefaultServiceAccountInNamespace waits for the default service account to be provisioned // the default service account is what is associated with pods when they do not specify a service account // as a result, pods are not able to be provisioned in a namespace until the service account is provisioned func WaitForDefaultServiceAccountInNamespace(c clientset.Interface, namespace string) error { return waitForServiceAccountInNamespace(c, namespace, "default", ServiceAccountProvisionTimeout) } // WaitForPersistentVolumePhase waits for a PersistentVolume to be in a specific phase or until timeout occurs, whichever comes first. func WaitForPersistentVolumePhase(phase v1.PersistentVolumePhase, c clientset.Interface, pvName string, Poll, timeout time.Duration) error { Logf("Waiting up to %v for PersistentVolume %s to have phase %s", timeout, pvName, phase) for start := time.Now(); time.Since(start) < timeout; time.Sleep(Poll) { pv, err := c.CoreV1().PersistentVolumes().Get(pvName, metav1.GetOptions{}) if err != nil { Logf("Get persistent volume %s in failed, ignoring for %v: %v", pvName, Poll, err) continue } else { if pv.Status.Phase == phase { Logf("PersistentVolume %s found and phase=%s (%v)", pvName, phase, time.Since(start)) return nil } else { Logf("PersistentVolume %s found but phase is %s instead of %s.", pvName, pv.Status.Phase, phase) } } } return fmt.Errorf("PersistentVolume %s not in phase %s within %v", pvName, phase, timeout) } // WaitForPersistentVolumeDeleted waits for a PersistentVolume to get deleted or until timeout occurs, whichever comes first. func WaitForPersistentVolumeDeleted(c clientset.Interface, pvName string, Poll, timeout time.Duration) error { Logf("Waiting up to %v for PersistentVolume %s to get deleted", timeout, pvName) for start := time.Now(); time.Since(start) < timeout; time.Sleep(Poll) { pv, err := c.CoreV1().PersistentVolumes().Get(pvName, metav1.GetOptions{}) if err == nil { Logf("PersistentVolume %s found and phase=%s (%v)", pvName, pv.Status.Phase, time.Since(start)) continue } else { if apierrs.IsNotFound(err) { Logf("PersistentVolume %s was removed", pvName) return nil } else { Logf("Get persistent volume %s in failed, ignoring for %v: %v", pvName, Poll, err) } } } return fmt.Errorf("PersistentVolume %s still exists within %v", pvName, timeout) } // WaitForPersistentVolumeClaimPhase waits for a PersistentVolumeClaim to be in a specific phase or until timeout occurs, whichever comes first. func WaitForPersistentVolumeClaimPhase(phase v1.PersistentVolumeClaimPhase, c clientset.Interface, ns string, pvcName string, Poll, timeout time.Duration) error { Logf("Waiting up to %v for PersistentVolumeClaim %s to have phase %s", timeout, pvcName, phase) for start := time.Now(); time.Since(start) < timeout; time.Sleep(Poll) { pvc, err := c.CoreV1().PersistentVolumeClaims(ns).Get(pvcName, metav1.GetOptions{}) if err != nil { Logf("Failed to get claim %q, retrying in %v. Error: %v", pvcName, Poll, err) continue } else { if pvc.Status.Phase == phase { Logf("PersistentVolumeClaim %s found and phase=%s (%v)", pvcName, phase, time.Since(start)) return nil } else { Logf("PersistentVolumeClaim %s found but phase is %s instead of %s.", pvcName, pvc.Status.Phase, phase) } } } return fmt.Errorf("PersistentVolumeClaim %s not in phase %s within %v", pvcName, phase, timeout) } // CreateTestingNS should be used by every test, note that we append a common prefix to the provided test name. // Please see NewFramework instead of using this directly. func CreateTestingNS(baseName string, c clientset.Interface, labels map[string]string) (*v1.Namespace, error) { if labels == nil { labels = map[string]string{} } labels["e2e-run"] = string(RunId) namespaceObj := &v1.Namespace{ ObjectMeta: metav1.ObjectMeta{ GenerateName: fmt.Sprintf("e2e-tests-%v-", baseName), Namespace: "", Labels: labels, }, Status: v1.NamespaceStatus{}, } // Be robust about making the namespace creation call. var got *v1.Namespace if err := wait.PollImmediate(Poll, 30*time.Second, func() (bool, error) { var err error got, err = c.CoreV1().Namespaces().Create(namespaceObj) if err != nil { Logf("Unexpected error while creating namespace: %v", err) return false, nil } return true, nil }); err != nil { return nil, err } if TestContext.VerifyServiceAccount { if err := WaitForDefaultServiceAccountInNamespace(c, got.Name); err != nil { // Even if we fail to create serviceAccount in the namespace, // we have successfully create a namespace. // So, return the created namespace. return got, err } } return got, nil } // CheckTestingNSDeletedExcept checks whether all e2e based existing namespaces are in the Terminating state // and waits until they are finally deleted. It ignores namespace skip. func CheckTestingNSDeletedExcept(c clientset.Interface, skip string) error { // TODO: Since we don't have support for bulk resource deletion in the API, // while deleting a namespace we are deleting all objects from that namespace // one by one (one deletion == one API call). This basically exposes us to // throttling - currently controller-manager has a limit of max 20 QPS. // Once #10217 is implemented and used in namespace-controller, deleting all // object from a given namespace should be much faster and we will be able // to lower this timeout. // However, now Density test is producing ~26000 events and Load capacity test // is producing ~35000 events, thus assuming there are no other requests it will // take ~30 minutes to fully delete the namespace. Thus I'm setting it to 60 // minutes to avoid any timeouts here. timeout := 60 * time.Minute Logf("Waiting for terminating namespaces to be deleted...") for start := time.Now(); time.Since(start) < timeout; time.Sleep(15 * time.Second) { namespaces, err := c.CoreV1().Namespaces().List(metav1.ListOptions{}) if err != nil { Logf("Listing namespaces failed: %v", err) continue } terminating := 0 for _, ns := range namespaces.Items { if strings.HasPrefix(ns.ObjectMeta.Name, "e2e-tests-") && ns.ObjectMeta.Name != skip { if ns.Status.Phase == v1.NamespaceActive { return fmt.Errorf("Namespace %s is active", ns.ObjectMeta.Name) } terminating++ } } if terminating == 0 { return nil } } return fmt.Errorf("Waiting for terminating namespaces to be deleted timed out") } // deleteNS deletes the provided namespace, waits for it to be completely deleted, and then checks // whether there are any pods remaining in a non-terminating state. func deleteNS(c clientset.Interface, clientPool dynamic.ClientPool, namespace string, timeout time.Duration) error { startTime := time.Now() if err := c.CoreV1().Namespaces().Delete(namespace, nil); err != nil { return err } // wait for namespace to delete or timeout. err := wait.PollImmediate(2*time.Second, timeout, func() (bool, error) { if _, err := c.CoreV1().Namespaces().Get(namespace, metav1.GetOptions{}); err != nil { if apierrs.IsNotFound(err) { return true, nil } Logf("Error while waiting for namespace to be terminated: %v", err) return false, nil } return false, nil }) // verify there is no more remaining content in the namespace remainingContent, cerr := hasRemainingContent(c, clientPool, namespace) if cerr != nil { return cerr } // if content remains, let's dump information about the namespace, and system for flake debugging. remainingPods := 0 missingTimestamp := 0 if remainingContent { // log information about namespace, and set of namespaces in api server to help flake detection logNamespace(c, namespace) logNamespaces(c, namespace) // if we can, check if there were pods remaining with no timestamp. remainingPods, missingTimestamp, _ = countRemainingPods(c, namespace) } // a timeout waiting for namespace deletion happened! if err != nil { // some content remains in the namespace if remainingContent { // pods remain if remainingPods > 0 { if missingTimestamp != 0 { // pods remained, but were not undergoing deletion (namespace controller is probably culprit) return fmt.Errorf("namespace %v was not deleted with limit: %v, pods remaining: %v, pods missing deletion timestamp: %v", namespace, err, remainingPods, missingTimestamp) } // but they were all undergoing deletion (kubelet is probably culprit, check NodeLost) return fmt.Errorf("namespace %v was not deleted with limit: %v, pods remaining: %v", namespace, err, remainingPods) } // other content remains (namespace controller is probably screwed up) return fmt.Errorf("namespace %v was not deleted with limit: %v, namespaced content other than pods remain", namespace, err) } // no remaining content, but namespace was not deleted (namespace controller is probably wedged) return fmt.Errorf("namespace %v was not deleted with limit: %v, namespace is empty but is not yet removed", namespace, err) } Logf("namespace %v deletion completed in %s", namespace, time.Now().Sub(startTime)) return nil } // logNamespaces logs the number of namespaces by phase // namespace is the namespace the test was operating against that failed to delete so it can be grepped in logs func logNamespaces(c clientset.Interface, namespace string) { namespaceList, err := c.CoreV1().Namespaces().List(metav1.ListOptions{}) if err != nil { Logf("namespace: %v, unable to list namespaces: %v", namespace, err) return } numActive := 0 numTerminating := 0 for _, namespace := range namespaceList.Items { if namespace.Status.Phase == v1.NamespaceActive { numActive++ } else { numTerminating++ } } Logf("namespace: %v, total namespaces: %v, active: %v, terminating: %v", namespace, len(namespaceList.Items), numActive, numTerminating) } // logNamespace logs detail about a namespace func logNamespace(c clientset.Interface, namespace string) { ns, err := c.CoreV1().Namespaces().Get(namespace, metav1.GetOptions{}) if err != nil { if apierrs.IsNotFound(err) { Logf("namespace: %v no longer exists", namespace) return } Logf("namespace: %v, unable to get namespace due to error: %v", namespace, err) return } Logf("namespace: %v, DeletionTimetamp: %v, Finalizers: %v, Phase: %v", ns.Name, ns.DeletionTimestamp, ns.Spec.Finalizers, ns.Status.Phase) } // countRemainingPods queries the server to count number of remaining pods, and number of pods that had a missing deletion timestamp. func countRemainingPods(c clientset.Interface, namespace string) (int, int, error) { // check for remaining pods pods, err := c.CoreV1().Pods(namespace).List(metav1.ListOptions{}) if err != nil { return 0, 0, err } // nothing remains! if len(pods.Items) == 0 { return 0, 0, nil } // stuff remains, log about it logPodStates(pods.Items) // check if there were any pods with missing deletion timestamp numPods := len(pods.Items) missingTimestamp := 0 for _, pod := range pods.Items { if pod.DeletionTimestamp == nil { missingTimestamp++ } } return numPods, missingTimestamp, nil } // isDynamicDiscoveryError returns true if the error is a group discovery error // only for groups expected to be created/deleted dynamically during e2e tests func isDynamicDiscoveryError(err error) bool { if !discovery.IsGroupDiscoveryFailedError(err) { return false } discoveryErr := err.(*discovery.ErrGroupDiscoveryFailed) for gv := range discoveryErr.Groups { switch gv.Group { case "mygroup.example.com": // custom_resource_definition // garbage_collector case "wardle.k8s.io": // aggregator default: Logf("discovery error for unexpected group: %#v", gv) return false } } return true } // hasRemainingContent checks if there is remaining content in the namespace via API discovery func hasRemainingContent(c clientset.Interface, clientPool dynamic.ClientPool, namespace string) (bool, error) { // some tests generate their own framework.Client rather than the default // TODO: ensure every test call has a configured clientPool if clientPool == nil { return false, nil } // find out what content is supported on the server // Since extension apiserver is not always available, e.g. metrics server sometimes goes down, // add retry here. resources, err := waitForServerPreferredNamespacedResources(c.Discovery(), 30*time.Second) if err != nil { return false, err } groupVersionResources, err := discovery.GroupVersionResources(resources) if err != nil { return false, err } // TODO: temporary hack for https://github.com/kubernetes/kubernetes/issues/31798 ignoredResources := sets.NewString("bindings") contentRemaining := false // dump how many of resource type is on the server in a log. for gvr := range groupVersionResources { // get a client for this group version... dynamicClient, err := clientPool.ClientForGroupVersionResource(gvr) if err != nil { // not all resource types support list, so some errors here are normal depending on the resource type. Logf("namespace: %s, unable to get client - gvr: %v, error: %v", namespace, gvr, err) continue } // get the api resource apiResource := metav1.APIResource{Name: gvr.Resource, Namespaced: true} // TODO: temporary hack for https://github.com/kubernetes/kubernetes/issues/31798 if ignoredResources.Has(apiResource.Name) { Logf("namespace: %s, resource: %s, ignored listing per whitelist", namespace, apiResource.Name) continue } obj, err := dynamicClient.Resource(&apiResource, namespace).List(metav1.ListOptions{}) if err != nil { // not all resources support list, so we ignore those if apierrs.IsMethodNotSupported(err) || apierrs.IsNotFound(err) || apierrs.IsForbidden(err) { continue } // skip unavailable servers if apierrs.IsServiceUnavailable(err) { continue } return false, err } unstructuredList, ok := obj.(*unstructured.UnstructuredList) if !ok { return false, fmt.Errorf("namespace: %s, resource: %s, expected *unstructured.UnstructuredList, got %#v", namespace, apiResource.Name, obj) } if len(unstructuredList.Items) > 0 { Logf("namespace: %s, resource: %s, items remaining: %v", namespace, apiResource.Name, len(unstructuredList.Items)) contentRemaining = true } } return contentRemaining, nil } func ContainerInitInvariant(older, newer runtime.Object) error { oldPod := older.(*v1.Pod) newPod := newer.(*v1.Pod) if len(oldPod.Spec.InitContainers) == 0 { return nil } if len(oldPod.Spec.InitContainers) != len(newPod.Spec.InitContainers) { return fmt.Errorf("init container list changed") } if oldPod.UID != newPod.UID { return fmt.Errorf("two different pods exist in the condition: %s vs %s", oldPod.UID, newPod.UID) } if err := initContainersInvariants(oldPod); err != nil { return err } if err := initContainersInvariants(newPod); err != nil { return err } oldInit, _, _ := podInitialized(oldPod) newInit, _, _ := podInitialized(newPod) if oldInit && !newInit { // TODO: we may in the future enable resetting PodInitialized = false if the kubelet needs to restart it // from scratch return fmt.Errorf("pod cannot be initialized and then regress to not being initialized") } return nil } func podInitialized(pod *v1.Pod) (ok bool, failed bool, err error) { allInit := true initFailed := false for _, s := range pod.Status.InitContainerStatuses { switch { case initFailed && s.State.Waiting == nil: return allInit, initFailed, fmt.Errorf("container %s is after a failed container but isn't waiting", s.Name) case allInit && s.State.Waiting == nil: return allInit, initFailed, fmt.Errorf("container %s is after an initializing container but isn't waiting", s.Name) case s.State.Terminated == nil: allInit = false case s.State.Terminated.ExitCode != 0: allInit = false initFailed = true case !s.Ready: return allInit, initFailed, fmt.Errorf("container %s initialized but isn't marked as ready", s.Name) } } return allInit, initFailed, nil } func initContainersInvariants(pod *v1.Pod) error { allInit, initFailed, err := podInitialized(pod) if err != nil { return err } if !allInit || initFailed { for _, s := range pod.Status.ContainerStatuses { if s.State.Waiting == nil || s.RestartCount != 0 { return fmt.Errorf("container %s is not waiting but initialization not complete", s.Name) } if s.State.Waiting.Reason != "PodInitializing" { return fmt.Errorf("container %s should have reason PodInitializing: %s", s.Name, s.State.Waiting.Reason) } } } _, c := podutil.GetPodCondition(&pod.Status, v1.PodInitialized) if c == nil { return fmt.Errorf("pod does not have initialized condition") } if c.LastTransitionTime.IsZero() { return fmt.Errorf("PodInitialized condition should always have a transition time") } switch { case c.Status == v1.ConditionUnknown: return fmt.Errorf("PodInitialized condition should never be Unknown") case c.Status == v1.ConditionTrue && (initFailed || !allInit): return fmt.Errorf("PodInitialized condition was True but all not all containers initialized") case c.Status == v1.ConditionFalse && (!initFailed && allInit): return fmt.Errorf("PodInitialized condition was False but all containers initialized") } return nil } type InvariantFunc func(older, newer runtime.Object) error func CheckInvariants(events []watch.Event, fns ...InvariantFunc) error { errs := sets.NewString() for i := range events { j := i + 1 if j >= len(events) { continue } for _, fn := range fns { if err := fn(events[i].Object, events[j].Object); err != nil { errs.Insert(err.Error()) } } } if errs.Len() > 0 { return fmt.Errorf("invariants violated:\n* %s", strings.Join(errs.List(), "\n* ")) } return nil } // Waits default amount of time (PodStartTimeout) for the specified pod to become running. // Returns an error if timeout occurs first, or pod goes in to failed state. func WaitForPodRunningInNamespace(c clientset.Interface, pod *v1.Pod) error { if pod.Status.Phase == v1.PodRunning { return nil } return waitTimeoutForPodRunningInNamespace(c, pod.Name, pod.Namespace, PodStartTimeout) } // Waits default amount of time (PodStartTimeout) for the specified pod to become running. // Returns an error if timeout occurs first, or pod goes in to failed state. func WaitForPodNameRunningInNamespace(c clientset.Interface, podName, namespace string) error { return waitTimeoutForPodRunningInNamespace(c, podName, namespace, PodStartTimeout) } // Waits an extended amount of time (slowPodStartTimeout) for the specified pod to become running. // The resourceVersion is used when Watching object changes, it tells since when we care // about changes to the pod. Returns an error if timeout occurs first, or pod goes in to failed state. func waitForPodRunningInNamespaceSlow(c clientset.Interface, podName, namespace string) error { return waitTimeoutForPodRunningInNamespace(c, podName, namespace, slowPodStartTimeout) } func waitTimeoutForPodRunningInNamespace(c clientset.Interface, podName, namespace string, timeout time.Duration) error { return wait.PollImmediate(Poll, timeout, podRunning(c, podName, namespace)) } func podRunning(c clientset.Interface, podName, namespace string) wait.ConditionFunc { return func() (bool, error) { pod, err := c.CoreV1().Pods(namespace).Get(podName, metav1.GetOptions{}) if err != nil { return false, err } switch pod.Status.Phase { case v1.PodRunning: return true, nil case v1.PodFailed, v1.PodSucceeded: return false, conditions.ErrPodCompleted } return false, nil } } // Waits default amount of time (DefaultPodDeletionTimeout) for the specified pod to stop running. // Returns an error if timeout occurs first. func WaitForPodNoLongerRunningInNamespace(c clientset.Interface, podName, namespace string) error { return WaitTimeoutForPodNoLongerRunningInNamespace(c, podName, namespace, DefaultPodDeletionTimeout) } func WaitTimeoutForPodNoLongerRunningInNamespace(c clientset.Interface, podName, namespace string, timeout time.Duration) error { return wait.PollImmediate(Poll, timeout, podCompleted(c, podName, namespace)) } func podCompleted(c clientset.Interface, podName, namespace string) wait.ConditionFunc { return func() (bool, error) { pod, err := c.CoreV1().Pods(namespace).Get(podName, metav1.GetOptions{}) if err != nil { return false, err } switch pod.Status.Phase { case v1.PodFailed, v1.PodSucceeded: return true, nil } return false, nil } } func waitTimeoutForPodReadyInNamespace(c clientset.Interface, podName, namespace string, timeout time.Duration) error { return wait.PollImmediate(Poll, timeout, podRunningAndReady(c, podName, namespace)) } func podRunningAndReady(c clientset.Interface, podName, namespace string) wait.ConditionFunc { return func() (bool, error) { pod, err := c.CoreV1().Pods(namespace).Get(podName, metav1.GetOptions{}) if err != nil { return false, err } switch pod.Status.Phase { case v1.PodFailed, v1.PodSucceeded: return false, conditions.ErrPodCompleted case v1.PodRunning: return podutil.IsPodReady(pod), nil } return false, nil } } // WaitForPodNotPending returns an error if it took too long for the pod to go out of pending state. // The resourceVersion is used when Watching object changes, it tells since when we care // about changes to the pod. func WaitForPodNotPending(c clientset.Interface, ns, podName string) error { return wait.PollImmediate(Poll, PodStartTimeout, podNotPending(c, podName, ns)) } func podNotPending(c clientset.Interface, podName, namespace string) wait.ConditionFunc { return func() (bool, error) { pod, err := c.CoreV1().Pods(namespace).Get(podName, metav1.GetOptions{}) if err != nil { return false, err } switch pod.Status.Phase { case v1.PodPending: return false, nil default: return true, nil } } } // waitForPodTerminatedInNamespace returns an error if it takes too long for the pod to terminate, // if the pod Get api returns an error (IsNotFound or other), or if the pod failed (and thus did not // terminate) with an unexpected reason. Typically called to test that the passed-in pod is fully // terminated (reason==""), but may be called to detect if a pod did *not* terminate according to // the supplied reason. func waitForPodTerminatedInNamespace(c clientset.Interface, podName, reason, namespace string) error { return WaitForPodCondition(c, namespace, podName, "terminated due to deadline exceeded", PodStartTimeout, func(pod *v1.Pod) (bool, error) { // Only consider Failed pods. Successful pods will be deleted and detected in // waitForPodCondition's Get call returning `IsNotFound` if pod.Status.Phase == v1.PodFailed { if pod.Status.Reason == reason { // short-circuit waitForPodCondition's loop return true, nil } else { return true, fmt.Errorf("Expected pod %q in namespace %q to be terminated with reason %q, got reason: %q", podName, namespace, reason, pod.Status.Reason) } } return false, nil }) } // waitForPodNotFoundInNamespace returns an error if it takes too long for the pod to fully terminate. // Unlike `waitForPodTerminatedInNamespace`, the pod's Phase and Reason are ignored. If the pod Get // api returns IsNotFound then the wait stops and nil is returned. If the Get api returns an error other // than "not found" then that error is returned and the wait stops. func waitForPodNotFoundInNamespace(c clientset.Interface, podName, ns string, timeout time.Duration) error { return wait.PollImmediate(Poll, timeout, func() (bool, error) { _, err := c.CoreV1().Pods(ns).Get(podName, metav1.GetOptions{}) if apierrs.IsNotFound(err) { return true, nil // done } if err != nil { return true, err // stop wait with error } return false, nil }) } // waitForPodSuccessInNamespaceTimeout returns nil if the pod reached state success, or an error if it reached failure or ran too long. func waitForPodSuccessInNamespaceTimeout(c clientset.Interface, podName string, namespace string, timeout time.Duration) error { return WaitForPodCondition(c, namespace, podName, "success or failure", timeout, func(pod *v1.Pod) (bool, error) { if pod.Spec.RestartPolicy == v1.RestartPolicyAlways { return true, fmt.Errorf("pod %q will never terminate with a succeeded state since its restart policy is Always", podName) } switch pod.Status.Phase { case v1.PodSucceeded: By("Saw pod success") return true, nil case v1.PodFailed: return true, fmt.Errorf("pod %q failed with status: %+v", podName, pod.Status) default: return false, nil } }) } // WaitForPodSuccessInNamespace returns nil if the pod reached state success, or an error if it reached failure or until podStartupTimeout. func WaitForPodSuccessInNamespace(c clientset.Interface, podName string, namespace string) error { return waitForPodSuccessInNamespaceTimeout(c, podName, namespace, PodStartTimeout) } // WaitForPodSuccessInNamespaceSlow returns nil if the pod reached state success, or an error if it reached failure or until slowPodStartupTimeout. func WaitForPodSuccessInNamespaceSlow(c clientset.Interface, podName string, namespace string) error { return waitForPodSuccessInNamespaceTimeout(c, podName, namespace, slowPodStartTimeout) } // WaitForRCToStabilize waits till the RC has a matching generation/replica count between spec and status. func WaitForRCToStabilize(c clientset.Interface, ns, name string, timeout time.Duration) error { options := metav1.ListOptions{FieldSelector: fields.Set{ "metadata.name": name, "metadata.namespace": ns, }.AsSelector().String()} w, err := c.CoreV1().ReplicationControllers(ns).Watch(options) if err != nil { return err } _, err = watch.Until(timeout, w, func(event watch.Event) (bool, error) { switch event.Type { case watch.Deleted: return false, apierrs.NewNotFound(schema.GroupResource{Resource: "replicationcontrollers"}, "") } switch rc := event.Object.(type) { case *v1.ReplicationController: if rc.Name == name && rc.Namespace == ns && rc.Generation <= rc.Status.ObservedGeneration && *(rc.Spec.Replicas) == rc.Status.Replicas { return true, nil } Logf("Waiting for rc %s to stabilize, generation %v observed generation %v spec.replicas %d status.replicas %d", name, rc.Generation, rc.Status.ObservedGeneration, *(rc.Spec.Replicas), rc.Status.Replicas) } return false, nil }) return err } func WaitForPodToDisappear(c clientset.Interface, ns, podName string, label labels.Selector, interval, timeout time.Duration) error { return wait.PollImmediate(interval, timeout, func() (bool, error) { Logf("Waiting for pod %s to disappear", podName) options := metav1.ListOptions{LabelSelector: label.String()} pods, err := c.CoreV1().Pods(ns).List(options) if err != nil { if IsRetryableAPIError(err) { return false, nil } return false, err } found := false for _, pod := range pods.Items { if pod.Name == podName { Logf("Pod %s still exists", podName) found = true break } } if !found { Logf("Pod %s no longer exists", podName) return true, nil } return false, nil }) } // WaitForPodNameUnschedulableInNamespace returns an error if it takes too long for the pod to become Pending // and have condition Status equal to Unschedulable, // if the pod Get api returns an error (IsNotFound or other), or if the pod failed with an unexpected reason. // Typically called to test that the passed-in pod is Pending and Unschedulable. func WaitForPodNameUnschedulableInNamespace(c clientset.Interface, podName, namespace string) error { return WaitForPodCondition(c, namespace, podName, "Unschedulable", PodStartTimeout, func(pod *v1.Pod) (bool, error) { // Only consider Failed pods. Successful pods will be deleted and detected in // waitForPodCondition's Get call returning `IsNotFound` if pod.Status.Phase == v1.PodPending { for _, cond := range pod.Status.Conditions { if cond.Type == v1.PodScheduled && cond.Status == v1.ConditionFalse && cond.Reason == "Unschedulable" { return true, nil } } } if pod.Status.Phase == v1.PodRunning || pod.Status.Phase == v1.PodSucceeded || pod.Status.Phase == v1.PodFailed { return true, fmt.Errorf("Expected pod %q in namespace %q to be in phase Pending, but got phase: %v", podName, namespace, pod.Status.Phase) } return false, nil }) } // WaitForService waits until the service appears (exist == true), or disappears (exist == false) func WaitForService(c clientset.Interface, namespace, name string, exist bool, interval, timeout time.Duration) error { err := wait.PollImmediate(interval, timeout, func() (bool, error) { _, err := c.CoreV1().Services(namespace).Get(name, metav1.GetOptions{}) switch { case err == nil: Logf("Service %s in namespace %s found.", name, namespace) return exist, nil case apierrs.IsNotFound(err): Logf("Service %s in namespace %s disappeared.", name, namespace) return !exist, nil case !IsRetryableAPIError(err): Logf("Non-retryable failure while getting service.") return false, err default: Logf("Get service %s in namespace %s failed: %v", name, namespace, err) return false, nil } }) if err != nil { stateMsg := map[bool]string{true: "to appear", false: "to disappear"} return fmt.Errorf("error waiting for service %s/%s %s: %v", namespace, name, stateMsg[exist], err) } return nil } // WaitForServiceWithSelector waits until any service with given selector appears (exist == true), or disappears (exist == false) func WaitForServiceWithSelector(c clientset.Interface, namespace string, selector labels.Selector, exist bool, interval, timeout time.Duration) error { err := wait.PollImmediate(interval, timeout, func() (bool, error) { services, err := c.CoreV1().Services(namespace).List(metav1.ListOptions{LabelSelector: selector.String()}) switch { case len(services.Items) != 0: Logf("Service with %s in namespace %s found.", selector.String(), namespace) return exist, nil case len(services.Items) == 0: Logf("Service with %s in namespace %s disappeared.", selector.String(), namespace) return !exist, nil case !IsRetryableAPIError(err): Logf("Non-retryable failure while listing service.") return false, err default: Logf("List service with %s in namespace %s failed: %v", selector.String(), namespace, err) return false, nil } }) if err != nil { stateMsg := map[bool]string{true: "to appear", false: "to disappear"} return fmt.Errorf("error waiting for service with %s in namespace %s %s: %v", selector.String(), namespace, stateMsg[exist], err) } return nil } //WaitForServiceEndpointsNum waits until the amount of endpoints that implement service to expectNum. func WaitForServiceEndpointsNum(c clientset.Interface, namespace, serviceName string, expectNum int, interval, timeout time.Duration) error { return wait.Poll(interval, timeout, func() (bool, error) { Logf("Waiting for amount of service:%s endpoints to be %d", serviceName, expectNum) list, err := c.CoreV1().Endpoints(namespace).List(metav1.ListOptions{}) if err != nil { return false, err } for _, e := range list.Items { if e.Name == serviceName && countEndpointsNum(&e) == expectNum { return true, nil } } return false, nil }) } func countEndpointsNum(e *v1.Endpoints) int { num := 0 for _, sub := range e.Subsets { num += len(sub.Addresses) } return num } func WaitForEndpoint(c clientset.Interface, ns, name string) error { for t := time.Now(); time.Since(t) < EndpointRegisterTimeout; time.Sleep(Poll) { endpoint, err := c.CoreV1().Endpoints(ns).Get(name, metav1.GetOptions{}) if apierrs.IsNotFound(err) { Logf("Endpoint %s/%s is not ready yet", ns, name) continue } Expect(err).NotTo(HaveOccurred()) if len(endpoint.Subsets) == 0 || len(endpoint.Subsets[0].Addresses) == 0 { Logf("Endpoint %s/%s is not ready yet", ns, name) continue } else { return nil } } return fmt.Errorf("Failed to get endpoints for %s/%s", ns, name) } // Context for checking pods responses by issuing GETs to them (via the API // proxy) and verifying that they answer with there own pod name. type podProxyResponseChecker struct { c clientset.Interface ns string label labels.Selector controllerName string respondName bool // Whether the pod should respond with its own name. pods *v1.PodList } func PodProxyResponseChecker(c clientset.Interface, ns string, label labels.Selector, controllerName string, respondName bool, pods *v1.PodList) podProxyResponseChecker { return podProxyResponseChecker{c, ns, label, controllerName, respondName, pods} } // CheckAllResponses issues GETs to all pods in the context and verify they // reply with their own pod name. func (r podProxyResponseChecker) CheckAllResponses() (done bool, err error) { successes := 0 options := metav1.ListOptions{LabelSelector: r.label.String()} currentPods, err := r.c.CoreV1().Pods(r.ns).List(options) Expect(err).NotTo(HaveOccurred()) for i, pod := range r.pods.Items { // Check that the replica list remains unchanged, otherwise we have problems. if !isElementOf(pod.UID, currentPods) { return false, fmt.Errorf("pod with UID %s is no longer a member of the replica set. Must have been restarted for some reason. Current replica set: %v", pod.UID, currentPods) } ctx, cancel := context.WithTimeout(context.Background(), SingleCallTimeout) defer cancel() body, err := r.c.CoreV1().RESTClient().Get(). Context(ctx). Namespace(r.ns). Resource("pods"). SubResource("proxy"). Name(string(pod.Name)). Do(). Raw() if err != nil { if ctx.Err() != nil { // We may encounter errors here because of a race between the pod readiness and apiserver // proxy. So, we log the error and retry if this occurs. Logf("Controller %s: Failed to Get from replica %d [%s]: %v\n pod status: %#v", r.controllerName, i+1, pod.Name, err, pod.Status) return false, nil } Logf("Controller %s: Failed to GET from replica %d [%s]: %v\npod status: %#v", r.controllerName, i+1, pod.Name, err, pod.Status) continue } // The response checker expects the pod's name unless !respondName, in // which case it just checks for a non-empty response. got := string(body) what := "" if r.respondName { what = "expected" want := pod.Name if got != want { Logf("Controller %s: Replica %d [%s] expected response %q but got %q", r.controllerName, i+1, pod.Name, want, got) continue } } else { what = "non-empty" if len(got) == 0 { Logf("Controller %s: Replica %d [%s] expected non-empty response", r.controllerName, i+1, pod.Name) continue } } successes++ Logf("Controller %s: Got %s result from replica %d [%s]: %q, %d of %d required successes so far", r.controllerName, what, i+1, pod.Name, got, successes, len(r.pods.Items)) } if successes < len(r.pods.Items) { return false, nil } return true, nil } // ServerVersionGTE returns true if v is greater than or equal to the server // version. // // TODO(18726): This should be incorporated into client.VersionInterface. func ServerVersionGTE(v *utilversion.Version, c discovery.ServerVersionInterface) (bool, error) { serverVersion, err := c.ServerVersion() if err != nil { return false, fmt.Errorf("Unable to get server version: %v", err) } sv, err := utilversion.ParseSemantic(serverVersion.GitVersion) if err != nil { return false, fmt.Errorf("Unable to parse server version %q: %v", serverVersion.GitVersion, err) } return sv.AtLeast(v), nil } func SkipUnlessKubectlVersionGTE(v *utilversion.Version) { gte, err := KubectlVersionGTE(v) if err != nil { Failf("Failed to get kubectl version: %v", err) } if !gte { Skipf("Not supported for kubectl versions before %q", v) } } // KubectlVersionGTE returns true if the kubectl version is greater than or // equal to v. func KubectlVersionGTE(v *utilversion.Version) (bool, error) { kv, err := KubectlVersion() if err != nil { return false, err } return kv.AtLeast(v), nil } // KubectlVersion gets the version of kubectl that's currently being used (see // --kubectl-path in e2e.go to use an alternate kubectl). func KubectlVersion() (*utilversion.Version, error) { output := RunKubectlOrDie("version", "--client") matches := gitVersionRegexp.FindStringSubmatch(output) if len(matches) != 2 { return nil, fmt.Errorf("Could not find kubectl version in output %v", output) } // Don't use the full match, as it contains "GitVersion:\"" and a // trailing "\"". Just use the submatch. return utilversion.ParseSemantic(matches[1]) } func PodsResponding(c clientset.Interface, ns, name string, wantName bool, pods *v1.PodList) error { By("trying to dial each unique pod") label := labels.SelectorFromSet(labels.Set(map[string]string{"name": name})) return wait.PollImmediate(Poll, podRespondingTimeout, PodProxyResponseChecker(c, ns, label, name, wantName, pods).CheckAllResponses) } func PodsCreated(c clientset.Interface, ns, name string, replicas int32) (*v1.PodList, error) { label := labels.SelectorFromSet(labels.Set(map[string]string{"name": name})) return PodsCreatedByLabel(c, ns, name, replicas, label) } func PodsCreatedByLabel(c clientset.Interface, ns, name string, replicas int32, label labels.Selector) (*v1.PodList, error) { timeout := 2 * time.Minute for start := time.Now(); time.Since(start) < timeout; time.Sleep(5 * time.Second) { options := metav1.ListOptions{LabelSelector: label.String()} // List the pods, making sure we observe all the replicas. pods, err := c.CoreV1().Pods(ns).List(options) if err != nil { return nil, err } created := []v1.Pod{} for _, pod := range pods.Items { if pod.DeletionTimestamp != nil { continue } created = append(created, pod) } Logf("Pod name %s: Found %d pods out of %d", name, len(created), replicas) if int32(len(created)) == replicas { pods.Items = created return pods, nil } } return nil, fmt.Errorf("Pod name %s: Gave up waiting %v for %d pods to come up", name, timeout, replicas) } func podsRunning(c clientset.Interface, pods *v1.PodList) []error { // Wait for the pods to enter the running state. Waiting loops until the pods // are running so non-running pods cause a timeout for this test. By("ensuring each pod is running") e := []error{} error_chan := make(chan error) for _, pod := range pods.Items { go func(p v1.Pod) { error_chan <- WaitForPodRunningInNamespace(c, &p) }(pod) } for range pods.Items { err := <-error_chan if err != nil { e = append(e, err) } } return e } func VerifyPods(c clientset.Interface, ns, name string, wantName bool, replicas int32) error { return podRunningMaybeResponding(c, ns, name, wantName, replicas, true) } func VerifyPodsRunning(c clientset.Interface, ns, name string, wantName bool, replicas int32) error { return podRunningMaybeResponding(c, ns, name, wantName, replicas, false) } func podRunningMaybeResponding(c clientset.Interface, ns, name string, wantName bool, replicas int32, checkResponding bool) error { pods, err := PodsCreated(c, ns, name, replicas) if err != nil { return err } e := podsRunning(c, pods) if len(e) > 0 { return fmt.Errorf("failed to wait for pods running: %v", e) } if checkResponding { err = PodsResponding(c, ns, name, wantName, pods) if err != nil { return fmt.Errorf("failed to wait for pods responding: %v", err) } } return nil } func ServiceResponding(c clientset.Interface, ns, name string) error { By(fmt.Sprintf("trying to dial the service %s.%s via the proxy", ns, name)) return wait.PollImmediate(Poll, ServiceRespondingTimeout, func() (done bool, err error) { proxyRequest, errProxy := GetServicesProxyRequest(c, c.CoreV1().RESTClient().Get()) if errProxy != nil { Logf("Failed to get services proxy request: %v:", errProxy) return false, nil } ctx, cancel := context.WithTimeout(context.Background(), SingleCallTimeout) defer cancel() body, err := proxyRequest.Namespace(ns). Context(ctx). Name(name). Do(). Raw() if err != nil { if ctx.Err() != nil { Failf("Failed to GET from service %s: %v", name, err) return true, err } Logf("Failed to GET from service %s: %v:", name, err) return false, nil } got := string(body) if len(got) == 0 { Logf("Service %s: expected non-empty response", name) return false, err // stop polling } Logf("Service %s: found nonempty answer: %s", name, got) return true, nil }) } func RestclientConfig(kubeContext string) (*clientcmdapi.Config, error) { Logf(">>> kubeConfig: %s", TestContext.KubeConfig) if TestContext.KubeConfig == "" { return nil, fmt.Errorf("KubeConfig must be specified to load client config") } c, err := clientcmd.LoadFromFile(TestContext.KubeConfig) if err != nil { return nil, fmt.Errorf("error loading KubeConfig: %v", err.Error()) } if kubeContext != "" { Logf(">>> kubeContext: %s", kubeContext) c.CurrentContext = kubeContext } return c, nil } type ClientConfigGetter func() (*restclient.Config, error) func LoadConfig() (*restclient.Config, error) { if TestContext.NodeE2E { // This is a node e2e test, apply the node e2e configuration return &restclient.Config{Host: TestContext.Host}, nil } c, err := RestclientConfig(TestContext.KubeContext) if err != nil { if TestContext.KubeConfig == "" { return restclient.InClusterConfig() } else { return nil, err } } return clientcmd.NewDefaultClientConfig(*c, &clientcmd.ConfigOverrides{ClusterInfo: clientcmdapi.Cluster{Server: TestContext.Host}}).ClientConfig() } func LoadInternalClientset() (*internalclientset.Clientset, error) { config, err := LoadConfig() if err != nil { return nil, fmt.Errorf("error creating client: %v", err.Error()) } return internalclientset.NewForConfig(config) } func LoadClientset() (*clientset.Clientset, error) { config, err := LoadConfig() if err != nil { return nil, fmt.Errorf("error creating client: %v", err.Error()) } return clientset.NewForConfig(config) } // randomSuffix provides a random string to append to pods,services,rcs. // TODO: Allow service names to have the same form as names // for pods and replication controllers so we don't // need to use such a function and can instead // use the UUID utility function. func randomSuffix() string { r := rand.New(rand.NewSource(time.Now().UnixNano())) return strconv.Itoa(r.Int() % 10000) } func ExpectNoError(err error, explain ...interface{}) { ExpectNoErrorWithOffset(1, err, explain...) } // ExpectNoErrorWithOffset checks if "err" is set, and if so, fails assertion while logging the error at "offset" levels above its caller // (for example, for call chain f -> g -> ExpectNoErrorWithOffset(1, ...) error would be logged for "f"). func ExpectNoErrorWithOffset(offset int, err error, explain ...interface{}) { if err != nil { Logf("Unexpected error occurred: %v", err) } ExpectWithOffset(1+offset, err).NotTo(HaveOccurred(), explain...) } func ExpectNoErrorWithRetries(fn func() error, maxRetries int, explain ...interface{}) { var err error for i := 0; i < maxRetries; i++ { err = fn() if err == nil { return } Logf("(Attempt %d of %d) Unexpected error occurred: %v", i+1, maxRetries, err) } ExpectWithOffset(1, err).NotTo(HaveOccurred(), explain...) } // Stops everything from filePath from namespace ns and checks if everything matching selectors from the given namespace is correctly stopped. func Cleanup(filePath, ns string, selectors ...string) { By("using delete to clean up resources") var nsArg string if ns != "" { nsArg = fmt.Sprintf("--namespace=%s", ns) } RunKubectlOrDie("delete", "--grace-period=0", "-f", filePath, nsArg) AssertCleanup(ns, selectors...) } // Asserts that cleanup of a namespace wrt selectors occurred. func AssertCleanup(ns string, selectors ...string) { var nsArg string if ns != "" { nsArg = fmt.Sprintf("--namespace=%s", ns) } for _, selector := range selectors { resources := RunKubectlOrDie("get", "rc,svc", "-l", selector, "--no-headers", nsArg) if resources != "" { Failf("Resources left running after stop:\n%s", resources) } pods := RunKubectlOrDie("get", "pods", "-l", selector, nsArg, "-o", "go-template={{ range .items }}{{ if not .metadata.deletionTimestamp }}{{ .metadata.name }}{{ \"\\n\" }}{{ end }}{{ end }}") if pods != "" { Failf("Pods left unterminated after stop:\n%s", pods) } } } // KubectlCmd runs the kubectl executable through the wrapper script. func KubectlCmd(args ...string) *exec.Cmd { defaultArgs := []string{} // Reference a --server option so tests can run anywhere. if TestContext.Host != "" { defaultArgs = append(defaultArgs, "--"+clientcmd.FlagAPIServer+"="+TestContext.Host) } if TestContext.KubeConfig != "" { defaultArgs = append(defaultArgs, "--"+clientcmd.RecommendedConfigPathFlag+"="+TestContext.KubeConfig) // Reference the KubeContext if TestContext.KubeContext != "" { defaultArgs = append(defaultArgs, "--"+clientcmd.FlagContext+"="+TestContext.KubeContext) } } else { if TestContext.CertDir != "" { defaultArgs = append(defaultArgs, fmt.Sprintf("--certificate-authority=%s", filepath.Join(TestContext.CertDir, "ca.crt")), fmt.Sprintf("--client-certificate=%s", filepath.Join(TestContext.CertDir, "kubecfg.crt")), fmt.Sprintf("--client-key=%s", filepath.Join(TestContext.CertDir, "kubecfg.key"))) } } kubectlArgs := append(defaultArgs, args...) //We allow users to specify path to kubectl, so you can test either "kubectl" or "cluster/kubectl.sh" //and so on. cmd := exec.Command(TestContext.KubectlPath, kubectlArgs...) //caller will invoke this and wait on it. return cmd } // kubectlBuilder is used to build, customize and execute a kubectl Command. // Add more functions to customize the builder as needed. type kubectlBuilder struct { cmd *exec.Cmd timeout <-chan time.Time } func NewKubectlCommand(args ...string) *kubectlBuilder { b := new(kubectlBuilder) b.cmd = KubectlCmd(args...) return b } func (b *kubectlBuilder) WithEnv(env []string) *kubectlBuilder { b.cmd.Env = env return b } func (b *kubectlBuilder) WithTimeout(t <-chan time.Time) *kubectlBuilder { b.timeout = t return b } func (b kubectlBuilder) WithStdinData(data string) *kubectlBuilder { b.cmd.Stdin = strings.NewReader(data) return &b } func (b kubectlBuilder) WithStdinReader(reader io.Reader) *kubectlBuilder { b.cmd.Stdin = reader return &b } func (b kubectlBuilder) ExecOrDie() string { str, err := b.Exec() Logf("stdout: %q", str) // In case of i/o timeout error, try talking to the apiserver again after 2s before dying. // Note that we're still dying after retrying so that we can get visibility to triage it further. if isTimeout(err) { Logf("Hit i/o timeout error, talking to the server 2s later to see if it's temporary.") time.Sleep(2 * time.Second) retryStr, retryErr := RunKubectl("version") Logf("stdout: %q", retryStr) Logf("err: %v", retryErr) } Expect(err).NotTo(HaveOccurred()) return str } func isTimeout(err error) bool { switch err := err.(type) { case net.Error: if err.Timeout() { return true } case *url.Error: if err, ok := err.Err.(net.Error); ok && err.Timeout() { return true } } return false } func (b kubectlBuilder) Exec() (string, error) { var stdout, stderr bytes.Buffer cmd := b.cmd cmd.Stdout, cmd.Stderr = &stdout, &stderr Logf("Running '%s %s'", cmd.Path, strings.Join(cmd.Args[1:], " ")) // skip arg[0] as it is printed separately if err := cmd.Start(); err != nil { return "", fmt.Errorf("error starting %v:\nCommand stdout:\n%v\nstderr:\n%v\nerror:\n%v\n", cmd, cmd.Stdout, cmd.Stderr, err) } errCh := make(chan error, 1) go func() { errCh <- cmd.Wait() }() select { case err := <-errCh: if err != nil { var rc int = 127 if ee, ok := err.(*exec.ExitError); ok { rc = int(ee.Sys().(syscall.WaitStatus).ExitStatus()) Logf("rc: %d", rc) } return "", uexec.CodeExitError{ Err: fmt.Errorf("error running %v:\nCommand stdout:\n%v\nstderr:\n%v\nerror:\n%v\n", cmd, cmd.Stdout, cmd.Stderr, err), Code: rc, } } case <-b.timeout: b.cmd.Process.Kill() return "", fmt.Errorf("timed out waiting for command %v:\nCommand stdout:\n%v\nstderr:\n%v\n", cmd, cmd.Stdout, cmd.Stderr) } Logf("stderr: %q", stderr.String()) return stdout.String(), nil } // RunKubectlOrDie is a convenience wrapper over kubectlBuilder func RunKubectlOrDie(args ...string) string { return NewKubectlCommand(args...).ExecOrDie() } // RunKubectl is a convenience wrapper over kubectlBuilder func RunKubectl(args ...string) (string, error) { return NewKubectlCommand(args...).Exec() } // RunKubectlOrDieInput is a convenience wrapper over kubectlBuilder that takes input to stdin func RunKubectlOrDieInput(data string, args ...string) string { return NewKubectlCommand(args...).WithStdinData(data).ExecOrDie() } // RunKubemciCmd is a convenience wrapper over kubectlBuilder to run kubemci. // It assumes that kubemci exists in PATH. func RunKubemciCmd(args ...string) (string, error) { // kubemci is assumed to be in PATH. kubemci := "kubemci" b := new(kubectlBuilder) if TestContext.KubeConfig != "" { args = append(args, "--"+clientcmd.RecommendedConfigPathFlag+"="+TestContext.KubeConfig) } args = append(args, "--gcp-project="+TestContext.CloudConfig.ProjectID) b.cmd = exec.Command(kubemci, args...) return b.Exec() } func StartCmdAndStreamOutput(cmd *exec.Cmd) (stdout, stderr io.ReadCloser, err error) { stdout, err = cmd.StdoutPipe() if err != nil { return } stderr, err = cmd.StderrPipe() if err != nil { return } Logf("Asynchronously running '%s %s'", cmd.Path, strings.Join(cmd.Args, " ")) err = cmd.Start() return } // Rough equivalent of ctrl+c for cleaning up processes. Intended to be run in defer. func TryKill(cmd *exec.Cmd) { if err := cmd.Process.Kill(); err != nil { Logf("ERROR failed to kill command %v! The process may leak", cmd) } } // testContainerOutputMatcher runs the given pod in the given namespace and waits // for all of the containers in the podSpec to move into the 'Success' status, and tests // the specified container log against the given expected output using the given matcher. func (f *Framework) testContainerOutputMatcher(scenarioName string, pod *v1.Pod, containerIndex int, expectedOutput []string, matcher func(string, ...interface{}) gomegatypes.GomegaMatcher) { By(fmt.Sprintf("Creating a pod to test %v", scenarioName)) if containerIndex < 0 || containerIndex >= len(pod.Spec.Containers) { Failf("Invalid container index: %d", containerIndex) } ExpectNoError(f.MatchContainerOutput(pod, pod.Spec.Containers[containerIndex].Name, expectedOutput, matcher)) } // MatchContainerOutput creates a pod and waits for all it's containers to exit with success. // It then tests that the matcher with each expectedOutput matches the output of the specified container. func (f *Framework) MatchContainerOutput( pod *v1.Pod, containerName string, expectedOutput []string, matcher func(string, ...interface{}) gomegatypes.GomegaMatcher) error { ns := pod.ObjectMeta.Namespace if ns == "" { ns = f.Namespace.Name } podClient := f.PodClientNS(ns) createdPod := podClient.Create(pod) defer func() { By("delete the pod") podClient.DeleteSync(createdPod.Name, &metav1.DeleteOptions{}, DefaultPodDeletionTimeout) }() // Wait for client pod to complete. podErr := WaitForPodSuccessInNamespace(f.ClientSet, createdPod.Name, ns) // Grab its logs. Get host first. podStatus, err := podClient.Get(createdPod.Name, metav1.GetOptions{}) if err != nil { return fmt.Errorf("failed to get pod status: %v", err) } if podErr != nil { // Pod failed. Dump all logs from all containers to see what's wrong for _, container := range podStatus.Spec.Containers { logs, err := GetPodLogs(f.ClientSet, ns, podStatus.Name, container.Name) if err != nil { Logf("Failed to get logs from node %q pod %q container %q: %v", podStatus.Spec.NodeName, podStatus.Name, container.Name, err) continue } Logf("Output of node %q pod %q container %q: %s", podStatus.Spec.NodeName, podStatus.Name, container.Name, logs) } return fmt.Errorf("expected pod %q success: %v", createdPod.Name, podErr) } Logf("Trying to get logs from node %s pod %s container %s: %v", podStatus.Spec.NodeName, podStatus.Name, containerName, err) // Sometimes the actual containers take a second to get started, try to get logs for 60s logs, err := GetPodLogs(f.ClientSet, ns, podStatus.Name, containerName) if err != nil { Logf("Failed to get logs from node %q pod %q container %q. %v", podStatus.Spec.NodeName, podStatus.Name, containerName, err) return fmt.Errorf("failed to get logs from %s for %s: %v", podStatus.Name, containerName, err) } for _, expected := range expectedOutput { m := matcher(expected) matches, err := m.Match(logs) if err != nil { return fmt.Errorf("expected %q in container output: %v", expected, err) } else if !matches { return fmt.Errorf("expected %q in container output: %s", expected, m.FailureMessage(logs)) } } return nil } type EventsLister func(opts metav1.ListOptions, ns string) (*v1.EventList, error) func DumpEventsInNamespace(eventsLister EventsLister, namespace string) { By(fmt.Sprintf("Collecting events from namespace %q.", namespace)) events, err := eventsLister(metav1.ListOptions{}, namespace) Expect(err).NotTo(HaveOccurred()) By(fmt.Sprintf("Found %d events.", len(events.Items))) // Sort events by their first timestamp sortedEvents := events.Items if len(sortedEvents) > 1 { sort.Sort(byFirstTimestamp(sortedEvents)) } for _, e := range sortedEvents { Logf("At %v - event for %v: %v %v: %v", e.FirstTimestamp, e.InvolvedObject.Name, e.Source, e.Reason, e.Message) } // Note that we don't wait for any Cleanup to propagate, which means // that if you delete a bunch of pods right before ending your test, // you may or may not see the killing/deletion/Cleanup events. } func DumpAllNamespaceInfo(c clientset.Interface, namespace string) { DumpEventsInNamespace(func(opts metav1.ListOptions, ns string) (*v1.EventList, error) { return c.CoreV1().Events(ns).List(opts) }, namespace) // If cluster is large, then the following logs are basically useless, because: // 1. it takes tens of minutes or hours to grab all of them // 2. there are so many of them that working with them are mostly impossible // So we dump them only if the cluster is relatively small. maxNodesForDump := 20 if nodes, err := c.CoreV1().Nodes().List(metav1.ListOptions{}); err == nil { if len(nodes.Items) <= maxNodesForDump { dumpAllPodInfo(c) dumpAllNodeInfo(c) } else { Logf("skipping dumping cluster info - cluster too large") } } else { Logf("unable to fetch node list: %v", err) } } // byFirstTimestamp sorts a slice of events by first timestamp, using their involvedObject's name as a tie breaker. type byFirstTimestamp []v1.Event func (o byFirstTimestamp) Len() int { return len(o) } func (o byFirstTimestamp) Swap(i, j int) { o[i], o[j] = o[j], o[i] } func (o byFirstTimestamp) Less(i, j int) bool { if o[i].FirstTimestamp.Equal(&o[j].FirstTimestamp) { return o[i].InvolvedObject.Name < o[j].InvolvedObject.Name } return o[i].FirstTimestamp.Before(&o[j].FirstTimestamp) } func dumpAllPodInfo(c clientset.Interface) { pods, err := c.CoreV1().Pods("").List(metav1.ListOptions{}) if err != nil { Logf("unable to fetch pod debug info: %v", err) } logPodStates(pods.Items) } func dumpAllNodeInfo(c clientset.Interface) { // It should be OK to list unschedulable Nodes here. nodes, err := c.CoreV1().Nodes().List(metav1.ListOptions{}) if err != nil { Logf("unable to fetch node list: %v", err) return } names := make([]string, len(nodes.Items)) for ix := range nodes.Items { names[ix] = nodes.Items[ix].Name } DumpNodeDebugInfo(c, names, Logf) } func DumpNodeDebugInfo(c clientset.Interface, nodeNames []string, logFunc func(fmt string, args ...interface{})) { for _, n := range nodeNames { logFunc("\nLogging node info for node %v", n) node, err := c.CoreV1().Nodes().Get(n, metav1.GetOptions{}) if err != nil { logFunc("Error getting node info %v", err) } logFunc("Node Info: %v", node) logFunc("\nLogging kubelet events for node %v", n) for _, e := range getNodeEvents(c, n) { logFunc("source %v type %v message %v reason %v first ts %v last ts %v, involved obj %+v", e.Source, e.Type, e.Message, e.Reason, e.FirstTimestamp, e.LastTimestamp, e.InvolvedObject) } logFunc("\nLogging pods the kubelet thinks is on node %v", n) podList, err := GetKubeletPods(c, n) if err != nil { logFunc("Unable to retrieve kubelet pods for node %v: %v", n, err) continue } for _, p := range podList.Items { logFunc("%v started at %v (%d+%d container statuses recorded)", p.Name, p.Status.StartTime, len(p.Status.InitContainerStatuses), len(p.Status.ContainerStatuses)) for _, c := range p.Status.InitContainerStatuses { logFunc("\tInit container %v ready: %v, restart count %v", c.Name, c.Ready, c.RestartCount) } for _, c := range p.Status.ContainerStatuses { logFunc("\tContainer %v ready: %v, restart count %v", c.Name, c.Ready, c.RestartCount) } } HighLatencyKubeletOperations(c, 10*time.Second, n, logFunc) // TODO: Log node resource info } } // logNodeEvents logs kubelet events from the given node. This includes kubelet // restart and node unhealthy events. Note that listing events like this will mess // with latency metrics, beware of calling it during a test. func getNodeEvents(c clientset.Interface, nodeName string) []v1.Event { selector := fields.Set{ "involvedObject.kind": "Node", "involvedObject.name": nodeName, "involvedObject.namespace": metav1.NamespaceAll, "source": "kubelet", }.AsSelector().String() options := metav1.ListOptions{FieldSelector: selector} events, err := c.CoreV1().Events(metav1.NamespaceSystem).List(options) if err != nil { Logf("Unexpected error retrieving node events %v", err) return []v1.Event{} } return events.Items } // waitListSchedulableNodesOrDie is a wrapper around listing nodes supporting retries. func waitListSchedulableNodesOrDie(c clientset.Interface) *v1.NodeList { var nodes *v1.NodeList var err error if wait.PollImmediate(Poll, SingleCallTimeout, func() (bool, error) { nodes, err = c.CoreV1().Nodes().List(metav1.ListOptions{FieldSelector: fields.Set{ "spec.unschedulable": "false", }.AsSelector().String()}) if err != nil { if IsRetryableAPIError(err) { return false, nil } return false, err } return true, nil }) != nil { ExpectNoError(err, "Non-retryable failure or timed out while listing nodes for e2e cluster.") } return nodes } // Node is schedulable if: // 1) doesn't have "unschedulable" field set // 2) it's Ready condition is set to true // 3) doesn't have NetworkUnavailable condition set to true func isNodeSchedulable(node *v1.Node) bool { nodeReady := IsNodeConditionSetAsExpected(node, v1.NodeReady, true) networkReady := IsNodeConditionUnset(node, v1.NodeNetworkUnavailable) || IsNodeConditionSetAsExpectedSilent(node, v1.NodeNetworkUnavailable, false) return !node.Spec.Unschedulable && nodeReady && networkReady } // Test whether a fake pod can be scheduled on "node", given its current taints. func isNodeUntainted(node *v1.Node) bool { fakePod := &v1.Pod{ TypeMeta: metav1.TypeMeta{ Kind: "Pod", APIVersion: testapi.Groups[v1.GroupName].GroupVersion().String(), }, ObjectMeta: metav1.ObjectMeta{ Name: "fake-not-scheduled", Namespace: "fake-not-scheduled", }, Spec: v1.PodSpec{ Containers: []v1.Container{ { Name: "fake-not-scheduled", Image: "fake-not-scheduled", }, }, }, } nodeInfo := schedulercache.NewNodeInfo() nodeInfo.SetNode(node) fit, _, err := predicates.PodToleratesNodeTaints(fakePod, nil, nodeInfo) if err != nil { Failf("Can't test predicates for node %s: %v", node.Name, err) return false } return fit } // GetReadySchedulableNodesOrDie addresses the common use case of getting nodes you can do work on. // 1) Needs to be schedulable. // 2) Needs to be ready. // If EITHER 1 or 2 is not true, most tests will want to ignore the node entirely. func GetReadySchedulableNodesOrDie(c clientset.Interface) (nodes *v1.NodeList) { nodes = waitListSchedulableNodesOrDie(c) // previous tests may have cause failures of some nodes. Let's skip // 'Not Ready' nodes, just in case (there is no need to fail the test). FilterNodes(nodes, func(node v1.Node) bool { return isNodeSchedulable(&node) && isNodeUntainted(&node) }) return nodes } func WaitForAllNodesSchedulable(c clientset.Interface, timeout time.Duration) error { Logf("Waiting up to %v for all (but %d) nodes to be schedulable", timeout, TestContext.AllowedNotReadyNodes) var notSchedulable []*v1.Node attempt := 0 return wait.PollImmediate(30*time.Second, timeout, func() (bool, error) { attempt++ notSchedulable = nil opts := metav1.ListOptions{ ResourceVersion: "0", FieldSelector: fields.Set{"spec.unschedulable": "false"}.AsSelector().String(), } nodes, err := c.CoreV1().Nodes().List(opts) if err != nil { Logf("Unexpected error listing nodes: %v", err) if IsRetryableAPIError(err) { return false, nil } return false, err } for i := range nodes.Items { node := &nodes.Items[i] if !isNodeSchedulable(node) { notSchedulable = append(notSchedulable, node) } } // Framework allows for <TestContext.AllowedNotReadyNodes> nodes to be non-ready, // to make it possible e.g. for incorrect deployment of some small percentage // of nodes (which we allow in cluster validation). Some nodes that are not // provisioned correctly at startup will never become ready (e.g. when something // won't install correctly), so we can't expect them to be ready at any point. // // However, we only allow non-ready nodes with some specific reasons. if len(notSchedulable) > 0 { // In large clusters, log them only every 10th pass. if len(nodes.Items) >= largeClusterThreshold && attempt%10 == 0 { Logf("Unschedulable nodes:") for i := range notSchedulable { Logf("-> %s Ready=%t Network=%t", notSchedulable[i].Name, IsNodeConditionSetAsExpectedSilent(notSchedulable[i], v1.NodeReady, true), IsNodeConditionSetAsExpectedSilent(notSchedulable[i], v1.NodeNetworkUnavailable, false)) } Logf("================================") } } return len(notSchedulable) <= TestContext.AllowedNotReadyNodes, nil }) } func GetPodSecretUpdateTimeout(c clientset.Interface) time.Duration { // With SecretManager(ConfigMapManager), we may have to wait up to full sync period + // TTL of secret(configmap) to elapse before the Kubelet projects the update into the // volume and the container picks it up. // So this timeout is based on default Kubelet sync period (1 minute) + maximum TTL for // secret(configmap) that's based on cluster size + additional time as a fudge factor. secretTTL, err := GetNodeTTLAnnotationValue(c) if err != nil { Logf("Couldn't get node TTL annotation (using default value of 0): %v", err) } podLogTimeout := 240*time.Second + secretTTL return podLogTimeout } func GetNodeTTLAnnotationValue(c clientset.Interface) (time.Duration, error) { nodes, err := c.CoreV1().Nodes().List(metav1.ListOptions{}) if err != nil || len(nodes.Items) == 0 { return time.Duration(0), fmt.Errorf("Couldn't list any nodes to get TTL annotation: %v", err) } // Since TTL the kubelet is using is stored in node object, for the timeout // purpose we take it from the first node (all of them should be the same). node := &nodes.Items[0] if node.Annotations == nil { return time.Duration(0), fmt.Errorf("No annotations found on the node") } value, ok := node.Annotations[v1.ObjectTTLAnnotationKey] if !ok { return time.Duration(0), fmt.Errorf("No TTL annotation found on the node") } intValue, err := strconv.Atoi(value) if err != nil { return time.Duration(0), fmt.Errorf("Cannot convert TTL annotation from %#v to int", *node) } return time.Duration(intValue) * time.Second, nil } func AddOrUpdateLabelOnNode(c clientset.Interface, nodeName string, labelKey, labelValue string) { ExpectNoError(testutil.AddLabelsToNode(c, nodeName, map[string]string{labelKey: labelValue})) } func AddOrUpdateLabelOnNodeAndReturnOldValue(c clientset.Interface, nodeName string, labelKey, labelValue string) string { var oldValue string node, err := c.CoreV1().Nodes().Get(nodeName, metav1.GetOptions{}) ExpectNoError(err) oldValue = node.Labels[labelKey] ExpectNoError(testutil.AddLabelsToNode(c, nodeName, map[string]string{labelKey: labelValue})) return oldValue } func ExpectNodeHasLabel(c clientset.Interface, nodeName string, labelKey string, labelValue string) { By("verifying the node has the label " + labelKey + " " + labelValue) node, err := c.CoreV1().Nodes().Get(nodeName, metav1.GetOptions{}) ExpectNoError(err) Expect(node.Labels[labelKey]).To(Equal(labelValue)) } func RemoveTaintOffNode(c clientset.Interface, nodeName string, taint v1.Taint) { ExpectNoError(controller.RemoveTaintOffNode(c, nodeName, nil, &taint)) VerifyThatTaintIsGone(c, nodeName, &taint) } func AddOrUpdateTaintOnNode(c clientset.Interface, nodeName string, taint v1.Taint) { ExpectNoError(controller.AddOrUpdateTaintOnNode(c, nodeName, &taint)) } // RemoveLabelOffNode is for cleaning up labels temporarily added to node, // won't fail if target label doesn't exist or has been removed. func RemoveLabelOffNode(c clientset.Interface, nodeName string, labelKey string) { By("removing the label " + labelKey + " off the node " + nodeName) ExpectNoError(testutil.RemoveLabelOffNode(c, nodeName, []string{labelKey})) By("verifying the node doesn't have the label " + labelKey) ExpectNoError(testutil.VerifyLabelsRemoved(c, nodeName, []string{labelKey})) } func VerifyThatTaintIsGone(c clientset.Interface, nodeName string, taint *v1.Taint) { By("verifying the node doesn't have the taint " + taint.ToString()) nodeUpdated, err := c.CoreV1().Nodes().Get(nodeName, metav1.GetOptions{}) ExpectNoError(err) if taintutils.TaintExists(nodeUpdated.Spec.Taints, taint) { Failf("Failed removing taint " + taint.ToString() + " of the node " + nodeName) } } func ExpectNodeHasTaint(c clientset.Interface, nodeName string, taint *v1.Taint) { By("verifying the node has the taint " + taint.ToString()) if has, err := NodeHasTaint(c, nodeName, taint); !has { ExpectNoError(err) Failf("Failed to find taint %s on node %s", taint.ToString(), nodeName) } } func NodeHasTaint(c clientset.Interface, nodeName string, taint *v1.Taint) (bool, error) { node, err := c.CoreV1().Nodes().Get(nodeName, metav1.GetOptions{}) if err != nil { return false, err } nodeTaints := node.Spec.Taints if len(nodeTaints) == 0 || !taintutils.TaintExists(nodeTaints, taint) { return false, nil } return true, nil } //AddOrUpdateAvoidPodOnNode adds avoidPods annotations to node, will override if it exists func AddOrUpdateAvoidPodOnNode(c clientset.Interface, nodeName string, avoidPods v1.AvoidPods) { err := wait.PollImmediate(Poll, SingleCallTimeout, func() (bool, error) { node, err := c.CoreV1().Nodes().Get(nodeName, metav1.GetOptions{}) if err != nil { if IsRetryableAPIError(err) { return false, nil } return false, err } taintsData, err := json.Marshal(avoidPods) ExpectNoError(err) if node.Annotations == nil { node.Annotations = make(map[string]string) } node.Annotations[v1.PreferAvoidPodsAnnotationKey] = string(taintsData) _, err = c.CoreV1().Nodes().Update(node) if err != nil { if !apierrs.IsConflict(err) { ExpectNoError(err) } else { Logf("Conflict when trying to add/update avoidPonds %v to %v", avoidPods, nodeName) } } return true, nil }) ExpectNoError(err) } //RemoveAnnotationOffNode removes AvoidPods annotations from the node. It does not fail if no such annotation exists. func RemoveAvoidPodsOffNode(c clientset.Interface, nodeName string) { err := wait.PollImmediate(Poll, SingleCallTimeout, func() (bool, error) { node, err := c.CoreV1().Nodes().Get(nodeName, metav1.GetOptions{}) if err != nil { if IsRetryableAPIError(err) { return false, nil } return false, err } if node.Annotations == nil { return true, nil } delete(node.Annotations, v1.PreferAvoidPodsAnnotationKey) _, err = c.CoreV1().Nodes().Update(node) if err != nil { if !apierrs.IsConflict(err) { ExpectNoError(err) } else { Logf("Conflict when trying to remove avoidPods to %v", nodeName) } } return true, nil }) ExpectNoError(err) } func ScaleResource( clientset clientset.Interface, internalClientset internalclientset.Interface, scalesGetter scaleclient.ScalesGetter, ns, name string, size uint, wait bool, kind schema.GroupKind, gr schema.GroupResource, ) error { By(fmt.Sprintf("Scaling %v %s in namespace %s to %d", kind, name, ns, size)) scaler := kubectl.ScalerFor(kind, internalClientset.Batch(), scalesGetter, gr) waitForScale := kubectl.NewRetryParams(5*time.Second, 1*time.Minute) waitForReplicas := kubectl.NewRetryParams(5*time.Second, 5*time.Minute) if err := scaler.Scale(ns, name, size, nil, waitForScale, waitForReplicas); err != nil { return fmt.Errorf("error while scaling RC %s to %d replicas: %v", name, size, err) } if !wait { return nil } return WaitForControlledPodsRunning(clientset, ns, name, kind) } // Wait up to 10 minutes for pods to become Running. func WaitForControlledPodsRunning(c clientset.Interface, ns, name string, kind schema.GroupKind) error { rtObject, err := getRuntimeObjectForKind(c, kind, ns, name) if err != nil { return err } selector, err := getSelectorFromRuntimeObject(rtObject) if err != nil { return err } err = testutil.WaitForPodsWithLabelRunning(c, ns, selector) if err != nil { return fmt.Errorf("Error while waiting for replication controller %s pods to be running: %v", name, err) } return nil } // Wait up to PodListTimeout for getting pods of the specified controller name and return them. func WaitForControlledPods(c clientset.Interface, ns, name string, kind schema.GroupKind) (pods *v1.PodList, err error) { rtObject, err := getRuntimeObjectForKind(c, kind, ns, name) if err != nil { return nil, err } selector, err := getSelectorFromRuntimeObject(rtObject) if err != nil { return nil, err } return WaitForPodsWithLabel(c, ns, selector) } // Returns true if all the specified pods are scheduled, else returns false. func podsWithLabelScheduled(c clientset.Interface, ns string, label labels.Selector) (bool, error) { PodStore := testutil.NewPodStore(c, ns, label, fields.Everything()) defer PodStore.Stop() pods := PodStore.List() if len(pods) == 0 { return false, nil } for _, pod := range pods { if pod.Spec.NodeName == "" { return false, nil } } return true, nil } // Wait for all matching pods to become scheduled and at least one // matching pod exists. Return the list of matching pods. func WaitForPodsWithLabelScheduled(c clientset.Interface, ns string, label labels.Selector) (pods *v1.PodList, err error) { err = wait.PollImmediate(Poll, podScheduledBeforeTimeout, func() (bool, error) { pods, err = WaitForPodsWithLabel(c, ns, label) if err != nil { return false, err } for _, pod := range pods.Items { if pod.Spec.NodeName == "" { return false, nil } } return true, nil }) return pods, err } // Wait up to PodListTimeout for getting pods with certain label func WaitForPodsWithLabel(c clientset.Interface, ns string, label labels.Selector) (pods *v1.PodList, err error) { for t := time.Now(); time.Since(t) < PodListTimeout; time.Sleep(Poll) { options := metav1.ListOptions{LabelSelector: label.String()} pods, err = c.CoreV1().Pods(ns).List(options) if err != nil { if IsRetryableAPIError(err) { continue } return } if len(pods.Items) > 0 { break } } if pods == nil || len(pods.Items) == 0 { err = fmt.Errorf("Timeout while waiting for pods with label %v", label) } return } // Wait for exact amount of matching pods to become running and ready. // Return the list of matching pods. func WaitForPodsWithLabelRunningReady(c clientset.Interface, ns string, label labels.Selector, num int, timeout time.Duration) (pods *v1.PodList, err error) { var current int err = wait.Poll(Poll, timeout, func() (bool, error) { pods, err := WaitForPodsWithLabel(c, ns, label) if err != nil { Logf("Failed to list pods: %v", err) if IsRetryableAPIError(err) { return false, nil } return false, err } current = 0 for _, pod := range pods.Items { if flag, err := testutil.PodRunningReady(&pod); err == nil && flag == true { current++ } } if current != num { Logf("Got %v pods running and ready, expect: %v", current, num) return false, nil } return true, nil }) return pods, err } func getRuntimeObjectForKind(c clientset.Interface, kind schema.GroupKind, ns, name string) (runtime.Object, error) { switch kind { case api.Kind("ReplicationController"): return c.CoreV1().ReplicationControllers(ns).Get(name, metav1.GetOptions{}) case extensionsinternal.Kind("ReplicaSet"), appsinternal.Kind("ReplicaSet"): return c.ExtensionsV1beta1().ReplicaSets(ns).Get(name, metav1.GetOptions{}) case extensionsinternal.Kind("Deployment"), appsinternal.Kind("Deployment"): return c.ExtensionsV1beta1().Deployments(ns).Get(name, metav1.GetOptions{}) case extensionsinternal.Kind("DaemonSet"): return c.ExtensionsV1beta1().DaemonSets(ns).Get(name, metav1.GetOptions{}) case batchinternal.Kind("Job"): return c.BatchV1().Jobs(ns).Get(name, metav1.GetOptions{}) default: return nil, fmt.Errorf("Unsupported kind when getting runtime object: %v", kind) } } func deleteResource(c clientset.Interface, kind schema.GroupKind, ns, name string, deleteOption *metav1.DeleteOptions) error { switch kind { case api.Kind("ReplicationController"): return c.CoreV1().ReplicationControllers(ns).Delete(name, deleteOption) case extensionsinternal.Kind("ReplicaSet"), appsinternal.Kind("ReplicaSet"): return c.ExtensionsV1beta1().ReplicaSets(ns).Delete(name, deleteOption) case extensionsinternal.Kind("Deployment"), appsinternal.Kind("Deployment"): return c.ExtensionsV1beta1().Deployments(ns).Delete(name, deleteOption) case extensionsinternal.Kind("DaemonSet"): return c.ExtensionsV1beta1().DaemonSets(ns).Delete(name, deleteOption) case batchinternal.Kind("Job"): return c.BatchV1().Jobs(ns).Delete(name, deleteOption) default: return fmt.Errorf("Unsupported kind when deleting: %v", kind) } } func getSelectorFromRuntimeObject(obj runtime.Object) (labels.Selector, error) { switch typed := obj.(type) { case *v1.ReplicationController: return labels.SelectorFromSet(typed.Spec.Selector), nil case *extensions.ReplicaSet: return metav1.LabelSelectorAsSelector(typed.Spec.Selector) case *extensions.Deployment: return metav1.LabelSelectorAsSelector(typed.Spec.Selector) case *extensions.DaemonSet: return metav1.LabelSelectorAsSelector(typed.Spec.Selector) case *batch.Job: return metav1.LabelSelectorAsSelector(typed.Spec.Selector) default: return nil, fmt.Errorf("Unsupported kind when getting selector: %v", obj) } } func getReplicasFromRuntimeObject(obj runtime.Object) (int32, error) { switch typed := obj.(type) { case *v1.ReplicationController: if typed.Spec.Replicas != nil { return *typed.Spec.Replicas, nil } return 0, nil case *extensions.ReplicaSet: if typed.Spec.Replicas != nil { return *typed.Spec.Replicas, nil } return 0, nil case *extensions.Deployment: if typed.Spec.Replicas != nil { return *typed.Spec.Replicas, nil } return 0, nil case *batch.Job: // TODO: currently we use pause pods so that's OK. When we'll want to switch to Pods // that actually finish we need a better way to do this. if typed.Spec.Parallelism != nil { return *typed.Spec.Parallelism, nil } return 0, nil default: return -1, fmt.Errorf("Unsupported kind when getting number of replicas: %v", obj) } } func getReaperForKind(internalClientset internalclientset.Interface, kind schema.GroupKind) (kubectl.Reaper, error) { return kubectl.ReaperFor(kind, internalClientset) } // DeleteResourceAndPods deletes a given resource and all pods it spawned func DeleteResourceAndPods(clientset clientset.Interface, internalClientset internalclientset.Interface, kind schema.GroupKind, ns, name string) error { By(fmt.Sprintf("deleting %v %s in namespace %s", kind, name, ns)) rtObject, err := getRuntimeObjectForKind(clientset, kind, ns, name) if err != nil { if apierrs.IsNotFound(err) { Logf("%v %s not found: %v", kind, name, err) return nil } return err } selector, err := getSelectorFromRuntimeObject(rtObject) if err != nil { return err } reaper, err := getReaperForKind(internalClientset, kind) if err != nil { return err } ps, err := podStoreForSelector(clientset, ns, selector) if err != nil { return err } defer ps.Stop() startTime := time.Now() err = reaper.Stop(ns, name, 0, nil) if apierrs.IsNotFound(err) { Logf("%v %s was already deleted: %v", kind, name, err) return nil } if err != nil { return fmt.Errorf("error while stopping %v: %s: %v", kind, name, err) } deleteTime := time.Now().Sub(startTime) Logf("Deleting %v %s took: %v", kind, name, deleteTime) err = waitForPodsInactive(ps, 100*time.Millisecond, 10*time.Minute) if err != nil { return fmt.Errorf("error while waiting for pods to become inactive %s: %v", name, err) } terminatePodTime := time.Now().Sub(startTime) - deleteTime Logf("Terminating %v %s pods took: %v", kind, name, terminatePodTime) // this is to relieve namespace controller's pressure when deleting the // namespace after a test. err = waitForPodsGone(ps, 100*time.Millisecond, 10*time.Minute) if err != nil { return fmt.Errorf("error while waiting for pods gone %s: %v", name, err) } gcPodTime := time.Now().Sub(startTime) - terminatePodTime Logf("Garbage collecting %v %s pods took: %v", kind, name, gcPodTime) return nil } // DeleteResourceAndWaitForGC deletes only given resource and waits for GC to delete the pods. func DeleteResourceAndWaitForGC(c clientset.Interface, kind schema.GroupKind, ns, name string) error { By(fmt.Sprintf("deleting %v %s in namespace %s, will wait for the garbage collector to delete the pods", kind, name, ns)) rtObject, err := getRuntimeObjectForKind(c, kind, ns, name) if err != nil { if apierrs.IsNotFound(err) { Logf("%v %s not found: %v", kind, name, err) return nil } return err } selector, err := getSelectorFromRuntimeObject(rtObject) if err != nil { return err } replicas, err := getReplicasFromRuntimeObject(rtObject) if err != nil { return err } ps, err := podStoreForSelector(c, ns, selector) if err != nil { return err } defer ps.Stop() startTime := time.Now() falseVar := false deleteOption := &metav1.DeleteOptions{OrphanDependents: &falseVar} err = deleteResource(c, kind, ns, name, deleteOption) if err != nil && apierrs.IsNotFound(err) { Logf("%v %s was already deleted: %v", kind, name, err) return nil } if err != nil { return err } deleteTime := time.Now().Sub(startTime) Logf("Deleting %v %s took: %v", kind, name, deleteTime) var interval, timeout time.Duration switch { case replicas < 100: interval = 100 * time.Millisecond case replicas < 1000: interval = 1 * time.Second default: interval = 10 * time.Second } if replicas < 5000 { timeout = 10 * time.Minute } else { timeout = time.Duration(replicas/gcThroughput) * time.Second // gcThroughput is pretty strict now, add a bit more to it timeout = timeout + 3*time.Minute } err = waitForPodsInactive(ps, interval, timeout) if err != nil { return fmt.Errorf("error while waiting for pods to become inactive %s: %v", name, err) } terminatePodTime := time.Now().Sub(startTime) - deleteTime Logf("Terminating %v %s pods took: %v", kind, name, terminatePodTime) err = waitForPodsGone(ps, interval, 10*time.Minute) if err != nil { return fmt.Errorf("error while waiting for pods gone %s: %v", name, err) } return nil } // podStoreForSelector creates a PodStore that monitors pods from given namespace matching given selector. // It waits until the reflector does a List() before returning. func podStoreForSelector(c clientset.Interface, ns string, selector labels.Selector) (*testutil.PodStore, error) { ps := testutil.NewPodStore(c, ns, selector, fields.Everything()) err := wait.Poll(100*time.Millisecond, 2*time.Minute, func() (bool, error) { if len(ps.Reflector.LastSyncResourceVersion()) != 0 { return true, nil } return false, nil }) return ps, err } // waitForPodsInactive waits until there are no active pods left in the PodStore. // This is to make a fair comparison of deletion time between DeleteRCAndPods // and DeleteRCAndWaitForGC, because the RC controller decreases status.replicas // when the pod is inactvie. func waitForPodsInactive(ps *testutil.PodStore, interval, timeout time.Duration) error { return wait.PollImmediate(interval, timeout, func() (bool, error) { pods := ps.List() for _, pod := range pods { if controller.IsPodActive(pod) { return false, nil } } return true, nil }) } // waitForPodsGone waits until there are no pods left in the PodStore. func waitForPodsGone(ps *testutil.PodStore, interval, timeout time.Duration) error { return wait.PollImmediate(interval, timeout, func() (bool, error) { if pods := ps.List(); len(pods) == 0 { return true, nil } return false, nil }) } func WaitForPodsReady(c clientset.Interface, ns, name string, minReadySeconds int) error { label := labels.SelectorFromSet(labels.Set(map[string]string{"name": name})) options := metav1.ListOptions{LabelSelector: label.String()} return wait.Poll(Poll, 5*time.Minute, func() (bool, error) { pods, err := c.CoreV1().Pods(ns).List(options) if err != nil { return false, nil } for _, pod := range pods.Items { if !podutil.IsPodAvailable(&pod, int32(minReadySeconds), metav1.Now()) { return false, nil } } return true, nil }) } // Waits for the number of events on the given object to reach a desired count. func WaitForEvents(c clientset.Interface, ns string, objOrRef runtime.Object, desiredEventsCount int) error { return wait.Poll(Poll, 5*time.Minute, func() (bool, error) { events, err := c.CoreV1().Events(ns).Search(legacyscheme.Scheme, objOrRef) if err != nil { return false, fmt.Errorf("error in listing events: %s", err) } eventsCount := len(events.Items) if eventsCount == desiredEventsCount { return true, nil } if eventsCount < desiredEventsCount { return false, nil } // Number of events has exceeded the desired count. return false, fmt.Errorf("number of events has exceeded the desired count, eventsCount: %d, desiredCount: %d", eventsCount, desiredEventsCount) }) } // Waits for the number of events on the given object to be at least a desired count. func WaitForPartialEvents(c clientset.Interface, ns string, objOrRef runtime.Object, atLeastEventsCount int) error { return wait.Poll(Poll, 5*time.Minute, func() (bool, error) { events, err := c.CoreV1().Events(ns).Search(legacyscheme.Scheme, objOrRef) if err != nil { return false, fmt.Errorf("error in listing events: %s", err) } eventsCount := len(events.Items) if eventsCount >= atLeastEventsCount { return true, nil } return false, nil }) } type updateDSFunc func(*extensions.DaemonSet) func UpdateDaemonSetWithRetries(c clientset.Interface, namespace, name string, applyUpdate updateDSFunc) (ds *extensions.DaemonSet, err error) { daemonsets := c.ExtensionsV1beta1().DaemonSets(namespace) var updateErr error pollErr := wait.PollImmediate(10*time.Millisecond, 1*time.Minute, func() (bool, error) { if ds, err = daemonsets.Get(name, metav1.GetOptions{}); err != nil { if IsRetryableAPIError(err) { return false, nil } return false, err } // Apply the update, then attempt to push it to the apiserver. applyUpdate(ds) if ds, err = daemonsets.Update(ds); err == nil { Logf("Updating DaemonSet %s", name) return true, nil } updateErr = err return false, nil }) if pollErr == wait.ErrWaitTimeout { pollErr = fmt.Errorf("couldn't apply the provided updated to DaemonSet %q: %v", name, updateErr) } return ds, pollErr } // NodeAddresses returns the first address of the given type of each node. func NodeAddresses(nodelist *v1.NodeList, addrType v1.NodeAddressType) []string { hosts := []string{} for _, n := range nodelist.Items { for _, addr := range n.Status.Addresses { // Use the first external IP address we find on the node, and // use at most one per node. // TODO(roberthbailey): Use the "preferred" address for the node, once // such a thing is defined (#2462). if addr.Type == addrType { hosts = append(hosts, addr.Address) break } } } return hosts } // NodeSSHHosts returns SSH-able host names for all schedulable nodes - this excludes master node. // It returns an error if it can't find an external IP for every node, though it still returns all // hosts that it found in that case. func NodeSSHHosts(c clientset.Interface) ([]string, error) { nodelist := waitListSchedulableNodesOrDie(c) // TODO(roberthbailey): Use the "preferred" address for the node, once such a thing is defined (#2462). hosts := NodeAddresses(nodelist, v1.NodeExternalIP) // Error if any node didn't have an external IP. if len(hosts) != len(nodelist.Items) { return hosts, fmt.Errorf( "only found %d external IPs on nodes, but found %d nodes. Nodelist: %v", len(hosts), len(nodelist.Items), nodelist) } sshHosts := make([]string, 0, len(hosts)) for _, h := range hosts { sshHosts = append(sshHosts, net.JoinHostPort(h, sshPort)) } return sshHosts, nil } type SSHResult struct { User string Host string Cmd string Stdout string Stderr string Code int } // NodeExec execs the given cmd on node via SSH. Note that the nodeName is an sshable name, // eg: the name returned by framework.GetMasterHost(). This is also not guaranteed to work across // cloud providers since it involves ssh. func NodeExec(nodeName, cmd string) (SSHResult, error) { return SSH(cmd, net.JoinHostPort(nodeName, sshPort), TestContext.Provider) } // SSH synchronously SSHs to a node running on provider and runs cmd. If there // is no error performing the SSH, the stdout, stderr, and exit code are // returned. func SSH(cmd, host, provider string) (SSHResult, error) { result := SSHResult{Host: host, Cmd: cmd} // Get a signer for the provider. signer, err := GetSigner(provider) if err != nil { return result, fmt.Errorf("error getting signer for provider %s: '%v'", provider, err) } // RunSSHCommand will default to Getenv("USER") if user == "", but we're // defaulting here as well for logging clarity. result.User = os.Getenv("KUBE_SSH_USER") if result.User == "" { result.User = os.Getenv("USER") } stdout, stderr, code, err := sshutil.RunSSHCommand(cmd, result.User, host, signer) result.Stdout = stdout result.Stderr = stderr result.Code = code return result, err } func LogSSHResult(result SSHResult) { remote := fmt.Sprintf("%s@%s", result.User, result.Host) Logf("ssh %s: command: %s", remote, result.Cmd) Logf("ssh %s: stdout: %q", remote, result.Stdout) Logf("ssh %s: stderr: %q", remote, result.Stderr) Logf("ssh %s: exit code: %d", remote, result.Code) } func IssueSSHCommandWithResult(cmd, provider string, node *v1.Node) (*SSHResult, error) { Logf("Getting external IP address for %s", node.Name) host := "" for _, a := range node.Status.Addresses { if a.Type == v1.NodeExternalIP { host = net.JoinHostPort(a.Address, sshPort) break } } if host == "" { // No external IPs were found, let's try to use internal as plan B for _, a := range node.Status.Addresses { if a.Type == v1.NodeInternalIP { host = net.JoinHostPort(a.Address, sshPort) break } } } if host == "" { return nil, fmt.Errorf("couldn't find any IP address for node %s", node.Name) } Logf("SSH %q on %s(%s)", cmd, node.Name, host) result, err := SSH(cmd, host, provider) LogSSHResult(result) if result.Code != 0 || err != nil { return nil, fmt.Errorf("failed running %q: %v (exit code %d)", cmd, err, result.Code) } return &result, nil } func IssueSSHCommand(cmd, provider string, node *v1.Node) error { _, err := IssueSSHCommandWithResult(cmd, provider, node) if err != nil { return err } return nil } // NewHostExecPodSpec returns the pod spec of hostexec pod func NewHostExecPodSpec(ns, name string) *v1.Pod { immediate := int64(0) pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: ns, }, Spec: v1.PodSpec{ Containers: []v1.Container{ { Name: "hostexec", Image: imageutils.GetE2EImage(imageutils.Hostexec), ImagePullPolicy: v1.PullIfNotPresent, }, }, HostNetwork: true, SecurityContext: &v1.PodSecurityContext{}, TerminationGracePeriodSeconds: &immediate, }, } return pod } // RunHostCmd runs the given cmd in the context of the given pod using `kubectl exec` // inside of a shell. func RunHostCmd(ns, name, cmd string) (string, error) { return RunKubectl("exec", fmt.Sprintf("--namespace=%v", ns), name, "--", "/bin/sh", "-c", cmd) } // RunHostCmdOrDie calls RunHostCmd and dies on error. func RunHostCmdOrDie(ns, name, cmd string) string { stdout, err := RunHostCmd(ns, name, cmd) Logf("stdout: %v", stdout) ExpectNoError(err) return stdout } // RunHostCmdWithRetries calls RunHostCmd and retries all errors // until it succeeds or the specified timeout expires. // This can be used with idempotent commands to deflake transient Node issues. func RunHostCmdWithRetries(ns, name, cmd string, interval, timeout time.Duration) (string, error) { start := time.Now() for { out, err := RunHostCmd(ns, name, cmd) if err == nil { return out, nil } if elapsed := time.Since(start); elapsed > timeout { return out, fmt.Errorf("RunHostCmd still failed after %v: %v", elapsed, err) } Logf("Waiting %v to retry failed RunHostCmd: %v", interval, err) time.Sleep(interval) } } // LaunchHostExecPod launches a hostexec pod in the given namespace and waits // until it's Running func LaunchHostExecPod(client clientset.Interface, ns, name string) *v1.Pod { hostExecPod := NewHostExecPodSpec(ns, name) pod, err := client.CoreV1().Pods(ns).Create(hostExecPod) ExpectNoError(err) err = WaitForPodRunningInNamespace(client, pod) ExpectNoError(err) return pod } // newExecPodSpec returns the pod spec of exec pod func newExecPodSpec(ns, generateName string) *v1.Pod { immediate := int64(0) pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ GenerateName: generateName, Namespace: ns, }, Spec: v1.PodSpec{ TerminationGracePeriodSeconds: &immediate, Containers: []v1.Container{ { Name: "exec", Image: BusyBoxImage, Command: []string{"sh", "-c", "while true; do sleep 5; done"}, }, }, }, } return pod } // CreateExecPodOrFail creates a simple busybox pod in a sleep loop used as a // vessel for kubectl exec commands. // Returns the name of the created pod. func CreateExecPodOrFail(client clientset.Interface, ns, generateName string, tweak func(*v1.Pod)) string { Logf("Creating new exec pod") execPod := newExecPodSpec(ns, generateName) if tweak != nil { tweak(execPod) } created, err := client.CoreV1().Pods(ns).Create(execPod) Expect(err).NotTo(HaveOccurred()) err = wait.PollImmediate(Poll, 5*time.Minute, func() (bool, error) { retrievedPod, err := client.CoreV1().Pods(execPod.Namespace).Get(created.Name, metav1.GetOptions{}) if err != nil { if IsRetryableAPIError(err) { return false, nil } return false, err } return retrievedPod.Status.Phase == v1.PodRunning, nil }) Expect(err).NotTo(HaveOccurred()) return created.Name } func CreatePodOrFail(c clientset.Interface, ns, name string, labels map[string]string, containerPorts []v1.ContainerPort) { By(fmt.Sprintf("Creating pod %s in namespace %s", name, ns)) pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: name, Labels: labels, }, Spec: v1.PodSpec{ Containers: []v1.Container{ { Name: "pause", Image: GetPauseImageName(c), Ports: containerPorts, // Add a dummy environment variable to work around a docker issue. // https://github.com/docker/docker/issues/14203 Env: []v1.EnvVar{{Name: "FOO", Value: " "}}, }, }, }, } _, err := c.CoreV1().Pods(ns).Create(pod) Expect(err).NotTo(HaveOccurred()) } func DeletePodOrFail(c clientset.Interface, ns, name string) { By(fmt.Sprintf("Deleting pod %s in namespace %s", name, ns)) err := c.CoreV1().Pods(ns).Delete(name, nil) Expect(err).NotTo(HaveOccurred()) } // GetSigner returns an ssh.Signer for the provider ("gce", etc.) that can be // used to SSH to their nodes. func GetSigner(provider string) (ssh.Signer, error) { // Get the directory in which SSH keys are located. keydir := filepath.Join(os.Getenv("HOME"), ".ssh") // Select the key itself to use. When implementing more providers here, // please also add them to any SSH tests that are disabled because of signer // support. keyfile := "" key := "" switch provider { case "gce", "gke", "kubemark": keyfile = "google_compute_engine" case "aws": // If there is an env. variable override, use that. aws_keyfile := os.Getenv("AWS_SSH_KEY") if len(aws_keyfile) != 0 { return sshutil.MakePrivateKeySignerFromFile(aws_keyfile) } // Otherwise revert to home dir keyfile = "kube_aws_rsa" case "local", "vsphere": keyfile = os.Getenv("LOCAL_SSH_KEY") // maybe? if len(keyfile) == 0 { keyfile = "id_rsa" } case "skeleton": keyfile = os.Getenv("KUBE_SSH_KEY") if len(keyfile) == 0 { keyfile = "id_rsa" } default: return nil, fmt.Errorf("GetSigner(...) not implemented for %s", provider) } if len(key) == 0 { key = filepath.Join(keydir, keyfile) } return sshutil.MakePrivateKeySignerFromFile(key) } // CheckPodsRunningReady returns whether all pods whose names are listed in // podNames in namespace ns are running and ready, using c and waiting at most // timeout. func CheckPodsRunningReady(c clientset.Interface, ns string, podNames []string, timeout time.Duration) bool { return CheckPodsCondition(c, ns, podNames, timeout, testutil.PodRunningReady, "running and ready") } // CheckPodsRunningReadyOrSucceeded returns whether all pods whose names are // listed in podNames in namespace ns are running and ready, or succeeded; use // c and waiting at most timeout. func CheckPodsRunningReadyOrSucceeded(c clientset.Interface, ns string, podNames []string, timeout time.Duration) bool { return CheckPodsCondition(c, ns, podNames, timeout, testutil.PodRunningReadyOrSucceeded, "running and ready, or succeeded") } // CheckPodsCondition returns whether all pods whose names are listed in podNames // in namespace ns are in the condition, using c and waiting at most timeout. func CheckPodsCondition(c clientset.Interface, ns string, podNames []string, timeout time.Duration, condition podCondition, desc string) bool { np := len(podNames) Logf("Waiting up to %v for %d pods to be %s: %s", timeout, np, desc, podNames) type waitPodResult struct { success bool podName string } result := make(chan waitPodResult, len(podNames)) for _, podName := range podNames { // Launch off pod readiness checkers. go func(name string) { err := WaitForPodCondition(c, ns, name, desc, timeout, condition) result <- waitPodResult{err == nil, name} }(podName) } // Wait for them all to finish. success := true for range podNames { res := <-result if !res.success { Logf("Pod %[1]s failed to be %[2]s.", res.podName, desc) success = false } } Logf("Wanted all %d pods to be %s. Result: %t. Pods: %v", np, desc, success, podNames) return success } // WaitForNodeToBeReady returns whether node name is ready within timeout. func WaitForNodeToBeReady(c clientset.Interface, name string, timeout time.Duration) bool { return WaitForNodeToBe(c, name, v1.NodeReady, true, timeout) } // WaitForNodeToBeNotReady returns whether node name is not ready (i.e. the // readiness condition is anything but ready, e.g false or unknown) within // timeout. func WaitForNodeToBeNotReady(c clientset.Interface, name string, timeout time.Duration) bool { return WaitForNodeToBe(c, name, v1.NodeReady, false, timeout) } func isNodeConditionSetAsExpected(node *v1.Node, conditionType v1.NodeConditionType, wantTrue, silent bool) bool { // Check the node readiness condition (logging all). for _, cond := range node.Status.Conditions { // Ensure that the condition type and the status matches as desired. if cond.Type == conditionType { // For NodeReady condition we need to check Taints as well if cond.Type == v1.NodeReady { hasNodeControllerTaints := false // For NodeReady we need to check if Taints are gone as well taints := node.Spec.Taints for _, taint := range taints { if taint.MatchTaint(nodectlr.UnreachableTaintTemplate) || taint.MatchTaint(nodectlr.NotReadyTaintTemplate) { hasNodeControllerTaints = true break } } if wantTrue { if (cond.Status == v1.ConditionTrue) && !hasNodeControllerTaints { return true } else { msg := "" if !hasNodeControllerTaints { msg = fmt.Sprintf("Condition %s of node %s is %v instead of %t. Reason: %v, message: %v", conditionType, node.Name, cond.Status == v1.ConditionTrue, wantTrue, cond.Reason, cond.Message) } else { msg = fmt.Sprintf("Condition %s of node %s is %v, but Node is tainted by NodeController with %v. Failure", conditionType, node.Name, cond.Status == v1.ConditionTrue, taints) } if !silent { Logf(msg) } return false } } else { // TODO: check if the Node is tainted once we enable NC notReady/unreachable taints by default if cond.Status != v1.ConditionTrue { return true } if !silent { Logf("Condition %s of node %s is %v instead of %t. Reason: %v, message: %v", conditionType, node.Name, cond.Status == v1.ConditionTrue, wantTrue, cond.Reason, cond.Message) } return false } } if (wantTrue && (cond.Status == v1.ConditionTrue)) || (!wantTrue && (cond.Status != v1.ConditionTrue)) { return true } else { if !silent { Logf("Condition %s of node %s is %v instead of %t. Reason: %v, message: %v", conditionType, node.Name, cond.Status == v1.ConditionTrue, wantTrue, cond.Reason, cond.Message) } return false } } } if !silent { Logf("Couldn't find condition %v on node %v", conditionType, node.Name) } return false } func IsNodeConditionSetAsExpected(node *v1.Node, conditionType v1.NodeConditionType, wantTrue bool) bool { return isNodeConditionSetAsExpected(node, conditionType, wantTrue, false) } func IsNodeConditionSetAsExpectedSilent(node *v1.Node, conditionType v1.NodeConditionType, wantTrue bool) bool { return isNodeConditionSetAsExpected(node, conditionType, wantTrue, true) } func IsNodeConditionUnset(node *v1.Node, conditionType v1.NodeConditionType) bool { for _, cond := range node.Status.Conditions { if cond.Type == conditionType { return false } } return true } // WaitForNodeToBe returns whether node "name's" condition state matches wantTrue // within timeout. If wantTrue is true, it will ensure the node condition status // is ConditionTrue; if it's false, it ensures the node condition is in any state // other than ConditionTrue (e.g. not true or unknown). func WaitForNodeToBe(c clientset.Interface, name string, conditionType v1.NodeConditionType, wantTrue bool, timeout time.Duration) bool { Logf("Waiting up to %v for node %s condition %s to be %t", timeout, name, conditionType, wantTrue) for start := time.Now(); time.Since(start) < timeout; time.Sleep(Poll) { node, err := c.CoreV1().Nodes().Get(name, metav1.GetOptions{}) if err != nil { Logf("Couldn't get node %s", name) continue } if IsNodeConditionSetAsExpected(node, conditionType, wantTrue) { return true } } Logf("Node %s didn't reach desired %s condition status (%t) within %v", name, conditionType, wantTrue, timeout) return false } // Checks whether all registered nodes are ready. // TODO: we should change the AllNodesReady call in AfterEach to WaitForAllNodesHealthy, // and figure out how to do it in a configurable way, as we can't expect all setups to run // default test add-ons. func AllNodesReady(c clientset.Interface, timeout time.Duration) error { Logf("Waiting up to %v for all (but %d) nodes to be ready", timeout, TestContext.AllowedNotReadyNodes) var notReady []*v1.Node err := wait.PollImmediate(Poll, timeout, func() (bool, error) { notReady = nil // It should be OK to list unschedulable Nodes here. nodes, err := c.CoreV1().Nodes().List(metav1.ListOptions{}) if err != nil { if IsRetryableAPIError(err) { return false, nil } return false, err } for i := range nodes.Items { node := &nodes.Items[i] if !IsNodeConditionSetAsExpected(node, v1.NodeReady, true) { notReady = append(notReady, node) } } // Framework allows for <TestContext.AllowedNotReadyNodes> nodes to be non-ready, // to make it possible e.g. for incorrect deployment of some small percentage // of nodes (which we allow in cluster validation). Some nodes that are not // provisioned correctly at startup will never become ready (e.g. when something // won't install correctly), so we can't expect them to be ready at any point. return len(notReady) <= TestContext.AllowedNotReadyNodes, nil }) if err != nil && err != wait.ErrWaitTimeout { return err } if len(notReady) > TestContext.AllowedNotReadyNodes { msg := "" for _, node := range notReady { msg = fmt.Sprintf("%s, %s", msg, node.Name) } return fmt.Errorf("Not ready nodes: %#v", msg) } return nil } // checks whether all registered nodes are ready and all required Pods are running on them. func WaitForAllNodesHealthy(c clientset.Interface, timeout time.Duration) error { Logf("Waiting up to %v for all nodes to be ready", timeout) var notReady []v1.Node var missingPodsPerNode map[string][]string err := wait.PollImmediate(Poll, timeout, func() (bool, error) { notReady = nil // It should be OK to list unschedulable Nodes here. nodes, err := c.CoreV1().Nodes().List(metav1.ListOptions{ResourceVersion: "0"}) if err != nil { if IsRetryableAPIError(err) { return false, nil } return false, err } for _, node := range nodes.Items { if !IsNodeConditionSetAsExpected(&node, v1.NodeReady, true) { notReady = append(notReady, node) } } pods, err := c.CoreV1().Pods(metav1.NamespaceAll).List(metav1.ListOptions{ResourceVersion: "0"}) if err != nil { return false, err } systemPodsPerNode := make(map[string][]string) for _, pod := range pods.Items { if pod.Namespace == metav1.NamespaceSystem && pod.Status.Phase == v1.PodRunning { if pod.Spec.NodeName != "" { systemPodsPerNode[pod.Spec.NodeName] = append(systemPodsPerNode[pod.Spec.NodeName], pod.Name) } } } missingPodsPerNode = make(map[string][]string) for _, node := range nodes.Items { if !system.IsMasterNode(node.Name) { for _, requiredPod := range requiredPerNodePods { foundRequired := false for _, presentPod := range systemPodsPerNode[node.Name] { if requiredPod.MatchString(presentPod) { foundRequired = true break } } if !foundRequired { missingPodsPerNode[node.Name] = append(missingPodsPerNode[node.Name], requiredPod.String()) } } } } return len(notReady) == 0 && len(missingPodsPerNode) == 0, nil }) if err != nil && err != wait.ErrWaitTimeout { return err } if len(notReady) > 0 { return fmt.Errorf("Not ready nodes: %v", notReady) } if len(missingPodsPerNode) > 0 { return fmt.Errorf("Not running system Pods: %v", missingPodsPerNode) } return nil } // Filters nodes in NodeList in place, removing nodes that do not // satisfy the given condition // TODO: consider merging with pkg/client/cache.NodeLister func FilterNodes(nodeList *v1.NodeList, fn func(node v1.Node) bool) { var l []v1.Node for _, node := range nodeList.Items { if fn(node) { l = append(l, node) } } nodeList.Items = l } // ParseKVLines parses output that looks like lines containing "<key>: <val>" // and returns <val> if <key> is found. Otherwise, it returns the empty string. func ParseKVLines(output, key string) string { delim := ":" key = key + delim for _, line := range strings.Split(output, "\n") { pieces := strings.SplitAfterN(line, delim, 2) if len(pieces) != 2 { continue } k, v := pieces[0], pieces[1] if k == key { return strings.TrimSpace(v) } } return "" } func RestartKubeProxy(host string) error { // TODO: Make it work for all providers. if !ProviderIs("gce", "gke", "aws") { return fmt.Errorf("unsupported provider: %s", TestContext.Provider) } // kubelet will restart the kube-proxy since it's running in a static pod Logf("Killing kube-proxy on node %v", host) result, err := SSH("sudo pkill kube-proxy", host, TestContext.Provider) if err != nil || result.Code != 0 { LogSSHResult(result) return fmt.Errorf("couldn't restart kube-proxy: %v", err) } // wait for kube-proxy to come back up sshCmd := "sudo /bin/sh -c 'pgrep kube-proxy | wc -l'" err = wait.Poll(5*time.Second, 60*time.Second, func() (bool, error) { Logf("Waiting for kubeproxy to come back up with %v on %v", sshCmd, host) result, err := SSH(sshCmd, host, TestContext.Provider) if err != nil { return false, err } if result.Code != 0 { LogSSHResult(result) return false, fmt.Errorf("failed to run command, exited %d", result.Code) } if result.Stdout == "0\n" { return false, nil } Logf("kube-proxy is back up.") return true, nil }) if err != nil { return fmt.Errorf("kube-proxy didn't recover: %v", err) } return nil } func RestartKubelet(host string) error { // TODO: Make it work for all providers and distros. supportedProviders := []string{"gce", "aws", "vsphere"} if !ProviderIs(supportedProviders...) { return fmt.Errorf("unsupported provider: %s, supported providers are: %v", TestContext.Provider, supportedProviders) } if ProviderIs("gce") && !NodeOSDistroIs("debian", "gci") { return fmt.Errorf("unsupported node OS distro: %s", TestContext.NodeOSDistro) } var cmd string if ProviderIs("gce") && NodeOSDistroIs("debian") { cmd = "sudo /etc/init.d/kubelet restart" } else if ProviderIs("vsphere") { var sudoPresent bool sshResult, err := SSH("sudo --version", host, TestContext.Provider) if err != nil { return fmt.Errorf("Unable to ssh to host %s with error %v", host, err) } if !strings.Contains(sshResult.Stderr, "command not found") { sudoPresent = true } sshResult, err = SSH("systemctl --version", host, TestContext.Provider) if !strings.Contains(sshResult.Stderr, "command not found") { cmd = "systemctl restart kubelet" } else { cmd = "service kubelet restart" } if sudoPresent { cmd = fmt.Sprintf("sudo %s", cmd) } } else { cmd = "sudo systemctl restart kubelet" } Logf("Restarting kubelet via ssh on host %s with command %s", host, cmd) result, err := SSH(cmd, host, TestContext.Provider) if err != nil || result.Code != 0 { LogSSHResult(result) return fmt.Errorf("couldn't restart kubelet: %v", err) } return nil } func WaitForKubeletUp(host string) error { cmd := "curl http://localhost:" + strconv.Itoa(ports.KubeletReadOnlyPort) + "/healthz" for start := time.Now(); time.Since(start) < time.Minute; time.Sleep(5 * time.Second) { result, err := SSH(cmd, host, TestContext.Provider) if err != nil || result.Code != 0 { LogSSHResult(result) } if result.Stdout == "ok" { return nil } } return fmt.Errorf("waiting for kubelet timed out") } func RestartApiserver(c discovery.ServerVersionInterface) error { // TODO: Make it work for all providers. if !ProviderIs("gce", "gke", "aws") { return fmt.Errorf("unsupported provider: %s", TestContext.Provider) } if ProviderIs("gce", "aws") { return sshRestartMaster() } // GKE doesn't allow ssh access, so use a same-version master // upgrade to teardown/recreate master. v, err := c.ServerVersion() if err != nil { return err } return masterUpgradeGKE(v.GitVersion[1:]) // strip leading 'v' } func sshRestartMaster() error { if !ProviderIs("gce", "aws") { return fmt.Errorf("unsupported provider: %s", TestContext.Provider) } var command string if ProviderIs("gce") { command = "pidof kube-apiserver | xargs sudo kill" } else { command = "sudo /etc/init.d/kube-apiserver restart" } Logf("Restarting master via ssh, running: %v", command) result, err := SSH(command, net.JoinHostPort(GetMasterHost(), sshPort), TestContext.Provider) if err != nil || result.Code != 0 { LogSSHResult(result) return fmt.Errorf("couldn't restart apiserver: %v", err) } return nil } func WaitForApiserverUp(c clientset.Interface) error { for start := time.Now(); time.Since(start) < time.Minute; time.Sleep(5 * time.Second) { body, err := c.CoreV1().RESTClient().Get().AbsPath("/healthz").Do().Raw() if err == nil && string(body) == "ok" { return nil } } return fmt.Errorf("waiting for apiserver timed out") } func RestartControllerManager() error { // TODO: Make it work for all providers and distros. if !ProviderIs("gce", "aws") { return fmt.Errorf("unsupported provider: %s", TestContext.Provider) } if ProviderIs("gce") && !MasterOSDistroIs("gci") { return fmt.Errorf("unsupported master OS distro: %s", TestContext.MasterOSDistro) } cmd := "pidof kube-controller-manager | xargs sudo kill" Logf("Restarting controller-manager via ssh, running: %v", cmd) result, err := SSH(cmd, net.JoinHostPort(GetMasterHost(), sshPort), TestContext.Provider) if err != nil || result.Code != 0 { LogSSHResult(result) return fmt.Errorf("couldn't restart controller-manager: %v", err) } return nil } func WaitForControllerManagerUp() error { cmd := "curl http://localhost:" + strconv.Itoa(ports.InsecureKubeControllerManagerPort) + "/healthz" for start := time.Now(); time.Since(start) < time.Minute; time.Sleep(5 * time.Second) { result, err := SSH(cmd, net.JoinHostPort(GetMasterHost(), sshPort), TestContext.Provider) if err != nil || result.Code != 0 { LogSSHResult(result) } if result.Stdout == "ok" { return nil } } return fmt.Errorf("waiting for controller-manager timed out") } // CheckForControllerManagerHealthy checks that the controller manager does not crash within "duration" func CheckForControllerManagerHealthy(duration time.Duration) error { var PID string cmd := "pidof kube-controller-manager" for start := time.Now(); time.Since(start) < duration; time.Sleep(5 * time.Second) { result, err := SSH(cmd, net.JoinHostPort(GetMasterHost(), sshPort), TestContext.Provider) if err != nil { // We don't necessarily know that it crashed, pipe could just be broken LogSSHResult(result) return fmt.Errorf("master unreachable after %v", time.Since(start)) } else if result.Code != 0 { LogSSHResult(result) return fmt.Errorf("SSH result code not 0. actually: %v after %v", result.Code, time.Since(start)) } else if result.Stdout != PID { if PID == "" { PID = result.Stdout } else { //its dead return fmt.Errorf("controller manager crashed, old PID: %s, new PID: %s", PID, result.Stdout) } } else { Logf("kube-controller-manager still healthy after %v", time.Since(start)) } } return nil } // Returns number of ready Nodes excluding Master Node. func NumberOfReadyNodes(c clientset.Interface) (int, error) { nodes, err := c.CoreV1().Nodes().List(metav1.ListOptions{FieldSelector: fields.Set{ "spec.unschedulable": "false", }.AsSelector().String()}) if err != nil { Logf("Failed to list nodes: %v", err) return 0, err } // Filter out not-ready nodes. FilterNodes(nodes, func(node v1.Node) bool { return IsNodeConditionSetAsExpected(&node, v1.NodeReady, true) }) return len(nodes.Items), nil } // WaitForReadyNodes waits until the cluster has desired size and there is no not-ready nodes in it. // By cluster size we mean number of Nodes excluding Master Node. func WaitForReadyNodes(c clientset.Interface, size int, timeout time.Duration) error { for start := time.Now(); time.Since(start) < timeout; time.Sleep(20 * time.Second) { nodes, err := c.CoreV1().Nodes().List(metav1.ListOptions{FieldSelector: fields.Set{ "spec.unschedulable": "false", }.AsSelector().String()}) if err != nil { Logf("Failed to list nodes: %v", err) continue } numNodes := len(nodes.Items) // Filter out not-ready nodes. FilterNodes(nodes, func(node v1.Node) bool { return IsNodeConditionSetAsExpected(&node, v1.NodeReady, true) }) numReady := len(nodes.Items) if numNodes == size && numReady == size { Logf("Cluster has reached the desired number of ready nodes %d", size) return nil } Logf("Waiting for ready nodes %d, current ready %d, not ready nodes %d", size, numNodes, numNodes-numReady) } return fmt.Errorf("timeout waiting %v for number of ready nodes to be %d", timeout, size) } func GenerateMasterRegexp(prefix string) string { return prefix + "(-...)?" } // waitForMasters waits until the cluster has the desired number of ready masters in it. func WaitForMasters(masterPrefix string, c clientset.Interface, size int, timeout time.Duration) error { for start := time.Now(); time.Since(start) < timeout; time.Sleep(20 * time.Second) { nodes, err := c.CoreV1().Nodes().List(metav1.ListOptions{}) if err != nil { Logf("Failed to list nodes: %v", err) continue } // Filter out nodes that are not master replicas FilterNodes(nodes, func(node v1.Node) bool { res, err := regexp.Match(GenerateMasterRegexp(masterPrefix), ([]byte)(node.Name)) if err != nil { Logf("Failed to match regexp to node name: %v", err) return false } return res }) numNodes := len(nodes.Items) // Filter out not-ready nodes. FilterNodes(nodes, func(node v1.Node) bool { return IsNodeConditionSetAsExpected(&node, v1.NodeReady, true) }) numReady := len(nodes.Items) if numNodes == size && numReady == size { Logf("Cluster has reached the desired number of masters %d", size) return nil } Logf("Waiting for the number of masters %d, current %d, not ready master nodes %d", size, numNodes, numNodes-numReady) } return fmt.Errorf("timeout waiting %v for the number of masters to be %d", timeout, size) } // GetHostExternalAddress gets the node for a pod and returns the first External // address. Returns an error if the node the pod is on doesn't have an External // address. func GetHostExternalAddress(client clientset.Interface, p *v1.Pod) (externalAddress string, err error) { node, err := client.CoreV1().Nodes().Get(p.Spec.NodeName, metav1.GetOptions{}) if err != nil { return "", err } for _, address := range node.Status.Addresses { if address.Type == v1.NodeExternalIP { if address.Address != "" { externalAddress = address.Address break } } } if externalAddress == "" { err = fmt.Errorf("No external address for pod %v on node %v", p.Name, p.Spec.NodeName) } return } type extractRT struct { http.Header } func (rt *extractRT) RoundTrip(req *http.Request) (*http.Response, error) { rt.Header = req.Header return &http.Response{}, nil } // headersForConfig extracts any http client logic necessary for the provided // config. func headersForConfig(c *restclient.Config) (http.Header, error) { extract := &extractRT{} rt, err := restclient.HTTPWrappersForConfig(c, extract) if err != nil { return nil, err } if _, err := rt.RoundTrip(&http.Request{}); err != nil { return nil, err } return extract.Header, nil } // OpenWebSocketForURL constructs a websocket connection to the provided URL, using the client // config, with the specified protocols. func OpenWebSocketForURL(url *url.URL, config *restclient.Config, protocols []string) (*websocket.Conn, error) { tlsConfig, err := restclient.TLSConfigFor(config) if err != nil { return nil, fmt.Errorf("failed to create tls config: %v", err) } if tlsConfig != nil { url.Scheme = "wss" if !strings.Contains(url.Host, ":") { url.Host += ":443" } } else { url.Scheme = "ws" if !strings.Contains(url.Host, ":") { url.Host += ":80" } } headers, err := headersForConfig(config) if err != nil { return nil, fmt.Errorf("failed to load http headers: %v", err) } cfg, err := websocket.NewConfig(url.String(), "http://localhost") if err != nil { return nil, fmt.Errorf("failed to create websocket config: %v", err) } cfg.Header = headers cfg.TlsConfig = tlsConfig cfg.Protocol = protocols return websocket.DialConfig(cfg) } // Looks for the given string in the log of a specific pod container func LookForStringInLog(ns, podName, container, expectedString string, timeout time.Duration) (result string, err error) { return LookForString(expectedString, timeout, func() string { return RunKubectlOrDie("logs", podName, container, fmt.Sprintf("--namespace=%v", ns)) }) } // Looks for the given string in a file in a specific pod container func LookForStringInFile(ns, podName, container, file, expectedString string, timeout time.Duration) (result string, err error) { return LookForString(expectedString, timeout, func() string { return RunKubectlOrDie("exec", podName, "-c", container, fmt.Sprintf("--namespace=%v", ns), "--", "cat", file) }) } // Looks for the given string in the output of a command executed in a specific pod container func LookForStringInPodExec(ns, podName string, command []string, expectedString string, timeout time.Duration) (result string, err error) { return LookForString(expectedString, timeout, func() string { // use the first container args := []string{"exec", podName, fmt.Sprintf("--namespace=%v", ns), "--"} args = append(args, command...) return RunKubectlOrDie(args...) }) } // Looks for the given string in the output of fn, repeatedly calling fn until // the timeout is reached or the string is found. Returns last log and possibly // error if the string was not found. func LookForString(expectedString string, timeout time.Duration, fn func() string) (result string, err error) { for t := time.Now(); time.Since(t) < timeout; time.Sleep(Poll) { result = fn() if strings.Contains(result, expectedString) { return } } err = fmt.Errorf("Failed to find \"%s\", last result: \"%s\"", expectedString, result) return } // getSvcNodePort returns the node port for the given service:port. func getSvcNodePort(client clientset.Interface, ns, name string, svcPort int) (int, error) { svc, err := client.CoreV1().Services(ns).Get(name, metav1.GetOptions{}) if err != nil { return 0, err } for _, p := range svc.Spec.Ports { if p.Port == int32(svcPort) { if p.NodePort != 0 { return int(p.NodePort), nil } } } return 0, fmt.Errorf( "No node port found for service %v, port %v", name, svcPort) } // GetNodePortURL returns the url to a nodeport Service. func GetNodePortURL(client clientset.Interface, ns, name string, svcPort int) (string, error) { nodePort, err := getSvcNodePort(client, ns, name, svcPort) if err != nil { return "", err } // This list of nodes must not include the master, which is marked // unschedulable, since the master doesn't run kube-proxy. Without // kube-proxy NodePorts won't work. var nodes *v1.NodeList if wait.PollImmediate(Poll, SingleCallTimeout, func() (bool, error) { nodes, err = client.CoreV1().Nodes().List(metav1.ListOptions{FieldSelector: fields.Set{ "spec.unschedulable": "false", }.AsSelector().String()}) if err != nil { if IsRetryableAPIError(err) { return false, nil } return false, err } return true, nil }) != nil { return "", err } if len(nodes.Items) == 0 { return "", fmt.Errorf("Unable to list nodes in cluster.") } for _, node := range nodes.Items { for _, address := range node.Status.Addresses { if address.Type == v1.NodeExternalIP { if address.Address != "" { return fmt.Sprintf("http://%v:%v", address.Address, nodePort), nil } } } } return "", fmt.Errorf("Failed to find external address for service %v", name) } // TODO(random-liu): Change this to be a member function of the framework. func GetPodLogs(c clientset.Interface, namespace, podName, containerName string) (string, error) { return getPodLogsInternal(c, namespace, podName, containerName, false) } func getPreviousPodLogs(c clientset.Interface, namespace, podName, containerName string) (string, error) { return getPodLogsInternal(c, namespace, podName, containerName, true) } // utility function for gomega Eventually func getPodLogsInternal(c clientset.Interface, namespace, podName, containerName string, previous bool) (string, error) { logs, err := c.CoreV1().RESTClient().Get(). Resource("pods"). Namespace(namespace). Name(podName).SubResource("log"). Param("container", containerName). Param("previous", strconv.FormatBool(previous)). Do(). Raw() if err != nil { return "", err } if err == nil && strings.Contains(string(logs), "Internal Error") { return "", fmt.Errorf("Fetched log contains \"Internal Error\": %q.", string(logs)) } return string(logs), err } func GetGCECloud() (*gcecloud.GCECloud, error) { gceCloud, ok := TestContext.CloudConfig.Provider.(*gcecloud.GCECloud) if !ok { return nil, fmt.Errorf("failed to convert CloudConfig.Provider to GCECloud: %#v", TestContext.CloudConfig.Provider) } return gceCloud, nil } // EnsureLoadBalancerResourcesDeleted ensures that cloud load balancer resources that were created // are actually cleaned up. Currently only implemented for GCE/GKE. func EnsureLoadBalancerResourcesDeleted(ip, portRange string) error { if TestContext.Provider == "gce" || TestContext.Provider == "gke" { return ensureGCELoadBalancerResourcesDeleted(ip, portRange) } return nil } func ensureGCELoadBalancerResourcesDeleted(ip, portRange string) error { gceCloud, err := GetGCECloud() if err != nil { return err } project := TestContext.CloudConfig.ProjectID region, err := gcecloud.GetGCERegion(TestContext.CloudConfig.Zone) if err != nil { return fmt.Errorf("could not get region for zone %q: %v", TestContext.CloudConfig.Zone, err) } return wait.Poll(10*time.Second, 5*time.Minute, func() (bool, error) { service := gceCloud.ComputeServices().GA list, err := service.ForwardingRules.List(project, region).Do() if err != nil { return false, err } for _, item := range list.Items { if item.PortRange == portRange && item.IPAddress == ip { Logf("found a load balancer: %v", item) return false, nil } } return true, nil }) } // The following helper functions can block/unblock network from source // host to destination host by manipulating iptable rules. // This function assumes it can ssh to the source host. // // Caution: // Recommend to input IP instead of hostnames. Using hostnames will cause iptables to // do a DNS lookup to resolve the name to an IP address, which will // slow down the test and cause it to fail if DNS is absent or broken. // // Suggested usage pattern: // func foo() { // ... // defer UnblockNetwork(from, to) // BlockNetwork(from, to) // ... // } // func BlockNetwork(from string, to string) { Logf("block network traffic from %s to %s", from, to) iptablesRule := fmt.Sprintf("OUTPUT --destination %s --jump REJECT", to) dropCmd := fmt.Sprintf("sudo iptables --insert %s", iptablesRule) if result, err := SSH(dropCmd, from, TestContext.Provider); result.Code != 0 || err != nil { LogSSHResult(result) Failf("Unexpected error: %v", err) } } func UnblockNetwork(from string, to string) { Logf("Unblock network traffic from %s to %s", from, to) iptablesRule := fmt.Sprintf("OUTPUT --destination %s --jump REJECT", to) undropCmd := fmt.Sprintf("sudo iptables --delete %s", iptablesRule) // Undrop command may fail if the rule has never been created. // In such case we just lose 30 seconds, but the cluster is healthy. // But if the rule had been created and removing it failed, the node is broken and // not coming back. Subsequent tests will run or fewer nodes (some of the tests // may fail). Manual intervention is required in such case (recreating the // cluster solves the problem too). err := wait.Poll(time.Millisecond*100, time.Second*30, func() (bool, error) { result, err := SSH(undropCmd, from, TestContext.Provider) if result.Code == 0 && err == nil { return true, nil } LogSSHResult(result) if err != nil { Logf("Unexpected error: %v", err) } return false, nil }) if err != nil { Failf("Failed to remove the iptable REJECT rule. Manual intervention is "+ "required on host %s: remove rule %s, if exists", from, iptablesRule) } } func isElementOf(podUID types.UID, pods *v1.PodList) bool { for _, pod := range pods.Items { if pod.UID == podUID { return true } } return false } // timeout for proxy requests. const proxyTimeout = 2 * time.Minute // NodeProxyRequest performs a get on a node proxy endpoint given the nodename and rest client. func NodeProxyRequest(c clientset.Interface, node, endpoint string) (restclient.Result, error) { // proxy tends to hang in some cases when Node is not ready. Add an artificial timeout for this call. // This will leak a goroutine if proxy hangs. #22165 var result restclient.Result finished := make(chan struct{}) go func() { result = c.CoreV1().RESTClient().Get(). Resource("nodes"). SubResource("proxy"). Name(fmt.Sprintf("%v:%v", node, ports.KubeletPort)). Suffix(endpoint). Do() finished <- struct{}{} }() select { case <-finished: return result, nil case <-time.After(proxyTimeout): return restclient.Result{}, nil } } // GetKubeletPods retrieves the list of pods on the kubelet func GetKubeletPods(c clientset.Interface, node string) (*v1.PodList, error) { return getKubeletPods(c, node, "pods") } // GetKubeletRunningPods retrieves the list of running pods on the kubelet. The pods // includes necessary information (e.g., UID, name, namespace for // pods/containers), but do not contain the full spec. func GetKubeletRunningPods(c clientset.Interface, node string) (*v1.PodList, error) { return getKubeletPods(c, node, "runningpods") } func getKubeletPods(c clientset.Interface, node, resource string) (*v1.PodList, error) { result := &v1.PodList{} client, err := NodeProxyRequest(c, node, resource) if err != nil { return &v1.PodList{}, err } if err = client.Into(result); err != nil { return &v1.PodList{}, err } return result, nil } // LaunchWebserverPod launches a pod serving http on port 8080 to act // as the target for networking connectivity checks. The ip address // of the created pod will be returned if the pod is launched // successfully. func LaunchWebserverPod(f *Framework, podName, nodeName string) (ip string) { containerName := fmt.Sprintf("%s-container", podName) port := 8080 pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: podName, }, Spec: v1.PodSpec{ Containers: []v1.Container{ { Name: containerName, Image: imageutils.GetE2EImage(imageutils.Porter), Env: []v1.EnvVar{{Name: fmt.Sprintf("SERVE_PORT_%d", port), Value: "foo"}}, Ports: []v1.ContainerPort{{ContainerPort: int32(port)}}, }, }, NodeName: nodeName, RestartPolicy: v1.RestartPolicyNever, }, } podClient := f.ClientSet.CoreV1().Pods(f.Namespace.Name) _, err := podClient.Create(pod) ExpectNoError(err) ExpectNoError(f.WaitForPodRunning(podName)) createdPod, err := podClient.Get(podName, metav1.GetOptions{}) ExpectNoError(err) ip = net.JoinHostPort(createdPod.Status.PodIP, strconv.Itoa(port)) Logf("Target pod IP:port is %s", ip) return } type PingCommand string const ( IPv4PingCommand PingCommand = "ping" IPv6PingCommand PingCommand = "ping6" ) // CheckConnectivityToHost launches a pod to test connectivity to the specified // host. An error will be returned if the host is not reachable from the pod. // // An empty nodeName will use the schedule to choose where the pod is executed. func CheckConnectivityToHost(f *Framework, nodeName, podName, host string, pingCmd PingCommand, timeout int) error { contName := fmt.Sprintf("%s-container", podName) command := []string{ string(pingCmd), "-c", "3", // send 3 pings "-W", "2", // wait at most 2 seconds for a reply "-w", strconv.Itoa(timeout), host, } pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: podName, }, Spec: v1.PodSpec{ Containers: []v1.Container{ { Name: contName, Image: BusyBoxImage, Command: command, }, }, NodeName: nodeName, RestartPolicy: v1.RestartPolicyNever, }, } podClient := f.ClientSet.CoreV1().Pods(f.Namespace.Name) _, err := podClient.Create(pod) if err != nil { return err } err = WaitForPodSuccessInNamespace(f.ClientSet, podName, f.Namespace.Name) if err != nil { logs, logErr := GetPodLogs(f.ClientSet, f.Namespace.Name, pod.Name, contName) if logErr != nil { Logf("Warning: Failed to get logs from pod %q: %v", pod.Name, logErr) } else { Logf("pod %s/%s logs:\n%s", f.Namespace.Name, pod.Name, logs) } } return err } // CoreDump SSHs to the master and all nodes and dumps their logs into dir. // It shells out to cluster/log-dump/log-dump.sh to accomplish this. func CoreDump(dir string) { if TestContext.DisableLogDump { Logf("Skipping dumping logs from cluster") return } var cmd *exec.Cmd if TestContext.LogexporterGCSPath != "" { Logf("Dumping logs from nodes to GCS directly at path: %s", TestContext.LogexporterGCSPath) cmd = exec.Command(path.Join(TestContext.RepoRoot, "cluster", "log-dump", "log-dump.sh"), dir, TestContext.LogexporterGCSPath) } else { Logf("Dumping logs locally to: %s", dir) cmd = exec.Command(path.Join(TestContext.RepoRoot, "cluster", "log-dump", "log-dump.sh"), dir) } cmd.Env = append(os.Environ(), fmt.Sprintf("LOG_DUMP_SYSTEMD_SERVICES=%s", parseSystemdServices(TestContext.SystemdServices))) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr if err := cmd.Run(); err != nil { Logf("Error running cluster/log-dump/log-dump.sh: %v", err) } } // parseSystemdServices converts services separator from comma to space. func parseSystemdServices(services string) string { return strings.TrimSpace(strings.Replace(services, ",", " ", -1)) } func UpdatePodWithRetries(client clientset.Interface, ns, name string, update func(*v1.Pod)) (*v1.Pod, error) { for i := 0; i < 3; i++ { pod, err := client.CoreV1().Pods(ns).Get(name, metav1.GetOptions{}) if err != nil { return nil, fmt.Errorf("Failed to get pod %q: %v", name, err) } update(pod) pod, err = client.CoreV1().Pods(ns).Update(pod) if err == nil { return pod, nil } if !apierrs.IsConflict(err) && !apierrs.IsServerTimeout(err) { return nil, fmt.Errorf("Failed to update pod %q: %v", name, err) } } return nil, fmt.Errorf("Too many retries updating Pod %q", name) } func GetPodsInNamespace(c clientset.Interface, ns string, ignoreLabels map[string]string) ([]*v1.Pod, error) { pods, err := c.CoreV1().Pods(ns).List(metav1.ListOptions{}) if err != nil { return []*v1.Pod{}, err } ignoreSelector := labels.SelectorFromSet(ignoreLabels) filtered := []*v1.Pod{} for _, p := range pods.Items { if len(ignoreLabels) != 0 && ignoreSelector.Matches(labels.Set(p.Labels)) { continue } filtered = append(filtered, &p) } return filtered, nil } // RunCmd runs cmd using args and returns its stdout and stderr. It also outputs // cmd's stdout and stderr to their respective OS streams. func RunCmd(command string, args ...string) (string, string, error) { return RunCmdEnv(nil, command, args...) } // RunCmdEnv runs cmd with the provided environment and args and // returns its stdout and stderr. It also outputs cmd's stdout and // stderr to their respective OS streams. func RunCmdEnv(env []string, command string, args ...string) (string, string, error) { Logf("Running %s %v", command, args) var bout, berr bytes.Buffer cmd := exec.Command(command, args...) // We also output to the OS stdout/stderr to aid in debugging in case cmd // hangs and never returns before the test gets killed. // // This creates some ugly output because gcloud doesn't always provide // newlines. cmd.Stdout = io.MultiWriter(os.Stdout, &bout) cmd.Stderr = io.MultiWriter(os.Stderr, &berr) cmd.Env = env err := cmd.Run() stdout, stderr := bout.String(), berr.String() if err != nil { return "", "", fmt.Errorf("error running %s %v; got error %v, stdout %q, stderr %q", command, args, err, stdout, stderr) } return stdout, stderr, nil } // retryCmd runs cmd using args and retries it for up to SingleCallTimeout if // it returns an error. It returns stdout and stderr. func retryCmd(command string, args ...string) (string, string, error) { var err error stdout, stderr := "", "" wait.Poll(Poll, SingleCallTimeout, func() (bool, error) { stdout, stderr, err = RunCmd(command, args...) if err != nil { Logf("Got %v", err) return false, nil } return true, nil }) return stdout, stderr, err } // GetPodsScheduled returns a number of currently scheduled and not scheduled Pods. func GetPodsScheduled(masterNodes sets.String, pods *v1.PodList) (scheduledPods, notScheduledPods []v1.Pod) { for _, pod := range pods.Items { if !masterNodes.Has(pod.Spec.NodeName) { if pod.Spec.NodeName != "" { _, scheduledCondition := podutil.GetPodCondition(&pod.Status, v1.PodScheduled) Expect(scheduledCondition != nil).To(Equal(true)) Expect(scheduledCondition.Status).To(Equal(v1.ConditionTrue)) scheduledPods = append(scheduledPods, pod) } else { _, scheduledCondition := podutil.GetPodCondition(&pod.Status, v1.PodScheduled) Expect(scheduledCondition != nil).To(Equal(true)) Expect(scheduledCondition.Status).To(Equal(v1.ConditionFalse)) if scheduledCondition.Reason == "Unschedulable" { notScheduledPods = append(notScheduledPods, pod) } } } } return } // WaitForStableCluster waits until all existing pods are scheduled and returns their amount. func WaitForStableCluster(c clientset.Interface, masterNodes sets.String) int { timeout := 10 * time.Minute startTime := time.Now() allPods, err := c.CoreV1().Pods(metav1.NamespaceAll).List(metav1.ListOptions{}) ExpectNoError(err) // API server returns also Pods that succeeded. We need to filter them out. currentPods := make([]v1.Pod, 0, len(allPods.Items)) for _, pod := range allPods.Items { if pod.Status.Phase != v1.PodSucceeded && pod.Status.Phase != v1.PodFailed { currentPods = append(currentPods, pod) } } allPods.Items = currentPods scheduledPods, currentlyNotScheduledPods := GetPodsScheduled(masterNodes, allPods) for len(currentlyNotScheduledPods) != 0 { time.Sleep(2 * time.Second) allPods, err := c.CoreV1().Pods(metav1.NamespaceAll).List(metav1.ListOptions{}) ExpectNoError(err) scheduledPods, currentlyNotScheduledPods = GetPodsScheduled(masterNodes, allPods) if startTime.Add(timeout).Before(time.Now()) { Failf("Timed out after %v waiting for stable cluster.", timeout) break } } return len(scheduledPods) } // GetMasterAndWorkerNodesOrDie will return a list masters and schedulable worker nodes func GetMasterAndWorkerNodesOrDie(c clientset.Interface) (sets.String, *v1.NodeList) { nodes := &v1.NodeList{} masters := sets.NewString() all, _ := c.CoreV1().Nodes().List(metav1.ListOptions{}) for _, n := range all.Items { if system.IsMasterNode(n.Name) { masters.Insert(n.Name) } else if isNodeSchedulable(&n) && isNodeUntainted(&n) { nodes.Items = append(nodes.Items, n) } } return masters, nodes } func ListNamespaceEvents(c clientset.Interface, ns string) error { ls, err := c.CoreV1().Events(ns).List(metav1.ListOptions{}) if err != nil { return err } for _, event := range ls.Items { glog.Infof("Event(%#v): type: '%v' reason: '%v' %v", event.InvolvedObject, event.Type, event.Reason, event.Message) } return nil } // E2ETestNodePreparer implements testutil.TestNodePreparer interface, which is used // to create/modify Nodes before running a test. type E2ETestNodePreparer struct { client clientset.Interface // Specifies how many nodes should be modified using the given strategy. // Only one strategy can be applied to a single Node, so there needs to // be at least <sum_of_keys> Nodes in the cluster. countToStrategy []testutil.CountToStrategy nodeToAppliedStrategy map[string]testutil.PrepareNodeStrategy } func NewE2ETestNodePreparer(client clientset.Interface, countToStrategy []testutil.CountToStrategy) testutil.TestNodePreparer { return &E2ETestNodePreparer{ client: client, countToStrategy: countToStrategy, nodeToAppliedStrategy: make(map[string]testutil.PrepareNodeStrategy), } } func (p *E2ETestNodePreparer) PrepareNodes() error { nodes := GetReadySchedulableNodesOrDie(p.client) numTemplates := 0 for k := range p.countToStrategy { numTemplates += k } if numTemplates > len(nodes.Items) { return fmt.Errorf("Can't prepare Nodes. Got more templates than existing Nodes.") } index := 0 sum := 0 for _, v := range p.countToStrategy { sum += v.Count for ; index < sum; index++ { if err := testutil.DoPrepareNode(p.client, &nodes.Items[index], v.Strategy); err != nil { glog.Errorf("Aborting node preparation: %v", err) return err } p.nodeToAppliedStrategy[nodes.Items[index].Name] = v.Strategy } } return nil } func (p *E2ETestNodePreparer) CleanupNodes() error { var encounteredError error nodes := GetReadySchedulableNodesOrDie(p.client) for i := range nodes.Items { var err error name := nodes.Items[i].Name strategy, found := p.nodeToAppliedStrategy[name] if found { if err = testutil.DoCleanupNode(p.client, name, strategy); err != nil { glog.Errorf("Skipping cleanup of Node: failed update of %v: %v", name, err) encounteredError = err } } } return encounteredError } func GetClusterID(c clientset.Interface) (string, error) { cm, err := c.CoreV1().ConfigMaps(metav1.NamespaceSystem).Get(gcecloud.UIDConfigMapName, metav1.GetOptions{}) if err != nil || cm == nil { return "", fmt.Errorf("error getting cluster ID: %v", err) } clusterID, clusterIDExists := cm.Data[gcecloud.UIDCluster] providerID, providerIDExists := cm.Data[gcecloud.UIDProvider] if !clusterIDExists { return "", fmt.Errorf("cluster ID not set") } if providerIDExists { return providerID, nil } return clusterID, nil } // CleanupGCEResources cleans up GCE Service Type=LoadBalancer resources with // the given name. The name is usually the UUID of the Service prefixed with an // alpha-numeric character ('a') to work around cloudprovider rules. func CleanupGCEResources(c clientset.Interface, loadBalancerName, zone string) (retErr error) { gceCloud, err := GetGCECloud() if err != nil { return err } region, err := gcecloud.GetGCERegion(zone) if err != nil { return fmt.Errorf("error parsing GCE/GKE region from zone %q: %v", zone, err) } if err := gceCloud.DeleteFirewall(gcecloud.MakeFirewallName(loadBalancerName)); err != nil && !IsGoogleAPIHTTPErrorCode(err, http.StatusNotFound) { retErr = err } if err := gceCloud.DeleteRegionForwardingRule(loadBalancerName, region); err != nil && !IsGoogleAPIHTTPErrorCode(err, http.StatusNotFound) { retErr = fmt.Errorf("%v\n%v", retErr, err) } if err := gceCloud.DeleteRegionAddress(loadBalancerName, region); err != nil && !IsGoogleAPIHTTPErrorCode(err, http.StatusNotFound) { retErr = fmt.Errorf("%v\n%v", retErr, err) } clusterID, err := GetClusterID(c) if err != nil { retErr = fmt.Errorf("%v\n%v", retErr, err) return } hcNames := []string{gcecloud.MakeNodesHealthCheckName(clusterID)} hc, getErr := gceCloud.GetHttpHealthCheck(loadBalancerName) if getErr != nil && !IsGoogleAPIHTTPErrorCode(getErr, http.StatusNotFound) { retErr = fmt.Errorf("%v\n%v", retErr, getErr) return } if hc != nil { hcNames = append(hcNames, hc.Name) } if err := gceCloud.DeleteExternalTargetPoolAndChecks(&v1.Service{}, loadBalancerName, region, clusterID, hcNames...); err != nil && !IsGoogleAPIHTTPErrorCode(err, http.StatusNotFound) { retErr = fmt.Errorf("%v\n%v", retErr, err) } return } // IsHTTPErrorCode returns true if the error is a google api // error matching the corresponding HTTP error code. func IsGoogleAPIHTTPErrorCode(err error, code int) bool { apiErr, ok := err.(*googleapi.Error) return ok && apiErr.Code == code } // getMaster populates the externalIP, internalIP and hostname fields of the master. // If any of these is unavailable, it is set to "". func getMaster(c clientset.Interface) Address { master := Address{} // Populate the internal IP. eps, err := c.CoreV1().Endpoints(metav1.NamespaceDefault).Get("kubernetes", metav1.GetOptions{}) if err != nil { Failf("Failed to get kubernetes endpoints: %v", err) } if len(eps.Subsets) != 1 || len(eps.Subsets[0].Addresses) != 1 { Failf("There are more than 1 endpoints for kubernetes service: %+v", eps) } master.internalIP = eps.Subsets[0].Addresses[0].IP // Populate the external IP/hostname. url, err := url.Parse(TestContext.Host) if err != nil { Failf("Failed to parse hostname: %v", err) } if net.ParseIP(url.Host) != nil { // TODO: Check that it is external IP (not having a reserved IP address as per RFC1918). master.externalIP = url.Host } else { master.hostname = url.Host } return master } // GetMasterAddress returns the hostname/external IP/internal IP as appropriate for e2e tests on a particular provider // which is the address of the interface used for communication with the kubelet. func GetMasterAddress(c clientset.Interface) string { master := getMaster(c) switch TestContext.Provider { case "gce", "gke": return master.externalIP case "aws": return awsMasterIP default: Failf("This test is not supported for provider %s and should be disabled", TestContext.Provider) } return "" } // GetNodeExternalIP returns node external IP concatenated with port 22 for ssh // e.g. 1.2.3.4:22 func GetNodeExternalIP(node *v1.Node) string { Logf("Getting external IP address for %s", node.Name) host := "" for _, a := range node.Status.Addresses { if a.Type == v1.NodeExternalIP { host = net.JoinHostPort(a.Address, sshPort) break } } if host == "" { Failf("Couldn't get the external IP of host %s with addresses %v", node.Name, node.Status.Addresses) } return host } // SimpleGET executes a get on the given url, returns error if non-200 returned. func SimpleGET(c *http.Client, url, host string) (string, error) { req, err := http.NewRequest("GET", url, nil) if err != nil { return "", err } req.Host = host res, err := c.Do(req) if err != nil { return "", err } defer res.Body.Close() rawBody, err := ioutil.ReadAll(res.Body) if err != nil { return "", err } body := string(rawBody) if res.StatusCode != http.StatusOK { err = fmt.Errorf( "GET returned http error %v", res.StatusCode) } return body, err } // PollURL polls till the url responds with a healthy http code. If // expectUnreachable is true, it breaks on first non-healthy http code instead. func PollURL(route, host string, timeout time.Duration, interval time.Duration, httpClient *http.Client, expectUnreachable bool) error { var lastBody string pollErr := wait.PollImmediate(interval, timeout, func() (bool, error) { var err error lastBody, err = SimpleGET(httpClient, route, host) if err != nil { Logf("host %v path %v: %v unreachable", host, route, err) return expectUnreachable, nil } Logf("host %v path %v: reached", host, route) return !expectUnreachable, nil }) if pollErr != nil { return fmt.Errorf("Failed to execute a successful GET within %v, Last response body for %v, host %v:\n%v\n\n%v\n", timeout, route, host, lastBody, pollErr) } return nil } func DescribeIng(ns string) { Logf("\nOutput of kubectl describe ing:\n") desc, _ := RunKubectl( "describe", "ing", fmt.Sprintf("--namespace=%v", ns)) Logf(desc) } // NewTestPod returns a pod that has the specified requests and limits func (f *Framework) NewTestPod(name string, requests v1.ResourceList, limits v1.ResourceList) *v1.Pod { return &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, Spec: v1.PodSpec{ Containers: []v1.Container{ { Name: "pause", Image: GetPauseImageName(f.ClientSet), Resources: v1.ResourceRequirements{ Requests: requests, Limits: limits, }, }, }, }, } } // create empty file at given path on the pod. func CreateEmptyFileOnPod(namespace string, podName string, filePath string) error { _, err := RunKubectl("exec", fmt.Sprintf("--namespace=%s", namespace), podName, "--", "/bin/sh", "-c", fmt.Sprintf("touch %s", filePath)) return err } // GetAzureCloud returns azure cloud provider func GetAzureCloud() (*azure.Cloud, error) { cloud, ok := TestContext.CloudConfig.Provider.(*azure.Cloud) if !ok { return nil, fmt.Errorf("failed to convert CloudConfig.Provider to Azure: %#v", TestContext.CloudConfig.Provider) } return cloud, nil } func PrintSummaries(summaries []TestDataSummary, testBaseName string) { now := time.Now() for i := range summaries { Logf("Printing summary: %v", summaries[i].SummaryKind()) switch TestContext.OutputPrintType { case "hr": if TestContext.ReportDir == "" { Logf(summaries[i].PrintHumanReadable()) } else { // TODO: learn to extract test name and append it to the kind instead of timestamp. filePath := path.Join(TestContext.ReportDir, summaries[i].SummaryKind()+"_"+testBaseName+"_"+now.Format(time.RFC3339)+".txt") if err := ioutil.WriteFile(filePath, []byte(summaries[i].PrintHumanReadable()), 0644); err != nil { Logf("Failed to write file %v with test performance data: %v", filePath, err) } } case "json": fallthrough default: if TestContext.OutputPrintType != "json" { Logf("Unknown output type: %v. Printing JSON", TestContext.OutputPrintType) } if TestContext.ReportDir == "" { Logf("%v JSON\n%v", summaries[i].SummaryKind(), summaries[i].PrintJSON()) Logf("Finished") } else { // TODO: learn to extract test name and append it to the kind instead of timestamp. filePath := path.Join(TestContext.ReportDir, summaries[i].SummaryKind()+"_"+testBaseName+"_"+now.Format(time.RFC3339)+".json") Logf("Writing to %s", filePath) if err := ioutil.WriteFile(filePath, []byte(summaries[i].PrintJSON()), 0644); err != nil { Logf("Failed to write file %v with test performance data: %v", filePath, err) } } } } } func DumpDebugInfo(c clientset.Interface, ns string) { sl, _ := c.CoreV1().Pods(ns).List(metav1.ListOptions{LabelSelector: labels.Everything().String()}) for _, s := range sl.Items { desc, _ := RunKubectl("describe", "po", s.Name, fmt.Sprintf("--namespace=%v", ns)) Logf("\nOutput of kubectl describe %v:\n%v", s.Name, desc) l, _ := RunKubectl("logs", s.Name, fmt.Sprintf("--namespace=%v", ns), "--tail=100") Logf("\nLast 100 log lines of %v:\n%v", s.Name, l) } } func IsRetryableAPIError(err error) bool { return apierrs.IsTimeout(err) || apierrs.IsServerTimeout(err) || apierrs.IsTooManyRequests(err) || apierrs.IsInternalError(err) } // DsFromManifest reads a .json/yaml file and returns the daemonset in it. func DsFromManifest(url string) (*extensions.DaemonSet, error) { var controller extensions.DaemonSet Logf("Parsing ds from %v", url) var response *http.Response var err error for i := 1; i <= 5; i++ { response, err = http.Get(url) if err == nil && response.StatusCode == 200 { break } time.Sleep(time.Duration(i) * time.Second) } if err != nil { return nil, fmt.Errorf("failed to get url: %v", err) } if response.StatusCode != 200 { return nil, fmt.Errorf("invalid http response status: %v", response.StatusCode) } defer response.Body.Close() data, err := ioutil.ReadAll(response.Body) if err != nil { return nil, fmt.Errorf("failed to read html response body: %v", err) } json, err := utilyaml.ToJSON(data) if err != nil { return nil, fmt.Errorf("failed to parse data to json: %v", err) } err = runtime.DecodeInto(legacyscheme.Codecs.UniversalDecoder(), json, &controller) if err != nil { return nil, fmt.Errorf("failed to decode DaemonSet spec: %v", err) } return &controller, nil } // waitForServerPreferredNamespacedResources waits until server preferred namespaced resources could be successfully discovered. // TODO: Fix https://github.com/kubernetes/kubernetes/issues/55768 and remove the following retry. func waitForServerPreferredNamespacedResources(d discovery.DiscoveryInterface, timeout time.Duration) ([]*metav1.APIResourceList, error) { Logf("Waiting up to %v for server preferred namespaced resources to be successfully discovered", timeout) var resources []*metav1.APIResourceList if err := wait.PollImmediate(Poll, timeout, func() (bool, error) { var err error resources, err = d.ServerPreferredNamespacedResources() if err == nil || isDynamicDiscoveryError(err) { return true, nil } if !discovery.IsGroupDiscoveryFailedError(err) { return false, err } Logf("Error discoverying server preferred namespaced resources: %v, retrying in %v.", err, Poll) return false, nil }); err != nil { return nil, err } return resources, nil } // WaitForPersistentVolumeClaimDeleted waits for a PersistentVolumeClaim to be removed from the system until timeout occurs, whichever comes first. func WaitForPersistentVolumeClaimDeleted(c clientset.Interface, ns string, pvcName string, Poll, timeout time.Duration) error { Logf("Waiting up to %v for PersistentVolumeClaim %s to be removed", timeout, pvcName) for start := time.Now(); time.Since(start) < timeout; time.Sleep(Poll) { _, err := c.CoreV1().PersistentVolumeClaims(ns).Get(pvcName, metav1.GetOptions{}) if err != nil { if apierrs.IsNotFound(err) { Logf("Claim %q in namespace %q doesn't exist in the system", pvcName, ns) return nil } Logf("Failed to get claim %q in namespace %q, retrying in %v. Error: %v", pvcName, ns, Poll, err) } } return fmt.Errorf("PersistentVolumeClaim %s is not removed from the system within %v", pvcName, timeout) }
floreks/kubernetes
test/e2e/framework/util.go
GO
apache-2.0
181,665
/* * * Copyright (c) 2014-2017 Nest Labs, Inc. * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. * * Author: Adam Dunkels <adam@sics.se> * */ #ifndef __ARCH_SYS_ARCH_H__ #define __ARCH_SYS_ARCH_H__ #include <errno.h> #define SYS_MBOX_NULL NULL #define SYS_SEM_NULL NULL typedef u32_t sys_prot_t; struct sys_sem; typedef struct sys_sem * sys_sem_t; #define sys_sem_valid(sem) (((sem) != NULL) && (*(sem) != NULL)) #define sys_sem_set_invalid(sem) do { if((sem) != NULL) { *(sem) = NULL; }}while(0) struct sys_mbox; typedef struct sys_mbox *sys_mbox_t; #define sys_mbox_valid(mbox) (((mbox) != NULL) && (*(mbox) != NULL)) #define sys_mbox_set_invalid(mbox) do { if((mbox) != NULL) { *(mbox) = NULL; }}while(0) struct sys_thread; typedef struct sys_thread * sys_thread_t; #endif /* __ARCH_SYS_ARCH_H__ */
openweave/openweave-core
src/lwip/standalone/arch/sys_arch.h
C
apache-2.0
2,945
/* * Copyright © 2014 - 2018 Leipzig University (Database Research Group) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.gradoop.flink.model.impl.operators.matching.single.cypher; import com.google.common.collect.Lists; import org.gradoop.flink.model.impl.operators.matching.common.MatchStrategy; import org.gradoop.flink.model.impl.operators.matching.common.statistics.GraphStatistics; import org.gradoop.flink.model.impl.operators.matching.single.PatternMatching; import org.gradoop.flink.model.impl.operators.matching.single.SubgraphHomomorphismTest; import org.junit.runners.Parameterized; import java.util.List; import static org.gradoop.flink.model.impl.operators.matching.TestData.*; public class CypherPatternMatchingHomomorphismTest extends SubgraphHomomorphismTest { @Parameterized.Parameters(name = "{index}: {0}") public static Iterable data() { List<String[]> data = Lists.newArrayList(SubgraphHomomorphismTest.data()); data.add(new String[] { "Graph2_VarLength2", GRAPH_2, VAR_LENGTH_PATH_PATTERN_2, "expected1,expected2", "expected1[(v9)-[e15]->(v9)-[e15]->(v9)]" + "expected2[(v9)-[e15]->(v9)-[e15]->(v9)-[e15]->(v9)]" }); data.add(new String[] { "Graph3_VarLength3", GRAPH_3, VAR_LENGTH_PATH_PATTERN_3, "expected1,expected2,expected3,expected4,expected5,expected6," + "expected7,expected8,expected9,expected10", "expected1[(v0)]" + "expected2[(v0)-[e0]->(v1)]" + "expected3[(v0)-[e0]->(v1)-[e1]->(v2)]" + "expected4[(v0)-[e0]->(v1)-[e1]->(v2)-[e2]->(v3)]" + "expected5[(v1)]" + "expected6[(v1)-[e1]->(v2)]" + "expected7[(v1)-[e1]->(v2)-[e2]->(v3)]" + "expected8[(v2)]" + "expected9[(v2)-[e2]->(v3)]" + "expected10[(v3)]" }); data.add(new String[] { "Graph2_VarLength4", GRAPH_2, VAR_LENGTH_PATH_PATTERN_4, "expected1", "expected1[(v2)-[e8]->(v6)-[e7]->(v2)]" }); return data; } public CypherPatternMatchingHomomorphismTest(String testName, String dataGraph, String queryGraph, String expectedGraphVariables, String expectedCollection) { super(testName, dataGraph, queryGraph, expectedGraphVariables, expectedCollection); } @Override public PatternMatching getImplementation(String queryGraph, boolean attachData) { int n = 42; // just used for testing return new CypherPatternMatching("MATCH " + queryGraph, attachData, MatchStrategy.HOMOMORPHISM, MatchStrategy.HOMOMORPHISM, new GraphStatistics(n, n, n, n)); } }
niklasteichmann/gradoop
gradoop-flink/src/test/java/org/gradoop/flink/model/impl/operators/matching/single/cypher/CypherPatternMatchingHomomorphismTest.java
Java
apache-2.0
3,103
# Laeticorticium jonides (Bres.) Donk SPECIES #### Status SYNONYM #### According to Index Fungorum #### Published in null #### Original name Corticium jonides Bres. ### Remarks null
mdoering/backbone
life/Fungi/Basidiomycota/Agaricomycetes/Corticiales/Corticiaceae/Laeticorticium/Laeticorticium ionides/ Syn. Laeticorticium jonides/README.md
Markdown
apache-2.0
186
/** * Copyright (c) 2015-2016, Michael Yang 杨福海 (fuhai999@gmail.com). * * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.gnu.org/licenses/lgpl-3.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.jpress.model.base; import io.jpress.model.Metadata; import io.jpress.model.core.JModel; import io.jpress.model.query.MetaDataQuery; import java.math.BigInteger; import com.jfinal.plugin.activerecord.IBean; import com.jfinal.plugin.ehcache.CacheKit; import com.jfinal.plugin.ehcache.IDataLoader; /** * Auto generated by JPress, do not modify this file. */ @SuppressWarnings("serial") public abstract class BaseComment<M extends BaseComment<M>> extends JModel<M> implements IBean { public static final String CACHE_NAME = "comment"; public static final String METADATA_TYPE = "comment"; public void removeCache(Object key){ if(key == null) return; CacheKit.remove(CACHE_NAME, key); } public void putCache(Object key,Object value){ CacheKit.put(CACHE_NAME, key, value); } public M getCache(Object key){ return CacheKit.get(CACHE_NAME, key); } public M getCache(Object key,IDataLoader dataloader){ return CacheKit.get(CACHE_NAME, key, dataloader); } public Metadata createMetadata(){ Metadata md = new Metadata(); md.setObjectId(getId()); md.setObjectType(METADATA_TYPE); return md; } public Metadata createMetadata(String key,String value){ Metadata md = new Metadata(); md.setObjectId(getId()); md.setObjectType(METADATA_TYPE); md.setMetaKey(key); md.setMetaValue(value); return md; } public boolean saveOrUpdateMetadta(String key,String value){ Metadata metadata = MetaDataQuery.me().findByTypeAndIdAndKey(METADATA_TYPE, getId(), key); if (metadata == null) { metadata = createMetadata(key, value); return metadata.save(); } metadata.setMetaValue(value); return metadata.update(); } public String metadata(String key) { Metadata m = MetaDataQuery.me().findByTypeAndIdAndKey(METADATA_TYPE, getId(), key); if (m != null) { return m.getMetaValue(); } return null; } @Override public boolean equals(Object o) { if(o == null){ return false; } if(!(o instanceof BaseComment<?>)){return false;} BaseComment<?> m = (BaseComment<?>) o; if(m.getId() == null){return false;} return m.getId().compareTo(this.getId()) == 0; } public void setId(java.math.BigInteger id) { set("id", id); } public java.math.BigInteger getId() { Object id = get("id"); if (id == null) return null; return id instanceof BigInteger ? (BigInteger)id : new BigInteger(id.toString()); } public void setParentId(java.math.BigInteger parentId) { set("parent_id", parentId); } public java.math.BigInteger getParentId() { return get("parent_id"); } public void setContentId(java.math.BigInteger contentId) { set("content_id", contentId); } public java.math.BigInteger getContentId() { return get("content_id"); } public void setContentModule(java.lang.String contentModule) { set("content_module", contentModule); } public java.lang.String getContentModule() { return get("content_module"); } public void setCommentCount(java.lang.Long commentCount) { set("comment_count", commentCount); } public java.lang.Long getCommentCount() { return get("comment_count"); } public void setOrderNumber(java.lang.Long orderNumber) { set("order_number", orderNumber); } public java.lang.Long getOrderNumber() { return get("order_number"); } public void setUserId(java.math.BigInteger userId) { set("user_id", userId); } public java.math.BigInteger getUserId() { return get("user_id"); } public void setIp(java.lang.String ip) { set("ip", ip); } public java.lang.String getIp() { return get("ip"); } public void setAuthor(java.lang.String author) { set("author", author); } public java.lang.String getAuthor() { return get("author"); } public void setType(java.lang.String type) { set("type", type); } public java.lang.String getType() { return get("type"); } public void setText(java.lang.String text) { set("text", text); } public java.lang.String getText() { return get("text"); } public void setAgent(java.lang.String agent) { set("agent", agent); } public java.lang.String getAgent() { return get("agent"); } public void setCreated(java.util.Date created) { set("created", created); } public java.util.Date getCreated() { return get("created"); } public void setSlug(java.lang.String slug) { set("slug", slug); } public java.lang.String getSlug() { return get("slug"); } public void setEmail(java.lang.String email) { set("email", email); } public java.lang.String getEmail() { return get("email"); } public void setStatus(java.lang.String status) { set("status", status); } public java.lang.String getStatus() { return get("status"); } public void setVoteUp(java.lang.Long voteUp) { set("vote_up", voteUp); } public java.lang.Long getVoteUp() { return get("vote_up"); } public void setVoteDown(java.lang.Long voteDown) { set("vote_down", voteDown); } public java.lang.Long getVoteDown() { return get("vote_down"); } public void setFlag(java.lang.String flag) { set("flag", flag); } public java.lang.String getFlag() { return get("flag"); } public void setLat(java.math.BigDecimal lat) { set("lat", lat); } public java.math.BigDecimal getLat() { return get("lat"); } public void setLng(java.math.BigDecimal lng) { set("lng", lng); } public java.math.BigDecimal getLng() { return get("lng"); } }
ledanck/fJinal
jpress-model/src/main/java/io/jpress/model/base/BaseComment.java
Java
apache-2.0
6,042
# Introduction to Java Enterprise Edition examples # ## JPA Core ## This module covers very basic usage of Java Persistence API together with JTA, EJB and Bean Validation technologies. ## Examples ## * crud - simple message board that shows how to build simple CRUD (Create Read Update Delete) application with basic usage of JPA. * ejb-container - simple message board app with transactions managed by EJB container. Example uses [crud example](crud) code. * lifecycle-events - basic showcase of PrePersist and PreUpdate events for simplifying entity storage service logic. Example uses [ejb-container](ejb-container) code. * sql-load-script - example that shows how to load some initial database content with single one-liner in persistence.xml file. Example uses [lifecycle-events](lifecycle-events) code. * bean-validation - basic example how to use Bean Validation features to automatically validate entity bean with JPA and give user some basic feedback. Example uses [lifecycle-events](lifecycle-events) partial code. * one-to-one - example of how to relate one entity to one other entity (in this example, how one message can be related to just one author). * one-to-many - example of how to relate one entity to multiple entities (in this example, how one message can be related to multiple comments). * many-to-many - example of how to relate multiple entities to multiple entities (in this example, how one message can be related to multiple tags, and each tag can be related to multiple messages). * element-collection - alternative relation solution to one-to-many relation with @ElementCollection annotation. Example uses [one-to-many](one-to-many) code.
Smoczysko/introduction-to-jee-examples
jpa/core/README.md
Markdown
apache-2.0
1,672
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_111) on Wed Jan 04 22:31:29 EST 2017 --> <title>Uses of Interface org.drip.learning.regularization.RegularizerR1ToR1</title> <meta name="date" content="2017-01-04"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.drip.learning.regularization.RegularizerR1ToR1"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/drip/learning/regularization/RegularizerR1ToR1.html" title="interface in org.drip.learning.regularization">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/drip/learning/regularization/class-use/RegularizerR1ToR1.html" target="_top">Frames</a></li> <li><a href="RegularizerR1ToR1.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface org.drip.learning.regularization.RegularizerR1ToR1" class="title">Uses of Interface<br>org.drip.learning.regularization.RegularizerR1ToR1</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../org/drip/learning/regularization/RegularizerR1ToR1.html" title="interface in org.drip.learning.regularization">RegularizerR1ToR1</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.drip.learning.regularization">org.drip.learning.regularization</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.drip.learning.regularization"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/drip/learning/regularization/RegularizerR1ToR1.html" title="interface in org.drip.learning.regularization">RegularizerR1ToR1</a> in <a href="../../../../../org/drip/learning/regularization/package-summary.html">org.drip.learning.regularization</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../org/drip/learning/regularization/package-summary.html">org.drip.learning.regularization</a> that implement <a href="../../../../../org/drip/learning/regularization/RegularizerR1ToR1.html" title="interface in org.drip.learning.regularization">RegularizerR1ToR1</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/drip/learning/regularization/RegularizerR1CombinatorialToR1Continuous.html" title="class in org.drip.learning.regularization">RegularizerR1CombinatorialToR1Continuous</a></span></code> <div class="block">RegularizerR1CombinatorialToR1Continuous computes the Structural Loss and Risk for the specified Normed R^1 Combinatorial To Normed R^1 Continuous Learning Function.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/drip/learning/regularization/RegularizerR1ContinuousToR1Continuous.html" title="class in org.drip.learning.regularization">RegularizerR1ContinuousToR1Continuous</a></span></code> <div class="block">RegularizerR1ContinuousToR1Continuous computes the Structural Loss and Risk for the specified Normed R^1 Continuous To Normed R^1 Continuous Learning Function.</div> </td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/drip/learning/regularization/package-summary.html">org.drip.learning.regularization</a> that return <a href="../../../../../org/drip/learning/regularization/RegularizerR1ToR1.html" title="interface in org.drip.learning.regularization">RegularizerR1ToR1</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/learning/regularization/RegularizerR1ToR1.html" title="interface in org.drip.learning.regularization">RegularizerR1ToR1</a></code></td> <td class="colLast"><span class="typeNameLabel">RegularizerBuilder.</span><code><span class="memberNameLink"><a href="../../../../../org/drip/learning/regularization/RegularizerBuilder.html#R1CombinatorialToR1Continuous-org.drip.function.definition.R1ToR1-org.drip.spaces.rxtor1.NormedR1CombinatorialToR1Continuous-double-">R1CombinatorialToR1Continuous</a></span>(<a href="../../../../../org/drip/function/definition/R1ToR1.html" title="class in org.drip.function.definition">R1ToR1</a>&nbsp;funcRegularizerR1ToR1, <a href="../../../../../org/drip/spaces/rxtor1/NormedR1CombinatorialToR1Continuous.html" title="class in org.drip.spaces.rxtor1">NormedR1CombinatorialToR1Continuous</a>&nbsp;funcSpaceR1ToR1, double&nbsp;dblLambda)</code> <div class="block">Construct an Instance of R^1 Combinatorial To R^1 Continuous Regularizer</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/learning/regularization/RegularizerR1ToR1.html" title="interface in org.drip.learning.regularization">RegularizerR1ToR1</a></code></td> <td class="colLast"><span class="typeNameLabel">RegularizerBuilder.</span><code><span class="memberNameLink"><a href="../../../../../org/drip/learning/regularization/RegularizerBuilder.html#R1ContinuousToR1Continuous-org.drip.function.definition.R1ToR1-org.drip.spaces.rxtor1.NormedR1ContinuousToR1Continuous-double-">R1ContinuousToR1Continuous</a></span>(<a href="../../../../../org/drip/function/definition/R1ToR1.html" title="class in org.drip.function.definition">R1ToR1</a>&nbsp;funcRegularizerR1ToR1, <a href="../../../../../org/drip/spaces/rxtor1/NormedR1ContinuousToR1Continuous.html" title="class in org.drip.spaces.rxtor1">NormedR1ContinuousToR1Continuous</a>&nbsp;funcSpaceR1ToR1, double&nbsp;dblLambda)</code> <div class="block">Construct an Instance of R^1 Continuous To R^1 Continuous Regularizer</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/learning/regularization/RegularizerR1ToR1.html" title="interface in org.drip.learning.regularization">RegularizerR1ToR1</a></code></td> <td class="colLast"><span class="typeNameLabel">RegularizerBuilder.</span><code><span class="memberNameLink"><a href="../../../../../org/drip/learning/regularization/RegularizerBuilder.html#ToR1Continuous-org.drip.function.definition.R1ToR1-org.drip.spaces.metric.R1Normed-org.drip.spaces.metric.R1Continuous-double-">ToR1Continuous</a></span>(<a href="../../../../../org/drip/function/definition/R1ToR1.html" title="class in org.drip.function.definition">R1ToR1</a>&nbsp;funcRegularizerR1ToR1, <a href="../../../../../org/drip/spaces/metric/R1Normed.html" title="interface in org.drip.spaces.metric">R1Normed</a>&nbsp;r1Input, <a href="../../../../../org/drip/spaces/metric/R1Continuous.html" title="class in org.drip.spaces.metric">R1Continuous</a>&nbsp;r1ContinuousOutput, double&nbsp;dblLambda)</code> <div class="block">Construct an Instance of R^1 Combinatorial/Continuous To R^1 Continuous Regularizer</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/drip/learning/regularization/RegularizerR1ToR1.html" title="interface in org.drip.learning.regularization">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/drip/learning/regularization/class-use/RegularizerR1ToR1.html" target="_top">Frames</a></li> <li><a href="RegularizerR1ToR1.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
lakshmiDRIP/DRIP
Javadoc/org/drip/learning/regularization/class-use/RegularizerR1ToR1.html
HTML
apache-2.0
11,461
/* * @(#)$Id: WebMailTitle.java 97 2008-10-28 19:41:29Z unsaved $ * * Copyright 2008 by the JWebMail Development Team and Sebastian Schaffert. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.wastl.webmail.plugins; import net.wastl.webmail.exceptions.WebMailException; import net.wastl.webmail.server.HTTPSession; import net.wastl.webmail.server.Plugin; import net.wastl.webmail.server.Storage; import net.wastl.webmail.server.URLHandler; import net.wastl.webmail.server.UserData; import net.wastl.webmail.server.WebMailServer; import net.wastl.webmail.server.WebMailSession; import net.wastl.webmail.server.http.HTTPRequestHeader; import net.wastl.webmail.ui.html.HTMLDocument; import net.wastl.webmail.ui.xml.XHTMLDocument; /** * Show WebMail title. * * provides: title * * @author Sebastian Schaffert */ public class WebMailTitle implements Plugin, URLHandler { public static final String VERSION="1.1"; public static final String URL="/title"; Storage store; public WebMailTitle() { } public void register(WebMailServer parent) { parent.getURLHandler().registerHandler(URL,this); store=parent.getStorage(); } public String getName() { return "WebMailTitle"; } public String getDescription() { return "The WebMail title-frame plugin"; } public String getVersion() { return VERSION; } public String getURL() { return URL; } public HTMLDocument handleURL(String suburl, HTTPSession session, HTTPRequestHeader header) throws WebMailException { if(session == null) { throw new WebMailException("No session was given. If you feel this is incorrect, please contact your system administrator"); } //return new HTMLParsedDocument(store,session,"title"); UserData user=((WebMailSession)session).getUser(); return new XHTMLDocument(session.getModel(),store.getStylesheet("title.xsl",user.getPreferredLocale(),user.getTheme())); } public String provides() { return "title"; } public String requires() { return ""; } }
epsiinside/interne
plugin-src/net/wastl/webmail/plugins/WebMailTitle.java
Java
apache-2.0
2,654
/** * Copyright 2007-2015, Kaazing Corporation. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.kaazing.k3po.driver.internal.control.handler; import static java.lang.String.format; import static java.lang.Thread.currentThread; import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.file.FileSystems.newFileSystem; import static org.kaazing.k3po.lang.internal.parser.ScriptParseStrategy.PROPERTY_NODE; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.nio.file.FileSystem; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import java.util.regex.Pattern; import org.jboss.netty.channel.ChannelFuture; import org.jboss.netty.channel.ChannelFutureListener; import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.ChannelStateEvent; import org.jboss.netty.channel.Channels; import org.jboss.netty.channel.MessageEvent; import org.jboss.netty.channel.socket.nio.NioSocketChannel; import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLoggerFactory; import org.kaazing.k3po.driver.internal.Robot; import org.kaazing.k3po.driver.internal.behavior.Barrier; import org.kaazing.k3po.driver.internal.control.AwaitMessage; import org.kaazing.k3po.driver.internal.control.ErrorMessage; import org.kaazing.k3po.driver.internal.control.FinishedMessage; import org.kaazing.k3po.driver.internal.control.NotifiedMessage; import org.kaazing.k3po.driver.internal.control.NotifyMessage; import org.kaazing.k3po.driver.internal.control.PrepareMessage; import org.kaazing.k3po.driver.internal.control.PreparedMessage; import org.kaazing.k3po.driver.internal.control.StartedMessage; import org.kaazing.k3po.lang.internal.parser.ScriptParseException; import org.kaazing.k3po.lang.internal.parser.ScriptParserImpl; public class ControlServerHandler extends ControlUpstreamHandler { private static final Map<String, Object> EMPTY_ENVIRONMENT = Collections.<String, Object>emptyMap(); private static final InternalLogger LOGGER = InternalLoggerFactory.getInstance(ControlServerHandler.class); private static final String ERROR_MSG_NOT_PREPARED = "Script has not been prepared or is still preparing\n"; private static final String ERROR_MSG_ALREADY_PREPARED = "Script already prepared\n"; private static final String ERROR_MSG_ALREADY_STARTED = "Script has already been started\n"; // the dispose future of the robot that is executing the current test. Will be used to check when it is disposed // in order to start this test private AtomicReference<Robot> activeRobotRef; private Robot robot; private ChannelFutureListener whenAbortedOrFinished; private volatile boolean isFinishedSent = false; private final ChannelFuture channelClosedFuture = Channels.future(null); private ClassLoader scriptLoader; public ControlServerHandler(AtomicReference<Robot> activeRobotRef) { this.activeRobotRef = activeRobotRef; } public void setScriptLoader(ClassLoader scriptLoader) { this.scriptLoader = scriptLoader; } // Note that this is more than just the channel close future. It's a future that means not only // that this channel has closed but it is a future that tells us when this obj has processed the closed event. public ChannelFuture getChannelClosedFuture() { return channelClosedFuture; } @Override public void channelClosed(final ChannelHandlerContext ctx, final ChannelStateEvent e) throws Exception { if (robot != null) { robot.dispose().addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { channelClosedFuture.setSuccess(); ctx.sendUpstream(e); activeRobotRef.compareAndSet(robot, null); } }); } } @Override public void prepareReceived(final ChannelHandlerContext ctx, MessageEvent evt) throws Exception { if (robot != null && robot.getPreparedFuture() != null) { sendErrorMessage(ctx, ERROR_MSG_ALREADY_PREPARED); return; } if (robot == null) { robot = new Robot(); } if (activeRobotRef.get() != robot && ! activeRobotRef.compareAndSet(null, robot)) { Robot activeRobot = activeRobotRef.get(); if (activeRobot == null) { // it seems the active robot finished in the mean time, so we will try again prepareReceived(ctx, evt); } else { activeRobot.getDisposedFuture().addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { ((NioSocketChannel) ctx.getChannel()).getWorker().executeInIoThread(() -> { try { prepareReceived(ctx, evt); } catch (Exception e) { sendErrorMessage(ctx, e); } }, true); } }); return; } } //just in case it was called after connection was closed (test timeout ?) if (ctx.getChannel().getCloseFuture().isDone()) { return; } final PrepareMessage prepare = (PrepareMessage) evt.getMessage(); // enforce control protocol version String version = prepare.getVersion(); if (!"2.0".equals(version)) { sendVersionError(ctx); return; } List<String> scriptNames = prepare.getNames(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("preparing script(s) " + scriptNames); } whenAbortedOrFinished = whenAbortedOrFinished(ctx); String originScript = ""; String origin = prepare.getOrigin(); if (origin != null) { try { originScript = OriginScript.get(origin); } catch (URISyntaxException e) { throw new Exception("Could not find origin: ", e); } } ChannelFuture prepareFuture; String aggregatedScript = originScript + aggregateScript(scriptNames, scriptLoader); List<String> properyOverrides = prepare.getProperties(); // consider hard fail in the future, when test frameworks support // override per test method aggregatedScript = injectOverridenProperties(aggregatedScript, properyOverrides); if (scriptLoader != null) { Thread currentThread = currentThread(); ClassLoader contextClassLoader = currentThread.getContextClassLoader(); try { currentThread.setContextClassLoader(scriptLoader); prepareFuture = robot.prepare(aggregatedScript); } finally { currentThread.setContextClassLoader(contextClassLoader); } } else { prepareFuture = robot.prepare(aggregatedScript); } final String scriptToRun = aggregatedScript; prepareFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(final ChannelFuture f) { PreparedMessage prepared = new PreparedMessage(); prepared.setScript(scriptToRun); prepared.getBarriers().addAll(robot.getBarriersByName().keySet()); writeEvent(ctx, prepared); } }); } private String injectOverridenProperties(String aggregatedScript, List<String> scriptProperties) throws Exception, ScriptParseException { ScriptParserImpl parser = new ScriptParserImpl(); for (String propertyToInject : scriptProperties) { String propertyName = parser.parseWithStrategy(propertyToInject, PROPERTY_NODE).getPropertyName(); StringBuilder replacementScript = new StringBuilder(); Pattern pattern = Pattern.compile("property\\s+" + propertyName + "\\s+.+"); boolean matchFound = false; for (String scriptLine : aggregatedScript.split("\\r?\\n")) { if (pattern.matcher(scriptLine).matches()) { matchFound = true; replacementScript.append(propertyToInject + "\n"); } else { replacementScript.append(scriptLine + "\n"); } } if (!matchFound) { String errorMsg = "Received " + propertyToInject + " in PREPARE but found no where to substitute it"; LOGGER.error(errorMsg); throw new Exception(errorMsg); } aggregatedScript = replacementScript.toString(); } return aggregatedScript; } /* * Public static because it is used in test utils */ public static String aggregateScript(List<String> scriptNames, ClassLoader scriptLoader) throws URISyntaxException, IOException { final StringBuilder aggregatedScript = new StringBuilder(); for (String scriptName : scriptNames) { String scriptNameWithExtension = format("%s.rpt", scriptName); Path scriptPath = Paths.get(scriptNameWithExtension); scriptNameWithExtension = URI.create(scriptNameWithExtension).normalize().getPath(); String script = null; assert !scriptPath.isAbsolute(); // resolve relative scripts in local file system if (scriptLoader != null) { // resolve relative scripts from class loader to support // separated specification projects that include Robot scripts only URL resource = scriptLoader.getResource(scriptNameWithExtension); if (resource != null) { URI resourceURI = resource.toURI(); if ("file".equals(resourceURI.getScheme())) { Path resourcePath = Paths.get(resourceURI); script = readScript(resourcePath); } else { try (FileSystem fileSystem = newFileSystem(resourceURI, EMPTY_ENVIRONMENT)) { Path resourcePath = Paths.get(resourceURI); script = readScript(resourcePath); } } } } if (script == null) { throw new RuntimeException("Script not found: " + scriptPath); } aggregatedScript.append(script); } return aggregatedScript.toString(); } private static String readScript(Path scriptPath) throws IOException { List<String> lines = Files.readAllLines(scriptPath, UTF_8); StringBuilder sb = new StringBuilder(); for (String line : lines) { sb.append(line); sb.append("\n"); } String script = sb.toString(); return script; } @Override public void startReceived(final ChannelHandlerContext ctx, MessageEvent evt) throws Exception { if (robot == null || robot.getPreparedFuture() == null) { sendErrorMessage(ctx, ERROR_MSG_NOT_PREPARED); return; } if (robot.getStartedFuture().isDone()) { sendErrorMessage(ctx, ERROR_MSG_ALREADY_STARTED); return; } ChannelFuture startFuture = robot.start(); startFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(final ChannelFuture f) { if (f.isSuccess()) { final StartedMessage started = new StartedMessage(); writeEvent(ctx, started); } else { sendErrorMessage(ctx, f.getCause()); } } }); assert whenAbortedOrFinished != null; robot.finish().addListener(whenAbortedOrFinished); } @Override public void abortReceived(final ChannelHandlerContext ctx, MessageEvent evt) throws Exception { if (LOGGER.isDebugEnabled()) { LOGGER.debug("ABORT"); } if (robot == null || robot.getPreparedFuture() == null) { sendErrorMessage(ctx, ERROR_MSG_NOT_PREPARED); return; } assert whenAbortedOrFinished != null; robot.abort().addListener(whenAbortedOrFinished); } @Override public void notifyReceived(final ChannelHandlerContext ctx, MessageEvent evt) throws Exception { NotifyMessage notifyMessage = (NotifyMessage) evt.getMessage(); final String barrier = notifyMessage.getBarrier(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("NOTIFY: " + barrier); } if (robot == null || robot.getPreparedFuture() == null) { sendErrorMessage(ctx, ERROR_MSG_NOT_PREPARED); return; } writeNotifiedOnBarrier(barrier, ctx); robot.notifyBarrier(barrier); } @Override public void awaitReceived(final ChannelHandlerContext ctx, MessageEvent evt) throws Exception { AwaitMessage awaitMessage = (AwaitMessage) evt.getMessage(); final String barrier = awaitMessage.getBarrier(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("AWAIT: " + barrier); } if (robot == null || robot.getPreparedFuture() == null) { sendErrorMessage(ctx, ERROR_MSG_NOT_PREPARED); return; } writeNotifiedOnBarrier(barrier, ctx); } private void writeNotifiedOnBarrier(final String barrier, final ChannelHandlerContext ctx) throws Exception { robot.awaitBarrier(barrier).addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess()) { LOGGER.debug("sending NOTIFIED: " + barrier); final NotifiedMessage notified = new NotifiedMessage(); notified.setBarrier(barrier); writeEvent(ctx, notified); } } }); } private ChannelFutureListener whenAbortedOrFinished(final ChannelHandlerContext ctx) { final AtomicBoolean oneTimeOnly = new AtomicBoolean(); return new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (oneTimeOnly.compareAndSet(false, true)) { sendFinishedMessage(ctx); } } }; } private void sendFinishedMessage(ChannelHandlerContext ctx) { String observedScript = robot.getObservedScript(); FinishedMessage finishedMessage = new FinishedMessage(); finishedMessage.setScript(observedScript); Map<String, Barrier> barriers = robot.getBarriersByName(); for (String name : barriers.keySet()) { if (barriers.get(name).getFuture().isSuccess()) finishedMessage.getCompletedBarriers().add(name); else finishedMessage.getIncompleteBarriers().add(name); } writeEvent(ctx, finishedMessage); } private void sendVersionError(ChannelHandlerContext ctx) { ErrorMessage errorMessage = new ErrorMessage(); errorMessage.setSummary("Bad control protocol version"); errorMessage.setDescription("Robot requires control protocol version 2.0"); writeEvent(ctx, errorMessage); } // will send no message after the FINISHED private void writeEvent(final ChannelHandlerContext ctx, final Object message) { if (isFinishedSent) return; if (message instanceof FinishedMessage) isFinishedSent = true; Channels.write(ctx, Channels.future(null), message); } }
StCostea/k3po
driver/src/main/java/org/kaazing/k3po/driver/internal/control/handler/ControlServerHandler.java
Java
apache-2.0
17,034
package com.ctrip.hermes.broker.queue.storage.kafka; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import org.unidal.lookup.annotation.Inject; import org.unidal.lookup.annotation.Named; import org.unidal.tuple.Pair; import com.ctrip.hermes.broker.queue.storage.MessageQueueStorage; import com.ctrip.hermes.broker.status.BrokerStatusMonitor; import com.ctrip.hermes.core.bo.Tpg; import com.ctrip.hermes.core.bo.Tpp; import com.ctrip.hermes.core.message.PartialDecodedMessage; import com.ctrip.hermes.core.message.TppConsumerMessageBatch.MessageMeta; import com.ctrip.hermes.core.message.codec.MessageCodec; import com.ctrip.hermes.core.meta.MetaService; import com.ctrip.hermes.core.transport.command.SendMessageCommand.MessageBatchWithRawData; import com.ctrip.hermes.meta.entity.Storage; @Named(type = MessageQueueStorage.class, value = Storage.KAFKA) public class KafkaMessageQueueStorage implements MessageQueueStorage { @Inject private MetaService m_metaService; @Inject private MessageCodec m_messageCodec; // TODO housekeeping private Map<String, KafkaMessageBrokerSender> m_senders = new HashMap<>(); @Override public void appendMessages(Tpp tpp, Collection<MessageBatchWithRawData> batches) throws Exception { ByteBuf buf = Unpooled.buffer(); KafkaMessageBrokerSender sender = getSender(tpp.getTopic()); for (MessageBatchWithRawData batch : batches) { List<PartialDecodedMessage> pdmsgs = batch.getMessages(); for (PartialDecodedMessage pdmsg : pdmsgs) { m_messageCodec.encodePartial(pdmsg, buf); byte[] bytes = new byte[buf.readableBytes()]; buf.readBytes(bytes); buf.clear(); sender.send(tpp.getTopic(), tpp.getPartition(), bytes); BrokerStatusMonitor.INSTANCE.kafkaSend(tpp.getTopic()); } } } @Override public Object findLastOffset(Tpp tpp, int groupId) throws Exception { return null; } @Override public Object findLastResendOffset(Tpg tpg) throws Exception { return null; } @Override public FetchResult fetchMessages(Tpp tpp, Object startOffset, int batchSize) { return null; } @Override public FetchResult fetchResendMessages(Tpg tpg, Object startOffset, int batchSize) { return null; } @Override public void nack(Tpp tpp, String groupId, boolean resend, List<Pair<Long, MessageMeta>> msgId2Metas) { } @Override public void ack(Tpp tpp, String groupId, boolean resend, long msgSeq) { } private KafkaMessageBrokerSender getSender(String topic) { if (!m_senders.containsKey(topic)) { synchronized (m_senders) { if (!m_senders.containsKey(topic)) { m_senders.put(topic, new KafkaMessageBrokerSender(topic, m_metaService)); } } } return m_senders.get(topic); } }
fengshao0907/hermes
hermes-broker/src/main/java/com/ctrip/hermes/broker/queue/storage/kafka/KafkaMessageQueueStorage.java
Java
apache-2.0
2,815
# Tillandsia ionochroma André ex Mez SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Poales/Bromeliaceae/Tillandsia/Tillandsia ionochroma/README.md
Markdown
apache-2.0
193
// Code generated by aws/endpoints/v3model_codegen.go. DO NOT EDIT. package endpoints import ( "regexp" ) // Partition identifiers const ( AwsPartitionID = "aws" // AWS Standard partition. AwsCnPartitionID = "aws-cn" // AWS China partition. AwsUsGovPartitionID = "aws-us-gov" // AWS GovCloud (US) partition. AwsIsoPartitionID = "aws-iso" // AWS ISO (US) partition. AwsIsoBPartitionID = "aws-iso-b" // AWS ISOB (US) partition. ) // AWS Standard partition's regions. const ( AfSouth1RegionID = "af-south-1" // Africa (Cape Town). ApEast1RegionID = "ap-east-1" // Asia Pacific (Hong Kong). ApNortheast1RegionID = "ap-northeast-1" // Asia Pacific (Tokyo). ApNortheast2RegionID = "ap-northeast-2" // Asia Pacific (Seoul). ApNortheast3RegionID = "ap-northeast-3" // Asia Pacific (Osaka). ApSouth1RegionID = "ap-south-1" // Asia Pacific (Mumbai). ApSoutheast1RegionID = "ap-southeast-1" // Asia Pacific (Singapore). ApSoutheast2RegionID = "ap-southeast-2" // Asia Pacific (Sydney). CaCentral1RegionID = "ca-central-1" // Canada (Central). EuCentral1RegionID = "eu-central-1" // Europe (Frankfurt). EuNorth1RegionID = "eu-north-1" // Europe (Stockholm). EuSouth1RegionID = "eu-south-1" // Europe (Milan). EuWest1RegionID = "eu-west-1" // Europe (Ireland). EuWest2RegionID = "eu-west-2" // Europe (London). EuWest3RegionID = "eu-west-3" // Europe (Paris). MeSouth1RegionID = "me-south-1" // Middle East (Bahrain). SaEast1RegionID = "sa-east-1" // South America (Sao Paulo). UsEast1RegionID = "us-east-1" // US East (N. Virginia). UsEast2RegionID = "us-east-2" // US East (Ohio). UsWest1RegionID = "us-west-1" // US West (N. California). UsWest2RegionID = "us-west-2" // US West (Oregon). ) // AWS China partition's regions. const ( CnNorth1RegionID = "cn-north-1" // China (Beijing). CnNorthwest1RegionID = "cn-northwest-1" // China (Ningxia). ) // AWS GovCloud (US) partition's regions. const ( UsGovEast1RegionID = "us-gov-east-1" // AWS GovCloud (US-East). UsGovWest1RegionID = "us-gov-west-1" // AWS GovCloud (US-West). ) // AWS ISO (US) partition's regions. const ( UsIsoEast1RegionID = "us-iso-east-1" // US ISO East. ) // AWS ISOB (US) partition's regions. const ( UsIsobEast1RegionID = "us-isob-east-1" // US ISOB East (Ohio). ) // DefaultResolver returns an Endpoint resolver that will be able // to resolve endpoints for: AWS Standard, AWS China, AWS GovCloud (US), AWS ISO (US), and AWS ISOB (US). // // Use DefaultPartitions() to get the list of the default partitions. func DefaultResolver() Resolver { return defaultPartitions } // DefaultPartitions returns a list of the partitions the SDK is bundled // with. The available partitions are: AWS Standard, AWS China, AWS GovCloud (US), AWS ISO (US), and AWS ISOB (US). // // partitions := endpoints.DefaultPartitions // for _, p := range partitions { // // ... inspect partitions // } func DefaultPartitions() []Partition { return defaultPartitions.Partitions() } var defaultPartitions = partitions{ awsPartition, awscnPartition, awsusgovPartition, awsisoPartition, awsisobPartition, } // AwsPartition returns the Resolver for AWS Standard. func AwsPartition() Partition { return awsPartition.Partition() } var awsPartition = partition{ ID: "aws", Name: "AWS Standard", DNSSuffix: "amazonaws.com", RegionRegex: regionRegex{ Regexp: func() *regexp.Regexp { reg, _ := regexp.Compile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$") return reg }(), }, Defaults: endpoint{ Hostname: "{service}.{region}.{dnsSuffix}", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, Regions: regions{ "af-south-1": region{ Description: "Africa (Cape Town)", }, "ap-east-1": region{ Description: "Asia Pacific (Hong Kong)", }, "ap-northeast-1": region{ Description: "Asia Pacific (Tokyo)", }, "ap-northeast-2": region{ Description: "Asia Pacific (Seoul)", }, "ap-northeast-3": region{ Description: "Asia Pacific (Osaka)", }, "ap-south-1": region{ Description: "Asia Pacific (Mumbai)", }, "ap-southeast-1": region{ Description: "Asia Pacific (Singapore)", }, "ap-southeast-2": region{ Description: "Asia Pacific (Sydney)", }, "ca-central-1": region{ Description: "Canada (Central)", }, "eu-central-1": region{ Description: "Europe (Frankfurt)", }, "eu-north-1": region{ Description: "Europe (Stockholm)", }, "eu-south-1": region{ Description: "Europe (Milan)", }, "eu-west-1": region{ Description: "Europe (Ireland)", }, "eu-west-2": region{ Description: "Europe (London)", }, "eu-west-3": region{ Description: "Europe (Paris)", }, "me-south-1": region{ Description: "Middle East (Bahrain)", }, "sa-east-1": region{ Description: "South America (Sao Paulo)", }, "us-east-1": region{ Description: "US East (N. Virginia)", }, "us-east-2": region{ Description: "US East (Ohio)", }, "us-west-1": region{ Description: "US West (N. California)", }, "us-west-2": region{ Description: "US West (Oregon)", }, }, Services: services{ "a4b": service{ Endpoints: endpoints{ "us-east-1": endpoint{}, }, }, "access-analyzer": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ca-central-1": endpoint{ Hostname: "access-analyzer-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-us-east-1": endpoint{ Hostname: "access-analyzer-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "access-analyzer-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "access-analyzer-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "access-analyzer-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "acm": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "ca-central-1-fips": endpoint{ Hostname: "acm-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "acm-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{}, "us-east-2-fips": endpoint{ Hostname: "acm-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{}, "us-west-1-fips": endpoint{ Hostname: "acm-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "acm-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "acm-pca": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ca-central-1": endpoint{ Hostname: "acm-pca-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-us-east-1": endpoint{ Hostname: "acm-pca-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "acm-pca-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "acm-pca-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "acm-pca-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "airflow": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "amplifybackend": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "api.detective": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "api.detective-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{}, "us-east-2-fips": endpoint{ Hostname: "api.detective-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{}, "us-west-1-fips": endpoint{ Hostname: "api.detective-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "api.detective-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "api.ecr": service{ Endpoints: endpoints{ "af-south-1": endpoint{ Hostname: "api.ecr.af-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "af-south-1", }, }, "ap-east-1": endpoint{ Hostname: "api.ecr.ap-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-east-1", }, }, "ap-northeast-1": endpoint{ Hostname: "api.ecr.ap-northeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-1", }, }, "ap-northeast-2": endpoint{ Hostname: "api.ecr.ap-northeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-2", }, }, "ap-northeast-3": endpoint{ Hostname: "api.ecr.ap-northeast-3.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-3", }, }, "ap-south-1": endpoint{ Hostname: "api.ecr.ap-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-south-1", }, }, "ap-southeast-1": endpoint{ Hostname: "api.ecr.ap-southeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-1", }, }, "ap-southeast-2": endpoint{ Hostname: "api.ecr.ap-southeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-2", }, }, "ca-central-1": endpoint{ Hostname: "api.ecr.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "eu-central-1": endpoint{ Hostname: "api.ecr.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-central-1", }, }, "eu-north-1": endpoint{ Hostname: "api.ecr.eu-north-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-north-1", }, }, "eu-south-1": endpoint{ Hostname: "api.ecr.eu-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-south-1", }, }, "eu-west-1": endpoint{ Hostname: "api.ecr.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-1", }, }, "eu-west-2": endpoint{ Hostname: "api.ecr.eu-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-2", }, }, "eu-west-3": endpoint{ Hostname: "api.ecr.eu-west-3.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-3", }, }, "fips-dkr-us-east-1": endpoint{ Hostname: "ecr-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-dkr-us-east-2": endpoint{ Hostname: "ecr-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-dkr-us-west-1": endpoint{ Hostname: "ecr-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-dkr-us-west-2": endpoint{ Hostname: "ecr-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "fips-us-east-1": endpoint{ Hostname: "ecr-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "ecr-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "ecr-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "ecr-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{ Hostname: "api.ecr.me-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "me-south-1", }, }, "sa-east-1": endpoint{ Hostname: "api.ecr.sa-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "sa-east-1", }, }, "us-east-1": endpoint{ Hostname: "api.ecr.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{ Hostname: "api.ecr.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{ Hostname: "api.ecr.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{ Hostname: "api.ecr.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "api.elastic-inference": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{ Hostname: "api.elastic-inference.ap-northeast-1.amazonaws.com", }, "ap-northeast-2": endpoint{ Hostname: "api.elastic-inference.ap-northeast-2.amazonaws.com", }, "eu-west-1": endpoint{ Hostname: "api.elastic-inference.eu-west-1.amazonaws.com", }, "us-east-1": endpoint{ Hostname: "api.elastic-inference.us-east-1.amazonaws.com", }, "us-east-2": endpoint{ Hostname: "api.elastic-inference.us-east-2.amazonaws.com", }, "us-west-2": endpoint{ Hostname: "api.elastic-inference.us-west-2.amazonaws.com", }, }, }, "api.fleethub.iot": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "api.mediatailor": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "api.pricing": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "pricing", }, }, Endpoints: endpoints{ "ap-south-1": endpoint{}, "us-east-1": endpoint{}, }, }, "api.sagemaker": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "api-fips.sagemaker.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{}, "us-east-2-fips": endpoint{ Hostname: "api-fips.sagemaker.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{}, "us-west-1-fips": endpoint{ Hostname: "api-fips.sagemaker.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "api-fips.sagemaker.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "apigateway": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "app-integrations": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "appflow": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "application-autoscaling": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "appmesh": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "apprunner": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "appstream2": service{ Defaults: endpoint{ Protocols: []string{"https"}, CredentialScope: credentialScope{ Service: "appstream", }, }, Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "fips": endpoint{ Hostname: "appstream2-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "appsync": service{ Endpoints: endpoints{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "athena": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "athena-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "athena-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "athena-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "athena-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "autoscaling": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "autoscaling-plans": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "backup": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "batch": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "fips.batch.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "fips.batch.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "fips.batch.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "fips.batch.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "budgets": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-global": endpoint{ Hostname: "budgets.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, }, }, "ce": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-global": endpoint{ Hostname: "ce.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, }, }, "chime": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "aws-global": endpoint{ Hostname: "chime.us-east-1.amazonaws.com", Protocols: []string{"https"}, CredentialScope: credentialScope{ Region: "us-east-1", }, }, }, }, "cloud9": service{ Endpoints: endpoints{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "clouddirectory": service{ Endpoints: endpoints{ "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "cloudformation": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "cloudformation-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{}, "us-east-2-fips": endpoint{ Hostname: "cloudformation-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{}, "us-west-1-fips": endpoint{ Hostname: "cloudformation-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "cloudformation-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "cloudfront": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-global": endpoint{ Hostname: "cloudfront.amazonaws.com", Protocols: []string{"http", "https"}, CredentialScope: credentialScope{ Region: "us-east-1", }, }, }, }, "cloudhsm": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "cloudhsmv2": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "cloudhsm", }, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "cloudsearch": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "cloudtrail": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "cloudtrail-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "cloudtrail-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "cloudtrail-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "cloudtrail-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "codeartifact": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "codebuild": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "codebuild-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{}, "us-east-2-fips": endpoint{ Hostname: "codebuild-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{}, "us-west-1-fips": endpoint{ Hostname: "codebuild-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "codebuild-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "codecommit": service{ Endpoints: endpoints{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips": endpoint{ Hostname: "codecommit-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "codedeploy": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "codedeploy-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{}, "us-east-2-fips": endpoint{ Hostname: "codedeploy-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{}, "us-west-1-fips": endpoint{ Hostname: "codedeploy-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "codedeploy-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "codeguru-reviewer": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "codepipeline": service{ Endpoints: endpoints{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ca-central-1": endpoint{ Hostname: "codepipeline-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-us-east-1": endpoint{ Hostname: "codepipeline-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "codepipeline-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "codepipeline-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "codepipeline-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "codestar": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "codestar-connections": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "cognito-identity": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "cognito-identity-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "cognito-identity-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-2": endpoint{ Hostname: "cognito-identity-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "cognito-idp": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "cognito-idp-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "cognito-idp-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "cognito-idp-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "cognito-idp-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "cognito-sync": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "comprehend": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "comprehend-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "comprehend-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-2": endpoint{ Hostname: "comprehend-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "comprehendmedical": service{ Endpoints: endpoints{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "comprehendmedical-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "comprehendmedical-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-2": endpoint{ Hostname: "comprehendmedical-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "config": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "config-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "config-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "config-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "config-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "connect": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "contact-lens": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "cur": service{ Endpoints: endpoints{ "us-east-1": endpoint{}, }, }, "data.mediastore": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "dataexchange": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "datapipeline": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "datasync": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ca-central-1": endpoint{ Hostname: "datasync-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-us-east-1": endpoint{ Hostname: "datasync-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "datasync-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "datasync-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "datasync-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "dax": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "devicefarm": service{ Endpoints: endpoints{ "us-west-2": endpoint{}, }, }, "directconnect": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "directconnect-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "directconnect-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "directconnect-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "directconnect-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "discovery": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "dms": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "dms-fips": endpoint{ Hostname: "dms-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "docdb": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{ Hostname: "rds.ap-northeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-1", }, }, "ap-northeast-2": endpoint{ Hostname: "rds.ap-northeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-2", }, }, "ap-south-1": endpoint{ Hostname: "rds.ap-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-south-1", }, }, "ap-southeast-1": endpoint{ Hostname: "rds.ap-southeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-1", }, }, "ap-southeast-2": endpoint{ Hostname: "rds.ap-southeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-2", }, }, "ca-central-1": endpoint{ Hostname: "rds.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "eu-central-1": endpoint{ Hostname: "rds.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-central-1", }, }, "eu-west-1": endpoint{ Hostname: "rds.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-1", }, }, "eu-west-2": endpoint{ Hostname: "rds.eu-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-2", }, }, "eu-west-3": endpoint{ Hostname: "rds.eu-west-3.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-3", }, }, "sa-east-1": endpoint{ Hostname: "rds.sa-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "sa-east-1", }, }, "us-east-1": endpoint{ Hostname: "rds.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{ Hostname: "rds.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-2": endpoint{ Hostname: "rds.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "ds": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ca-central-1": endpoint{ Hostname: "ds-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-us-east-1": endpoint{ Hostname: "ds-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "ds-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "ds-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "ds-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "dynamodb": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "ca-central-1-fips": endpoint{ Hostname: "dynamodb-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "local": endpoint{ Hostname: "localhost:8000", Protocols: []string{"http"}, CredentialScope: credentialScope{ Region: "us-east-1", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "dynamodb-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{}, "us-east-2-fips": endpoint{ Hostname: "dynamodb-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{}, "us-west-1-fips": endpoint{ Hostname: "dynamodb-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "dynamodb-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "ebs": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ca-central-1": endpoint{ Hostname: "ebs-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-us-east-1": endpoint{ Hostname: "ebs-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "ebs-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "ebs-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "ebs-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "ec2": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ca-central-1": endpoint{ Hostname: "ec2-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-us-east-1": endpoint{ Hostname: "ec2-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "ec2-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "ec2-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "ec2-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "ec2metadata": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-global": endpoint{ Hostname: "169.254.169.254/latest", Protocols: []string{"http"}, }, }, }, "ecs": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "ecs-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "ecs-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "ecs-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "ecs-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "eks": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "fips.eks.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "fips.eks.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "fips.eks.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "fips.eks.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "elasticache": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips": endpoint{ Hostname: "elasticache-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "elasticbeanstalk": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "elasticbeanstalk-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "elasticbeanstalk-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "elasticbeanstalk-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "elasticbeanstalk-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "elasticfilesystem": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-af-south-1": endpoint{ Hostname: "elasticfilesystem-fips.af-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "af-south-1", }, }, "fips-ap-east-1": endpoint{ Hostname: "elasticfilesystem-fips.ap-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-east-1", }, }, "fips-ap-northeast-1": endpoint{ Hostname: "elasticfilesystem-fips.ap-northeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-1", }, }, "fips-ap-northeast-2": endpoint{ Hostname: "elasticfilesystem-fips.ap-northeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-2", }, }, "fips-ap-northeast-3": endpoint{ Hostname: "elasticfilesystem-fips.ap-northeast-3.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-3", }, }, "fips-ap-south-1": endpoint{ Hostname: "elasticfilesystem-fips.ap-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-south-1", }, }, "fips-ap-southeast-1": endpoint{ Hostname: "elasticfilesystem-fips.ap-southeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-1", }, }, "fips-ap-southeast-2": endpoint{ Hostname: "elasticfilesystem-fips.ap-southeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-2", }, }, "fips-ca-central-1": endpoint{ Hostname: "elasticfilesystem-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-eu-central-1": endpoint{ Hostname: "elasticfilesystem-fips.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-central-1", }, }, "fips-eu-north-1": endpoint{ Hostname: "elasticfilesystem-fips.eu-north-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-north-1", }, }, "fips-eu-south-1": endpoint{ Hostname: "elasticfilesystem-fips.eu-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-south-1", }, }, "fips-eu-west-1": endpoint{ Hostname: "elasticfilesystem-fips.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-1", }, }, "fips-eu-west-2": endpoint{ Hostname: "elasticfilesystem-fips.eu-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-2", }, }, "fips-eu-west-3": endpoint{ Hostname: "elasticfilesystem-fips.eu-west-3.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-3", }, }, "fips-me-south-1": endpoint{ Hostname: "elasticfilesystem-fips.me-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "me-south-1", }, }, "fips-sa-east-1": endpoint{ Hostname: "elasticfilesystem-fips.sa-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "sa-east-1", }, }, "fips-us-east-1": endpoint{ Hostname: "elasticfilesystem-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "elasticfilesystem-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "elasticfilesystem-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "elasticfilesystem-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "elasticloadbalancing": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "elasticloadbalancing-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "elasticloadbalancing-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "elasticloadbalancing-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "elasticloadbalancing-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "elasticmapreduce": service{ Defaults: endpoint{ SSLCommonName: "{region}.{service}.{dnsSuffix}", Protocols: []string{"https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{ SSLCommonName: "{service}.{region}.{dnsSuffix}", }, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ca-central-1": endpoint{ Hostname: "elasticmapreduce-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-us-east-1": endpoint{ Hostname: "elasticmapreduce-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "elasticmapreduce-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "elasticmapreduce-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "elasticmapreduce-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{ SSLCommonName: "{service}.{region}.{dnsSuffix}", }, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "elastictranscoder": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "email": service{ Endpoints: endpoints{ "ap-south-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "emr-containers": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "entitlement.marketplace": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "aws-marketplace", }, }, Endpoints: endpoints{ "us-east-1": endpoint{}, }, }, "es": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips": endpoint{ Hostname: "es-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "events": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "events-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "events-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "events-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "events-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "finspace": service{ Endpoints: endpoints{ "ca-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "finspace-api": service{ Endpoints: endpoints{ "ca-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "firehose": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "firehose-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "firehose-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "firehose-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "firehose-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "fms": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-af-south-1": endpoint{ Hostname: "fms-fips.af-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "af-south-1", }, }, "fips-ap-east-1": endpoint{ Hostname: "fms-fips.ap-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-east-1", }, }, "fips-ap-northeast-1": endpoint{ Hostname: "fms-fips.ap-northeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-1", }, }, "fips-ap-northeast-2": endpoint{ Hostname: "fms-fips.ap-northeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-2", }, }, "fips-ap-south-1": endpoint{ Hostname: "fms-fips.ap-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-south-1", }, }, "fips-ap-southeast-1": endpoint{ Hostname: "fms-fips.ap-southeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-1", }, }, "fips-ap-southeast-2": endpoint{ Hostname: "fms-fips.ap-southeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-2", }, }, "fips-ca-central-1": endpoint{ Hostname: "fms-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-eu-central-1": endpoint{ Hostname: "fms-fips.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-central-1", }, }, "fips-eu-south-1": endpoint{ Hostname: "fms-fips.eu-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-south-1", }, }, "fips-eu-west-1": endpoint{ Hostname: "fms-fips.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-1", }, }, "fips-eu-west-2": endpoint{ Hostname: "fms-fips.eu-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-2", }, }, "fips-eu-west-3": endpoint{ Hostname: "fms-fips.eu-west-3.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-3", }, }, "fips-me-south-1": endpoint{ Hostname: "fms-fips.me-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "me-south-1", }, }, "fips-sa-east-1": endpoint{ Hostname: "fms-fips.sa-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "sa-east-1", }, }, "fips-us-east-1": endpoint{ Hostname: "fms-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "fms-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "fms-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "fms-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "forecast": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "forecast-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "forecast-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-2": endpoint{ Hostname: "forecast-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "forecastquery": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "forecastquery-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "forecastquery-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-2": endpoint{ Hostname: "forecastquery-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "fsx": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-prod-ca-central-1": endpoint{ Hostname: "fsx-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-prod-us-east-1": endpoint{ Hostname: "fsx-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-prod-us-east-2": endpoint{ Hostname: "fsx-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-prod-us-west-1": endpoint{ Hostname: "fsx-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-prod-us-west-2": endpoint{ Hostname: "fsx-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "gamelift": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "glacier": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ca-central-1": endpoint{ Hostname: "glacier-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-us-east-1": endpoint{ Hostname: "glacier-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "glacier-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "glacier-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "glacier-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "glue": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "glue-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "glue-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "glue-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "glue-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "greengrass": service{ IsRegionalized: boxedTrue, Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "groundstation": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "groundstation-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "groundstation-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-2": endpoint{ Hostname: "groundstation-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "guardduty": service{ IsRegionalized: boxedTrue, Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "guardduty-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{}, "us-east-2-fips": endpoint{ Hostname: "guardduty-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{}, "us-west-1-fips": endpoint{ Hostname: "guardduty-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "guardduty-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "health": service{ Endpoints: endpoints{ "fips-us-east-2": endpoint{ Hostname: "health-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, }, }, "healthlake": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "us-east-1": endpoint{}, }, }, "honeycode": service{ Endpoints: endpoints{ "us-west-2": endpoint{}, }, }, "iam": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-global": endpoint{ Hostname: "iam.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "iam-fips": endpoint{ Hostname: "iam-fips.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, }, }, "identitystore": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "importexport": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-global": endpoint{ Hostname: "importexport.amazonaws.com", SignatureVersions: []string{"v2", "v4"}, CredentialScope: credentialScope{ Region: "us-east-1", Service: "IngestionService", }, }, }, }, "inspector": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "inspector-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "inspector-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "inspector-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "inspector-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "iot": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "execute-api", }, }, Endpoints: endpoints{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "iotanalytics": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "iotevents": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "ioteventsdata": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{ Hostname: "data.iotevents.ap-northeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-1", }, }, "ap-northeast-2": endpoint{ Hostname: "data.iotevents.ap-northeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-2", }, }, "ap-southeast-1": endpoint{ Hostname: "data.iotevents.ap-southeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-1", }, }, "ap-southeast-2": endpoint{ Hostname: "data.iotevents.ap-southeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-2", }, }, "eu-central-1": endpoint{ Hostname: "data.iotevents.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-central-1", }, }, "eu-west-1": endpoint{ Hostname: "data.iotevents.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-1", }, }, "eu-west-2": endpoint{ Hostname: "data.iotevents.eu-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-2", }, }, "us-east-1": endpoint{ Hostname: "data.iotevents.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{ Hostname: "data.iotevents.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-2": endpoint{ Hostname: "data.iotevents.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "iotsecuredtunneling": service{ Endpoints: endpoints{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "iotthingsgraph": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "iotthingsgraph", }, }, Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-southeast-2": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "iotwireless": service{ Endpoints: endpoints{ "eu-west-1": endpoint{ Hostname: "api.iotwireless.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-1", }, }, "us-east-1": endpoint{ Hostname: "api.iotwireless.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, }, }, "kafka": service{ Endpoints: endpoints{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "kinesis": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "kinesis-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "kinesis-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "kinesis-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "kinesis-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "kinesisanalytics": service{ Endpoints: endpoints{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "kinesisvideo": service{ Endpoints: endpoints{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "kms": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "lakeformation": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "lakeformation-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "lakeformation-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "lakeformation-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "lakeformation-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "lambda": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "lambda-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "lambda-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "lambda-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "lambda-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "license-manager": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "license-manager-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "license-manager-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "license-manager-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "license-manager-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "lightsail": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "logs": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "logs-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "logs-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "logs-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "logs-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "lookoutequipment": service{ Endpoints: endpoints{ "ap-northeast-2": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, }, }, "lookoutvision": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "machinelearning": service{ Endpoints: endpoints{ "eu-west-1": endpoint{}, "us-east-1": endpoint{}, }, }, "macie": service{ Endpoints: endpoints{ "fips-us-east-1": endpoint{ Hostname: "macie-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-west-2": endpoint{ Hostname: "macie-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "macie2": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "macie2-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "macie2-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "macie2-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "macie2-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "managedblockchain": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-southeast-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, }, }, "marketplacecommerceanalytics": service{ Endpoints: endpoints{ "us-east-1": endpoint{}, }, }, "mediaconnect": service{ Endpoints: endpoints{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "mediaconvert": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ca-central-1": endpoint{ Hostname: "mediaconvert-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-us-east-1": endpoint{ Hostname: "mediaconvert-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "mediaconvert-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "mediaconvert-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "mediaconvert-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "medialive": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "medialive-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "medialive-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-2": endpoint{ Hostname: "medialive-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "mediapackage": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "mediastore": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "metering.marketplace": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "aws-marketplace", }, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "mgh": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "mobileanalytics": service{ Endpoints: endpoints{ "us-east-1": endpoint{}, }, }, "models.lex": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "lex", }, }, Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "models-fips.lex.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "models-fips.lex.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "monitoring": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "monitoring-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "monitoring-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "monitoring-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "monitoring-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "mq": service{ Endpoints: endpoints{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "mq-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "mq-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "mq-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "mq-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "mturk-requester": service{ IsRegionalized: boxedFalse, Endpoints: endpoints{ "sandbox": endpoint{ Hostname: "mturk-requester-sandbox.us-east-1.amazonaws.com", }, "us-east-1": endpoint{}, }, }, "neptune": service{ Endpoints: endpoints{ "ap-east-1": endpoint{ Hostname: "rds.ap-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-east-1", }, }, "ap-northeast-1": endpoint{ Hostname: "rds.ap-northeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-1", }, }, "ap-northeast-2": endpoint{ Hostname: "rds.ap-northeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-2", }, }, "ap-south-1": endpoint{ Hostname: "rds.ap-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-south-1", }, }, "ap-southeast-1": endpoint{ Hostname: "rds.ap-southeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-1", }, }, "ap-southeast-2": endpoint{ Hostname: "rds.ap-southeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-2", }, }, "ca-central-1": endpoint{ Hostname: "rds.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "eu-central-1": endpoint{ Hostname: "rds.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-central-1", }, }, "eu-north-1": endpoint{ Hostname: "rds.eu-north-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-north-1", }, }, "eu-west-1": endpoint{ Hostname: "rds.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-1", }, }, "eu-west-2": endpoint{ Hostname: "rds.eu-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-2", }, }, "eu-west-3": endpoint{ Hostname: "rds.eu-west-3.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-3", }, }, "me-south-1": endpoint{ Hostname: "rds.me-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "me-south-1", }, }, "sa-east-1": endpoint{ Hostname: "rds.sa-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "sa-east-1", }, }, "us-east-1": endpoint{ Hostname: "rds.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{ Hostname: "rds.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{ Hostname: "rds.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{ Hostname: "rds.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "oidc": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{ Hostname: "oidc.ap-northeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-1", }, }, "ap-northeast-2": endpoint{ Hostname: "oidc.ap-northeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-2", }, }, "ap-south-1": endpoint{ Hostname: "oidc.ap-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-south-1", }, }, "ap-southeast-1": endpoint{ Hostname: "oidc.ap-southeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-1", }, }, "ap-southeast-2": endpoint{ Hostname: "oidc.ap-southeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-2", }, }, "ca-central-1": endpoint{ Hostname: "oidc.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "eu-central-1": endpoint{ Hostname: "oidc.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-central-1", }, }, "eu-north-1": endpoint{ Hostname: "oidc.eu-north-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-north-1", }, }, "eu-west-1": endpoint{ Hostname: "oidc.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-1", }, }, "eu-west-2": endpoint{ Hostname: "oidc.eu-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-2", }, }, "us-east-1": endpoint{ Hostname: "oidc.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{ Hostname: "oidc.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-2": endpoint{ Hostname: "oidc.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "opsworks": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "opsworks-cm": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "organizations": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-global": endpoint{ Hostname: "organizations.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-aws-global": endpoint{ Hostname: "organizations-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, }, }, "outposts": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ca-central-1": endpoint{ Hostname: "outposts-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-us-east-1": endpoint{ Hostname: "outposts-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "outposts-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "outposts-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "outposts-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "personalize": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "pinpoint": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "mobiletargeting", }, }, Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "pinpoint-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-west-2": endpoint{ Hostname: "pinpoint-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "us-east-1": endpoint{ Hostname: "pinpoint.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-west-2": endpoint{ Hostname: "pinpoint.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "polly": service{ Endpoints: endpoints{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "polly-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "polly-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "polly-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "polly-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "portal.sso": service{ Endpoints: endpoints{ "ap-southeast-1": endpoint{ Hostname: "portal.sso.ap-southeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-1", }, }, "ap-southeast-2": endpoint{ Hostname: "portal.sso.ap-southeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-2", }, }, "ca-central-1": endpoint{ Hostname: "portal.sso.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "eu-central-1": endpoint{ Hostname: "portal.sso.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-central-1", }, }, "eu-west-1": endpoint{ Hostname: "portal.sso.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-1", }, }, "eu-west-2": endpoint{ Hostname: "portal.sso.eu-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-2", }, }, "us-east-1": endpoint{ Hostname: "portal.sso.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{ Hostname: "portal.sso.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-2": endpoint{ Hostname: "portal.sso.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "profile": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "projects.iot1click": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "qldb": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "qldb-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "qldb-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-2": endpoint{ Hostname: "qldb-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "ram": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ca-central-1": endpoint{ Hostname: "ram-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-us-east-1": endpoint{ Hostname: "ram-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "ram-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "ram-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "ram-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "rds": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "rds-fips.ca-central-1": endpoint{ Hostname: "rds-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "rds-fips.us-east-1": endpoint{ Hostname: "rds-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "rds-fips.us-east-2": endpoint{ Hostname: "rds-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "rds-fips.us-west-1": endpoint{ Hostname: "rds-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "rds-fips.us-west-2": endpoint{ Hostname: "rds-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "sa-east-1": endpoint{}, "us-east-1": endpoint{ SSLCommonName: "{service}.{dnsSuffix}", }, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "redshift": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ca-central-1": endpoint{ Hostname: "redshift-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-us-east-1": endpoint{ Hostname: "redshift-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "redshift-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "redshift-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "redshift-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "rekognition": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "rekognition-fips.ca-central-1": endpoint{ Hostname: "rekognition-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "rekognition-fips.us-east-1": endpoint{ Hostname: "rekognition-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "rekognition-fips.us-east-2": endpoint{ Hostname: "rekognition-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "rekognition-fips.us-west-1": endpoint{ Hostname: "rekognition-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "rekognition-fips.us-west-2": endpoint{ Hostname: "rekognition-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "resource-groups": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "resource-groups-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "resource-groups-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "resource-groups-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "resource-groups-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "robomaker": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "route53": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-global": endpoint{ Hostname: "route53.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-aws-global": endpoint{ Hostname: "route53-fips.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, }, }, "route53domains": service{ Endpoints: endpoints{ "us-east-1": endpoint{}, }, }, "route53resolver": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "runtime.lex": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "lex", }, }, Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "runtime-fips.lex.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "runtime-fips.lex.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "runtime.sagemaker": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "runtime-fips.sagemaker.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{}, "us-east-2-fips": endpoint{ Hostname: "runtime-fips.sagemaker.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{}, "us-west-1-fips": endpoint{ Hostname: "runtime-fips.sagemaker.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "runtime-fips.sagemaker.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "s3": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedTrue, Defaults: endpoint{ Protocols: []string{"http", "https"}, SignatureVersions: []string{"s3v4"}, HasDualStack: boxedTrue, DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", }, Endpoints: endpoints{ "accesspoint-af-south-1": endpoint{ Hostname: "s3-accesspoint.af-south-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-ap-east-1": endpoint{ Hostname: "s3-accesspoint.ap-east-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-ap-northeast-1": endpoint{ Hostname: "s3-accesspoint.ap-northeast-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-ap-northeast-2": endpoint{ Hostname: "s3-accesspoint.ap-northeast-2.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-ap-northeast-3": endpoint{ Hostname: "s3-accesspoint.ap-northeast-3.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-ap-south-1": endpoint{ Hostname: "s3-accesspoint.ap-south-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-ap-southeast-1": endpoint{ Hostname: "s3-accesspoint.ap-southeast-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-ap-southeast-2": endpoint{ Hostname: "s3-accesspoint.ap-southeast-2.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-ca-central-1": endpoint{ Hostname: "s3-accesspoint.ca-central-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-eu-central-1": endpoint{ Hostname: "s3-accesspoint.eu-central-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-eu-north-1": endpoint{ Hostname: "s3-accesspoint.eu-north-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-eu-south-1": endpoint{ Hostname: "s3-accesspoint.eu-south-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-eu-west-1": endpoint{ Hostname: "s3-accesspoint.eu-west-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-eu-west-2": endpoint{ Hostname: "s3-accesspoint.eu-west-2.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-eu-west-3": endpoint{ Hostname: "s3-accesspoint.eu-west-3.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-me-south-1": endpoint{ Hostname: "s3-accesspoint.me-south-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-sa-east-1": endpoint{ Hostname: "s3-accesspoint.sa-east-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-us-east-1": endpoint{ Hostname: "s3-accesspoint.us-east-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-us-east-2": endpoint{ Hostname: "s3-accesspoint.us-east-2.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-us-west-1": endpoint{ Hostname: "s3-accesspoint.us-west-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-us-west-2": endpoint{ Hostname: "s3-accesspoint.us-west-2.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{ Hostname: "s3.ap-northeast-1.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, }, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{ Hostname: "s3.ap-southeast-1.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, }, "ap-southeast-2": endpoint{ Hostname: "s3.ap-southeast-2.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, }, "aws-global": endpoint{ Hostname: "s3.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, CredentialScope: credentialScope{ Region: "us-east-1", }, }, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{ Hostname: "s3.eu-west-1.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, }, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-accesspoint-ca-central-1": endpoint{ Hostname: "s3-accesspoint-fips.ca-central-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "fips-accesspoint-us-east-1": endpoint{ Hostname: "s3-accesspoint-fips.us-east-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "fips-accesspoint-us-east-2": endpoint{ Hostname: "s3-accesspoint-fips.us-east-2.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "fips-accesspoint-us-west-1": endpoint{ Hostname: "s3-accesspoint-fips.us-west-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "fips-accesspoint-us-west-2": endpoint{ Hostname: "s3-accesspoint-fips.us-west-2.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "me-south-1": endpoint{}, "s3-external-1": endpoint{ Hostname: "s3-external-1.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, CredentialScope: credentialScope{ Region: "us-east-1", }, }, "sa-east-1": endpoint{ Hostname: "s3.sa-east-1.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, }, "us-east-1": endpoint{ Hostname: "s3.us-east-1.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, }, "us-east-2": endpoint{}, "us-west-1": endpoint{ Hostname: "s3.us-west-1.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, }, "us-west-2": endpoint{ Hostname: "s3.us-west-2.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, }, }, }, "s3-control": service{ Defaults: endpoint{ Protocols: []string{"https"}, SignatureVersions: []string{"s3v4"}, HasDualStack: boxedTrue, DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", }, Endpoints: endpoints{ "ap-northeast-1": endpoint{ Hostname: "s3-control.ap-northeast-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "ap-northeast-1", }, }, "ap-northeast-2": endpoint{ Hostname: "s3-control.ap-northeast-2.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "ap-northeast-2", }, }, "ap-northeast-3": endpoint{ Hostname: "s3-control.ap-northeast-3.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "ap-northeast-3", }, }, "ap-south-1": endpoint{ Hostname: "s3-control.ap-south-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "ap-south-1", }, }, "ap-southeast-1": endpoint{ Hostname: "s3-control.ap-southeast-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "ap-southeast-1", }, }, "ap-southeast-2": endpoint{ Hostname: "s3-control.ap-southeast-2.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "ap-southeast-2", }, }, "ca-central-1": endpoint{ Hostname: "s3-control.ca-central-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "ca-central-1-fips": endpoint{ Hostname: "s3-control-fips.ca-central-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "eu-central-1": endpoint{ Hostname: "s3-control.eu-central-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "eu-central-1", }, }, "eu-north-1": endpoint{ Hostname: "s3-control.eu-north-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "eu-north-1", }, }, "eu-west-1": endpoint{ Hostname: "s3-control.eu-west-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "eu-west-1", }, }, "eu-west-2": endpoint{ Hostname: "s3-control.eu-west-2.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "eu-west-2", }, }, "eu-west-3": endpoint{ Hostname: "s3-control.eu-west-3.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "eu-west-3", }, }, "sa-east-1": endpoint{ Hostname: "s3-control.sa-east-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "sa-east-1", }, }, "us-east-1": endpoint{ Hostname: "s3-control.us-east-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-1-fips": endpoint{ Hostname: "s3-control-fips.us-east-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{ Hostname: "s3-control.us-east-2.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-east-2-fips": endpoint{ Hostname: "s3-control-fips.us-east-2.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{ Hostname: "s3-control.us-west-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-1-fips": endpoint{ Hostname: "s3-control-fips.us-west-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{ Hostname: "s3-control.us-west-2.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "us-west-2", }, }, "us-west-2-fips": endpoint{ Hostname: "s3-control-fips.us-west-2.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "savingsplans": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-global": endpoint{ Hostname: "savingsplans.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, }, }, "schemas": service{ Endpoints: endpoints{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "sdb": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, SignatureVersions: []string{"v2"}, }, Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-west-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{ Hostname: "sdb.amazonaws.com", }, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "secretsmanager": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "secretsmanager-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{}, "us-east-2-fips": endpoint{ Hostname: "secretsmanager-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{}, "us-west-1-fips": endpoint{ Hostname: "secretsmanager-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "secretsmanager-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "securityhub": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "securityhub-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "securityhub-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "securityhub-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "securityhub-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "serverlessrepo": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "ap-east-1": endpoint{ Protocols: []string{"https"}, }, "ap-northeast-1": endpoint{ Protocols: []string{"https"}, }, "ap-northeast-2": endpoint{ Protocols: []string{"https"}, }, "ap-south-1": endpoint{ Protocols: []string{"https"}, }, "ap-southeast-1": endpoint{ Protocols: []string{"https"}, }, "ap-southeast-2": endpoint{ Protocols: []string{"https"}, }, "ca-central-1": endpoint{ Protocols: []string{"https"}, }, "eu-central-1": endpoint{ Protocols: []string{"https"}, }, "eu-north-1": endpoint{ Protocols: []string{"https"}, }, "eu-west-1": endpoint{ Protocols: []string{"https"}, }, "eu-west-2": endpoint{ Protocols: []string{"https"}, }, "eu-west-3": endpoint{ Protocols: []string{"https"}, }, "me-south-1": endpoint{ Protocols: []string{"https"}, }, "sa-east-1": endpoint{ Protocols: []string{"https"}, }, "us-east-1": endpoint{ Protocols: []string{"https"}, }, "us-east-2": endpoint{ Protocols: []string{"https"}, }, "us-west-1": endpoint{ Protocols: []string{"https"}, }, "us-west-2": endpoint{ Protocols: []string{"https"}, }, }, }, "servicecatalog": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "servicecatalog-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{}, "us-east-2-fips": endpoint{ Hostname: "servicecatalog-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{}, "us-west-1-fips": endpoint{ Hostname: "servicecatalog-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "servicecatalog-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "servicecatalog-appregistry": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ca-central-1": endpoint{ Hostname: "servicecatalog-appregistry-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-us-east-1": endpoint{ Hostname: "servicecatalog-appregistry-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "servicecatalog-appregistry-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "servicecatalog-appregistry-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "servicecatalog-appregistry-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "servicediscovery": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "servicediscovery-fips": endpoint{ Hostname: "servicediscovery-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "servicequotas": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "session.qldb": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "session.qldb-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "session.qldb-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-2": endpoint{ Hostname: "session.qldb-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "shield": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Defaults: endpoint{ SSLCommonName: "shield.us-east-1.amazonaws.com", Protocols: []string{"https"}, }, Endpoints: endpoints{ "aws-global": endpoint{ Hostname: "shield.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-aws-global": endpoint{ Hostname: "shield-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, }, }, "sms": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "sms-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "sms-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "sms-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "sms-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "snowball": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ap-northeast-1": endpoint{ Hostname: "snowball-fips.ap-northeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-1", }, }, "fips-ap-northeast-2": endpoint{ Hostname: "snowball-fips.ap-northeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-2", }, }, "fips-ap-northeast-3": endpoint{ Hostname: "snowball-fips.ap-northeast-3.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-3", }, }, "fips-ap-south-1": endpoint{ Hostname: "snowball-fips.ap-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-south-1", }, }, "fips-ap-southeast-1": endpoint{ Hostname: "snowball-fips.ap-southeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-1", }, }, "fips-ap-southeast-2": endpoint{ Hostname: "snowball-fips.ap-southeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-2", }, }, "fips-ca-central-1": endpoint{ Hostname: "snowball-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-eu-central-1": endpoint{ Hostname: "snowball-fips.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-central-1", }, }, "fips-eu-west-1": endpoint{ Hostname: "snowball-fips.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-1", }, }, "fips-eu-west-2": endpoint{ Hostname: "snowball-fips.eu-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-2", }, }, "fips-eu-west-3": endpoint{ Hostname: "snowball-fips.eu-west-3.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-3", }, }, "fips-sa-east-1": endpoint{ Hostname: "snowball-fips.sa-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "sa-east-1", }, }, "fips-us-east-1": endpoint{ Hostname: "snowball-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "snowball-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "snowball-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "snowball-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "sns": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "sns-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "sns-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "sns-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "sns-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "sqs": service{ Defaults: endpoint{ SSLCommonName: "{region}.queue.{dnsSuffix}", Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "sqs-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "sqs-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "sqs-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "sqs-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{ SSLCommonName: "queue.{dnsSuffix}", }, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "ssm": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ca-central-1": endpoint{ Hostname: "ssm-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-us-east-1": endpoint{ Hostname: "ssm-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "ssm-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "ssm-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "ssm-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "states": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "states-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "states-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "states-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "states-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "storagegateway": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips": endpoint{ Hostname: "storagegateway-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "streams.dynamodb": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, CredentialScope: credentialScope{ Service: "dynamodb", }, }, Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "ca-central-1-fips": endpoint{ Hostname: "dynamodb-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "local": endpoint{ Hostname: "localhost:8000", Protocols: []string{"http"}, CredentialScope: credentialScope{ Region: "us-east-1", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "dynamodb-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{}, "us-east-2-fips": endpoint{ Hostname: "dynamodb-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{}, "us-west-1-fips": endpoint{ Hostname: "dynamodb-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "dynamodb-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "sts": service{ PartitionEndpoint: "aws-global", Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "aws-global": endpoint{ Hostname: "sts.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "sts-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{}, "us-east-2-fips": endpoint{ Hostname: "sts-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{}, "us-west-1-fips": endpoint{ Hostname: "sts-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "sts-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "support": service{ PartitionEndpoint: "aws-global", Endpoints: endpoints{ "aws-global": endpoint{ Hostname: "support.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, }, }, "swf": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "swf-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "swf-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "swf-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "swf-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "tagging": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "transcribe": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "fips.transcribe.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "fips.transcribe.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "fips.transcribe.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "fips.transcribe.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "transcribestreaming": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, "transfer": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-ca-central-1": endpoint{ Hostname: "transfer-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-us-east-1": endpoint{ Hostname: "transfer-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "transfer-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "transfer-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "transfer-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "translate": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "translate-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{}, "us-east-2-fips": endpoint{ Hostname: "translate-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{}, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "translate-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "waf": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-fips": endpoint{ Hostname: "waf-fips.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "aws-global": endpoint{ Hostname: "waf.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, }, }, "waf-regional": service{ Endpoints: endpoints{ "af-south-1": endpoint{ Hostname: "waf-regional.af-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "af-south-1", }, }, "ap-east-1": endpoint{ Hostname: "waf-regional.ap-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-east-1", }, }, "ap-northeast-1": endpoint{ Hostname: "waf-regional.ap-northeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-1", }, }, "ap-northeast-2": endpoint{ Hostname: "waf-regional.ap-northeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-2", }, }, "ap-south-1": endpoint{ Hostname: "waf-regional.ap-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-south-1", }, }, "ap-southeast-1": endpoint{ Hostname: "waf-regional.ap-southeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-1", }, }, "ap-southeast-2": endpoint{ Hostname: "waf-regional.ap-southeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-2", }, }, "ca-central-1": endpoint{ Hostname: "waf-regional.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "eu-central-1": endpoint{ Hostname: "waf-regional.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-central-1", }, }, "eu-north-1": endpoint{ Hostname: "waf-regional.eu-north-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-north-1", }, }, "eu-south-1": endpoint{ Hostname: "waf-regional.eu-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-south-1", }, }, "eu-west-1": endpoint{ Hostname: "waf-regional.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-1", }, }, "eu-west-2": endpoint{ Hostname: "waf-regional.eu-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-2", }, }, "eu-west-3": endpoint{ Hostname: "waf-regional.eu-west-3.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-3", }, }, "fips-af-south-1": endpoint{ Hostname: "waf-regional-fips.af-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "af-south-1", }, }, "fips-ap-east-1": endpoint{ Hostname: "waf-regional-fips.ap-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-east-1", }, }, "fips-ap-northeast-1": endpoint{ Hostname: "waf-regional-fips.ap-northeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-1", }, }, "fips-ap-northeast-2": endpoint{ Hostname: "waf-regional-fips.ap-northeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-northeast-2", }, }, "fips-ap-south-1": endpoint{ Hostname: "waf-regional-fips.ap-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-south-1", }, }, "fips-ap-southeast-1": endpoint{ Hostname: "waf-regional-fips.ap-southeast-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-1", }, }, "fips-ap-southeast-2": endpoint{ Hostname: "waf-regional-fips.ap-southeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-2", }, }, "fips-ca-central-1": endpoint{ Hostname: "waf-regional-fips.ca-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "ca-central-1", }, }, "fips-eu-central-1": endpoint{ Hostname: "waf-regional-fips.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-central-1", }, }, "fips-eu-north-1": endpoint{ Hostname: "waf-regional-fips.eu-north-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-north-1", }, }, "fips-eu-south-1": endpoint{ Hostname: "waf-regional-fips.eu-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-south-1", }, }, "fips-eu-west-1": endpoint{ Hostname: "waf-regional-fips.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-1", }, }, "fips-eu-west-2": endpoint{ Hostname: "waf-regional-fips.eu-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-2", }, }, "fips-eu-west-3": endpoint{ Hostname: "waf-regional-fips.eu-west-3.amazonaws.com", CredentialScope: credentialScope{ Region: "eu-west-3", }, }, "fips-me-south-1": endpoint{ Hostname: "waf-regional-fips.me-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "me-south-1", }, }, "fips-sa-east-1": endpoint{ Hostname: "waf-regional-fips.sa-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "sa-east-1", }, }, "fips-us-east-1": endpoint{ Hostname: "waf-regional-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "waf-regional-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "waf-regional-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "waf-regional-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{ Hostname: "waf-regional.me-south-1.amazonaws.com", CredentialScope: credentialScope{ Region: "me-south-1", }, }, "sa-east-1": endpoint{ Hostname: "waf-regional.sa-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "sa-east-1", }, }, "us-east-1": endpoint{ Hostname: "waf-regional.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "us-east-2": endpoint{ Hostname: "waf-regional.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "us-west-1": endpoint{ Hostname: "waf-regional.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "us-west-2": endpoint{ Hostname: "waf-regional.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, }, }, "workdocs": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-west-1": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "workdocs-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-west-2": endpoint{ Hostname: "workdocs-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "workmail": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "workspaces": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "workspaces-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-west-2": endpoint{ Hostname: "workspaces-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, "xray": service{ Endpoints: endpoints{ "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "xray-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, "fips-us-east-2": endpoint{ Hostname: "xray-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-2", }, }, "fips-us-west-1": endpoint{ Hostname: "xray-fips.us-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-1", }, }, "fips-us-west-2": endpoint{ Hostname: "xray-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, }, } // AwsCnPartition returns the Resolver for AWS China. func AwsCnPartition() Partition { return awscnPartition.Partition() } var awscnPartition = partition{ ID: "aws-cn", Name: "AWS China", DNSSuffix: "amazonaws.com.cn", RegionRegex: regionRegex{ Regexp: func() *regexp.Regexp { reg, _ := regexp.Compile("^cn\\-\\w+\\-\\d+$") return reg }(), }, Defaults: endpoint{ Hostname: "{service}.{region}.{dnsSuffix}", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, Regions: regions{ "cn-north-1": region{ Description: "China (Beijing)", }, "cn-northwest-1": region{ Description: "China (Ningxia)", }, }, Services: services{ "access-analyzer": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "acm": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "api.ecr": service{ Endpoints: endpoints{ "cn-north-1": endpoint{ Hostname: "api.ecr.cn-north-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-north-1", }, }, "cn-northwest-1": endpoint{ Hostname: "api.ecr.cn-northwest-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-northwest-1", }, }, }, }, "api.sagemaker": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "apigateway": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "application-autoscaling": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "appsync": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "athena": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "autoscaling": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "autoscaling-plans": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "backup": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "batch": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "budgets": service{ PartitionEndpoint: "aws-cn-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-cn-global": endpoint{ Hostname: "budgets.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-northwest-1", }, }, }, }, "ce": service{ PartitionEndpoint: "aws-cn-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-cn-global": endpoint{ Hostname: "ce.cn-northwest-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-northwest-1", }, }, }, }, "cloudformation": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "cloudfront": service{ PartitionEndpoint: "aws-cn-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-cn-global": endpoint{ Hostname: "cloudfront.cn-northwest-1.amazonaws.com.cn", Protocols: []string{"http", "https"}, CredentialScope: credentialScope{ Region: "cn-northwest-1", }, }, }, }, "cloudtrail": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "codebuild": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "codecommit": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "codedeploy": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "cognito-identity": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, }, }, "config": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "cur": service{ Endpoints: endpoints{ "cn-northwest-1": endpoint{}, }, }, "dax": service{ Endpoints: endpoints{ "cn-northwest-1": endpoint{}, }, }, "directconnect": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "dms": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "docdb": service{ Endpoints: endpoints{ "cn-northwest-1": endpoint{ Hostname: "rds.cn-northwest-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-northwest-1", }, }, }, }, "ds": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "dynamodb": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "ebs": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "ec2": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "ec2metadata": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-global": endpoint{ Hostname: "169.254.169.254/latest", Protocols: []string{"http"}, }, }, }, "ecs": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "eks": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "elasticache": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "elasticbeanstalk": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "elasticfilesystem": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, "fips-cn-north-1": endpoint{ Hostname: "elasticfilesystem-fips.cn-north-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-north-1", }, }, "fips-cn-northwest-1": endpoint{ Hostname: "elasticfilesystem-fips.cn-northwest-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-northwest-1", }, }, }, }, "elasticloadbalancing": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "elasticmapreduce": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "es": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "events": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "firehose": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "fsx": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "gamelift": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, }, }, "glacier": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "glue": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "greengrass": service{ IsRegionalized: boxedTrue, Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, }, }, "guardduty": service{ IsRegionalized: boxedTrue, Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "health": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "iam": service{ PartitionEndpoint: "aws-cn-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-cn-global": endpoint{ Hostname: "iam.cn-north-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-north-1", }, }, }, }, "iot": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "execute-api", }, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "iotanalytics": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, }, }, "iotevents": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, }, }, "ioteventsdata": service{ Endpoints: endpoints{ "cn-north-1": endpoint{ Hostname: "data.iotevents.cn-north-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-north-1", }, }, }, }, "iotsecuredtunneling": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "kafka": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "kinesis": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "kinesisanalytics": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "kms": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "lakeformation": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "lambda": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "license-manager": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "logs": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "mediaconvert": service{ Endpoints: endpoints{ "cn-northwest-1": endpoint{ Hostname: "subscribe.mediaconvert.cn-northwest-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-northwest-1", }, }, }, }, "monitoring": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "mq": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "neptune": service{ Endpoints: endpoints{ "cn-northwest-1": endpoint{ Hostname: "rds.cn-northwest-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-northwest-1", }, }, }, }, "organizations": service{ PartitionEndpoint: "aws-cn-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-cn-global": endpoint{ Hostname: "organizations.cn-northwest-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-northwest-1", }, }, }, }, "personalize": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, }, }, "polly": service{ Endpoints: endpoints{ "cn-northwest-1": endpoint{}, }, }, "ram": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "rds": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "redshift": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "resource-groups": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "route53": service{ PartitionEndpoint: "aws-cn-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-cn-global": endpoint{ Hostname: "route53.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-northwest-1", }, }, }, }, "route53resolver": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "runtime.sagemaker": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "s3": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, SignatureVersions: []string{"s3v4"}, HasDualStack: boxedTrue, DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", }, Endpoints: endpoints{ "accesspoint-cn-north-1": endpoint{ Hostname: "s3-accesspoint.cn-north-1.amazonaws.com.cn", SignatureVersions: []string{"s3v4"}, }, "accesspoint-cn-northwest-1": endpoint{ Hostname: "s3-accesspoint.cn-northwest-1.amazonaws.com.cn", SignatureVersions: []string{"s3v4"}, }, "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "s3-control": service{ Defaults: endpoint{ Protocols: []string{"https"}, SignatureVersions: []string{"s3v4"}, HasDualStack: boxedTrue, DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", }, Endpoints: endpoints{ "cn-north-1": endpoint{ Hostname: "s3-control.cn-north-1.amazonaws.com.cn", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "cn-north-1", }, }, "cn-northwest-1": endpoint{ Hostname: "s3-control.cn-northwest-1.amazonaws.com.cn", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "cn-northwest-1", }, }, }, }, "secretsmanager": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "securityhub": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "serverlessrepo": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{ Protocols: []string{"https"}, }, "cn-northwest-1": endpoint{ Protocols: []string{"https"}, }, }, }, "servicecatalog": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "servicediscovery": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "sms": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "snowball": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, "fips-cn-north-1": endpoint{ Hostname: "snowball-fips.cn-north-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-north-1", }, }, "fips-cn-northwest-1": endpoint{ Hostname: "snowball-fips.cn-northwest-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-northwest-1", }, }, }, }, "sns": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "sqs": service{ Defaults: endpoint{ SSLCommonName: "{region}.queue.{dnsSuffix}", Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "ssm": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "states": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "storagegateway": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "streams.dynamodb": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, CredentialScope: credentialScope{ Service: "dynamodb", }, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "sts": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "support": service{ PartitionEndpoint: "aws-cn-global", Endpoints: endpoints{ "aws-cn-global": endpoint{ Hostname: "support.cn-north-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-north-1", }, }, }, }, "swf": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "tagging": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, "transcribe": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "cn-north-1": endpoint{ Hostname: "cn.transcribe.cn-north-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-north-1", }, }, "cn-northwest-1": endpoint{ Hostname: "cn.transcribe.cn-northwest-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-northwest-1", }, }, }, }, "workspaces": service{ Endpoints: endpoints{ "cn-northwest-1": endpoint{}, }, }, "xray": service{ Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, }, } // AwsUsGovPartition returns the Resolver for AWS GovCloud (US). func AwsUsGovPartition() Partition { return awsusgovPartition.Partition() } var awsusgovPartition = partition{ ID: "aws-us-gov", Name: "AWS GovCloud (US)", DNSSuffix: "amazonaws.com", RegionRegex: regionRegex{ Regexp: func() *regexp.Regexp { reg, _ := regexp.Compile("^us\\-gov\\-\\w+\\-\\d+$") return reg }(), }, Defaults: endpoint{ Hostname: "{service}.{region}.{dnsSuffix}", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, Regions: regions{ "us-gov-east-1": region{ Description: "AWS GovCloud (US-East)", }, "us-gov-west-1": region{ Description: "AWS GovCloud (US-West)", }, }, Services: services{ "access-analyzer": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "access-analyzer.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "access-analyzer.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "acm": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "acm.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "acm.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "acm-pca": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "acm-pca.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "acm-pca.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "api.detective": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-east-1-fips": endpoint{ Hostname: "api.detective-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "api.detective-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "api.ecr": service{ Endpoints: endpoints{ "fips-dkr-us-gov-east-1": endpoint{ Hostname: "ecr-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-dkr-us-gov-west-1": endpoint{ Hostname: "ecr-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "fips-us-gov-east-1": endpoint{ Hostname: "ecr-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "ecr-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{ Hostname: "api.ecr.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "api.ecr.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "api.sagemaker": service{ Endpoints: endpoints{ "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "api-fips.sagemaker.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-west-1-fips-secondary": endpoint{ Hostname: "api.sagemaker.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "apigateway": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "application-autoscaling": service{ Defaults: endpoint{ Hostname: "autoscaling.{region}.amazonaws.com", Protocols: []string{"http", "https"}, CredentialScope: credentialScope{ Service: "application-autoscaling", }, }, Endpoints: endpoints{ "us-gov-east-1": endpoint{ Protocols: []string{"http", "https"}, }, "us-gov-west-1": endpoint{ Protocols: []string{"http", "https"}, }, }, }, "appstream2": service{ Defaults: endpoint{ Protocols: []string{"https"}, CredentialScope: credentialScope{ Service: "appstream", }, }, Endpoints: endpoints{ "fips": endpoint{ Hostname: "appstream2-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-west-1": endpoint{}, }, }, "athena": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "athena-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "athena-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "autoscaling": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Protocols: []string{"http", "https"}, }, "us-gov-west-1": endpoint{ Protocols: []string{"http", "https"}, }, }, }, "autoscaling-plans": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "us-gov-east-1": endpoint{ Protocols: []string{"http", "https"}, }, "us-gov-west-1": endpoint{ Protocols: []string{"http", "https"}, }, }, }, "backup": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "batch": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "batch.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "batch.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "clouddirectory": service{ Endpoints: endpoints{ "us-gov-west-1": endpoint{}, }, }, "cloudformation": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "cloudformation.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "cloudformation.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "cloudhsm": service{ Endpoints: endpoints{ "us-gov-west-1": endpoint{}, }, }, "cloudhsmv2": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "cloudhsm", }, }, Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "cloudtrail": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "cloudtrail.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "cloudtrail.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "codebuild": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-east-1-fips": endpoint{ Hostname: "codebuild-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "codebuild-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "codecommit": service{ Endpoints: endpoints{ "fips": endpoint{ Hostname: "codecommit-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "codedeploy": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-east-1-fips": endpoint{ Hostname: "codedeploy-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "codedeploy-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "codepipeline": service{ Endpoints: endpoints{ "fips-us-gov-west-1": endpoint{ Hostname: "codepipeline-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-west-1": endpoint{}, }, }, "cognito-identity": service{ Endpoints: endpoints{ "fips-us-gov-west-1": endpoint{ Hostname: "cognito-identity-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-west-1": endpoint{}, }, }, "cognito-idp": service{ Endpoints: endpoints{ "fips-us-gov-west-1": endpoint{ Hostname: "cognito-idp-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-west-1": endpoint{}, }, }, "comprehend": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "fips-us-gov-west-1": endpoint{ Hostname: "comprehend-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-west-1": endpoint{}, }, }, "comprehendmedical": service{ Endpoints: endpoints{ "fips-us-gov-west-1": endpoint{ Hostname: "comprehendmedical-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-west-1": endpoint{}, }, }, "config": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "config.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "config.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "connect": service{ Endpoints: endpoints{ "us-gov-west-1": endpoint{}, }, }, "datasync": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "datasync-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "datasync-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "directconnect": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "directconnect.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "directconnect.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "dms": service{ Endpoints: endpoints{ "dms-fips": endpoint{ Hostname: "dms.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "docdb": service{ Endpoints: endpoints{ "us-gov-west-1": endpoint{ Hostname: "rds.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "ds": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "ds-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "ds-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "dynamodb": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-east-1-fips": endpoint{ Hostname: "dynamodb.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "dynamodb.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "ebs": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "ec2": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "ec2.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "ec2.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "ec2metadata": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-global": endpoint{ Hostname: "169.254.169.254/latest", Protocols: []string{"http"}, }, }, }, "ecs": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "ecs-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "ecs-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "eks": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "eks.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "eks.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "elasticache": service{ Endpoints: endpoints{ "fips": endpoint{ Hostname: "elasticache.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "elasticbeanstalk": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "elasticbeanstalk.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "elasticbeanstalk.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "elasticfilesystem": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "elasticfilesystem-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "elasticfilesystem-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "elasticloadbalancing": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "elasticloadbalancing.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "elasticloadbalancing.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{ Protocols: []string{"http", "https"}, }, }, }, "elasticmapreduce": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "elasticmapreduce.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "elasticmapreduce.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{ Protocols: []string{"https"}, }, }, }, "email": service{ Endpoints: endpoints{ "fips-us-gov-west-1": endpoint{ Hostname: "email-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-west-1": endpoint{}, }, }, "es": service{ Endpoints: endpoints{ "fips": endpoint{ Hostname: "es-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "events": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "events.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "events.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "firehose": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "firehose-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "firehose-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "fms": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "fms-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "fms-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "fsx": service{ Endpoints: endpoints{ "fips-prod-us-gov-east-1": endpoint{ Hostname: "fsx-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-prod-us-gov-west-1": endpoint{ Hostname: "fsx-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "glacier": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "glacier.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "glacier.us-gov-west-1.amazonaws.com", Protocols: []string{"http", "https"}, CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "glue": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "glue-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "glue-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "greengrass": service{ IsRegionalized: boxedTrue, Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "dataplane-us-gov-east-1": endpoint{ Hostname: "greengrass-ats.iot.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "dataplane-us-gov-west-1": endpoint{ Hostname: "greengrass-ats.iot.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "fips-us-gov-east-1": endpoint{ Hostname: "greengrass-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-east-1": endpoint{ Hostname: "greengrass.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "greengrass.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "guardduty": service{ IsRegionalized: boxedTrue, Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-east-1-fips": endpoint{ Hostname: "guardduty.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "guardduty.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "health": service{ Endpoints: endpoints{ "fips-us-gov-west-1": endpoint{ Hostname: "health-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "iam": service{ PartitionEndpoint: "aws-us-gov-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-us-gov-global": endpoint{ Hostname: "iam.us-gov.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "iam-govcloud-fips": endpoint{ Hostname: "iam.us-gov.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "inspector": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "inspector-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "inspector-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "iot": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "execute-api", }, }, Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "iotsecuredtunneling": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "kafka": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "kinesis": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "kinesis.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "kinesis.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "kinesisanalytics": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "kms": service{ Endpoints: endpoints{ "ProdFips": endpoint{ Hostname: "kms-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "lakeformation": service{ Endpoints: endpoints{ "fips-us-gov-west-1": endpoint{ Hostname: "lakeformation-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-west-1": endpoint{}, }, }, "lambda": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "lambda-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "lambda-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "license-manager": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "license-manager-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "license-manager-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "logs": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "logs.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "logs.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "mediaconvert": service{ Endpoints: endpoints{ "us-gov-west-1": endpoint{ Hostname: "mediaconvert.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "metering.marketplace": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "aws-marketplace", }, }, Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "models.lex": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "lex", }, }, Endpoints: endpoints{ "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "models-fips.lex.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "monitoring": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "monitoring.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "monitoring.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "neptune": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "rds.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "rds.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "organizations": service{ PartitionEndpoint: "aws-us-gov-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-us-gov-global": endpoint{ Hostname: "organizations.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "fips-aws-us-gov-global": endpoint{ Hostname: "organizations.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "outposts": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "outposts.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "outposts.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "pinpoint": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "mobiletargeting", }, }, Endpoints: endpoints{ "fips-us-gov-west-1": endpoint{ Hostname: "pinpoint-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-west-1": endpoint{ Hostname: "pinpoint.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "polly": service{ Endpoints: endpoints{ "fips-us-gov-west-1": endpoint{ Hostname: "polly-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-west-1": endpoint{}, }, }, "ram": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "ram.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "ram.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "rds": service{ Endpoints: endpoints{ "rds.us-gov-east-1": endpoint{ Hostname: "rds.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "rds.us-gov-west-1": endpoint{ Hostname: "rds.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "redshift": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "redshift.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "redshift.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "rekognition": service{ Endpoints: endpoints{ "rekognition-fips.us-gov-west-1": endpoint{ Hostname: "rekognition-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-west-1": endpoint{}, }, }, "resource-groups": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "resource-groups.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "resource-groups.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "route53": service{ PartitionEndpoint: "aws-us-gov-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-us-gov-global": endpoint{ Hostname: "route53.us-gov.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "fips-aws-us-gov-global": endpoint{ Hostname: "route53.us-gov.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "route53resolver": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "runtime.lex": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "lex", }, }, Endpoints: endpoints{ "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "runtime-fips.lex.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "runtime.sagemaker": service{ Endpoints: endpoints{ "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "runtime.sagemaker.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "s3": service{ Defaults: endpoint{ SignatureVersions: []string{"s3", "s3v4"}, HasDualStack: boxedTrue, DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", }, Endpoints: endpoints{ "accesspoint-us-gov-east-1": endpoint{ Hostname: "s3-accesspoint.us-gov-east-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "accesspoint-us-gov-west-1": endpoint{ Hostname: "s3-accesspoint.us-gov-west-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "fips-accesspoint-us-gov-east-1": endpoint{ Hostname: "s3-accesspoint-fips.us-gov-east-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "fips-accesspoint-us-gov-west-1": endpoint{ Hostname: "s3-accesspoint-fips.us-gov-west-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, }, "fips-us-gov-west-1": endpoint{ Hostname: "s3-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{ Hostname: "s3.us-gov-east-1.amazonaws.com", Protocols: []string{"http", "https"}, }, "us-gov-west-1": endpoint{ Hostname: "s3.us-gov-west-1.amazonaws.com", Protocols: []string{"http", "https"}, }, }, }, "s3-control": service{ Defaults: endpoint{ Protocols: []string{"https"}, SignatureVersions: []string{"s3v4"}, HasDualStack: boxedTrue, DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", }, Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "s3-control.us-gov-east-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-east-1-fips": endpoint{ Hostname: "s3-control-fips.us-gov-east-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "s3-control.us-gov-west-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-west-1-fips": endpoint{ Hostname: "s3-control-fips.us-gov-west-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "secretsmanager": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-east-1-fips": endpoint{ Hostname: "secretsmanager-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "secretsmanager-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "securityhub": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "securityhub-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "securityhub-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "serverlessrepo": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "serverlessrepo.us-gov-east-1.amazonaws.com", Protocols: []string{"https"}, CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "serverlessrepo.us-gov-west-1.amazonaws.com", Protocols: []string{"https"}, CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "servicecatalog": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-east-1-fips": endpoint{ Hostname: "servicecatalog-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "servicecatalog-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "servicecatalog-appregistry": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "servicecatalog-appregistry.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "servicecatalog-appregistry.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "servicequotas": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "servicequotas.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "servicequotas.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "sms": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "sms-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "sms-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "snowball": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "snowball-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "snowball-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "sns": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "sns.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "sns.us-gov-west-1.amazonaws.com", Protocols: []string{"http", "https"}, CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "sqs": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "sqs.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "sqs.us-gov-west-1.amazonaws.com", SSLCommonName: "{region}.queue.{dnsSuffix}", Protocols: []string{"http", "https"}, CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "ssm": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "ssm.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "ssm.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "states": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "states-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "states.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "storagegateway": service{ Endpoints: endpoints{ "fips": endpoint{ Hostname: "storagegateway-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "streams.dynamodb": service{ Defaults: endpoint{ CredentialScope: credentialScope{ Service: "dynamodb", }, }, Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-east-1-fips": endpoint{ Hostname: "dynamodb.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "dynamodb.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "sts": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-east-1-fips": endpoint{ Hostname: "sts.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "sts.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "support": service{ PartitionEndpoint: "aws-us-gov-global", Endpoints: endpoints{ "aws-us-gov-global": endpoint{ Hostname: "support.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "support.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "swf": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{ Hostname: "swf.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "swf.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "tagging": service{ Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "transcribe": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "fips.transcribe.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "fips.transcribe.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "transfer": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "transfer-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "transfer-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "translate": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "translate-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "waf-regional": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "waf-regional-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "waf-regional-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{ Hostname: "waf-regional.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "us-gov-west-1": endpoint{ Hostname: "waf-regional.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, }, }, "workspaces": service{ Endpoints: endpoints{ "fips-us-gov-west-1": endpoint{ Hostname: "workspaces-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-west-1": endpoint{}, }, }, "xray": service{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ Hostname: "xray-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ Hostname: "xray-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, }, } // AwsIsoPartition returns the Resolver for AWS ISO (US). func AwsIsoPartition() Partition { return awsisoPartition.Partition() } var awsisoPartition = partition{ ID: "aws-iso", Name: "AWS ISO (US)", DNSSuffix: "c2s.ic.gov", RegionRegex: regionRegex{ Regexp: func() *regexp.Regexp { reg, _ := regexp.Compile("^us\\-iso\\-\\w+\\-\\d+$") return reg }(), }, Defaults: endpoint{ Hostname: "{service}.{region}.{dnsSuffix}", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, Regions: regions{ "us-iso-east-1": region{ Description: "US ISO East", }, }, Services: services{ "api.ecr": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{ Hostname: "api.ecr.us-iso-east-1.c2s.ic.gov", CredentialScope: credentialScope{ Region: "us-iso-east-1", }, }, }, }, "api.sagemaker": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "apigateway": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "application-autoscaling": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "autoscaling": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{ Protocols: []string{"http", "https"}, }, }, }, "cloudformation": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "cloudtrail": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "codedeploy": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "comprehend": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "config": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "datapipeline": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "directconnect": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "dms": service{ Endpoints: endpoints{ "dms-fips": endpoint{ Hostname: "dms.us-iso-east-1.c2s.ic.gov", CredentialScope: credentialScope{ Region: "us-iso-east-1", }, }, "us-iso-east-1": endpoint{}, }, }, "ds": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "dynamodb": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{ Protocols: []string{"http", "https"}, }, }, }, "ec2": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "ec2metadata": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-global": endpoint{ Hostname: "169.254.169.254/latest", Protocols: []string{"http"}, }, }, }, "ecs": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "elasticache": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "elasticfilesystem": service{ Endpoints: endpoints{ "fips-us-iso-east-1": endpoint{ Hostname: "elasticfilesystem-fips.us-iso-east-1.c2s.ic.gov", CredentialScope: credentialScope{ Region: "us-iso-east-1", }, }, "us-iso-east-1": endpoint{}, }, }, "elasticloadbalancing": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{ Protocols: []string{"http", "https"}, }, }, }, "elasticmapreduce": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{ Protocols: []string{"https"}, }, }, }, "es": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "events": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "firehose": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "glacier": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{ Protocols: []string{"http", "https"}, }, }, }, "health": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "iam": service{ PartitionEndpoint: "aws-iso-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-iso-global": endpoint{ Hostname: "iam.us-iso-east-1.c2s.ic.gov", CredentialScope: credentialScope{ Region: "us-iso-east-1", }, }, }, }, "kinesis": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "kms": service{ Endpoints: endpoints{ "ProdFips": endpoint{ Hostname: "kms-fips.us-iso-east-1.c2s.ic.gov", CredentialScope: credentialScope{ Region: "us-iso-east-1", }, }, "us-iso-east-1": endpoint{}, }, }, "lambda": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "logs": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "medialive": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "mediapackage": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "monitoring": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "outposts": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "ram": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "rds": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "redshift": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "route53": service{ PartitionEndpoint: "aws-iso-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-iso-global": endpoint{ Hostname: "route53.c2s.ic.gov", CredentialScope: credentialScope{ Region: "us-iso-east-1", }, }, }, }, "runtime.sagemaker": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "s3": service{ Defaults: endpoint{ SignatureVersions: []string{"s3v4"}, }, Endpoints: endpoints{ "us-iso-east-1": endpoint{ Protocols: []string{"http", "https"}, SignatureVersions: []string{"s3v4"}, }, }, }, "secretsmanager": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "snowball": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "sns": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{ Protocols: []string{"http", "https"}, }, }, }, "sqs": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{ Protocols: []string{"http", "https"}, }, }, }, "ssm": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "states": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "streams.dynamodb": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, CredentialScope: credentialScope{ Service: "dynamodb", }, }, Endpoints: endpoints{ "us-iso-east-1": endpoint{ Protocols: []string{"http", "https"}, }, }, }, "sts": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "support": service{ PartitionEndpoint: "aws-iso-global", Endpoints: endpoints{ "aws-iso-global": endpoint{ Hostname: "support.us-iso-east-1.c2s.ic.gov", CredentialScope: credentialScope{ Region: "us-iso-east-1", }, }, }, }, "swf": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "transcribe": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "transcribestreaming": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "translate": service{ Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, "workspaces": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, }, } // AwsIsoBPartition returns the Resolver for AWS ISOB (US). func AwsIsoBPartition() Partition { return awsisobPartition.Partition() } var awsisobPartition = partition{ ID: "aws-iso-b", Name: "AWS ISOB (US)", DNSSuffix: "sc2s.sgov.gov", RegionRegex: regionRegex{ Regexp: func() *regexp.Regexp { reg, _ := regexp.Compile("^us\\-isob\\-\\w+\\-\\d+$") return reg }(), }, Defaults: endpoint{ Hostname: "{service}.{region}.{dnsSuffix}", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, Regions: regions{ "us-isob-east-1": region{ Description: "US ISOB East (Ohio)", }, }, Services: services{ "api.ecr": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{ Hostname: "api.ecr.us-isob-east-1.sc2s.sgov.gov", CredentialScope: credentialScope{ Region: "us-isob-east-1", }, }, }, }, "application-autoscaling": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "autoscaling": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "cloudformation": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "cloudtrail": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "codedeploy": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "config": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "directconnect": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "dms": service{ Endpoints: endpoints{ "dms-fips": endpoint{ Hostname: "dms.us-isob-east-1.sc2s.sgov.gov", CredentialScope: credentialScope{ Region: "us-isob-east-1", }, }, "us-isob-east-1": endpoint{}, }, }, "dynamodb": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "ec2": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "ec2metadata": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-global": endpoint{ Hostname: "169.254.169.254/latest", Protocols: []string{"http"}, }, }, }, "ecs": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "elasticache": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "elasticloadbalancing": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{ Protocols: []string{"https"}, }, }, }, "elasticmapreduce": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "es": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "events": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "glacier": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "health": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "iam": service{ PartitionEndpoint: "aws-iso-b-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-iso-b-global": endpoint{ Hostname: "iam.us-isob-east-1.sc2s.sgov.gov", CredentialScope: credentialScope{ Region: "us-isob-east-1", }, }, }, }, "kinesis": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "kms": service{ Endpoints: endpoints{ "ProdFips": endpoint{ Hostname: "kms-fips.us-isob-east-1.sc2s.sgov.gov", CredentialScope: credentialScope{ Region: "us-isob-east-1", }, }, "us-isob-east-1": endpoint{}, }, }, "lambda": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "license-manager": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "logs": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "monitoring": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "rds": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "redshift": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "route53": service{ PartitionEndpoint: "aws-iso-b-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-iso-b-global": endpoint{ Hostname: "route53.sc2s.sgov.gov", CredentialScope: credentialScope{ Region: "us-isob-east-1", }, }, }, }, "s3": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, SignatureVersions: []string{"s3v4"}, }, Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "snowball": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "sns": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "sqs": service{ Defaults: endpoint{ SSLCommonName: "{region}.queue.{dnsSuffix}", Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "ssm": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "states": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "streams.dynamodb": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, CredentialScope: credentialScope{ Service: "dynamodb", }, }, Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "sts": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, "support": service{ PartitionEndpoint: "aws-iso-b-global", Endpoints: endpoints{ "aws-iso-b-global": endpoint{ Hostname: "support.us-isob-east-1.sc2s.sgov.gov", CredentialScope: credentialScope{ Region: "us-isob-east-1", }, }, }, }, "swf": service{ Endpoints: endpoints{ "us-isob-east-1": endpoint{}, }, }, }, }
trivago/gollum
vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
GO
apache-2.0
292,209
# Load pickled data import pickle import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import ImageGrid import numpy as np import tensorflow as tf from tensorflow.contrib.layers import flatten from sklearn.utils import shuffle class Data: def __init__(self): training_file = 'data/train.p' validation_file= 'data/valid.p' testing_file = 'data/test.p' with open(training_file, mode='rb') as f: train = pickle.load(f) with open(validation_file, mode='rb') as f: valid = pickle.load(f) with open(testing_file, mode='rb') as f: test = pickle.load(f) self.X_train, self.y_train = train['features'], train['labels'] self.X_valid, self.y_valid = valid['features'], valid['labels'] self.X_test, self.y_test = test['features'], test['labels'] def render_data(self): image_with_label = zip(self.X_train, self.y_train) seen_labels = set() fig = plt.figure(figsize=(200, 200)) total_unique_labels = len(set(self.y_train)) unique_rows = total_unique_labels // 5 + 1 grid = ImageGrid(fig, 151, # similar to subplot(141) nrows_ncols=(unique_rows, 5), axes_pad=0.05, label_mode="1", ) i = 0 for i_l in image_with_label: img, label = i_l if label not in seen_labels: im = grid[i].imshow(img) seen_labels.add(label) i += 1 plt.show() def LeNet(x, max_labels): # Hyper parameters mu = 0 sigma = 0.1 # Convolutional Layer 1: Input = 32x32x3 Output = 28x28x6 conv1_W = tf.Variable(tf.truncated_normal(shape=(5, 5, 3, 6), mean=mu, stddev=sigma), name="v1") conv1_b = tf.Variable(tf.zeros(6), name="v2") conv1 = tf.nn.conv2d(x, conv1_W, strides=[1, 1, 1, 1], padding='VALID') + conv1_b # Activation Layer conv1 = tf.nn.relu(conv1) # Max Pooling : Input = 28x28x6 Output = 14x14x6 conv1 = tf.nn.max_pool(conv1, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='VALID') # Convolutional Layer 2: Input = 14x14x6 Output: 10x10x16 conv2_W = tf.Variable(tf.truncated_normal(shape=(5, 5, 6, 16), mean=mu, stddev=sigma), name="v3") conv2_b = tf.Variable(tf.zeros(16), name="v4") conv2 = tf.nn.conv2d(conv1, conv2_W, strides=[1, 1, 1, 1], padding='VALID') + conv2_b # Activation Layer conv2 = tf.nn.relu(conv2) # Max Pooling : Input = 10x10x16 Output = 5x5x16 conv2 = tf.nn.max_pool(conv2, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='VALID') # Fully Connected Layer fc0 = flatten(conv2) # Layer 3 - Fully Connected: Input = 400 Output = 120 fc1_W = tf.Variable(tf.truncated_normal(shape=(400, 120), mean=mu, stddev=sigma), name="v5") fc1_b = tf.Variable(tf.zeros(120), name="v6") fc1 = tf.matmul(fc0, fc1_W) + fc1_b # Activation fc1 = tf.nn.relu(fc1) # Layer 4 : Fully Connected: Input = 120 Output = 84 fc2_W = tf.Variable(tf.truncated_normal(shape=(120, 84), mean=mu, stddev=sigma), name="v7") fc2_b = tf.Variable(tf.zeros(84), name="v8") fc2 = tf.matmul(fc1, fc2_W) + fc2_b # Activation fc2 = tf.nn.relu(fc2) # Layer 5 - Fully Connected Input = 84 Output = 10 fc3_W = tf.Variable(tf.truncated_normal(shape=(84, max_labels), mean=mu, stddev=sigma), name="v9") fc3_b = tf.Variable(tf.zeros(max_labels), name="v10") logits = tf.matmul(fc2, fc3_W) + fc3_b return logits def train(max_classified_id): x = tf.placeholder(tf.float32, (None, 32, 32, 3), name="X") y = tf.placeholder(tf.int32, (None), name="Y") one_hot_y = tf.one_hot(y, max_classified_id) rate = 0.001 logits = LeNet(x, max_classified_id) cross_entropy = tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=one_hot_y) loss_operation = tf.reduce_mean(cross_entropy) optimizer = tf.train.AdamOptimizer(learning_rate=rate) training_operation = optimizer.minimize(loss_operation) correct_prediction = tf.equal(tf.argmax(logits, 1), tf.argmax(one_hot_y, 1)) accuracy_operation = tf.reduce_mean(tf.cast(correct_prediction, tf.float32)) saver = tf.train.Saver(), training_operation, accuracy_operation return saver, training_operation, accuracy_operation, x, y def evaluate(x, y, X_data, y_data, accuracy_operation, BATCH_SIZE): num_examples = len(X_data) total_accuracy = 0 sess = tf.get_default_session() for offset in range(0, num_examples, BATCH_SIZE): batch_x, batch_y = X_data[offset:offset+BATCH_SIZE], y_data[offset:offset+BATCH_SIZE] accuracy = sess.run(accuracy_operation, feed_dict={x: batch_x, y: batch_y}) total_accuracy += (accuracy * len(batch_x)) return total_accuracy / num_examples def main(): data = Data() EPOCHS = 10 BATCH_SIZE = 128 max_classified_id = np.max(data.y_train) saver, training_operation, accuracy_operation, x, y = train(max_classified_id) with tf.Session() as sess: sess.run(tf.global_variables_initializer()) num_examples = len(data.X_train) print("Training...") print() for i in range(EPOCHS): X_train, y_train = shuffle(data.X_train, data.y_train) for offset in range(0, num_examples, BATCH_SIZE): end = offset + BATCH_SIZE batch_x, batch_y = X_train[offset:end], y_train[offset:end] sess.run(training_operation, feed_dict={x: batch_x, y: batch_y}) validation_accuracy = evaluate(x, y, data.X_valid, data.y_valid, accuracy_operation, BATCH_SIZE) print("EPOCH {} ...".format(i+1)) print("Validation Accuracy = {:.3f}".format(validation_accuracy)) print() saver.save(sess, './lenet') print("Model saved") if __name__ == "__main__": main()
ssarangi/self_driving_cars
traffic_sign_classifier/classify.py
Python
apache-2.0
6,030
#!/usr/bin/python # -*- coding: utf-8 -*- DOCUMENTATION = ''' --- module: softlayer_vs_ip short_description: Retrieves instance ip addresses from Softlayer description: - Retrieves instance ip addresses of all adapters from Softlayer - the result is stored in the "result" dict entry of he registered variable requirements: - Requires SoftLayer python client - Requires Ansible options: api_key: description: - SoftLayer API Key default: null sl_username: description: - SoftLayer username default: null fqdn: description: - The fully qualified domain name of the instance. type: string required: true author: scoss notes: - Instead of supplying api_key and username, .softlayer or env variables ''' from ansible.module_utils.basic import * import SoftLayer import sys import logging import time from softlayer_vs_basic import * class IpAddressReader(SoftlayerVirtualServerBasic): def __init__(self, sl_client, instance_config): SoftlayerVirtualServerBasic.__init__(self, sl_client, instance_config) def read_ip_address(self): sl_instance = self.sl_virtual_guest.getObject(id=self.get_vs_id(True), mask='primaryBackendIpAddress, primaryIpAddress') return sl_instance def main(): module_helper = AnsibleModule( argument_spec = dict( SLClientConfig.arg_spec().items() + VSInstanceConfigBasic.arg_spec().items() ) ) sl_client_config = SLClientConfig(module_helper.params) sl_client = SoftLayer.Client(username=sl_client_config.sl_username, api_key=sl_client_config.api_key) vs = IpAddressReader(sl_client, VSInstanceConfigBasic(ansible_config=module_helper.params)) try: module_helper.exit_json(changed=False, result=vs.read_ip_address()) except Exception as se: module_helper.fail_json(changed=False, msg=str(se)) main()
hubward/ansible-softlayer
softlayer_vs_ip.py
Python
apache-2.0
1,999
/* * Copyright 2013 Guidewire Software, Inc. */ package gw.lang.reflect; public interface IParameterInfo extends IFeatureInfo, IIntrinsicTypeReference { IParameterInfo[] EMPTY_ARRAY = new IParameterInfo[0]; }
gosu-lang/old-gosu-repo
gosu-core-api/src/main/java/gw/lang/reflect/IParameterInfo.java
Java
apache-2.0
215
<?php // +---------------------------------------------------------------------- // | @name base.php // +---------------------------------------------------------------------- // | @desc 配置文件 // +---------------------------------------------------------------------- // | @author bibyzhang90@gmail.com // +---------------------------------------------------------------------- //入口定义 define('PRODUCE_ACCESS_GRANT', TRUE); //调试模式 if( APP_DEBUG ){ ini_set("display_errors", 1); error_reporting(E_ALL^E_NOTICE); }else{ ini_set("display_errors", 0); error_reporting(0); } //时区设置 date_default_timezone_set('Asia/Chongqidng'); //缓存文件夹地址 define('CACHE_PATH', BASE_PATH.'caches'.DIRECTORY_SEPARATOR); //公共类文件夹地址 define('CLASS_PATH', BASE_PATH.'common/libs/classes'.DIRECTORY_SEPARATOR); //公共函数文件夹地址 define('FUNC_PATH', BASE_PATH.'common/libs/functions'.DIRECTORY_SEPARATOR); //模型文件夹地址 define('MODEL_PATH', BASE_PATH.'model'.DIRECTORY_SEPARATOR); //模块文件夹地址 define('MODULE_PATH', BASE_PATH.'modules'.DIRECTORY_SEPARATOR); //游戏库静态资源地址 define('STATIC_PATH',BASE_PATH . 'statics' . DIRECTORY_SEPARATOR); //动态域名地址 //define('APP_PATH',pc_base::load_config('system','app_path')); require(CACHE_PATH . 'configs/system.php'); define('APP_PATH',$systemArr['app_path']); //图片地址 define('IMG_PATH',$systemArr['img_path']); //图片下载存放地址 define('IMAGE_PATH', BASE_PATH . '../');//图片下载存放地址 //前端模板目录 define('TPL_PATH',BASE_PATH); //图片展示域名 define('IMAGES_PATH',$systemArr['images_path']); //生成文件路径 define('HTML_PATH', BASE_PATH.'..'.DIRECTORY_SEPARATOR); //IOS PLIST 路径 define('XML_PATH', BASE_PATH . '..' . DIRECTORY_SEPARATOR); //加载Smarty /* require_once(BASE_PATH . 'Smarty/Smarty.class.php'); $smarty = new Smarty();*/ require_once(BASE_PATH . 'Smarty/SmartyBC.class.php'); $smarty = new SmartyBC(); $smarty->compile_dir = BASE_PATH . "templates_c/"; //设置编译目录 $smarty->template_dir = BASE_PATH . "templates/"; //设置模板目录 //左右边界符 $smarty->left_delimiter = "<{"; $smarty->right_delimiter = "}>"; $smarty->caching = false; //设置缓存方式 $smarty->cache_lifetime = 86400; //设置缓存时间 $smarty->debugging = false; //加载公用函数库 require_once(FUNC_PATH . 'global.func.php'); //加载公用类库 require_once(CLASS_PATH . 'mysql.class.php'); require_once(CLASS_PATH . 'Ftp.class.php'); require_once(CLASS_PATH . 'tpl.class.php'); //引入图片处理库 require(CLASS_PATH . 'ThinkImage.class.php'); require(CLASS_PATH . 'Gd.class.php'); require(CLASS_PATH . 'Image.class.php'); //beanstalk require(CLASS_PATH . 'beanstalk.class.php'); require_once(CLASS_PATH . 'Base.class.php');
bibyzhang/produce_cms
common/base.php
PHP
apache-2.0
2,863
<!doctype html> <html> <title>link</title> <meta http-equiv="content-type" value="text/html;utf-8"> <link rel="stylesheet" type="text/css" href="./style.css"> <body> <div id="wrapper"> <h1><a href="../api/link.html">link</a></h1> <p>Symlink a package folder</p> <h2 id="SYNOPSIS">SYNOPSIS</h2> <pre><code>npm.command.link(callback) npm.command.link(packages, callback)</code></pre> <h2 id="DESCRIPTION">DESCRIPTION</h2> <p>Package linking is a two-step process.</p> <p>Without parameters, link will create a globally-installed symbolic link from <code>prefix/package-name</code> to the current folder.</p> <p>With a parameters, link will create a symlink from the local <code>node_modules</code> folder to the global symlink.</p> <p>When creating tarballs for <code>npm publish</code>, the linked packages are "snapshotted" to their current state by resolving the symbolic links.</p> <p>This is handy for installing your own stuff, so that you can work on it and test it iteratively without having to continually rebuild.</p> <p>For example:</p> <pre><code>npm.commands.link(cb) # creates global link from the cwd # (say redis package) npm.commands.link('redis', cb) # link-install the package</code></pre> <p>Now, any changes to the redis package will be reflected in the package in the current working directory</p> </div> <p id="footer">link &mdash; npm@1.0.106</p> <script> ;(function () { var wrapper = document.getElementById("wrapper") var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) .filter(function (el) { return el.parentNode === wrapper && el.tagName.match(/H[1-6]/) && el.id }) var l = 2 , toc = document.createElement("ul") toc.innerHTML = els.map(function (el) { var i = el.tagName.charAt(1) , out = "" while (i > l) { out += "<ul>" l ++ } while (i < l) { out += "</ul>" l -- } out += "<li><a href='#" + el.id + "'>" + ( el.innerText || el.text || el.innerHTML) + "</a>" return out }).join("\n") toc.id = "toc" document.body.appendChild(toc) })() </script> </body></html>
astro/browser-request
node_modules/ender/node_modules/npm/html/api/link.html
HTML
apache-2.0
2,148
"""Bitcoin information service that uses blockchain.info.""" from datetime import timedelta import logging from blockchain import exchangerates, statistics import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ATTR_ATTRIBUTION, CONF_CURRENCY, CONF_DISPLAY_OPTIONS import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity _LOGGER = logging.getLogger(__name__) ATTRIBUTION = "Data provided by blockchain.info" DEFAULT_CURRENCY = "USD" ICON = "mdi:currency-btc" SCAN_INTERVAL = timedelta(minutes=5) OPTION_TYPES = { "exchangerate": ["Exchange rate (1 BTC)", None], "trade_volume_btc": ["Trade volume", "BTC"], "miners_revenue_usd": ["Miners revenue", "USD"], "btc_mined": ["Mined", "BTC"], "trade_volume_usd": ["Trade volume", "USD"], "difficulty": ["Difficulty", None], "minutes_between_blocks": ["Time between Blocks", "min"], "number_of_transactions": ["No. of Transactions", None], "hash_rate": ["Hash rate", "PH/s"], "timestamp": ["Timestamp", None], "mined_blocks": ["Mined Blocks", None], "blocks_size": ["Block size", None], "total_fees_btc": ["Total fees", "BTC"], "total_btc_sent": ["Total sent", "BTC"], "estimated_btc_sent": ["Estimated sent", "BTC"], "total_btc": ["Total", "BTC"], "total_blocks": ["Total Blocks", None], "next_retarget": ["Next retarget", None], "estimated_transaction_volume_usd": ["Est. Transaction volume", "USD"], "miners_revenue_btc": ["Miners revenue", "BTC"], "market_price_usd": ["Market price", "USD"], } PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { vol.Required(CONF_DISPLAY_OPTIONS, default=[]): vol.All( cv.ensure_list, [vol.In(OPTION_TYPES)] ), vol.Optional(CONF_CURRENCY, default=DEFAULT_CURRENCY): cv.string, } ) def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Bitcoin sensors.""" currency = config.get(CONF_CURRENCY) if currency not in exchangerates.get_ticker(): _LOGGER.warning("Currency %s is not available. Using USD", currency) currency = DEFAULT_CURRENCY data = BitcoinData() dev = [] for variable in config[CONF_DISPLAY_OPTIONS]: dev.append(BitcoinSensor(data, variable, currency)) add_entities(dev, True) class BitcoinSensor(Entity): """Representation of a Bitcoin sensor.""" def __init__(self, data, option_type, currency): """Initialize the sensor.""" self.data = data self._name = OPTION_TYPES[option_type][0] self._unit_of_measurement = OPTION_TYPES[option_type][1] self._currency = currency self.type = option_type self._state = None @property def name(self): """Return the name of the sensor.""" return self._name @property def state(self): """Return the state of the sensor.""" return self._state @property def unit_of_measurement(self): """Return the unit the value is expressed in.""" return self._unit_of_measurement @property def icon(self): """Return the icon to use in the frontend, if any.""" return ICON @property def device_state_attributes(self): """Return the state attributes of the sensor.""" return {ATTR_ATTRIBUTION: ATTRIBUTION} def update(self): """Get the latest data and updates the states.""" self.data.update() stats = self.data.stats ticker = self.data.ticker if self.type == "exchangerate": self._state = ticker[self._currency].p15min self._unit_of_measurement = self._currency elif self.type == "trade_volume_btc": self._state = "{0:.1f}".format(stats.trade_volume_btc) elif self.type == "miners_revenue_usd": self._state = "{0:.0f}".format(stats.miners_revenue_usd) elif self.type == "btc_mined": self._state = "{}".format(stats.btc_mined * 0.00000001) elif self.type == "trade_volume_usd": self._state = "{0:.1f}".format(stats.trade_volume_usd) elif self.type == "difficulty": self._state = "{0:.0f}".format(stats.difficulty) elif self.type == "minutes_between_blocks": self._state = "{0:.2f}".format(stats.minutes_between_blocks) elif self.type == "number_of_transactions": self._state = "{}".format(stats.number_of_transactions) elif self.type == "hash_rate": self._state = "{0:.1f}".format(stats.hash_rate * 0.000001) elif self.type == "timestamp": self._state = stats.timestamp elif self.type == "mined_blocks": self._state = "{}".format(stats.mined_blocks) elif self.type == "blocks_size": self._state = "{0:.1f}".format(stats.blocks_size) elif self.type == "total_fees_btc": self._state = "{0:.2f}".format(stats.total_fees_btc * 0.00000001) elif self.type == "total_btc_sent": self._state = "{0:.2f}".format(stats.total_btc_sent * 0.00000001) elif self.type == "estimated_btc_sent": self._state = "{0:.2f}".format(stats.estimated_btc_sent * 0.00000001) elif self.type == "total_btc": self._state = "{0:.2f}".format(stats.total_btc * 0.00000001) elif self.type == "total_blocks": self._state = "{0:.0f}".format(stats.total_blocks) elif self.type == "next_retarget": self._state = "{0:.2f}".format(stats.next_retarget) elif self.type == "estimated_transaction_volume_usd": self._state = "{0:.2f}".format(stats.estimated_transaction_volume_usd) elif self.type == "miners_revenue_btc": self._state = "{0:.1f}".format(stats.miners_revenue_btc * 0.00000001) elif self.type == "market_price_usd": self._state = "{0:.2f}".format(stats.market_price_usd) class BitcoinData: """Get the latest data and update the states.""" def __init__(self): """Initialize the data object.""" self.stats = None self.ticker = None def update(self): """Get the latest data from blockchain.info.""" self.stats = statistics.get() self.ticker = exchangerates.get_ticker()
Teagan42/home-assistant
homeassistant/components/bitcoin/sensor.py
Python
apache-2.0
6,395
package com.jivesoftware.jivesdk.impl.http; import org.apache.http.client.HttpClient; import javax.annotation.Nonnull; /** * Created with IntelliJ IDEA. * User: Zvoykish * Date: 9/1/13 * Time: 3:48 PM */ public interface HttpClientFactory { /** * Acquires an HTTP client with the default timeout setting () * * @return An HTTP client */ @Nonnull HttpClient getClient(); /** * Acquires an HTTP client with the given timeout applied for socket and connection. * * @param timeout Timeout in milliseconds * @return An HTTP client */ @Nonnull HttpClient getClient(int timeout); }
zvoykish/jive-sdk-java
api/src/main/java/com/jivesoftware/jivesdk/impl/http/HttpClientFactory.java
Java
apache-2.0
653
--- search: keywords: ['SQL', 'DROP SEQUENCE', 'command', 'drop', 'delete', 'sequence'] --- # SQL - `DROP SEQUENCE` Removes a sequence. This feature was introduced in version 2.2. **Syntax** ```sql DROP SEQUENCE <sequence> ``` - **`<sequence>`** Defines the name of the sequence you want to remove. **Examples** - Remove the sequence `idseq`: <pre> orientdb> <code class="lang-sql userinput">DROP SEQUENCE idseq</code> </pre> >For more information, see >- [`CREATE SEQUENCE`](SQL-Create-Sequence.md) >- [`DROP SEQUENCE`](SQL-Drop-Sequence.md) >- [Sequences and auto increment](Sequences-and-auto-increment.md) >- [SQL Commands](SQL-Commands.md)
smolinari/orientdb-docs
sql/SQL-Drop-Sequence.md
Markdown
apache-2.0
666
/** * Copyright (C) 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ninja.template; import java.util.ArrayList; import java.util.List; import ninja.Router; import com.google.inject.Inject; import com.google.inject.Singleton; import freemarker.template.SimpleNumber; import freemarker.template.SimpleScalar; import freemarker.template.TemplateModel; import freemarker.template.TemplateModelException; @Singleton public class TemplateEngineFreemarkerReverseRouteHelper { final Router router; @Inject public TemplateEngineFreemarkerReverseRouteHelper(Router router) { this.router = router; } public TemplateModel computeReverseRoute(List args) throws TemplateModelException { if (args.size() < 2) { throw new TemplateModelException( "Please specify at least classname and controller (2 parameters)."); } else { List<String> strings = new ArrayList<>(args.size()); for (Object o : args) { // We currently allow only numbers and strings as arguments if (o instanceof String) { strings.add((String) o); } if (o instanceof SimpleScalar) { strings.add(((SimpleScalar) o).getAsString()); } else if (o instanceof SimpleNumber) { strings.add(((SimpleNumber) o).toString()); } } try { Class<?> clazz = Class.forName(strings.get(0)); Object [] parameterMap = strings.subList(2, strings.size()).toArray(); String reverseRoute = router.getReverseRoute( clazz, strings.get(1), parameterMap); return new SimpleScalar(reverseRoute); } catch (ClassNotFoundException ex) { throw new TemplateModelException("Error. Cannot find class for String: " + strings.get(0)); } } } }
krahman/emedia
ninja-core/src/main/java/ninja/template/TemplateEngineFreemarkerReverseRouteHelper.java
Java
apache-2.0
2,609
package org.unitsheet.types.typeconverters; import org.unitsheet.api.types.TypeConverter; import java.math.BigDecimal; import java.math.BigInteger; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import static org.unitsheet.utils.ArgumentChecks.checkNotNull; /** * Convert from Number.class, String.class * * Convert to String.class, Byte.class, byte.class, Short.class, short.class, Integer.class, int.class, Long.class, long.class, Double.class, double.class, Float.class, float.class, BigDecimal.class, BigInteger.class, AtomicInteger.class, AtomicLong.class * */ public class NumericTypeConverter implements TypeConverter { @Override @SuppressWarnings("unchecked") public <T> T convert(Object source, Class<T> destinationClass) { checkNotNull(source, "source may not be null"); checkNotNull(destinationClass, "destinationClass may not be null"); Class<?> sourceClass = source.getClass(); if (String.class.isAssignableFrom(sourceClass)) { Object convertedObject = convertStringToDestinationNumberType(destinationClass, (String) source); if (convertedObject != null) { return (T) convertedObject; } } else if (Number.class.isAssignableFrom(sourceClass)) { Object convertedObject = convertNumberToDestinationNumberType(destinationClass, (Number) source); if (convertedObject != null) { return (T) convertedObject; } } // null implies conversion failed... ObjectConverter will keep trying remaining typeconverters return null; } private <T> Object convertStringToDestinationNumberType(Class<T> destinationClass, String source) { Object returnObj = null; if (Byte.class.equals(destinationClass) || byte.class.equals(destinationClass)) { returnObj = Byte.valueOf(source); } else if (Short.class.equals(destinationClass) || short.class.equals(destinationClass)) { returnObj = Short.valueOf(source); } else if (Integer.class.equals(destinationClass) || int.class.equals(destinationClass)) { returnObj = Integer.valueOf(source); } else if (Long.class.equals(destinationClass) || long.class.equals(destinationClass)) { returnObj = Long.valueOf(source); } else if (Double.class.equals(destinationClass) || double.class.equals(destinationClass)) { returnObj = Double.valueOf(source); } else if (Float.class.equals(destinationClass) || float.class.equals(destinationClass)) { returnObj = Float.valueOf(source); } else if (BigInteger.class.equals(destinationClass)) { returnObj = new BigInteger(source); } else if (BigDecimal.class.equals(destinationClass)) { returnObj = new BigDecimal(source); } else if (AtomicInteger.class.equals(destinationClass)) { returnObj = new AtomicInteger(Integer.valueOf(source)); } else if (AtomicLong.class.equals(destinationClass)) { returnObj = new AtomicLong(Long.valueOf(source)); } return returnObj; } private <T> Object convertNumberToDestinationNumberType(Class<T> destinationClass, Number sourceNumber) { Object returnObj = null; if (Byte.class.equals(destinationClass) || byte.class.equals(destinationClass)) { returnObj = sourceNumber.byteValue(); } else if (Short.class.equals(destinationClass) || short.class.equals(destinationClass)) { returnObj = sourceNumber.shortValue(); } else if (Integer.class.equals(destinationClass) || int.class.equals(destinationClass)) { returnObj = sourceNumber.intValue(); } else if (Long.class.equals(destinationClass) || long.class.equals(destinationClass)) { returnObj = sourceNumber.longValue(); } else if (Double.class.equals(destinationClass) || double.class.equals(destinationClass)) { returnObj = sourceNumber.doubleValue(); } else if (Float.class.equals(destinationClass) || float.class.equals(destinationClass)) { returnObj = sourceNumber.floatValue(); } else if (BigInteger.class.equals(destinationClass)) { returnObj = new BigInteger(sourceNumber.toString().replaceAll("\\..*","")); } else if (BigDecimal.class.equals(destinationClass)) { returnObj = new BigDecimal(sourceNumber.toString()); } else if (AtomicInteger.class.equals(destinationClass)) { returnObj = new AtomicInteger(sourceNumber.intValue()); } else if (AtomicLong.class.equals(destinationClass)) { returnObj = new AtomicLong(sourceNumber.longValue()); } return returnObj; } }
wjsrobertson/unitsheet
core/src/main/java/org/unitsheet/types/typeconverters/NumericTypeConverter.java
Java
apache-2.0
5,102
# # Copyright 2013 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from six import iteritems, iterkeys import pandas as pd from . utils.protocol_utils import Enum from zipline.finance.trading import with_environment from zipline.utils.algo_instance import get_algo_instance # Datasource type should completely determine the other fields of a # message with its type. DATASOURCE_TYPE = Enum( 'AS_TRADED_EQUITY', 'MERGER', 'SPLIT', 'DIVIDEND', 'TRADE', 'TRANSACTION', 'ORDER', 'EMPTY', 'DONE', 'CUSTOM', 'BENCHMARK', 'COMMISSION' ) # Expected fields/index values for a dividend Series. DIVIDEND_FIELDS = [ 'declared_date', 'ex_date', 'gross_amount', 'net_amount', 'pay_date', 'payment_sid', 'ratio', 'sid', ] # Expected fields/index values for a dividend payment Series. DIVIDEND_PAYMENT_FIELDS = ['id', 'payment_sid', 'cash_amount', 'share_count'] def dividend_payment(data=None): """ Take a dictionary whose values are in DIVIDEND_PAYMENT_FIELDS and return a series representing the payment of a dividend. Ids are assigned to each historical dividend in PerformanceTracker.update_dividends. They are guaranteed to be unique integers with the context of a single simulation. If @data is non-empty, a id is required to identify the historical dividend associated with this payment. Additionally, if @data is non-empty, either data['cash_amount'] should be nonzero or data['payment_sid'] should be a security identifier and data['share_count'] should be nonzero. The returned Series is given its id value as a name so that concatenating payments results in a DataFrame indexed by id. (Note, however, that the name value is not used to construct an index when this series is returned by function passed to `DataFrame.apply`. In such a case, pandas preserves the index of the DataFrame on which `apply` is being called.) """ return pd.Series( data=data, name=data['id'] if data is not None else None, index=DIVIDEND_PAYMENT_FIELDS, dtype=object, ) class Event(object): def __init__(self, initial_values=None): if initial_values: self.__dict__ = initial_values def __getitem__(self, name): return getattr(self, name) def __setitem__(self, name, value): setattr(self, name, value) def __delitem__(self, name): delattr(self, name) def keys(self): return self.__dict__.keys() def __eq__(self, other): return hasattr(other, '__dict__') and self.__dict__ == other.__dict__ def __contains__(self, name): return name in self.__dict__ def __repr__(self): return "Event({0})".format(self.__dict__) def to_series(self, index=None): return pd.Series(self.__dict__, index=index) class Order(Event): pass class Portfolio(object): def __init__(self): self.capital_used = 0.0 self.starting_cash = 0.0 self.portfolio_value = 0.0 self.pnl = 0.0 self.returns = 0.0 self.cash = 0.0 self.positions = Positions() self.start_date = None self.positions_value = 0.0 def __getitem__(self, key): return self.__dict__[key] def __repr__(self): return "Portfolio({0})".format(self.__dict__) class Account(object): ''' The account object tracks information about the trading account. The values are updated as the algorithm runs and its keys remain unchanged. If connected to a broker, one can update these values with the trading account values as reported by the broker. ''' def __init__(self): self.settled_cash = 0.0 self.accrued_interest = 0.0 self.buying_power = float('inf') self.equity_with_loan = 0.0 self.total_positions_value = 0.0 self.regt_equity = 0.0 self.regt_margin = float('inf') self.initial_margin_requirement = 0.0 self.maintenance_margin_requirement = 0.0 self.available_funds = 0.0 self.excess_liquidity = 0.0 self.cushion = 0.0 self.day_trades_remaining = float('inf') self.leverage = 0.0 self.net_liquidation = 0.0 def __getitem__(self, key): return self.__dict__[key] def __repr__(self): return "Account({0})".format(self.__dict__) def _get_state(self): return 'Account', self.__dict__ def _set_state(self, saved_state): self.__dict__.update(saved_state) class Position(object): def __init__(self, sid): self.sid = sid self.amount = 0 self.cost_basis = 0.0 # per share self.last_sale_price = 0.0 def __getitem__(self, key): return self.__dict__[key] def __repr__(self): return "Position({0})".format(self.__dict__) class Positions(dict): def __missing__(self, key): pos = Position(key) self[key] = pos return pos class SIDData(object): # Cache some data on the class so that this is shared for all instances of # siddata. # The dt where we cached the history. _history_cache_dt = None # _history_cache is a a dict mapping fields to pd.DataFrames. This is the # most data we have for a given field for the _history_cache_dt. _history_cache = {} # This is the cache that is used for returns. This will have a different # structure than the other history cache as this is always daily. _returns_cache_dt = None _returns_cache = None # The last dt that we needed to cache the number of minutes. _minute_bar_cache_dt = None # If we are in minute mode, there is some cost associated with computing # the number of minutes that we need to pass to the bar count of history. # This will remain constant for a given bar and day count. # This maps days to number of minutes. _minute_bar_cache = {} def __init__(self, sid, initial_values=None): self._sid = sid self._freqstr = None # To check if we have data, we use the __len__ which depends on the # __dict__. Because we are foward defining the attributes needed, we # need to account for their entrys in the __dict__. # We will add 1 because we need to account for the _initial_len entry # itself. self._initial_len = len(self.__dict__) + 1 if initial_values: self.__dict__.update(initial_values) @property def datetime(self): """ Provides an alias from data['foo'].datetime -> data['foo'].dt `datetime` was previously provided by adding a seperate `datetime` member of the SIDData object via a generator that wrapped the incoming data feed and added the field to each equity event. This alias is intended to be temporary, to provide backwards compatibility with existing algorithms, but should be considered deprecated, and may be removed in the future. """ return self.dt def get(self, name, default=None): return self.__dict__.get(name, default) def __getitem__(self, name): return self.__dict__[name] def __setitem__(self, name, value): self.__dict__[name] = value def __len__(self): return len(self.__dict__) - self._initial_len def __contains__(self, name): return name in self.__dict__ def __repr__(self): return "SIDData({0})".format(self.__dict__) def _get_buffer(self, bars, field='price'): """ Gets the result of history for the given number of bars and field. This will cache the results internally. """ cls = self.__class__ algo = get_algo_instance() now = algo.datetime if now != cls._history_cache_dt: # For a given dt, the history call for this field will not change. # We have a new dt, so we should reset the cache. cls._history_cache_dt = now cls._history_cache = {} if field not in self._history_cache \ or bars > len(cls._history_cache[field].index): # If we have never cached this field OR the amount of bars that we # need for this field is greater than the amount we have cached, # then we need to get more history. hst = algo.history( bars, self._freqstr, field, ffill=True, ) # Assert that the column holds ints, not security objects. if not isinstance(self._sid, str): hst.columns = hst.columns.astype(int) self._history_cache[field] = hst # Slice of only the bars needed. This is because we strore the LARGEST # amount of history for the field, and we might request less than the # largest from the cache. return cls._history_cache[field][self._sid][-bars:] def _get_bars(self, days): """ Gets the number of bars needed for the current number of days. Figures this out based on the algo datafrequency and caches the result. This caches the result by replacing this function on the object. This means that after the first call to _get_bars, this method will point to a new function object. """ def daily_get_bars(days): return days @with_environment() def minute_get_bars(days, env=None): cls = self.__class__ now = get_algo_instance().datetime if now != cls._minute_bar_cache_dt: cls._minute_bar_cache_dt = now cls._minute_bar_cache = {} if days not in cls._minute_bar_cache: # Cache this calculation to happen once per bar, even if we # use another transform with the same number of days. prev = env.previous_trading_day(now) ds = env.days_in_range( env.add_trading_days(-days + 2, prev), prev, ) # compute the number of minutes in the (days - 1) days before # today. # 210 minutes in a an early close and 390 in a full day. ms = sum(210 if d in env.early_closes else 390 for d in ds) # Add the number of minutes for today. ms += int( (now - env.get_open_and_close(now)[0]).total_seconds() / 60 ) cls._minute_bar_cache[days] = ms + 1 # Account for this minute return cls._minute_bar_cache[days] if get_algo_instance().sim_params.data_frequency == 'daily': self._freqstr = '1d' # update this method to point to the daily variant. self._get_bars = daily_get_bars else: self._freqstr = '1m' # update this method to point to the minute variant. self._get_bars = minute_get_bars # Not actually recursive because we have already cached the new method. return self._get_bars(days) def mavg(self, days): return self._get_buffer(self._get_bars(days)).mean() def stddev(self, days): return self._get_buffer(self._get_bars(days)).std(ddof=1) def vwap(self, days): bars = self._get_bars(days) prices = self._get_buffer(bars) vols = self._get_buffer(bars, field='volume') return (prices * vols).sum() / vols.sum() def returns(self): algo = get_algo_instance() now = algo.datetime if now != self._returns_cache_dt: self._returns_cache_dt = now self._returns_cache = algo.history(2, '1d', 'price', ffill=True) hst = self._returns_cache[self._sid] return (hst.iloc[-1] - hst.iloc[0]) / hst.iloc[0] class BarData(object): """ Holds the event data for all sids for a given dt. This is what is passed as `data` to the `handle_data` function. Note: Many methods are analogues of dictionary because of historical usage of what this replaced as a dictionary subclass. """ def __init__(self, data=None): self._data = data or {} self._contains_override = None def __contains__(self, name): if self._contains_override: if self._contains_override(name): return name in self._data else: return False else: return name in self._data def has_key(self, name): """ DEPRECATED: __contains__ is preferred, but this method is for compatibility with existing algorithms. """ return name in self def __setitem__(self, name, value): self._data[name] = value def __getitem__(self, name): return self._data[name] def __delitem__(self, name): del self._data[name] def __iter__(self): for sid, data in iteritems(self._data): # Allow contains override to filter out sids. if sid in self: if len(data): yield sid def iterkeys(self): # Allow contains override to filter out sids. return (sid for sid in iterkeys(self._data) if sid in self) def keys(self): # Allow contains override to filter out sids. return list(self.iterkeys()) def itervalues(self): return (value for _sid, value in self.iteritems()) def values(self): return list(self.itervalues()) def iteritems(self): return ((sid, value) for sid, value in iteritems(self._data) if sid in self) def items(self): return list(self.iteritems()) def __len__(self): return len(self.keys()) def __repr__(self): return '{0}({1})'.format(self.__class__.__name__, self._data)
mattcaldwell/zipline
zipline/protocol.py
Python
apache-2.0
14,487
# Biatora ahlesii Körb. SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in Flecht. Eur. no. 732 (1860) #### Original name Biatora ahlesii Körb. ### Remarks null
mdoering/backbone
life/Fungi/Ascomycota/Lecanoromycetes/Lecanorales/Lecideaceae/Lecidea/Lecidea ahlesii/ Syn. Biatora ahlesii/README.md
Markdown
apache-2.0
220
# Privacy Policy ### Information Collection and Use For a better experience, while using the Service, I may require you to provide certain personally identifiable information, including but not limited to your location. The sample app may ask for permission to access your location. This information is used only within the app to show your current location on some of the maps displayed within the app; your location is never shared with any third parties or stored on any servers. The information that I request is retained on your device and is not collected by me in any way. The app does use third-party services that may collect information used to identify you. Links to privacy policy of third-party service providers used by the app are listed below: - [Google Play Services](https://www.google.com/policies/privacy) - [Crashlytics](http://try.crashlytics.com/terms) ### Log Data I want to inform you that whenever you use my Service, in a case of an error in the app I collect data and information (through third-party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing the Service, the time and date of your use of the Service, and other statistics. ### Cookies Cookies are files with small amount of data that is commonly used an anonymous unique identifier. These are sent to your browser from the website that you visit and are stored on your device internal memory. This Service does not use these “cookies” explicitly. However, the app may use third-party code and libraries that use “cookies” to collection information and to improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse cookies, you may not be able to use some portions of this Service. ### Service Providers I may employ third-party companies and individuals due to the following reasons: - To facilitate the Service; - To provide the Service on my behalf; - To perform Service-related services; or - To assist me in analyzing how the Service is used. I want to inform users of this Service that these third parties have access to your Personal Information. The reason is to perform the tasks assigned to them on behalf of the Service. However, they are obligated not to disclose or use the information for any other purpose. ### Security I value your trust in providing me your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security. ### Links to Other Sites This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services. ### Children’s Privacy These Services do not address anyone under the age of 13. I do not knowingly collect personally identifiable information from children under 13. In the case I discover that a child under 13 has provided me with personal information, I immediately delete this from my servers. If you are a parent or guardian and you are aware that your child has provided me with personal information, please contact me so that I will be able to do necessary actions. ### Changes to This Privacy Policy I may update this Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page. These changes are effective immediately after they are posted on this page. ### Contact Me If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me. This privacy policy page was created at [privacypolicytemplate.net](https://privacypolicytemplate.net) and modified/generated by [App Privacy Policy Generator](https://app-privacy-policy-generator.firebaseapp.com).
cdeange/hubbub
PRIVACY.md
Markdown
apache-2.0
4,368
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Tue Aug 14 15:31:51 MST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Class org.wildfly.swarm.config.ejb3.AsyncService (BOM: * : All 2.1.0.Final API)</title> <meta name="date" content="2018-08-14"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.wildfly.swarm.config.ejb3.AsyncService (BOM: * : All 2.1.0.Final API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncService.html" title="class in org.wildfly.swarm.config.ejb3">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.1.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/ejb3/class-use/AsyncService.html" target="_top">Frames</a></li> <li><a href="AsyncService.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.wildfly.swarm.config.ejb3.AsyncService" class="title">Uses of Class<br>org.wildfly.swarm.config.ejb3.AsyncService</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncService.html" title="class in org.wildfly.swarm.config.ejb3">AsyncService</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config">org.wildfly.swarm.config</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.ejb3">org.wildfly.swarm.config.ejb3</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.wildfly.swarm.config"> <!-- --> </a> <h3>Uses of <a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncService.html" title="class in org.wildfly.swarm.config.ejb3">AsyncService</a> in <a href="../../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a> that return <a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncService.html" title="class in org.wildfly.swarm.config.ejb3">AsyncService</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncService.html" title="class in org.wildfly.swarm.config.ejb3">AsyncService</a></code></td> <td class="colLast"><span class="typeNameLabel">EJB3.EJB3Resources.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/EJB3.EJB3Resources.html#asyncService--">asyncService</a></span>()</code> <div class="block">The EJB3 Asynchronous Invocation Service</div> </td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a> with parameters of type <a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncService.html" title="class in org.wildfly.swarm.config.ejb3">AsyncService</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/wildfly/swarm/config/EJB3.html" title="type parameter in EJB3">T</a></code></td> <td class="colLast"><span class="typeNameLabel">EJB3.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/EJB3.html#asyncService-org.wildfly.swarm.config.ejb3.AsyncService-">asyncService</a></span>(<a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncService.html" title="class in org.wildfly.swarm.config.ejb3">AsyncService</a>&nbsp;value)</code> <div class="block">The EJB3 Asynchronous Invocation Service</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.wildfly.swarm.config.ejb3"> <!-- --> </a> <h3>Uses of <a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncService.html" title="class in org.wildfly.swarm.config.ejb3">AsyncService</a> in <a href="../../../../../../org/wildfly/swarm/config/ejb3/package-summary.html">org.wildfly.swarm.config.ejb3</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../../org/wildfly/swarm/config/ejb3/package-summary.html">org.wildfly.swarm.config.ejb3</a> with type parameters of type <a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncService.html" title="class in org.wildfly.swarm.config.ejb3">AsyncService</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncService.html" title="class in org.wildfly.swarm.config.ejb3">AsyncService</a>&lt;T extends <a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncService.html" title="class in org.wildfly.swarm.config.ejb3">AsyncService</a>&lt;T&gt;&gt;</span></code> <div class="block">The EJB3 Asynchronous Invocation Service</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>interface&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncServiceConsumer.html" title="interface in org.wildfly.swarm.config.ejb3">AsyncServiceConsumer</a>&lt;T extends <a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncService.html" title="class in org.wildfly.swarm.config.ejb3">AsyncService</a>&lt;T&gt;&gt;</span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>interface&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncServiceSupplier.html" title="interface in org.wildfly.swarm.config.ejb3">AsyncServiceSupplier</a>&lt;T extends <a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncService.html" title="class in org.wildfly.swarm.config.ejb3">AsyncService</a>&gt;</span></code>&nbsp;</td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../org/wildfly/swarm/config/ejb3/package-summary.html">org.wildfly.swarm.config.ejb3</a> that return <a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncService.html" title="class in org.wildfly.swarm.config.ejb3">AsyncService</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncService.html" title="class in org.wildfly.swarm.config.ejb3">AsyncService</a></code></td> <td class="colLast"><span class="typeNameLabel">AsyncServiceSupplier.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncServiceSupplier.html#get--">get</a></span>()</code> <div class="block">Constructed instance of AsyncService resource</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/wildfly/swarm/config/ejb3/AsyncService.html" title="class in org.wildfly.swarm.config.ejb3">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.1.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/ejb3/class-use/AsyncService.html" target="_top">Frames</a></li> <li><a href="AsyncService.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2018 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
wildfly-swarm/wildfly-swarm-javadocs
2.1.0.Final/apidocs/org/wildfly/swarm/config/ejb3/class-use/AsyncService.html
HTML
apache-2.0
12,101
//===--- Requests.cpp -----------------------------------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// #include "DictionaryKeys.h" #include "sourcekitd/CodeCompletionResultsArray.h" #include "sourcekitd/DocStructureArray.h" #include "sourcekitd/DocSupportAnnotationArray.h" #include "sourcekitd/TokenAnnotationsArray.h" #include "SourceKit/Core/Context.h" #include "SourceKit/Core/LangSupport.h" #include "SourceKit/Core/NotificationCenter.h" #include "SourceKit/Support/Concurrency.h" #include "SourceKit/Support/Logging.h" #include "SourceKit/Support/Statistic.h" #include "SourceKit/Support/Tracing.h" #include "SourceKit/Support/UIdent.h" #include "SourceKit/SwiftLang/Factory.h" #include "swift/Basic/ExponentialGrowthAppendingBinaryByteStream.h" #include "swift/Basic/Mangler.h" #include "swift/Demangling/Demangler.h" #include "swift/Demangling/ManglingMacros.h" #include "swift/Syntax/Serialization/SyntaxSerialization.h" #include "swift/Syntax/SyntaxNodes.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/BinaryByteStream.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/NativeFormatting.h" #include "llvm/Support/Path.h" #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/raw_ostream.h" #include <mutex> // FIXME: Portability. #include <dispatch/dispatch.h> using namespace sourcekitd; using namespace SourceKit; namespace { class LazySKDUID { const char *Name; mutable std::atomic<sourcekitd_uid_t> UID { nullptr }; public: LazySKDUID(const char *Name) : Name(Name) { } sourcekitd_uid_t get() const { sourcekitd_uid_t UIDValue = UID; if (!UIDValue) UID = SKDUIDFromUIdent(UIdent(Name)); return UID; } operator sourcekitd_uid_t() const { return get(); } StringRef str() const { return StringRef(Name); } }; struct SKEditorConsumerOptions { bool EnableSyntaxMap = false; bool EnableStructure = false; bool EnableDiagnostics = false; SyntaxTreeTransferMode SyntaxTransferMode = SyntaxTreeTransferMode::Off; SyntaxTreeSerializationFormat SyntaxSerializationFormat = SyntaxTreeSerializationFormat::JSON; bool SyntacticOnly = false; }; } // anonymous namespace #define REQUEST(NAME, CONTENT) static LazySKDUID Request##NAME(CONTENT); #define KIND(NAME, CONTENT) static LazySKDUID Kind##NAME(CONTENT); #include "SourceKit/Core/ProtocolUIDs.def" #define REFACTORING(KIND, NAME, ID) static LazySKDUID Kind##Refactoring##KIND("source.refactoring.kind."#ID); #include "swift/IDE/RefactoringKinds.def" static void onDocumentUpdateNotification(StringRef DocumentName) { static UIdent DocumentUpdateNotificationUID( "source.notification.editor.documentupdate"); ResponseBuilder RespBuilder; auto Dict = RespBuilder.getDictionary(); Dict.set(KeyNotification, DocumentUpdateNotificationUID); Dict.set(KeyName, DocumentName); sourcekitd::postNotification(RespBuilder.createResponse()); } static SourceKit::Context *GlobalCtx = nullptr; void sourcekitd::initialize() { llvm::EnablePrettyStackTrace(); GlobalCtx = new SourceKit::Context(sourcekitd::getRuntimeLibPath(), SourceKit::createSwiftLangSupport); GlobalCtx->getNotificationCenter().addDocumentUpdateNotificationReceiver( onDocumentUpdateNotification); } void sourcekitd::shutdown() { delete GlobalCtx; GlobalCtx = nullptr; } static SourceKit::Context &getGlobalContext() { assert(GlobalCtx); return *GlobalCtx; } static sourcekitd_response_t demangleNames(ArrayRef<const char *> MangledNames, bool Simplified); static sourcekitd_response_t mangleSimpleClassNames(ArrayRef<std::pair<StringRef, StringRef>> ModuleClassPairs); static sourcekitd_response_t indexSource(StringRef Filename, ArrayRef<const char *> Args, StringRef KnownHash); static sourcekitd_response_t reportDocInfo(llvm::MemoryBuffer *InputBuf, StringRef ModuleName, ArrayRef<const char *> Args); static void reportCursorInfo(const CursorInfoData &Info, ResponseReceiver Rec); static void reportRangeInfo(const RangeInfo &Info, ResponseReceiver Rec); static void reportNameInfo(const NameTranslatingInfo &Info, ResponseReceiver Rec); static void findRelatedIdents(StringRef Filename, int64_t Offset, bool CancelOnSubsequentRequest, ArrayRef<const char *> Args, ResponseReceiver Rec); static sourcekitd_response_t codeComplete(llvm::MemoryBuffer *InputBuf, int64_t Offset, ArrayRef<const char *> Args); static sourcekitd_response_t codeCompleteOpen(StringRef name, llvm::MemoryBuffer *InputBuf, int64_t Offset, Optional<RequestDict> optionsDict, ArrayRef<const char *> Args); static sourcekitd_response_t codeCompleteUpdate(StringRef name, int64_t Offset, Optional<RequestDict> optionsDict); static sourcekitd_response_t codeCompleteClose(StringRef name, int64_t Offset); static sourcekitd_response_t editorOpen(StringRef Name, llvm::MemoryBuffer *Buf, SKEditorConsumerOptions Opts, ArrayRef<const char *> Args); static sourcekitd_response_t editorOpenInterface(StringRef Name, StringRef ModuleName, Optional<StringRef> Group, ArrayRef<const char *> Args, bool SynthesizedExtensions, Optional<StringRef> InterestedUSR); static sourcekitd_response_t editorOpenHeaderInterface(StringRef Name, StringRef HeaderName, ArrayRef<const char *> Args, bool UsingSwiftArgs, bool SynthesizedExtensions, StringRef swiftVersion); static void editorOpenSwiftSourceInterface(StringRef Name, StringRef SourceName, ArrayRef<const char *> Args, ResponseReceiver Rec); static void editorOpenSwiftTypeInterface(StringRef TypeUsr, ArrayRef<const char *> Args, ResponseReceiver Rec); static sourcekitd_response_t editorExtractTextFromComment(StringRef Source); static sourcekitd_response_t editorConvertMarkupToXML(StringRef Source); static sourcekitd_response_t editorClose(StringRef Name, bool RemoveCache); static sourcekitd_response_t editorReplaceText(StringRef Name, llvm::MemoryBuffer *Buf, unsigned Offset, unsigned Length, SKEditorConsumerOptions Opts); static void editorApplyFormatOptions(StringRef Name, RequestDict &FmtOptions); static sourcekitd_response_t editorFormatText(StringRef Name, unsigned Line, unsigned Length); static sourcekitd_response_t editorExpandPlaceholder(StringRef Name, unsigned Offset, unsigned Length); static sourcekitd_response_t editorFindUSR(StringRef DocumentName, StringRef USR); static sourcekitd_response_t editorFindInterfaceDoc(StringRef ModuleName, ArrayRef<const char *> Args); static sourcekitd_response_t editorFindModuleGroups(StringRef ModuleName, ArrayRef<const char *> Args); static bool buildRenameLocationsFromDict(RequestDict &Req, bool UseNewName, std::vector<RenameLocations> &RenameLocations, llvm::SmallString<64> &Error); static sourcekitd_response_t createCategorizedEditsResponse(ArrayRef<CategorizedEdits> AllEdits, StringRef Error); static sourcekitd_response_t syntacticRename(llvm::MemoryBuffer *InputBuf, ArrayRef<RenameLocations> RenameLocations, ArrayRef<const char*> Args); static sourcekitd_response_t createCategorizedRenameRangesResponse(ArrayRef<CategorizedRenameRanges> Ranges, StringRef Error); static sourcekitd_response_t findRenameRanges(llvm::MemoryBuffer *InputBuf, ArrayRef<RenameLocations> RenameLocations, ArrayRef<const char *> Args); static bool isSemanticEditorDisabled(); static void fillDictionaryForDiagnosticInfo( ResponseBuilder::Dictionary Elem, const DiagnosticEntryInfo &Info); static void enableCompileNotifications(bool value); static SyntaxTreeTransferMode syntaxTransferModeFromUID(sourcekitd_uid_t UID) { if (UID == nullptr) { // Default is no syntax tree return SyntaxTreeTransferMode::Off; } else if (UID == KindSyntaxTreeOff) { return SyntaxTreeTransferMode::Off; } else if (UID == KindSyntaxTreeIncremental) { return SyntaxTreeTransferMode::Incremental; } else if (UID == KindSyntaxTreeFull) { return SyntaxTreeTransferMode::Full; } else { llvm_unreachable("Unexpected syntax tree transfer mode"); } } static llvm::Optional<SyntaxTreeSerializationFormat> syntaxSerializationFormatFromUID(sourcekitd_uid_t UID) { if (UID == nullptr) { // Default is JSON return SyntaxTreeSerializationFormat::JSON; } else if (UID == KindSyntaxTreeSerializationJSON) { return SyntaxTreeSerializationFormat::JSON; } else if (UID == KindSyntaxTreeSerializationByteTree) { return SyntaxTreeSerializationFormat::ByteTree; } else { return llvm::None; } } static void handleRequestImpl(sourcekitd_object_t Req, ResponseReceiver Receiver); void sourcekitd::handleRequest(sourcekitd_object_t Req, ResponseReceiver Receiver) { LOG_SECTION("handleRequest-before", InfoHighPrio) { sourcekitd::printRequestObject(Req, Log->getOS()); } handleRequestImpl(Req, [Receiver](sourcekitd_response_t Resp) { LOG_SECTION("handleRequest-after", InfoHighPrio) { // Responses are big, print them out with info medium priority. if (Logger::isLoggingEnabledForLevel(Logger::Level::InfoMediumPrio)) sourcekitd::printResponse(Resp, Log->getOS()); } Receiver(Resp); }); } static std::unique_ptr<llvm::MemoryBuffer> getInputBufForRequest(Optional<StringRef> SourceFile, Optional<StringRef> SourceText, llvm::SmallString<64> &ErrBuf) { std::unique_ptr<llvm::MemoryBuffer> InputBuf; if (SourceText.hasValue()) { StringRef BufName; if (SourceFile.hasValue()) BufName = *SourceFile; else BufName = "<input>"; InputBuf = llvm::MemoryBuffer::getMemBuffer(*SourceText, BufName); } else if (SourceFile.hasValue()) { llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> FileBufOrErr = llvm::MemoryBuffer::getFile(*SourceFile); if (FileBufOrErr) { InputBuf = std::move(FileBufOrErr.get()); } else { llvm::raw_svector_ostream OSErr(ErrBuf); OSErr << "error opening input file '" << *SourceFile << "' (" << FileBufOrErr.getError().message() << ')'; return nullptr; } } else { InputBuf = llvm::WritableMemoryBuffer::getNewMemBuffer(0, "<input>"); } return InputBuf; } static void handleSemanticRequest(RequestDict Req, ResponseReceiver Receiver, sourcekitd_uid_t ReqUID, Optional<StringRef> SourceFile, Optional<StringRef> SourceText, ArrayRef<const char *> Args); void handleRequestImpl(sourcekitd_object_t ReqObj, ResponseReceiver Rec) { // NOTE: if we had a connection context, these stats should move into it. static Statistic numRequests(UIdentFromSKDUID(KindStatNumRequests), "# of requests (total)"); static Statistic numSemaRequests(UIdentFromSKDUID(KindStatNumSemaRequests), "# of semantic requests"); ++numRequests; RequestDict Req(ReqObj); sourcekitd_uid_t ReqUID = Req.getUID(KeyRequest); if (!ReqUID) return Rec(createErrorRequestInvalid("missing 'key.request' with UID value")); if (ReqUID == RequestProtocolVersion) { ResponseBuilder RB; auto dict = RB.getDictionary(); dict.set(KeyVersionMajor, ProtocolMajorVersion); dict.set(KeyVersionMinor, static_cast<int64_t>(ProtocolMinorVersion)); return Rec(RB.createResponse()); } if (ReqUID == RequestCrashWithExit) { // 'exit' has the same effect as crashing but without the crash log. ::exit(1); } if (ReqUID == RequestTestNotification) { static UIdent TestNotification("source.notification.test"); ResponseBuilder RespBuilder; auto Dict = RespBuilder.getDictionary(); Dict.set(KeyNotification, TestNotification); sourcekitd::postNotification(RespBuilder.createResponse()); return Rec(ResponseBuilder().createResponse()); } if (ReqUID == RequestDemangle) { SmallVector<const char *, 8> MangledNames; bool Failed = Req.getStringArray(KeyNames, MangledNames, /*isOptional=*/true); if (Failed) { return Rec(createErrorRequestInvalid( "'key.names' not an array of strings")); } int64_t Simplified = false; Req.getInt64(KeySimplified, Simplified, /*isOptional=*/true); return Rec(demangleNames(MangledNames, Simplified)); } if (ReqUID == RequestMangleSimpleClass) { SmallVector<std::pair<StringRef, StringRef>, 16> ModuleClassPairs; sourcekitd_response_t err = nullptr; bool failed = Req.dictionaryArrayApply(KeyNames, [&](RequestDict dict) { Optional<StringRef> ModuleName = dict.getString(KeyModuleName); if (!ModuleName.hasValue()) { err = createErrorRequestInvalid("missing 'key.modulename'"); return true; } Optional<StringRef> ClassName = dict.getString(KeyName); if (!ClassName.hasValue()) { err = createErrorRequestInvalid("missing 'key.name'"); return true; } ModuleClassPairs.push_back(std::make_pair(*ModuleName, *ClassName)); return false; }); if (failed) { if (!err) err = createErrorRequestInvalid("missing 'key.names'"); return Rec(err); } return Rec(mangleSimpleClassNames(ModuleClassPairs)); } if (ReqUID == RequestEnableCompileNotifications) { int64_t value = true; if (Req.getInt64(KeyValue, value, /*isOptional=*/false)) { return Rec(createErrorRequestInvalid("missing 'key.value'")); } enableCompileNotifications(value); return Rec(ResponseBuilder().createResponse()); } // Just accept 'source.request.buildsettings.register' for now, don't do // anything else. // FIXME: Heavy WIP here. if (ReqUID == RequestBuildSettingsRegister) { return Rec(ResponseBuilder().createResponse()); } Optional<StringRef> SourceFile = Req.getString(KeySourceFile); Optional<StringRef> SourceText = Req.getString(KeySourceText); llvm::SmallString<64> ErrBuf; SmallVector<const char *, 8> Args; bool Failed = Req.getStringArray(KeyCompilerArgs, Args, /*isOptional=*/true); if (Failed) { return Rec(createErrorRequestInvalid( "'key.compilerargs' not an array of strings")); } if (ReqUID == RequestDocInfo) { std::unique_ptr<llvm::MemoryBuffer> InputBuf = getInputBufForRequest(SourceFile, SourceText, ErrBuf); if (!InputBuf) return Rec(createErrorRequestFailed(ErrBuf.c_str())); StringRef ModuleName; Optional<StringRef> ModuleNameOpt = Req.getString(KeyModuleName); if (ModuleNameOpt.hasValue()) ModuleName = *ModuleNameOpt; return Rec(reportDocInfo(InputBuf.get(), ModuleName, Args)); } if (ReqUID == RequestEditorOpen) { Optional<StringRef> Name = Req.getString(KeyName); if (!Name.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.name'")); std::unique_ptr<llvm::MemoryBuffer> InputBuf = getInputBufForRequest(SourceFile, SourceText, ErrBuf); if (!InputBuf) return Rec(createErrorRequestFailed(ErrBuf.c_str())); int64_t EnableSyntaxMap = true; Req.getInt64(KeyEnableSyntaxMap, EnableSyntaxMap, /*isOptional=*/true); int64_t EnableStructure = true; Req.getInt64(KeyEnableStructure, EnableStructure, /*isOptional=*/true); int64_t EnableDiagnostics = true; Req.getInt64(KeyEnableDiagnostics, EnableDiagnostics, /*isOptional=*/true); auto TransferModeUID = Req.getUID(KeySyntaxTreeTransferMode); auto SerializationFormatUID = Req.getUID(KeySyntaxTreeSerializationFormat); int64_t SyntacticOnly = false; Req.getInt64(KeySyntacticOnly, SyntacticOnly, /*isOptional=*/true); SKEditorConsumerOptions Opts; Opts.EnableSyntaxMap = EnableSyntaxMap; Opts.EnableStructure = EnableStructure; Opts.EnableDiagnostics = EnableDiagnostics; Opts.SyntaxTransferMode = syntaxTransferModeFromUID(TransferModeUID); auto SyntaxSerializationFormat = syntaxSerializationFormatFromUID(SerializationFormatUID); if (!SyntaxSerializationFormat) return Rec(createErrorRequestFailed("Invalid serialization format")); Opts.SyntaxSerializationFormat = SyntaxSerializationFormat.getValue(); Opts.SyntacticOnly = SyntacticOnly; return Rec(editorOpen(*Name, InputBuf.get(), Opts, Args)); } if (ReqUID == RequestEditorClose) { Optional<StringRef> Name = Req.getString(KeyName); if (!Name.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.name'")); // Whether we remove the cached AST from libcache, by default, false. int64_t RemoveCache = false; Req.getInt64(KeyRemoveCache, RemoveCache, /*isOptional=*/true); return Rec(editorClose(*Name, RemoveCache)); } if (ReqUID == RequestEditorReplaceText) { Optional<StringRef> Name = Req.getString(KeyName); if (!Name.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.name'")); std::unique_ptr<llvm::MemoryBuffer> InputBuf = getInputBufForRequest(SourceFile, SourceText, ErrBuf); if (!InputBuf) return Rec(createErrorRequestFailed(ErrBuf.c_str())); int64_t Offset = 0; Req.getInt64(KeyOffset, Offset, /*isOptional=*/true); int64_t Length = 0; Req.getInt64(KeyLength, Length, /*isOptional=*/true); int64_t EnableSyntaxMap = true; Req.getInt64(KeyEnableSyntaxMap, EnableSyntaxMap, /*isOptional=*/true); int64_t EnableStructure = true; Req.getInt64(KeyEnableStructure, EnableStructure, /*isOptional=*/true); int64_t EnableDiagnostics = true; Req.getInt64(KeyEnableDiagnostics, EnableDiagnostics, /*isOptional=*/true); int64_t SyntacticOnly = false; Req.getInt64(KeySyntacticOnly, SyntacticOnly, /*isOptional=*/true); auto TransferModeUID = Req.getUID(KeySyntaxTreeTransferMode); auto SerializationFormatUID = Req.getUID(KeySyntaxTreeSerializationFormat); SKEditorConsumerOptions Opts; Opts.EnableSyntaxMap = EnableSyntaxMap; Opts.EnableStructure = EnableStructure; Opts.EnableDiagnostics = EnableDiagnostics; Opts.SyntaxTransferMode = syntaxTransferModeFromUID(TransferModeUID); auto SyntaxSerializationFormat = syntaxSerializationFormatFromUID(SerializationFormatUID); if (!SyntaxSerializationFormat) return Rec(createErrorRequestFailed("Invalid serialization format")); Opts.SyntaxSerializationFormat = SyntaxSerializationFormat.getValue(); Opts.SyntacticOnly = SyntacticOnly; return Rec(editorReplaceText(*Name, InputBuf.get(), Offset, Length, Opts)); } if (ReqUID == RequestEditorFormatText) { Optional<StringRef> Name = Req.getString(KeyName); if (!Name.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.name'")); Optional<RequestDict> FmtOptions = Req.getDictionary(KeyFormatOptions); if (FmtOptions.hasValue()) editorApplyFormatOptions(*Name, *FmtOptions); int64_t Line = 0; Req.getInt64(KeyLine, Line, /*isOptional=*/false); int64_t Length = 0; Req.getInt64(KeyLength, Length, /*isOptional=*/true); return Rec(editorFormatText(*Name, Line, Length)); } if (ReqUID == RequestEditorExpandPlaceholder) { Optional<StringRef> Name = Req.getString(KeyName); if (!Name.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.name'")); int64_t Offset = 0; Req.getInt64(KeyOffset, Offset, /*isOptional=*/false); int64_t Length = 0; Req.getInt64(KeyLength, Length, /*isOptional=*/false); return Rec(editorExpandPlaceholder(*Name, Offset, Length)); } if (ReqUID == RequestEditorOpenInterface) { Optional<StringRef> Name = Req.getString(KeyName); if (!Name.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.name'")); Optional<StringRef> ModuleName = Req.getString(KeyModuleName); if (!ModuleName.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.modulename'")); Optional<StringRef> GroupName = Req.getString(KeyGroupName); int64_t SynthesizedExtension = false; Req.getInt64(KeySynthesizedExtension, SynthesizedExtension, /*isOptional=*/true); Optional<StringRef> InterestedUSR = Req.getString(KeyInterestedUSR); return Rec(editorOpenInterface(*Name, *ModuleName, GroupName, Args, SynthesizedExtension, InterestedUSR)); } if (ReqUID == RequestEditorOpenHeaderInterface) { Optional<StringRef> Name = Req.getString(KeyName); if (!Name.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.name'")); Optional<StringRef> HeaderName = Req.getString(KeyFilePath); if (!HeaderName.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.filepath'")); int64_t SynthesizedExtension = false; Req.getInt64(KeySynthesizedExtension, SynthesizedExtension, /*isOptional=*/true); Optional<int64_t> UsingSwiftArgs = Req.getOptionalInt64(KeyUsingSwiftArgs); std::string swiftVer; Optional<StringRef> swiftVerValStr = Req.getString(KeySwiftVersion); if (swiftVerValStr.hasValue()) { swiftVer = swiftVerValStr.getValue(); } else { Optional<int64_t> swiftVerVal = Req.getOptionalInt64(KeySwiftVersion); if (swiftVerVal.hasValue()) swiftVer = std::to_string(*swiftVerVal); } return Rec(editorOpenHeaderInterface(*Name, *HeaderName, Args, UsingSwiftArgs.getValueOr(false), SynthesizedExtension, swiftVer)); } if (ReqUID == RequestEditorOpenSwiftSourceInterface) { Optional<StringRef> Name = Req.getString(KeyName); if (!Name.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.name'")); Optional<StringRef> FileName = Req.getString(KeySourceFile); if (!FileName.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.sourcefile'")); return editorOpenSwiftSourceInterface(*Name, *FileName, Args, Rec); } if (ReqUID == RequestEditorOpenSwiftTypeInterface) { Optional<StringRef> Usr = Req.getString(KeyUSR); if (!Usr.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.usr'")); return editorOpenSwiftTypeInterface(*Usr, Args, Rec); } if (ReqUID == RequestEditorExtractTextFromComment) { Optional<StringRef> Source = Req.getString(KeySourceText); if (!Source.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.sourcetext'")); return Rec(editorExtractTextFromComment(Source.getValue())); } if (ReqUID == RequestMarkupToXML) { Optional<StringRef> Source = Req.getString(KeySourceText); if (!Source.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.sourcetext'")); return Rec(editorConvertMarkupToXML(Source.getValue())); } if (ReqUID == RequestEditorFindUSR) { Optional<StringRef> Name = Req.getString(KeySourceFile); if (!Name.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.sourcefile'")); Optional<StringRef> USR = Req.getString(KeyUSR); if (!USR.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.usr'")); return Rec(editorFindUSR(*Name, *USR)); } if (ReqUID == RequestEditorFindInterfaceDoc) { Optional<StringRef> ModuleName = Req.getString(KeyModuleName); if (!ModuleName.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.modulename'")); return Rec(editorFindInterfaceDoc(*ModuleName, Args)); } if (ReqUID == RequestModuleGroups) { Optional<StringRef> ModuleName = Req.getString(KeyModuleName); if (!ModuleName.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.modulename'")); return Rec(editorFindModuleGroups(*ModuleName, Args)); } if (ReqUID == RequestSyntacticRename) { std::unique_ptr<llvm::MemoryBuffer> InputBuf = getInputBufForRequest(SourceFile, SourceText, ErrBuf); if (!InputBuf) return Rec(createErrorRequestFailed(ErrBuf.c_str())); std::vector<RenameLocations> RenameLocations; if (buildRenameLocationsFromDict(Req, true, RenameLocations, ErrBuf)) return Rec(createErrorRequestFailed(ErrBuf.c_str())); return Rec(syntacticRename(InputBuf.get(), RenameLocations, Args)); } if (ReqUID == RequestFindRenameRanges) { std::unique_ptr<llvm::MemoryBuffer> InputBuf = getInputBufForRequest(SourceFile, SourceText, ErrBuf); if (!InputBuf) return Rec(createErrorRequestFailed(ErrBuf.c_str())); std::vector<RenameLocations> RenameLocations; if (buildRenameLocationsFromDict(Req, false, RenameLocations, ErrBuf)) return Rec(createErrorRequestFailed(ErrBuf.c_str())); return Rec(findRenameRanges(InputBuf.get(), RenameLocations, Args)); } if (ReqUID == RequestCodeCompleteClose) { // Unlike opening code completion, this is not a semantic request. Optional<StringRef> Name = Req.getString(KeyName); if (!Name.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.name'")); int64_t Offset; if (Req.getInt64(KeyOffset, Offset, /*isOptional=*/false)) return Rec(createErrorRequestInvalid("missing 'key.offset'")); return Rec(codeCompleteClose(*Name, Offset)); } if (ReqUID == RequestCodeCompleteCacheOnDisk) { Optional<StringRef> Name = Req.getString(KeyName); if (!Name.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.name'")); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.codeCompleteCacheOnDisk(*Name); ResponseBuilder b; return Rec(b.createResponse()); } if (ReqUID == RequestCodeCompleteSetPopularAPI) { llvm::SmallVector<const char *, 0> popular; llvm::SmallVector<const char *, 0> unpopular; Req.getStringArray(KeyPopular, popular, /*isOptional=*/false); Req.getStringArray(KeyUnpopular, unpopular, /*isOptional=*/false); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.codeCompleteSetPopularAPI(popular, unpopular); ResponseBuilder b; return Rec(b.createResponse()); } if (ReqUID == RequestCodeCompleteSetCustom) { SmallVector<CustomCompletionInfo, 16> customCompletions; sourcekitd_response_t err = nullptr; bool failed = Req.dictionaryArrayApply(KeyResults, [&](RequestDict dict) { CustomCompletionInfo CCInfo; Optional<StringRef> Name = dict.getString(KeyName); if (!Name.hasValue()) { err = createErrorRequestInvalid("missing 'key.name'"); return true; } CCInfo.Name = *Name; sourcekitd_uid_t Kind = dict.getUID(KeyKind); if (!Kind) { err = createErrorRequestInvalid("missing 'key.kind'"); return true; } CCInfo.Kind = Kind; SmallVector<sourcekitd_uid_t, 3> contexts; if (dict.getUIDArray(KeyContext, contexts, false)) { err = createErrorRequestInvalid("missing 'key.context'"); return true; } for (auto context : contexts) { if (context == KindExpr) { CCInfo.Contexts |= CustomCompletionInfo::Expr; } else if (context == KindStmt) { CCInfo.Contexts |= CustomCompletionInfo::Stmt; } else if (context == KindType) { CCInfo.Contexts |= CustomCompletionInfo::Type; } else if (context == KindForEachSequence) { CCInfo.Contexts |= CustomCompletionInfo::ForEachSequence; } else { err = createErrorRequestInvalid("invalid value for 'key.context'"); return true; } } customCompletions.push_back(std::move(CCInfo)); return false; }); if (failed) { if (!err) err = createErrorRequestInvalid("missing 'key.results'"); return Rec(err); } LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.codeCompleteSetCustom(customCompletions); return Rec(ResponseBuilder().createResponse()); } if (ReqUID == RequestStatistics) { LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.getStatistics([Rec](ArrayRef<Statistic *> stats) { ResponseBuilder builder; auto results = builder.getDictionary().setArray(KeyResults); auto addStat = [&results](Statistic *stat) { auto dict = results.appendDictionary(); dict.set(KeyKind, stat->name); dict.set(KeyDescription, stat->description); dict.set(KeyValue, stat->value); }; addStat(&numRequests); addStat(&numSemaRequests); std::for_each(stats.begin(), stats.end(), addStat); Rec(builder.createResponse()); }); return; } if (!SourceFile.hasValue() && !SourceText.hasValue() && ReqUID != RequestCodeCompleteUpdate) return Rec(createErrorRequestInvalid( "missing 'key.sourcefile' or 'key.sourcetext'")); // Requests that need semantic typechecking. // Typechecking arrays can blow up the stack currently. // Run them under a malloc'ed stack. static WorkQueue SemaQueue{ WorkQueue::Dequeuing::Concurrent, "sourcekit.request.semantic" }; sourcekitd_request_retain(ReqObj); ++numSemaRequests; SemaQueue.dispatch( [ReqObj, Rec, ReqUID, SourceFile, SourceText, Args] { RequestDict Req(ReqObj); handleSemanticRequest(Req, Rec, ReqUID, SourceFile, SourceText, Args); sourcekitd_request_release(ReqObj); }, /*isStackDeep=*/true); } static void handleSemanticRequest(RequestDict Req, ResponseReceiver Rec, sourcekitd_uid_t ReqUID, Optional<StringRef> SourceFile, Optional<StringRef> SourceText, ArrayRef<const char *> Args) { llvm::SmallString<64> ErrBuf; if (isSemanticEditorDisabled()) return Rec(createErrorRequestFailed("semantic editor is disabled")); if (ReqUID == RequestCodeComplete) { std::unique_ptr<llvm::MemoryBuffer> InputBuf = getInputBufForRequest(SourceFile, SourceText, ErrBuf); if (!InputBuf) return Rec(createErrorRequestFailed(ErrBuf.c_str())); int64_t Offset; if (Req.getInt64(KeyOffset, Offset, /*isOptional=*/false)) return Rec(createErrorRequestInvalid("missing 'key.offset'")); return Rec(codeComplete(InputBuf.get(), Offset, Args)); } if (ReqUID == RequestCodeCompleteOpen) { std::unique_ptr<llvm::MemoryBuffer> InputBuf = getInputBufForRequest(SourceFile, SourceText, ErrBuf); if (!InputBuf) return Rec(createErrorRequestFailed(ErrBuf.c_str())); Optional<StringRef> Name = Req.getString(KeyName); if (!Name.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.name'")); int64_t Offset; if (Req.getInt64(KeyOffset, Offset, /*isOptional=*/false)) return Rec(createErrorRequestInvalid("missing 'key.offset'")); Optional<RequestDict> options = Req.getDictionary(KeyCodeCompleteOptions); return Rec(codeCompleteOpen(*Name, InputBuf.get(), Offset, options, Args)); } if (ReqUID == RequestCodeCompleteUpdate) { Optional<StringRef> Name = Req.getString(KeyName); if (!Name.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.name'")); int64_t Offset; if (Req.getInt64(KeyOffset, Offset, /*isOptional=*/false)) return Rec(createErrorRequestInvalid("missing 'key.offset'")); Optional<RequestDict> options = Req.getDictionary(KeyCodeCompleteOptions); return Rec(codeCompleteUpdate(*Name, Offset, options)); } if (!SourceFile.hasValue()) return Rec(createErrorRequestInvalid("missing 'key.sourcefile'")); if (ReqUID == RequestIndex) { StringRef Hash; Optional<StringRef> HashOpt = Req.getString(KeyHash); if (HashOpt.hasValue()) Hash = *HashOpt; return Rec(indexSource(*SourceFile, Args, Hash)); } if (ReqUID == RequestCursorInfo) { LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); // For backwards compatibility, the default is 1. int64_t CancelOnSubsequentRequest = 1; Req.getInt64(KeyCancelOnSubsequentRequest, CancelOnSubsequentRequest, /*isOptional=*/true); int64_t Offset; if (!Req.getInt64(KeyOffset, Offset, /*isOptional=*/false)) { int64_t Length = 0; Req.getInt64(KeyLength, Length, /*isOptional=*/true); int64_t Actionables = false; Req.getInt64(KeyRetrieveRefactorActions, Actionables, /*isOptional=*/true); return Lang.getCursorInfo( *SourceFile, Offset, Length, Actionables, CancelOnSubsequentRequest, Args, [Rec](const CursorInfoData &Info) { reportCursorInfo(Info, Rec); }); } if (auto USR = Req.getString(KeyUSR)) { return Lang.getCursorInfoFromUSR( *SourceFile, *USR, CancelOnSubsequentRequest, Args, [Rec](const CursorInfoData &Info) { reportCursorInfo(Info, Rec); }); } return Rec(createErrorRequestInvalid( "either 'key.offset' or 'key.usr' is required")); } if (ReqUID == RequestRangeInfo) { LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); int64_t Offset; int64_t Length; // For backwards compatibility, the default is 1. int64_t CancelOnSubsequentRequest = 1; Req.getInt64(KeyCancelOnSubsequentRequest, CancelOnSubsequentRequest, /*isOptional=*/true); if (!Req.getInt64(KeyOffset, Offset, /*isOptional=*/false)) { if (!Req.getInt64(KeyLength, Length, /*isOptional=*/false)) { return Lang.getRangeInfo(*SourceFile, Offset, Length, CancelOnSubsequentRequest, Args, [Rec](const RangeInfo &Info) { reportRangeInfo(Info, Rec); }); } } return Rec(createErrorRequestInvalid( "'key.offset' or 'key.length' is required")); } if (ReqUID == RequestSemanticRefactoring) { int64_t Line = 0; int64_t Column = 0; int64_t Length = 0; auto KA = Req.getUID(KeyActionUID); if (!KA) { return Rec(createErrorRequestInvalid("'key.actionuid' is required")); } SemanticRefactoringInfo Info; Info.Kind = SemanticRefactoringKind::None; #define SEMANTIC_REFACTORING(KIND, NAME, ID) \ if (KA == KindRefactoring##KIND) Info.Kind = SemanticRefactoringKind::KIND; #include "swift/IDE/RefactoringKinds.def" if (Info.Kind == SemanticRefactoringKind::None) return Rec(createErrorRequestInvalid("'key.actionuid' isn't recognized")); if (!Req.getInt64(KeyLine, Line, /*isOptional=*/false)) { if (!Req.getInt64(KeyColumn, Column, /*isOptional=*/false)) { Req.getInt64(KeyLength, Length, /*isOptional=*/true); if (auto N = Req.getString(KeyName)) Info.PreferredName = *N; LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Info.Line = Line; Info.Column = Column; Info.Length = Length; return Lang.semanticRefactoring(*SourceFile, Info, Args, [Rec](ArrayRef<CategorizedEdits> CategorizedEdits, StringRef Error) { Rec(createCategorizedEditsResponse(CategorizedEdits, Error)); }); } } return Rec(createErrorRequestInvalid("'key.line' or 'key.column' are required")); } if (ReqUID == RequestFindLocalRenameRanges) { int64_t Line = 0, Column = 0, Length = 0; if (Req.getInt64(KeyLine, Line, /*isOptional=*/false)) return Rec(createErrorRequestInvalid("'key.line' is required")); if (Req.getInt64(KeyColumn, Column, /*isOptional=*/false)) return Rec(createErrorRequestInvalid("'key.column' is required")); Req.getInt64(KeyLength, Length, /*isOptional=*/true); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); return Lang.findLocalRenameRanges( *SourceFile, Line, Column, Length, Args, [Rec](ArrayRef<CategorizedRenameRanges> Ranges, StringRef Error) { Rec(createCategorizedRenameRangesResponse(Ranges, Error)); }); } if (ReqUID == RequestNameTranslation) { LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); int64_t Offset; if (Req.getInt64(KeyOffset, Offset, /*isOptional=*/false)) { return Rec(createErrorRequestInvalid("'key.offset' is required")); } NameTranslatingInfo Input; auto NK = Req.getUID(KeyNameKind); if (!NK) { return Rec(createErrorRequestInvalid("'key.namekind' is required")); } static UIdent UIDKindNameSwift(KindNameSwift.str()); static UIdent UIDKindNameObjc(KindNameObjc.str()); if (NK == KindNameSwift.get()) Input.NameKind = UIDKindNameSwift; else if (NK == KindNameObjc.get()) Input.NameKind = UIDKindNameObjc; else return Rec(createErrorRequestInvalid("'key.namekind' is unrecognizable")); if (auto Base = Req.getString(KeyBaseName)) { Input.BaseName = Base.getValue(); } llvm::SmallVector<const char*, 4> ArgParts; llvm::SmallVector<const char*, 4> Selectors; Req.getStringArray(KeyArgNames, ArgParts, true); Req.getStringArray(KeySelectorPieces, Selectors, true); if (!ArgParts.empty() && !Selectors.empty()) { return Rec(createErrorRequestInvalid("cannot specify 'key.selectorpieces' " "and 'key.argnames' at the same time")); } std::transform(ArgParts.begin(), ArgParts.end(), std::back_inserter(Input.ArgNames), [](const char *C) { return StringRef(C); }); std::transform(Selectors.begin(), Selectors.end(), std::back_inserter(Input.ArgNames), [](const char *C) { return StringRef(C); }); return Lang.getNameInfo(*SourceFile, Offset, Input, Args, [Rec](const NameTranslatingInfo &Info) { reportNameInfo(Info, Rec); }); } if (ReqUID == RequestRelatedIdents) { int64_t Offset; if (Req.getInt64(KeyOffset, Offset, /*isOptional=*/false)) return Rec(createErrorRequestInvalid("missing 'key.offset'")); // For backwards compatibility, the default is 1. int64_t CancelOnSubsequentRequest = 1; Req.getInt64(KeyCancelOnSubsequentRequest, CancelOnSubsequentRequest, /*isOptional=*/true); return findRelatedIdents(*SourceFile, Offset, CancelOnSubsequentRequest, Args, Rec); } { llvm::raw_svector_ostream OSErr(ErrBuf); OSErr << "unknown request: " << UIdentFromSKDUID(ReqUID).getName(); } return Rec(createErrorRequestInvalid(ErrBuf.c_str())); } //===----------------------------------------------------------------------===// // Index //===----------------------------------------------------------------------===// namespace { class SKIndexingConsumer : public IndexingConsumer { struct Entity { UIdent Kind; ResponseBuilder::Dictionary Data; ResponseBuilder::Array Entities; ResponseBuilder::Array Related; }; SmallVector<Entity, 6> EntitiesStack; struct Dependency { UIdent Kind; ResponseBuilder::Dictionary Data; ResponseBuilder::Array Dependencies; }; SmallVector<Dependency, 6> DependenciesStack; ResponseBuilder::Dictionary TopDict; bool Cancelled = false; public: std::string ErrorDescription; explicit SKIndexingConsumer(ResponseBuilder &RespBuilder) { TopDict = RespBuilder.getDictionary(); // First in stack is the top-level "key.entities" container. EntitiesStack.push_back( { UIdent(), TopDict, ResponseBuilder::Array(), ResponseBuilder::Array() }); DependenciesStack.push_back({UIdent(), TopDict, ResponseBuilder::Array() }); } ~SKIndexingConsumer() override { assert(Cancelled || (EntitiesStack.size() == 1 && DependenciesStack.size() == 1)); (void) Cancelled; } void failed(StringRef ErrDescription) override; bool recordHash(StringRef Hash, bool isKnown) override; bool startDependency(UIdent Kind, StringRef Name, StringRef Path, bool IsSystem, StringRef Hash) override; bool finishDependency(UIdent Kind) override; bool startSourceEntity(const EntityInfo &Info) override; bool recordRelatedEntity(const EntityInfo &Info) override; bool finishSourceEntity(UIdent Kind) override; }; } // end anonymous namespace static sourcekitd_response_t indexSource(StringRef Filename, ArrayRef<const char *> Args, StringRef KnownHash) { ResponseBuilder RespBuilder; SKIndexingConsumer IdxConsumer(RespBuilder); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.indexSource(Filename, IdxConsumer, Args, KnownHash); if (!IdxConsumer.ErrorDescription.empty()) return createErrorRequestFailed(IdxConsumer.ErrorDescription.c_str()); return RespBuilder.createResponse(); } void SKIndexingConsumer::failed(StringRef ErrDescription) { ErrorDescription = ErrDescription; } bool SKIndexingConsumer::recordHash(StringRef Hash, bool isKnown) { assert(!Hash.empty()); TopDict.set(KeyHash, Hash); if (!isKnown) { // If the hash is known key.entities should be missing otherwise it should // exist, even as an empty array, so create it here. assert(EntitiesStack.size() == 1); Entity &Top = EntitiesStack.back(); ResponseBuilder::Array &Arr = Top.Entities; assert(Arr.isNull()); Arr = Top.Data.setArray(KeyEntities); } return true; } bool SKIndexingConsumer::startDependency(UIdent Kind, StringRef Name, StringRef Path, bool IsSystem, StringRef Hash) { Dependency &Parent = DependenciesStack.back(); ResponseBuilder::Array &Arr = Parent.Dependencies; if (Arr.isNull()) Arr = Parent.Data.setArray(KeyDependencies); auto Elem = Arr.appendDictionary(); Elem.set(KeyKind, Kind); Elem.set(KeyName, Name); Elem.set(KeyFilePath, Path); if (IsSystem) Elem.setBool(KeyIsSystem, IsSystem); if (!Hash.empty()) Elem.set(KeyHash, Hash); DependenciesStack.push_back({ Kind, Elem, ResponseBuilder::Array() }); return true; } bool SKIndexingConsumer::finishDependency(UIdent Kind) { assert(DependenciesStack.back().Kind == Kind); DependenciesStack.pop_back(); return true; } bool SKIndexingConsumer::startSourceEntity(const EntityInfo &Info) { Entity &Parent = EntitiesStack.back(); ResponseBuilder::Array &Arr = Parent.Entities; if (Arr.isNull()) Arr = Parent.Data.setArray(KeyEntities); auto Elem = Arr.appendDictionary(); Elem.set(KeyKind, Info.Kind); if (!Info.Name.empty()) Elem.set(KeyName, Info.Name); if (!Info.USR.empty()) Elem.set(KeyUSR, Info.USR); if (Info.Line != 0) { assert(Info.Column != 0); Elem.set(KeyLine, Info.Line); Elem.set(KeyColumn, Info.Column); } if (!Info.Group.empty()) Elem.set(KeyGroupName, Info.Group); if (!Info.ReceiverUSR.empty()) Elem.set(KeyReceiverUSR, Info.ReceiverUSR); if (Info.IsDynamic) Elem.setBool(KeyIsDynamic, true); if (Info.IsTestCandidate) Elem.setBool(KeyIsTestCandidate, true); if (!Info.Attrs.empty()) { auto AttrArray = Elem.setArray(KeyAttributes); for (auto Attr : Info.Attrs) { auto AttrDict = AttrArray.appendDictionary(); AttrDict.set(KeyAttribute, Attr); } } EntitiesStack.push_back({ Info.Kind, Elem, ResponseBuilder::Array(), ResponseBuilder::Array()}); return true; } bool SKIndexingConsumer::recordRelatedEntity(const EntityInfo &Info) { assert(EntitiesStack.size() > 1 && "Related entity at top-level ?"); Entity &Parent = EntitiesStack.back(); ResponseBuilder::Array &Arr = Parent.Related; if (Arr.isNull()) Arr = Parent.Data.setArray(KeyRelated); auto Elem = Arr.appendDictionary(); Elem.set(KeyKind, Info.Kind); if (!Info.Name.empty()) Elem.set(KeyName, Info.Name); if (!Info.USR.empty()) Elem.set(KeyUSR, Info.USR); if (Info.Line != 0) { assert(Info.Column != 0); Elem.set(KeyLine, Info.Line); Elem.set(KeyColumn, Info.Column); } return true; } bool SKIndexingConsumer::finishSourceEntity(UIdent Kind) { Entity &CurrEnt = EntitiesStack.back(); assert(CurrEnt.Kind == Kind); (void) CurrEnt; EntitiesStack.pop_back(); return true; } //===----------------------------------------------------------------------===// // ReportDocInfo //===----------------------------------------------------------------------===// namespace { class SKDocConsumer : public DocInfoConsumer { ResponseBuilder &RespBuilder; struct Entity { UIdent Kind; ResponseBuilder::Dictionary Data; ResponseBuilder::Array Entities; ResponseBuilder::Array Inherits; ResponseBuilder::Array Conforms; ResponseBuilder::Array Attrs; }; SmallVector<Entity, 6> EntitiesStack; ResponseBuilder::Dictionary TopDict; ResponseBuilder::Array Diags; DocSupportAnnotationArrayBuilder AnnotationsBuilder; bool Cancelled = false; void addDocEntityInfoToDict(const DocEntityInfo &Info, ResponseBuilder::Dictionary Dict); public: std::string ErrorDescription; explicit SKDocConsumer(ResponseBuilder &RespBuilder) : RespBuilder(RespBuilder) { TopDict = RespBuilder.getDictionary(); // First in stack is the top-level "key.entities" container. EntitiesStack.push_back( { UIdent(), TopDict, ResponseBuilder::Array(), ResponseBuilder::Array(), ResponseBuilder::Array(), ResponseBuilder::Array() }); } ~SKDocConsumer() override { assert(Cancelled || EntitiesStack.size() == 1); (void) Cancelled; } sourcekitd_response_t createResponse() { TopDict.setCustomBuffer(KeyAnnotations, CustomBufferKind::DocSupportAnnotationArray, AnnotationsBuilder.createBuffer()); return RespBuilder.createResponse(); } void failed(StringRef ErrDescription) override; bool handleSourceText(StringRef Text) override; bool handleAnnotation(const DocEntityInfo &Info) override; bool startSourceEntity(const DocEntityInfo &Info) override; bool handleInheritsEntity(const DocEntityInfo &Info) override; bool handleConformsToEntity(const DocEntityInfo &Info) override; bool handleExtendsEntity(const DocEntityInfo &Info) override; bool handleAvailableAttribute(const AvailableAttrInfo &Info) override; bool finishSourceEntity(UIdent Kind) override; bool handleDiagnostic(const DiagnosticEntryInfo &Info) override; }; } // end anonymous namespace static sourcekitd_response_t demangleNames(ArrayRef<const char *> MangledNames, bool Simplified) { swift::Demangle::DemangleOptions DemangleOptions; if (Simplified) { DemangleOptions = swift::Demangle::DemangleOptions::SimplifiedUIDemangleOptions(); } auto getDemangledName = [&](StringRef MangledName) -> std::string { if (!swift::Demangle::isSwiftSymbol(MangledName)) return std::string(); // Not a mangled name std::string Result = swift::Demangle::demangleSymbolAsString( MangledName, DemangleOptions); if (Result == MangledName) return std::string(); // Not a mangled name return Result; }; ResponseBuilder RespBuilder; auto Arr = RespBuilder.getDictionary().setArray(KeyResults); for (auto MangledName : MangledNames) { std::string Result = getDemangledName(MangledName); auto Entry = Arr.appendDictionary(); Entry.set(KeyName, Result.c_str()); } return RespBuilder.createResponse(); } static std::string mangleSimpleClass(StringRef moduleName, StringRef className) { using namespace swift::Demangle; Demangler Dem; auto moduleNode = Dem.createNode(Node::Kind::Module, moduleName); auto IdNode = Dem.createNode(Node::Kind::Identifier, className); auto classNode = Dem.createNode(Node::Kind::Class); auto typeNode = Dem.createNode(Node::Kind::Type); auto typeManglingNode = Dem.createNode(Node::Kind::TypeMangling); auto globalNode = Dem.createNode(Node::Kind::Global); classNode->addChild(moduleNode, Dem); classNode->addChild(IdNode, Dem); typeNode->addChild(classNode, Dem); typeManglingNode->addChild(typeNode, Dem); globalNode->addChild(typeManglingNode, Dem); return mangleNode(globalNode); } static sourcekitd_response_t mangleSimpleClassNames(ArrayRef<std::pair<StringRef, StringRef>> ModuleClassPairs) { ResponseBuilder RespBuilder; auto Arr = RespBuilder.getDictionary().setArray(KeyResults); for (auto &pair : ModuleClassPairs) { std::string Result = mangleSimpleClass(pair.first, pair.second); auto Entry = Arr.appendDictionary(); Entry.set(KeyName, Result.c_str()); } return RespBuilder.createResponse(); } static sourcekitd_response_t reportDocInfo(llvm::MemoryBuffer *InputBuf, StringRef ModuleName, ArrayRef<const char *> Args) { ResponseBuilder RespBuilder; SKDocConsumer DocConsumer(RespBuilder); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.getDocInfo(InputBuf, ModuleName, Args, DocConsumer); if (!DocConsumer.ErrorDescription.empty()) return createErrorRequestFailed(DocConsumer.ErrorDescription.c_str()); return DocConsumer.createResponse(); } void SKDocConsumer::addDocEntityInfoToDict(const DocEntityInfo &Info, ResponseBuilder::Dictionary Elem) { Elem.set(KeyKind, Info.Kind); if (!Info.Name.empty()) Elem.set(KeyName, Info.Name); if (!Info.Argument.empty()) Elem.set(KeyKeyword, Info.Argument); if (!Info.SubModuleName.empty()) Elem.set(KeyModuleName, Info.SubModuleName); if (!Info.USR.empty()) Elem.set(KeyUSR, Info.USR); if (!Info.OriginalUSR.empty()) Elem.set(KeyOriginalUSR, Info.OriginalUSR); if (!Info.ProvideImplementationOfUSR.empty()) Elem.set(KeyDefaultImplementationOf, Info.ProvideImplementationOfUSR); if (Info.Length > 0) { Elem.set(KeyOffset, Info.Offset); Elem.set(KeyLength, Info.Length); } if (Info.IsUnavailable) Elem.set(KeyIsUnavailable, Info.IsUnavailable); if (Info.IsDeprecated) Elem.set(KeyIsDeprecated, Info.IsDeprecated); if (Info.IsOptional) Elem.set(KeyIsOptional, Info.IsOptional); if (!Info.DocComment.empty()) Elem.set(KeyDocFullAsXML, Info.DocComment); if (!Info.FullyAnnotatedDecl.empty()) Elem.set(KeyFullyAnnotatedDecl, Info.FullyAnnotatedDecl); if (!Info.LocalizationKey.empty()) Elem.set(KeyLocalizationKey, Info.LocalizationKey); if (!Info.GenericParams.empty()) { auto GPArray = Elem.setArray(KeyGenericParams); for (auto &GP : Info.GenericParams) { auto GPElem = GPArray.appendDictionary(); GPElem.set(KeyName, GP.Name); if (!GP.Inherits.empty()) GPElem.set(KeyInherits, GP.Inherits); } } // Note that due to protocol extensions, GenericRequirements may be non-empty // while GenericParams is empty. if (!Info.GenericRequirements.empty()) { auto ReqArray = Elem.setArray(KeyGenericRequirements); for (auto &Req : Info.GenericRequirements) { auto ReqElem = ReqArray.appendDictionary(); ReqElem.set(KeyDescription, Req); } } } void SKDocConsumer::failed(StringRef ErrDescription) { ErrorDescription = ErrDescription; } bool SKDocConsumer::handleSourceText(StringRef Text) { TopDict.set(KeySourceText, Text); return true; } bool SKDocConsumer::handleAnnotation(const DocEntityInfo &Info) { AnnotationsBuilder.add(Info); return true; } bool SKDocConsumer::startSourceEntity(const DocEntityInfo &Info) { Entity &Parent = EntitiesStack.back(); ResponseBuilder::Array &Arr = Parent.Entities; if (Arr.isNull()) Arr = Parent.Data.setArray(KeyEntities); auto Elem = Arr.appendDictionary(); addDocEntityInfoToDict(Info, Elem); EntitiesStack.push_back({ Info.Kind, Elem, ResponseBuilder::Array(), ResponseBuilder::Array(), ResponseBuilder::Array(), ResponseBuilder::Array()}); return true; } bool SKDocConsumer::handleInheritsEntity(const DocEntityInfo &Info) { assert(EntitiesStack.size() > 1 && "Related entity at top-level ?"); Entity &Parent = EntitiesStack.back(); ResponseBuilder::Array &Arr = Parent.Inherits; if (Arr.isNull()) Arr = Parent.Data.setArray(KeyInherits); addDocEntityInfoToDict(Info, Arr.appendDictionary()); return true; } bool SKDocConsumer::handleConformsToEntity(const DocEntityInfo &Info) { assert(EntitiesStack.size() > 1 && "Related entity at top-level ?"); Entity &Parent = EntitiesStack.back(); ResponseBuilder::Array &Arr = Parent.Conforms; if (Arr.isNull()) Arr = Parent.Data.setArray(KeyConforms); addDocEntityInfoToDict(Info, Arr.appendDictionary()); return true; } bool SKDocConsumer::handleExtendsEntity(const DocEntityInfo &Info) { assert(EntitiesStack.size() > 1 && "Related entity at top-level ?"); Entity &Parent = EntitiesStack.back(); addDocEntityInfoToDict(Info, Parent.Data.setDictionary(KeyExtends)); return true; } bool SKDocConsumer::handleAvailableAttribute(const AvailableAttrInfo &Info) { Entity &Parent = EntitiesStack.back(); ResponseBuilder::Array &Arr = Parent.Attrs; if (Arr.isNull()) Arr = Parent.Data.setArray(KeyAttributes); auto Elem = Arr.appendDictionary(); Elem.set(KeyKind, Info.AttrKind); if (Info.IsUnavailable) Elem.set(KeyIsUnavailable, Info.IsUnavailable); if (Info.IsDeprecated) Elem.set(KeyIsDeprecated, Info.IsDeprecated); if (Info.Platform.isValid()) Elem.set(KeyPlatform, Info.Platform); if (!Info.Message.empty()) Elem.set(KeyMessage, Info.Message); if (Info.Introduced.hasValue()) Elem.set(KeyIntroduced, Info.Introduced.getValue().getAsString()); if (Info.Deprecated.hasValue()) Elem.set(KeyDeprecated, Info.Deprecated.getValue().getAsString()); if (Info.Obsoleted.hasValue()) Elem.set(KeyObsoleted, Info.Obsoleted.getValue().getAsString()); return true; } bool SKDocConsumer::finishSourceEntity(UIdent Kind) { Entity &CurrEnt = EntitiesStack.back(); assert(CurrEnt.Kind == Kind); (void) CurrEnt; EntitiesStack.pop_back(); return true; } bool SKDocConsumer::handleDiagnostic(const DiagnosticEntryInfo &Info) { ResponseBuilder::Array &Arr = Diags; if (Arr.isNull()) Arr = TopDict.setArray(KeyDiagnostics); auto Elem = Arr.appendDictionary(); fillDictionaryForDiagnosticInfo(Elem, Info); return true; } //===----------------------------------------------------------------------===// // ReportCursorInfo //===----------------------------------------------------------------------===// static void reportCursorInfo(const CursorInfoData &Info, ResponseReceiver Rec) { if (Info.IsCancelled) return Rec(createErrorRequestCancelled()); ResponseBuilder RespBuilder; if (Info.Kind.isInvalid()) return Rec(RespBuilder.createResponse()); auto Elem = RespBuilder.getDictionary(); Elem.set(KeyKind, Info.Kind); Elem.set(KeyName, Info.Name); if (!Info.USR.empty()) Elem.set(KeyUSR, Info.USR); if (!Info.TypeName.empty()) Elem.set(KeyTypeName, Info.TypeName); if (!Info.DocComment.empty()) Elem.set(KeyDocFullAsXML, Info.DocComment); if (!Info.AnnotatedDeclaration.empty()) Elem.set(KeyAnnotatedDecl, Info.AnnotatedDeclaration); if (!Info.FullyAnnotatedDeclaration.empty()) Elem.set(KeyFullyAnnotatedDecl, Info.FullyAnnotatedDeclaration); if (!Info.ModuleName.empty()) Elem.set(KeyModuleName, Info.ModuleName); if (!Info.GroupName.empty()) Elem.set(KeyGroupName, Info.GroupName); if (!Info.LocalizationKey.empty()) Elem.set(KeyLocalizationKey, Info.LocalizationKey); if (!Info.ModuleInterfaceName.empty()) Elem.set(KeyModuleInterfaceName, Info.ModuleInterfaceName); if (Info.DeclarationLoc.hasValue()) { Elem.set(KeyOffset, Info.DeclarationLoc.getValue().first); Elem.set(KeyLength, Info.DeclarationLoc.getValue().second); if (!Info.Filename.empty()) Elem.set(KeyFilePath, Info.Filename); } if (!Info.OverrideUSRs.empty()) { auto Overrides = Elem.setArray(KeyOverrides); for (auto USR : Info.OverrideUSRs) { auto Override = Overrides.appendDictionary(); Override.set(KeyUSR, USR); } } if (!Info.ModuleGroupArray.empty()) { auto Groups = Elem.setArray(KeyModuleGroups); for (auto Name : Info.ModuleGroupArray) { auto Entry = Groups.appendDictionary(); Entry.set(KeyGroupName, Name); } } if (!Info.AvailableActions.empty()) { auto Actions = Elem.setArray(KeyRefactorActions); for (auto Info : Info.AvailableActions) { auto Entry = Actions.appendDictionary(); Entry.set(KeyActionUID, Info.Kind); Entry.set(KeyActionName, Info.KindName); if (!Info.UnavailableReason.empty()) Entry.set(KeyActionUnavailableReason, Info.UnavailableReason); } } if (Info.ParentNameOffset) { Elem.set(KeyParentLoc, Info.ParentNameOffset.getValue()); } if (!Info.AnnotatedRelatedDeclarations.empty()) { auto RelDecls = Elem.setArray(KeyRelatedDecls); for (auto AnnotDecl : Info.AnnotatedRelatedDeclarations) { auto RelDecl = RelDecls.appendDictionary(); RelDecl.set(KeyAnnotatedDecl, AnnotDecl); } } if (Info.IsSystem) Elem.setBool(KeyIsSystem, true); if (!Info.TypeInterface.empty()) Elem.set(KeyTypeInterface, Info.TypeInterface); if (!Info.TypeUSR.empty()) Elem.set(KeyTypeUsr, Info.TypeUSR); if (!Info.ContainerTypeUSR.empty()) Elem.set(KeyContainerTypeUsr, Info.ContainerTypeUSR); return Rec(RespBuilder.createResponse()); } //===----------------------------------------------------------------------===// // ReportRangeInfo //===----------------------------------------------------------------------===// static void reportRangeInfo(const RangeInfo &Info, ResponseReceiver Rec) { if (Info.IsCancelled) return Rec(createErrorRequestCancelled()); ResponseBuilder RespBuilder; auto Elem = RespBuilder.getDictionary(); Elem.set(KeyKind, Info.RangeKind); Elem.set(KeyTypeName, Info.ExprType); Elem.set(KeyRangeContent, Info.RangeContent); Rec(RespBuilder.createResponse()); } //===----------------------------------------------------------------------===// // ReportNameInfo //===----------------------------------------------------------------------===// static void reportNameInfo(const NameTranslatingInfo &Info, ResponseReceiver Rec) { if (Info.IsCancelled) return Rec(createErrorRequestCancelled()); ResponseBuilder RespBuilder; if (Info.NameKind.isInvalid()) return Rec(RespBuilder.createResponse()); if (Info.BaseName.empty() && Info.ArgNames.empty()) return Rec(RespBuilder.createResponse()); auto Elem = RespBuilder.getDictionary(); Elem.set(KeyNameKind, Info.NameKind); if (!Info.BaseName.empty()) { Elem.set(KeyBaseName, Info.BaseName); } if (!Info.ArgNames.empty()) { static UIdent UIDKindNameSwift(KindNameSwift.str()); auto Arr = Elem.setArray(Info.NameKind == UIDKindNameSwift ? KeyArgNames : KeySelectorPieces); for (auto N : Info.ArgNames) { auto NameEle = Arr.appendDictionary(); NameEle.set(KeyName, N); } } if (Info.IsZeroArgSelector) { Elem.set(KeyIsZeroArgSelector, Info.IsZeroArgSelector); } Rec(RespBuilder.createResponse()); } //===----------------------------------------------------------------------===// // FindRelatedIdents //===----------------------------------------------------------------------===// static void findRelatedIdents(StringRef Filename, int64_t Offset, bool CancelOnSubsequentRequest, ArrayRef<const char *> Args, ResponseReceiver Rec) { LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.findRelatedIdentifiersInFile(Filename, Offset, CancelOnSubsequentRequest, Args, [Rec](const RelatedIdentsInfo &Info) { if (Info.IsCancelled) return Rec(createErrorRequestCancelled()); ResponseBuilder RespBuilder; auto Arr = RespBuilder.getDictionary().setArray(KeyResults); for (auto R : Info.Ranges) { auto Elem = Arr.appendDictionary(); Elem.set(KeyOffset, R.first); Elem.set(KeyLength, R.second); } Rec(RespBuilder.createResponse()); }); } //===----------------------------------------------------------------------===// // CodeComplete //===----------------------------------------------------------------------===// namespace { class SKCodeCompletionConsumer : public CodeCompletionConsumer { ResponseBuilder &RespBuilder; CodeCompletionResultsArrayBuilder ResultsBuilder; std::string ErrorDescription; public: explicit SKCodeCompletionConsumer(ResponseBuilder &RespBuilder) : RespBuilder(RespBuilder) { } sourcekitd_response_t createResponse() { if (!ErrorDescription.empty()) return createErrorRequestFailed(ErrorDescription.c_str()); RespBuilder.getDictionary().setCustomBuffer(KeyResults, CustomBufferKind::CodeCompletionResultsArray, ResultsBuilder.createBuffer()); return RespBuilder.createResponse(); } void failed(StringRef ErrDescription) override; bool handleResult(const CodeCompletionInfo &Info) override; }; } // end anonymous namespace static sourcekitd_response_t codeComplete(llvm::MemoryBuffer *InputBuf, int64_t Offset, ArrayRef<const char *> Args) { ResponseBuilder RespBuilder; SKCodeCompletionConsumer CCC(RespBuilder); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.codeComplete(InputBuf, Offset, CCC, Args); return CCC.createResponse(); } void SKCodeCompletionConsumer::failed(StringRef ErrDescription) { ErrorDescription = ErrDescription; } bool SKCodeCompletionConsumer::handleResult(const CodeCompletionInfo &R) { Optional<StringRef> ModuleNameOpt; if (!R.ModuleName.empty()) ModuleNameOpt = R.ModuleName; Optional<StringRef> DocBriefOpt; if (!R.DocBrief.empty()) DocBriefOpt = R.DocBrief; Optional<StringRef> AssocUSRsOpt; if (!R.AssocUSRs.empty()) AssocUSRsOpt = R.AssocUSRs; assert(!R.ModuleImportDepth && "not implemented on CompactArray path"); ResultsBuilder.add(R.Kind, R.Name, R.Description, R.SourceText, R.TypeName, ModuleNameOpt, DocBriefOpt, AssocUSRsOpt, R.SemanticContext, R.NotRecommended, R.NumBytesToErase); return true; } //===----------------------------------------------------------------------===// // (New) CodeComplete //===----------------------------------------------------------------------===// namespace { class SKGroupedCodeCompletionConsumer : public GroupedCodeCompletionConsumer { ResponseBuilder &RespBuilder; ResponseBuilder::Dictionary Response; SmallVector<ResponseBuilder::Array, 3> GroupContentsStack; std::string ErrorDescription; public: explicit SKGroupedCodeCompletionConsumer(ResponseBuilder &RespBuilder) : RespBuilder(RespBuilder) {} sourcekitd_response_t createResponse() { if (!ErrorDescription.empty()) return createErrorRequestFailed(ErrorDescription.c_str()); assert(GroupContentsStack.empty() && "mismatched start/endGroup"); return RespBuilder.createResponse(); } void failed(StringRef ErrDescription) override; bool handleResult(const CodeCompletionInfo &Info) override; void startGroup(UIdent kind, StringRef name) override; void endGroup() override; void setNextRequestStart(unsigned offset) override; }; class SKOptionsDictionary : public OptionsDictionary { RequestDict &Options; public: explicit SKOptionsDictionary(RequestDict &Options) : Options(Options) {} bool valueForOption(UIdent Key, unsigned &Val) override { int64_t result; if (Options.getInt64(Key, result, false)) return false; Val = static_cast<unsigned>(result); return true; } bool valueForOption(UIdent Key, bool &Val) override { int64_t result; if (Options.getInt64(Key, result, false)) return false; Val = result ? true : false; return true; } bool valueForOption(UIdent Key, StringRef &Val) override { Optional<StringRef> value = Options.getString(Key); if (!value) return false; Val = *value; return true; } }; } // end anonymous namespace static sourcekitd_response_t codeCompleteOpen(StringRef Name, llvm::MemoryBuffer *InputBuf, int64_t Offset, Optional<RequestDict> optionsDict, ArrayRef<const char *> Args) { ResponseBuilder RespBuilder; SKGroupedCodeCompletionConsumer CCC(RespBuilder); std::unique_ptr<SKOptionsDictionary> options; std::vector<FilterRule> filterRules; if (optionsDict) { options = llvm::make_unique<SKOptionsDictionary>(*optionsDict); bool failed = false; optionsDict->dictionaryArrayApply(KeyFilterRules, [&](RequestDict dict) { FilterRule rule; auto kind = dict.getUID(KeyKind); if (kind == KindCodeCompletionEverything) { rule.kind = FilterRule::Everything; } else if (kind == KindCodeCompletionModule) { rule.kind = FilterRule::Module; } else if (kind == KindCodeCompletionKeyword) { rule.kind = FilterRule::Keyword; } else if (kind == KindCodeCompletionLiteral) { rule.kind = FilterRule::Literal; } else if (kind == KindCodeCompletionCustom) { rule.kind = FilterRule::CustomCompletion; } else if (kind == KindCodeCompletionIdentifier) { rule.kind = FilterRule::Identifier; } else if (kind == KindCodeCompletionDescription) { rule.kind = FilterRule::Description; } else { // Warning: unknown } int64_t hide; if (dict.getInt64(KeyHide, hide, false)) { failed = true; CCC.failed("filter rule missing required key 'key.hide'"); return true; } rule.hide = hide; switch (rule.kind) { case FilterRule::Everything: break; case FilterRule::Module: case FilterRule::Identifier: { SmallVector<const char *, 8> names; if (dict.getStringArray(KeyNames, names, false)) { failed = true; CCC.failed("filter rule missing required key 'key.names'"); return true; } rule.names.assign(names.begin(), names.end()); break; } case FilterRule::Description: { SmallVector<const char *, 8> names; if (dict.getStringArray(KeyNames, names, false)) { failed = true; CCC.failed("filter rule missing required key 'key.names'"); return true; } rule.names.assign(names.begin(), names.end()); break; } case FilterRule::Keyword: case FilterRule::Literal: case FilterRule::CustomCompletion: { SmallVector<sourcekitd_uid_t, 8> uids; dict.getUIDArray(KeyUIDs, uids, true); for (auto uid : uids) rule.uids.push_back(UIdentFromSKDUID(uid)); break; } } filterRules.push_back(std::move(rule)); return false; // continue }); if (failed) return CCC.createResponse(); } LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.codeCompleteOpen(Name, InputBuf, Offset, options.get(), filterRules, CCC, Args); return CCC.createResponse(); } static sourcekitd_response_t codeCompleteClose(StringRef Name, int64_t Offset) { ResponseBuilder RespBuilder; SKGroupedCodeCompletionConsumer CCC(RespBuilder); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.codeCompleteClose(Name, Offset, CCC); return CCC.createResponse(); } static sourcekitd_response_t codeCompleteUpdate(StringRef name, int64_t offset, Optional<RequestDict> optionsDict) { ResponseBuilder RespBuilder; SKGroupedCodeCompletionConsumer CCC(RespBuilder); std::unique_ptr<SKOptionsDictionary> options; if (optionsDict) options = llvm::make_unique<SKOptionsDictionary>(*optionsDict); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.codeCompleteUpdate(name, offset, options.get(), CCC); return CCC.createResponse(); } void SKGroupedCodeCompletionConsumer::failed(StringRef ErrDescription) { ErrorDescription = ErrDescription; } bool SKGroupedCodeCompletionConsumer::handleResult(const CodeCompletionInfo &R) { assert(!GroupContentsStack.empty() && "missing root group"); auto result = GroupContentsStack.back().appendDictionary(); if (R.CustomKind) result.set(KeyKind, sourcekitd_uid_t(R.CustomKind)); else result.set(KeyKind, R.Kind); result.set(KeyName, R.Name); result.set(KeyDescription, R.Description); result.set(KeySourceText, R.SourceText); result.set(KeyTypeName, R.TypeName); result.set(KeyContext, R.SemanticContext); if (!R.ModuleName.empty()) result.set(KeyModuleName, R.ModuleName); if (!R.DocBrief.empty()) result.set(KeyDocBrief, R.DocBrief); if (!R.AssocUSRs.empty()) result.set(KeyAssociatedUSRs, R.AssocUSRs); if (R.ModuleImportDepth) result.set(KeyModuleImportDepth, *R.ModuleImportDepth); if (R.NotRecommended) result.set(KeyNotRecommended, R.NotRecommended); result.set(KeyNumBytesToErase, R.NumBytesToErase); if (R.descriptionStructure) { auto addRange = [](ResponseBuilder::Dictionary dict, UIdent offset, UIdent length, CodeCompletionInfo::IndexRange range) { if (!range.empty()) { dict.set(offset, range.begin); dict.set(length, range.length()); } }; auto structure = result.setDictionary(KeySubStructure); addRange(structure, KeyNameOffset, KeyNameLength, R.descriptionStructure->baseName); addRange(structure, KeyBodyOffset, KeyBodyLength, R.descriptionStructure->parameterRange); addRange(structure, KeyThrowOffset, KeyThrowLength, R.descriptionStructure->throwsRange); if (R.parametersStructure) { auto params = structure.setArray(KeySubStructure); for (auto &P : *R.parametersStructure) { auto param = params.appendDictionary(); addRange(param, KeyNameOffset, KeyNameLength, P.name); addRange(param, KeyBodyOffset, KeyBodyLength, P.afterColon); if (P.isLocalName) param.set(KeyIsLocal, true); } } } return true; } void SKGroupedCodeCompletionConsumer::startGroup(UIdent kind, StringRef name) { ResponseBuilder::Dictionary group; if (GroupContentsStack.empty()) { group = RespBuilder.getDictionary(); Response = group; } else { group = GroupContentsStack.back().appendDictionary(); } group.set(KeyKind, kind); group.set(KeyName, name); auto contents = group.setArray(KeyResults); GroupContentsStack.push_back(contents); } void SKGroupedCodeCompletionConsumer::endGroup() { assert(!GroupContentsStack.empty()); GroupContentsStack.pop_back(); } void SKGroupedCodeCompletionConsumer::setNextRequestStart(unsigned offset) { assert(!Response.isNull()); Response.set(KeyNextRequestStart, offset); } //===----------------------------------------------------------------------===// // Editor //===----------------------------------------------------------------------===// namespace { class SKEditorConsumer : public EditorConsumer { ResponseReceiver RespReceiver; ResponseBuilder RespBuilder; public: ResponseBuilder::Dictionary Dict; DocStructureArrayBuilder DocStructure; TokenAnnotationsArrayBuilder SyntaxMap; TokenAnnotationsArrayBuilder SemanticAnnotations; ResponseBuilder::Array Diags; sourcekitd_response_t Error = nullptr; SKEditorConsumerOptions Opts; public: SKEditorConsumer(SKEditorConsumerOptions Opts) : Opts(Opts) { Dict = RespBuilder.getDictionary(); } SKEditorConsumer(ResponseReceiver RespReceiver, SKEditorConsumerOptions Opts) : SKEditorConsumer(Opts) { this->RespReceiver = RespReceiver; } sourcekitd_response_t createResponse(); bool needsSemanticInfo() override { return !Opts.SyntacticOnly && !isSemanticEditorDisabled(); } void handleRequestError(const char *Description) override; bool syntaxMapEnabled() override { return Opts.EnableSyntaxMap; } void handleSyntaxMap(unsigned Offset, unsigned Length, UIdent Kind) override; void handleSemanticAnnotation(unsigned Offset, unsigned Length, UIdent Kind, bool isSystem) override; bool documentStructureEnabled() override { return Opts.EnableStructure; } void beginDocumentSubStructure(unsigned Offset, unsigned Length, UIdent Kind, UIdent AccessLevel, UIdent SetterAccessLevel, unsigned NameOffset, unsigned NameLength, unsigned BodyOffset, unsigned BodyLength, unsigned DocOffset, unsigned DocLength, StringRef DisplayName, StringRef TypeName, StringRef RuntimeName, StringRef SelectorName, ArrayRef<StringRef> InheritedTypes, ArrayRef<std::tuple<UIdent, unsigned, unsigned>> Attrs) override; void endDocumentSubStructure() override; void handleDocumentSubStructureElement(UIdent Kind, unsigned Offset, unsigned Length) override; void recordAffectedRange(unsigned Offset, unsigned Length) override; void recordAffectedLineRange(unsigned Line, unsigned Length) override; void recordFormattedText(StringRef Text) override; void setDiagnosticStage(UIdent DiagStage) override; void handleDiagnostic(const DiagnosticEntryInfo &Info, UIdent DiagStage) override; void handleSourceText(StringRef Text) override; void handleSyntaxTree(const swift::syntax::SourceFileSyntax &SyntaxTree, std::unordered_set<unsigned> &ReusedNodeIds) override; SyntaxTreeTransferMode syntaxTreeTransferMode() override { return Opts.SyntaxTransferMode; } void finished() override { if (RespReceiver) RespReceiver(createResponse()); } }; } // end anonymous namespace static sourcekitd_response_t editorOpen(StringRef Name, llvm::MemoryBuffer *Buf, SKEditorConsumerOptions Opts, ArrayRef<const char *> Args) { SKEditorConsumer EditC(Opts); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.editorOpen(Name, Buf, EditC, Args); return EditC.createResponse(); } static sourcekitd_response_t editorOpenInterface(StringRef Name, StringRef ModuleName, Optional<StringRef> Group, ArrayRef<const char *> Args, bool SynthesizedExtensions, Optional<StringRef> InterestedUSR) { SKEditorConsumerOptions Opts; Opts.EnableSyntaxMap = true; Opts.EnableStructure = true; SKEditorConsumer EditC(Opts); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.editorOpenInterface(EditC, Name, ModuleName, Group, Args, SynthesizedExtensions, InterestedUSR); return EditC.createResponse(); } /// Getting the interface from a swift source file differs from getting interfaces /// from headers or modules for its performing asynchronously. static void editorOpenSwiftSourceInterface(StringRef Name, StringRef HeaderName, ArrayRef<const char *> Args, ResponseReceiver Rec) { SKEditorConsumerOptions Opts; Opts.EnableSyntaxMap = true; Opts.EnableStructure = true; auto EditC = std::make_shared<SKEditorConsumer>(Rec, Opts); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.editorOpenSwiftSourceInterface(Name, HeaderName, Args, EditC); } static void editorOpenSwiftTypeInterface(StringRef TypeUsr, ArrayRef<const char *> Args, ResponseReceiver Rec) { SKEditorConsumerOptions Opts; Opts.EnableSyntaxMap = true; Opts.EnableStructure = true; auto EditC = std::make_shared<SKEditorConsumer>(Rec, Opts); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.editorOpenTypeInterface(*EditC, Args, TypeUsr); } static sourcekitd_response_t editorExtractTextFromComment(StringRef Source) { SKEditorConsumerOptions Opts; Opts.SyntacticOnly = true; SKEditorConsumer EditC(Opts); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.editorExtractTextFromComment(Source, EditC); return EditC.createResponse(); } static sourcekitd_response_t editorConvertMarkupToXML(StringRef Source) { SKEditorConsumerOptions Opts; Opts.SyntacticOnly = true; SKEditorConsumer EditC(Opts); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.editorConvertMarkupToXML(Source, EditC); return EditC.createResponse(); } static sourcekitd_response_t editorOpenHeaderInterface(StringRef Name, StringRef HeaderName, ArrayRef<const char *> Args, bool UsingSwiftArgs, bool SynthesizedExtensions, StringRef swiftVersion) { SKEditorConsumerOptions Opts; Opts.EnableSyntaxMap = true; Opts.EnableStructure = true; SKEditorConsumer EditC(Opts); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.editorOpenHeaderInterface(EditC, Name, HeaderName, Args, UsingSwiftArgs, SynthesizedExtensions, swiftVersion); return EditC.createResponse(); } static sourcekitd_response_t editorClose(StringRef Name, bool RemoveCache) { ResponseBuilder RespBuilder; LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.editorClose(Name, RemoveCache); return RespBuilder.createResponse(); } static sourcekitd_response_t editorReplaceText(StringRef Name, llvm::MemoryBuffer *Buf, unsigned Offset, unsigned Length, SKEditorConsumerOptions Opts) { SKEditorConsumer EditC(Opts); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.editorReplaceText(Name, Buf, Offset, Length, EditC); return EditC.createResponse(); } static void editorApplyFormatOptions(StringRef Name, RequestDict &FmtOptions) { LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); SKOptionsDictionary SKFmtOptions(FmtOptions); Lang.editorApplyFormatOptions(Name, SKFmtOptions); } static sourcekitd_response_t editorFormatText(StringRef Name, unsigned Line, unsigned Length) { SKEditorConsumerOptions Opts; Opts.SyntacticOnly = true; SKEditorConsumer EditC(Opts); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.editorFormatText(Name, Line, Length, EditC); return EditC.createResponse(); } static sourcekitd_response_t editorExpandPlaceholder(StringRef Name, unsigned Offset, unsigned Length) { SKEditorConsumerOptions Opts; Opts.SyntacticOnly = true; SKEditorConsumer EditC(Opts); LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.editorExpandPlaceholder(Name, Offset, Length, EditC); return EditC.createResponse(); } sourcekitd_response_t SKEditorConsumer::createResponse() { if (Error) return Error; if (Opts.EnableSyntaxMap) { Dict.setCustomBuffer(KeySyntaxMap, CustomBufferKind::TokenAnnotationsArray, SyntaxMap.createBuffer()); } if (!SemanticAnnotations.empty()) { Dict.setCustomBuffer(KeyAnnotations, CustomBufferKind::TokenAnnotationsArray, SemanticAnnotations.createBuffer()); } if (Opts.EnableStructure) { Dict.setCustomBuffer(KeySubStructure, CustomBufferKind::DocStructureArray, DocStructure.createBuffer()); } return RespBuilder.createResponse(); } void SKEditorConsumer::handleRequestError(const char *Description) { if (!Error) { Error = createErrorRequestFailed(Description); } if (RespReceiver) { RespReceiver(Error); RespReceiver = ResponseReceiver(); } } void SKEditorConsumer::handleSyntaxMap(unsigned Offset, unsigned Length, UIdent Kind) { if (!Opts.EnableSyntaxMap) return; SyntaxMap.add(Kind, Offset, Length, /*IsSystem=*/false); } void SKEditorConsumer::handleSemanticAnnotation(unsigned Offset, unsigned Length, UIdent Kind, bool isSystem) { assert(Kind.isValid()); SemanticAnnotations.add(Kind, Offset, Length, isSystem); } void SKEditorConsumer::beginDocumentSubStructure(unsigned Offset, unsigned Length, UIdent Kind, UIdent AccessLevel, UIdent SetterAccessLevel, unsigned NameOffset, unsigned NameLength, unsigned BodyOffset, unsigned BodyLength, unsigned DocOffset, unsigned DocLength, StringRef DisplayName, StringRef TypeName, StringRef RuntimeName, StringRef SelectorName, ArrayRef<StringRef> InheritedTypes, ArrayRef<std::tuple<UIdent, unsigned, unsigned>> Attrs) { if (Opts.EnableStructure) { DocStructure.beginSubStructure( Offset, Length, Kind, AccessLevel, SetterAccessLevel, NameOffset, NameLength, BodyOffset, BodyLength, DocOffset, DocLength, DisplayName, TypeName, RuntimeName, SelectorName, InheritedTypes, Attrs); } } void SKEditorConsumer::endDocumentSubStructure() { if (Opts.EnableStructure) DocStructure.endSubStructure(); } void SKEditorConsumer::handleDocumentSubStructureElement(UIdent Kind, unsigned Offset, unsigned Length) { if (Opts.EnableStructure) DocStructure.addElement(Kind, Offset, Length); } void SKEditorConsumer::recordAffectedRange(unsigned Offset, unsigned Length) { Dict.set(KeyOffset, Offset); Dict.set(KeyLength, Length); } void SKEditorConsumer::recordAffectedLineRange(unsigned Line, unsigned Length) { Dict.set(KeyLine, Line); Dict.set(KeyLength, Length); } void SKEditorConsumer::recordFormattedText(StringRef Text) { Dict.set(KeySourceText, Text); } static void fillDictionaryForDiagnosticInfoBase( ResponseBuilder::Dictionary Elem, const DiagnosticEntryInfoBase &Info); static void fillDictionaryForDiagnosticInfo( ResponseBuilder::Dictionary Elem, const DiagnosticEntryInfo &Info) { UIdent SeverityUID; static UIdent UIDKindDiagWarning(KindDiagWarning.str()); static UIdent UIDKindDiagError(KindDiagError.str()); switch (Info.Severity) { case DiagnosticSeverityKind::Warning: SeverityUID = UIDKindDiagWarning; break; case DiagnosticSeverityKind::Error: SeverityUID = UIDKindDiagError; break; } Elem.set(KeySeverity, SeverityUID); fillDictionaryForDiagnosticInfoBase(Elem, Info); if (!Info.Notes.empty()) { auto NotesArr = Elem.setArray(KeyDiagnostics); for (auto &NoteDiag : Info.Notes) { auto NoteElem = NotesArr.appendDictionary(); NoteElem.set(KeySeverity, KindDiagNote); fillDictionaryForDiagnosticInfoBase(NoteElem, NoteDiag); } } } static void fillDictionaryForDiagnosticInfoBase( ResponseBuilder::Dictionary Elem, const DiagnosticEntryInfoBase &Info) { Elem.set(KeyDescription, Info.Description); if (Info.Line != 0) { Elem.set(KeyLine, Info.Line); Elem.set(KeyColumn, Info.Column); } else { Elem.set(KeyOffset, Info.Offset); } if (!Info.Filename.empty()) Elem.set(KeyFilePath, Info.Filename); if (!Info.Ranges.empty()) { auto RangesArr = Elem.setArray(KeyRanges); for (auto R : Info.Ranges) { auto RangeElem = RangesArr.appendDictionary(); RangeElem.set(KeyOffset, R.first); RangeElem.set(KeyLength, R.second); } } if (!Info.Fixits.empty()) { auto FixitsArr = Elem.setArray(KeyFixits); for (auto F : Info.Fixits) { auto FixitElem = FixitsArr.appendDictionary(); FixitElem.set(KeyOffset, F.Offset); FixitElem.set(KeyLength, F.Length); FixitElem.set(KeySourceText, F.Text); } } } void SKEditorConsumer::setDiagnosticStage(UIdent DiagStage) { Dict.set(KeyDiagnosticStage, DiagStage); } void SKEditorConsumer::handleDiagnostic(const DiagnosticEntryInfo &Info, UIdent DiagStage) { if (!Opts.EnableDiagnostics) return; ResponseBuilder::Array &Arr = Diags; if (Arr.isNull()) Arr = Dict.setArray(KeyDiagnostics); auto Elem = Arr.appendDictionary(); Elem.set(KeyDiagnosticStage, DiagStage); fillDictionaryForDiagnosticInfo(Elem, Info); } void SKEditorConsumer::handleSourceText(StringRef Text) { Dict.set(KeySourceText, Text); } void serializeSyntaxTreeAsByteTree( const swift::syntax::SourceFileSyntax &SyntaxTree, std::unordered_set<unsigned> &ReusedNodeIds, ResponseBuilder::Dictionary &Dict) { auto StartClock = clock(); // Serialize the syntax tree as a ByteTree swift::ExponentialGrowthAppendingBinaryByteStream Stream( llvm::support::endianness::little); Stream.reserve(32 * 1024); std::map<void *, void *> UserInfo; UserInfo[swift::byteTree::UserInfoKeyReusedNodeIds] = &ReusedNodeIds; swift::byteTree::ByteTreeWriter::write(Stream, swift::byteTree::SYNTAX_TREE_VERSION, *SyntaxTree.getRaw(), UserInfo); std::unique_ptr<llvm::WritableMemoryBuffer> Buf = llvm::WritableMemoryBuffer::getNewUninitMemBuffer(Stream.data().size()); memcpy(Buf->getBufferStart(), Stream.data().data(), Stream.data().size()); Dict.setCustomBuffer(KeySerializedSyntaxTree, CustomBufferKind::RawData, std::move(Buf)); auto EndClock = clock(); LOG_SECTION("incrParse Performance", InfoLowPrio) { Log->getOS() << "Serialized " << Stream.data().size() << " bytes as ByteTree in "; auto Seconds = (double)(EndClock - StartClock) * 1000 / CLOCKS_PER_SEC; llvm::write_double(Log->getOS(), Seconds, llvm::FloatStyle::Fixed, 2); Log->getOS() << "ms"; } } void serializeSyntaxTreeAsJson( const swift::syntax::SourceFileSyntax &SyntaxTree, std::unordered_set<unsigned> ReusedNodeIds, ResponseBuilder::Dictionary &Dict) { auto StartClock = clock(); // 4096 is a heuristic buffer size that appears to usually be able to fit an // incremental syntax tree size_t ReserveBufferSize = 4096; std::string SyntaxTreeString; SyntaxTreeString.reserve(ReserveBufferSize); { llvm::raw_string_ostream SyntaxTreeStream(SyntaxTreeString); SyntaxTreeStream.SetBufferSize(ReserveBufferSize); swift::json::Output::UserInfoMap JsonUserInfo; JsonUserInfo[swift::json::OmitNodesUserInfoKey] = &ReusedNodeIds; swift::json::Output SyntaxTreeOutput(SyntaxTreeStream, JsonUserInfo, /*PrettyPrint=*/false); SyntaxTreeOutput << *SyntaxTree.getRaw(); } Dict.set(KeySerializedSyntaxTree, SyntaxTreeString); auto EndClock = clock(); LOG_SECTION("incrParse Performance", InfoLowPrio) { Log->getOS() << "Serialized " << SyntaxTreeString.size() << " bytes as JSON in "; auto Seconds = (double)(EndClock - StartClock) * 1000 / CLOCKS_PER_SEC; llvm::write_double(Log->getOS(), Seconds, llvm::FloatStyle::Fixed, 2); Log->getOS() << "ms"; } } void SKEditorConsumer::handleSyntaxTree( const swift::syntax::SourceFileSyntax &SyntaxTree, std::unordered_set<unsigned> &ReusedNodeIds) { std::unordered_set<unsigned> OmitNodes; switch (Opts.SyntaxTransferMode) { case SourceKit::SyntaxTreeTransferMode::Off: // Don't serialize the tree at all return; case SourceKit::SyntaxTreeTransferMode::Full: // Serialize the tree without omitting any nodes OmitNodes = {}; break; case SourceKit::SyntaxTreeTransferMode::Incremental: // Serialize the tree and omit all nodes that have been reused OmitNodes = ReusedNodeIds; break; } switch (Opts.SyntaxSerializationFormat) { case SourceKit::SyntaxTreeSerializationFormat::JSON: serializeSyntaxTreeAsJson(SyntaxTree, OmitNodes, Dict); break; case SourceKit::SyntaxTreeSerializationFormat::ByteTree: serializeSyntaxTreeAsByteTree(SyntaxTree, OmitNodes, Dict); break; } } static sourcekitd_response_t editorFindUSR(StringRef DocumentName, StringRef USR) { ResponseBuilder RespBuilder; LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); llvm::Optional<std::pair<unsigned, unsigned>> Range = Lang.findUSRRange(DocumentName, USR); if (!Range) { // If cannot find the synthesized USR, find the actual USR instead. Range = Lang.findUSRRange(DocumentName, USR.split(LangSupport::SynthesizedUSRSeparator). first); } if (Range.hasValue()) { RespBuilder.getDictionary().set(KeyOffset, Range->first); RespBuilder.getDictionary().set(KeyLength, Range->second); } return RespBuilder.createResponse(); } static sourcekitd_response_t editorFindInterfaceDoc(StringRef ModuleName, ArrayRef<const char *> Args) { ResponseBuilder RespBuilder; sourcekitd_response_t Resp; LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.findInterfaceDocument(ModuleName, Args, [&](const InterfaceDocInfo &Info) { if (!Info.Error.empty()) { SmallString<128> Err(Info.Error); Resp = createErrorRequestFailed(Err.c_str()); return; } auto Elem = RespBuilder.getDictionary(); if (!Info.ModuleInterfaceName.empty()) Elem.set(KeyModuleInterfaceName, Info.ModuleInterfaceName); if (!Info.CompilerArgs.empty()) Elem.set(KeyCompilerArgs, Info.CompilerArgs); Resp = RespBuilder.createResponse(); }); return Resp; } static sourcekitd_response_t editorFindModuleGroups(StringRef ModuleName, ArrayRef<const char *> Args) { ResponseBuilder RespBuilder; sourcekitd_response_t Resp; LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); Lang.findModuleGroups(ModuleName, Args, [&](ArrayRef<StringRef> Groups, StringRef Error) { if (!Error.empty()) { Resp = createErrorRequestFailed(Error.str().c_str()); return; } auto Dict = RespBuilder.getDictionary(); auto Arr = Dict.setArray(KeyModuleGroups); for (auto G : Groups) { auto Entry = Arr.appendDictionary(); Entry.set(KeyGroupName, G); } Resp = RespBuilder.createResponse(); }); return Resp; } static bool buildRenameLocationsFromDict(RequestDict &Req, bool UseNewName, std::vector<RenameLocations> &RenameLocations, llvm::SmallString<64> &Error) { bool Failed = Req.dictionaryArrayApply(KeyRenameLocations, [&](RequestDict RenameLocation) { int64_t IsFunctionLike = false; if (RenameLocation.getInt64(KeyIsFunctionLike, IsFunctionLike, false)) { Error = "missing key.is_function_like"; return true; } int64_t IsNonProtocolType = false; if (RenameLocation.getInt64(KeyIsNonProtocolType, IsNonProtocolType, false)) { Error = "missing key.is_non_protocol_type"; return true; } Optional<StringRef> OldName = RenameLocation.getString(KeyName); if (!OldName.hasValue()) { Error = "missing key.name"; return true; } Optional<StringRef> NewName; if (UseNewName) { NewName = RenameLocation.getString(KeyNewName); if (!NewName.hasValue()) { Error = "missing key.newname"; return true; } } RenameLocations.push_back({*OldName, UseNewName ? *NewName : "", static_cast<bool>(IsFunctionLike), static_cast<bool>(IsNonProtocolType), {}}); auto &LineCols = RenameLocations.back().LineColumnLocs; bool Failed = RenameLocation.dictionaryArrayApply(KeyLocations, [&](RequestDict LineAndCol) { int64_t Line = 0; int64_t Column = 0; if (LineAndCol.getInt64(KeyLine, Line, false)) { Error = "missing key.line"; return true; } if (LineAndCol.getInt64(KeyColumn, Column, false)) { Error = "missing key.column"; return true; } sourcekitd_uid_t NameType = LineAndCol.getUID(KeyNameType); if (!NameType) { Error = "missing key.nametype"; return true; } RenameType RenameType = RenameType::Unknown; if (NameType == KindDefinition) { RenameType = RenameType::Definition; } else if (NameType == KindReference) { RenameType = RenameType::Reference; } else if (NameType == KindCall) { RenameType = RenameType::Call; } else if (NameType != KindUnknown) { Error = "invalid value for 'key.nametype'"; return true; } LineCols.push_back({static_cast<unsigned>(Line), static_cast<unsigned>(Column), RenameType}); return false; }); if (Failed && Error.empty()) { Error = "invalid key.locations"; } return Failed; }); if (Failed && Error.empty()) { Error = "invalid key.renamelocations"; } return Failed; } static sourcekitd_response_t createCategorizedEditsResponse(ArrayRef<CategorizedEdits> AllEdits, StringRef Error) { if (!Error.empty()) { return createErrorRequestFailed(Error.str().c_str()); } ResponseBuilder RespBuilder; auto Dict = RespBuilder.getDictionary(); auto Arr = Dict.setArray(KeyCategorizedEdits); for (auto &TheEdit : AllEdits) { auto Entry = Arr.appendDictionary(); Entry.set(KeyCategory, TheEdit.Category); auto Edits = Entry.setArray(KeyEdits); for(auto E: TheEdit.Edits) { auto Edit = Edits.appendDictionary(); Edit.set(KeyLine, E.StartLine); Edit.set(KeyColumn, E.StartColumn); Edit.set(KeyEndLine, E.EndLine); Edit.set(KeyEndColumn, E.EndColumn); Edit.set(KeyText, E.NewText); if (!E.RegionsWithNote.empty()) { auto Notes = Edit.setArray(KeyRangesWorthNote); for (auto R : E.RegionsWithNote) { auto N = Notes.appendDictionary(); N.set(KeyKind, R.Kind); N.set(KeyLine, R.StartLine); N.set(KeyColumn, R.StartColumn); N.set(KeyEndLine, R.EndLine); N.set(KeyEndColumn, R.EndColumn); if (R.ArgIndex) N.set(KeyArgIndex, *R.ArgIndex); } } } } return RespBuilder.createResponse(); } static sourcekitd_response_t syntacticRename(llvm::MemoryBuffer *InputBuf, ArrayRef<RenameLocations> RenameLocations, ArrayRef<const char*> Args) { LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); sourcekitd_response_t Result; Lang.syntacticRename(InputBuf, RenameLocations, Args, [&](ArrayRef<CategorizedEdits> AllEdits, StringRef Error) { Result = createCategorizedEditsResponse(AllEdits, Error); }); return Result; } static sourcekitd_response_t createCategorizedRenameRangesResponse(ArrayRef<CategorizedRenameRanges> Ranges, StringRef Error) { if (!Error.empty()) { return createErrorRequestFailed(Error.str().c_str()); } ResponseBuilder RespBuilder; auto Dict = RespBuilder.getDictionary(); auto Arr = Dict.setArray(KeyCategorizedRanges); for (const auto &CategorizedRange : Ranges) { auto Entry = Arr.appendDictionary(); Entry.set(KeyCategory, CategorizedRange.Category); auto Ranges = Entry.setArray(KeyRanges); for (const auto &R : CategorizedRange.Ranges) { auto Range = Ranges.appendDictionary(); Range.set(KeyLine, R.StartLine); Range.set(KeyColumn, R.StartColumn); Range.set(KeyEndLine, R.EndLine); Range.set(KeyEndColumn, R.EndColumn); Range.set(KeyKind, R.Kind); if (R.ArgIndex) { Range.set(KeyArgIndex, *R.ArgIndex); } } } return RespBuilder.createResponse(); } static sourcekitd_response_t findRenameRanges(llvm::MemoryBuffer *InputBuf, ArrayRef<RenameLocations> RenameLocations, ArrayRef<const char *> Args) { LangSupport &Lang = getGlobalContext().getSwiftLangSupport(); sourcekitd_response_t Result; Lang.findRenameRanges( InputBuf, RenameLocations, Args, [&](ArrayRef<CategorizedRenameRanges> Ranges, StringRef Error) { Result = createCategorizedRenameRangesResponse(Ranges, Error); }); return Result; } static bool isSemanticEditorDisabled() { enum class SemaInfoToggle : char { None, Disable, Enable }; static SemaInfoToggle Toggle = SemaInfoToggle::None; if (Toggle == SemaInfoToggle::None) { static std::once_flag flag; std::call_once(flag, []() { Toggle = SemaInfoToggle::Enable; const char *EnvOpt = ::getenv("SOURCEKIT_DELAY_SEMA_EDITOR"); if (!EnvOpt) { return; } unsigned Seconds; if (StringRef(EnvOpt).getAsInteger(10, Seconds)) return; // A crash occurred previously. Disable semantic info in the editor for // the given amount, to avoid repeated crashers. LOG_WARN_FUNC("delaying semantic editor for " << Seconds << " seconds"); Toggle = SemaInfoToggle::Disable; dispatch_time_t When = dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * Seconds); dispatch_after(When, dispatch_get_main_queue(), ^{ Toggle = SemaInfoToggle::Enable; }); }); } assert(Toggle != SemaInfoToggle::None); return Toggle == SemaInfoToggle::Disable; } namespace { class CompileTrackingConsumer final : public trace::TraceConsumer { public: void operationStarted(uint64_t OpId, trace::OperationKind OpKind, const trace::SwiftInvocation &Inv, const trace::StringPairs &OpArgs) override; void operationFinished(uint64_t OpId, trace::OperationKind OpKind, ArrayRef<DiagnosticEntryInfo> Diagnostics) override; swift::OptionSet<trace::OperationKind> desiredOperations() override { return swift::OptionSet<trace::OperationKind>() | trace::OperationKind::PerformSema | trace::OperationKind::CodeCompletion; } }; } // end anonymous namespace void CompileTrackingConsumer::operationStarted( uint64_t OpId, trace::OperationKind OpKind, const trace::SwiftInvocation &Inv, const trace::StringPairs &OpArgs) { if (!desiredOperations().contains(OpKind)) return; static UIdent CompileWillStartUID("source.notification.compile-will-start"); ResponseBuilder RespBuilder; auto Dict = RespBuilder.getDictionary(); Dict.set(KeyNotification, CompileWillStartUID); Dict.set(KeyCompileID, std::to_string(OpId)); Dict.set(KeyFilePath, Inv.Args.PrimaryFile); // FIXME: OperationKind Dict.set(KeyCompilerArgsString, Inv.Args.Arguments); sourcekitd::postNotification(RespBuilder.createResponse()); } void CompileTrackingConsumer::operationFinished( uint64_t OpId, trace::OperationKind OpKind, ArrayRef<DiagnosticEntryInfo> Diagnostics) { if (!desiredOperations().contains(OpKind)) return; static UIdent CompileDidFinishUID("source.notification.compile-did-finish"); ResponseBuilder RespBuilder; auto Dict = RespBuilder.getDictionary(); Dict.set(KeyNotification, CompileDidFinishUID); Dict.set(KeyCompileID, std::to_string(OpId)); auto DiagArray = Dict.setArray(KeyDiagnostics); for (const auto &DiagInfo : Diagnostics) { fillDictionaryForDiagnosticInfo(DiagArray.appendDictionary(), DiagInfo); } sourcekitd::postNotification(RespBuilder.createResponse()); } static void enableCompileNotifications(bool value) { static std::atomic<bool> status{false}; if (status.exchange(value) == value) { return; // Unchanged. } static CompileTrackingConsumer compileConsumer; if (value) { trace::registerConsumer(&compileConsumer); } else { trace::unregisterConsumer(&compileConsumer); } }
natecook1000/swift
tools/SourceKit/tools/sourcekitd/lib/API/Requests.cpp
C++
apache-2.0
103,084
package at.dafnik.ragemode.Weapons; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Arrow; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.block.Action; import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.metadata.FixedMetadataValue; import at.dafnik.ragemode.API.Explosion; import at.dafnik.ragemode.Main.Library; import at.dafnik.ragemode.Main.Main; import at.dafnik.ragemode.Main.Main.Status; import at.dafnik.ragemode.Main.PowerSystem; import at.dafnik.ragemode.Threads.ArrowSparcleThread; import java.util.ArrayList; import java.util.List; public class Bow implements Listener{ @EventHandler public void shootArrow(EntityShootBowEvent event) { if(event.getEntity() instanceof Player && event.getProjectile() instanceof Arrow) { if(Main.status == Status.INGAME) { Player player = (Player) event.getEntity(); Arrow arrow = (Arrow) event.getProjectile(); if(PowerSystem.getPower(player) > 0) { if(Library.sparcleswitch.contains(player)) new ArrowSparcleThread(arrow).start(); } } else event.setCancelled(true); } else event.setCancelled(true); } @EventHandler public void HitEvent(ProjectileHitEvent event){ if (event.getEntity() instanceof Arrow && event.getEntity().getShooter() instanceof Player) { Arrow arrow = (Arrow) event.getEntity(); if(Main.status == Status.INGAME) { if(arrow.getMetadata("shootedWith").isEmpty()) { arrow.setMetadata("shootedWith", new FixedMetadataValue(Main.getInstance(), "bow")); if (arrow.getShooter() instanceof Player) { Bukkit.getScheduler().scheduleSyncDelayedTask(Main.getInstance(), new Runnable() { @Override public void run() { new Explosion("bow", event.getEntity().getLocation(), ((Player) arrow.getShooter())); arrow.remove(); } }, 20); } } } else arrow.remove(); } } @EventHandler public void DamagebyEntity(EntityDamageByEntityEvent event){ if (event.getCause() == DamageCause.PROJECTILE) { if (event.getDamager() instanceof Arrow && event.getEntity() instanceof Player) { Arrow arrow = (Arrow) event.getDamager(); if(Main.status == Status.INGAME) { String shootedWith = arrow.getMetadata("shootedWith").get(0).asString(); if(shootedWith != null) { if(shootedWith == "bow") { if(arrow.getShooter() instanceof Player) { Player victim = (Player) event.getEntity(); if (!Library.respawnsafe.contains(victim)) { victim.removeMetadata("killedWith", Main.getInstance()); victim.setMetadata("killedWith", new FixedMetadataValue(Main.getInstance(), "bow")); if(Library.powerup_shield.contains(victim)) { event.setDamage(11); } else { event.setDamage(21); } } event.setCancelled(true); } else event.setCancelled(true); } //Don't add else because grenate is also with shootedWith } else event.setCancelled(true); arrow.remove(); } else arrow.remove(); } else event.setCancelled(true); } } }
Dafnik/RageMode
RageMode/src/at/dafnik/ragemode/Weapons/Bow.java
Java
apache-2.0
3,570
package Testing; /** * Created by Jeff on 2016/3/6. */ public class test5 { public static void main(String[] args) { char chh = 'a' + 4; System.out.println(chh); } }
gdefias/StudyJava
InitJava/base/src/main/java/Testing/test5.java
Java
apache-2.0
193
//rest-client.js var _pulse = require('request'); var _internal = require('./conf/conf.json'); var _conf = require('../param.json'); var exports = module.exports = {}; var pulseAPI = _conf.pulseAPI; exports.call = function( apiContext, callback) { //console.log("Calling External API"); var callOptions = { url: apiContext }; _pulse.get(callOptions, callback); } exports.pulseAPICall = function( apiContext, postData, callback) { //console.log("Calling Pulse API"); var callOptions = { url: pulseAPI + apiContext, body: postData, auth: { user: _conf.user, pass: _conf.pass, sendImmediately: true }, headers: { 'Content-type' : 'application/json; charset=UTF-8' } }; if (! postData) { _pulse.get(callOptions, callback); return } _pulse.post(callOptions, callback); }
jcaldeir/pulse-workload-wizard
plugin/rest-client.js
JavaScript
apache-2.0
945
package application.viewer; import application.MainAppFX; import application.tools.Sound; import javafx.fxml.FXML; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.control.Button; import javafx.scene.image.ImageView; import javafx.scene.layout.FlowPane; import javafx.scene.layout.HBox; import javafx.scene.media.*; import javafx.scene.media.MediaPlayer.Status; import java.io.File; import java.util.List; import java.util.ArrayList; import java.util.ResourceBundle; import javafx.util.Duration; import javax.swing.*; import javafx.scene.image.Image; import java.awt.image.BufferedImage; import java.io.IOException; import javax.imageio.ImageIO; /** * * @author Neo_Ryu */ public class SplashController extends JFrame { // Référence à l'application principale public static MainAppFX mainAppFX; // Sons public Sound sound = new Sound(); public static ResourceBundle player = ResourceBundle.getBundle("application.Config"); // VIDEO D'INTRODUCTION private File file = new File("src/res/Oracle.flv"); //src/res/SEGA.mp4 private String VID_URL = file.toURI().toString(); public String getVID_URL() { return VID_URL; } public void setVID_URL(String URL) { VID_URL = URL; } @FXML private MediaPlayer mediaPlayer; @FXML private Duration duration; @FXML private MediaView mediaView; @FXML private FlowPane paneVideo; @FXML private HBox mediaBar; // Boutons @FXML private Button START, SELECT, CANCEL, SKIP; @FXML public static Button ENTER; public static String btnSelected = ""; // Permet de determiner le bouton selectionneé pour switchcase // EASTER EGG protected List<String> Combo = new ArrayList<String>(); @FXML public ImageView imgAnim; /** * Initialises la classe controller. * Cette methode est automaticament appelée après le chargement du fichier FXML. */ @FXML private void initialize() { // CONFIGURATION DES BOUTTONS - TODO police ne possede pas caracteres play pause stop START.setText("⏵ PLAY"); START.setFont(MainAppFX.f); SELECT.setText("⏸ PAUSE"); SELECT.setFont(MainAppFX.f); CANCEL.setText("⏹ STOP"); CANCEL.setFont(MainAppFX.f); SKIP.setFont(MainAppFX.f); // Chemin d'accès pour la vidéo d'introduction if (player.getString("intro").isEmpty()) { setVID_URL(file.toURI().toString()); } else { if ((player.getString("intro").length() >= 4) && (player.getString("intro").substring(0,4).equals("www."))) { System.out.println("Video via URL : "+player.getString("intro").toString()); try { setVID_URL("http://"+player.getString("intro").toString()); } catch (IllegalArgumentException e) { setVID_URL(file.toURI().toString()); } } else if ( ((player.getString("intro").length() >= 7) && (player.getString("intro").substring(0,7).equals("http://"))) || ((player.getString("intro").length() >= 8) &&(player.getString("intro").substring(0,8).equals("https://"))) ) { System.out.println("Video via URL : "+player.getString("intro").toString()); try { setVID_URL(player.getString("intro").toString()); } catch (IllegalArgumentException e) { setVID_URL(file.toURI().toString()); } } else { try { System.out.println("Video via chemin local : "+player.getString("intro").toString()); File fichier = new File(player.getString("intro").toString()); file = fichier; setVID_URL(fichier.toURI().toString()); } catch (IllegalArgumentException e) { setVID_URL(file.toURI().toString()); } } } // INITFX initFX(); } boolean TEST = false; // AFFICHAGE VIDEO public void initFX() { if (VID_URL.equals(null)) { return; } //if (!TEST) { final Media media = new Media(getVID_URL()); final MediaPlayer mediaPlayer = new MediaPlayer(media); mediaPlayer.setAutoPlay(true); paneVideo.getChildren().setAll(mediaView); mediaView.setMediaPlayer(mediaPlayer); mediaPlayer.setOnReady(new Runnable() { @Override public void run() { mediaView.fitWidthProperty().bind(paneVideo.widthProperty()); mediaView.fitHeightProperty().bind(paneVideo.heightProperty()); mediaView.getMediaPlayer().seek(Duration.ZERO); mediaView.getMediaPlayer().play(); } }); mediaPlayer.setOnPlaying(new Runnable() { @Override public void run() { // LISTENERS GERANT LA LECTURE/PAUSE/STOP START.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent e) { Status status = mediaPlayer.getStatus(); if (status == Status.UNKNOWN || status == Status.HALTED) { // ne rien faire return; } if ( status == Status.PAUSED || status == Status.READY || status == Status.STOPPED) { mediaPlayer.play(); } START.setDisable(true); SELECT.setDisable(false); CANCEL.setDisable(false); } }); SELECT.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent e) { Status status = mediaPlayer.getStatus(); if (status == Status.UNKNOWN || status == Status.HALTED) { // ne rien faire return; } if ( status != Status.PAUSED && status != Status.READY && status != Status.STOPPED) { mediaPlayer.pause(); } START.setDisable(false); SELECT.setDisable(true); CANCEL.setDisable(false); } }); CANCEL.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent e) { Status status = mediaPlayer.getStatus(); if (status == Status.UNKNOWN || status == Status.HALTED) { // ne rien faire return; } else { mediaPlayer.stop(); } START.setDisable(false); SELECT.setDisable(true); CANCEL.setDisable(true); } }); SKIP.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent e) { Status status = mediaPlayer.getStatus(); if (status == Status.UNKNOWN || status == Status.HALTED) { // ne rien faire return; } else { mediaPlayer.stop(); handleSKIP(); } } }); } }); mediaPlayer.setOnError(new Runnable() { @Override public void run() { String message = mediaPlayer.errorProperty().get().getMessage(); System.out.println(message); } }); mediaPlayer.setOnEndOfMedia(new Runnable() { @Override public void run() { //System.out.println(file.toURI().toString()); if (file.toURI().toString().toLowerCase().contains("SEGA".toLowerCase())){ System.out.println("> SEGA, C'EST PLUS FORT QUE TOI !"); } if (file.toURI().toString().toLowerCase().contains("ORACLE".toLowerCase())){ System.out.println("> ORACLE : Hardware and Software - Engineered to Work Together"); } skipVideo(); } }); } private void skipVideo() { // PAGE QUI S'OUVRIRA A LA SUITE DE LA VIDEO mainAppFX.Reflexivite(); mainAppFX.showOverview(mainAppFX.getPageIntro()); } // SKIP : Methode appelée lorsque l'utilisateur clique sur le boutton pour passer la video @FXML private void handleSKIP() { if (player.getString("sound").equals("ON")) { sound = new Sound(mainAppFX, "../../res/bitENTER.wav"); sound.Play(); } btnSelected = "SKIP"; skipVideo(); } // AJOUTER : Methode appelée lorsque l'utilisateur clique sur le boutton d'ajout @FXML private void handleSTART() { if (player.getString("sound").equals("ON")) { sound = new Sound(mainAppFX, "../../res/bitENTER.wav"); sound.Play(); } btnSelected = "START"; } // MODIFIER : Methode appelée lorsque l'utilisateur clique sur le bouton de modification @FXML private void handleSELECT() { if (player.getString("sound").equals("ON")) { sound = new Sound(mainAppFX, "../../res/bitENTER.wav"); sound.Play(); } btnSelected = "SELECT"; //System.out.println(btnSelected); } // SUPPRIMER : Methode appelée lorsque l'utilisateur clique sur le bouton de suppression @FXML private void handleCANCEL() { if (player.getString("sound").equals("ON")) { sound = new Sound(mainAppFX, "../../res/bitENTER.wav"); sound.Play(); } btnSelected = "CANCEL"; } // GAMEPAD @FXML private void handleENTER() { hackCombo(); } int pressENTER = 0; private void hackCombo() { if (!Combo.isEmpty()) { // AFFICHAGE COMBO System.out.print("[GamePad] > "); for (int i = 0 ; i < Combo.size() ; i++) { System.out.print(Combo.get(i)+" + "); } System.out.println(pressENTER+1 +"x[ENTER]"); try { // STREET FIGHTERS - Metsu-Hadoken (Ryu) if ((Combo.get(0) == "DOWN") && (Combo.get(1) == "RIGHT") && (Combo.get(2) == "DOWN") && (Combo.get(3) == "RIGHT")) { pressENTER++; if (pressENTER >= 3) { hackComboVideo("metsuhadoken.mp4",10000); System.out.println("[CHEATCODE] METSU HADOKEN ! (Ryu - Street Fighters)"); pressENTER = 0; } } // STREET FIGHTERS - Hadoken (Ryu) else if ((pressENTER == 0) && (Combo.get(0) == "DOWN") && (Combo.get(1) == "RIGHT")) { hackComboSound("../../res/bitHadoken.wav",1300); //hackComboPicture("Hadoken.gif", 1300); // TODO - IMAGE... } // STREET FIGHTERS - Shoryuken (Ryu) else if ((Combo.get(0) == "RIGHT") && (Combo.get(1) == "DOWN") && (Combo.get(2) == "RIGHT")) { hackComboSound("../../res/bitShoryuken.wav",2500); } // GALAGA - Challenge Completed else if ( (Combo.get(0) == "UP") && (Combo.get(1) == "DOWN") && (Combo.get(2) == "UP") && (Combo.get(3) == "DOWN")) { hackComboSound("../../res/bitABOUT.wav",6300); } // On nettoie la liste Combo si on foire en appuyant sur ENTER else { if (pressENTER == 0) { Combo.clear(); } } } catch (IndexOutOfBoundsException e) { Combo.clear(); } } } private void hackComboSound(String son, int duree) { SKIP.setDisable(true); START.setDisable(true); SELECT.setDisable(true); /* CANCEL.setDisable(false); CANCEL.requestFocus(); CANCEL.isPressed(); // TODO - mediaPlayer.stop(); */ CANCEL.setDisable(true); sound = new Sound(mainAppFX, son); sound.Play(); new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(duree); START.setDisable(false); SKIP.setDisable(false); } catch (InterruptedException e) { e.printStackTrace(); // TODO LOGGER } } }).start(); Combo.clear(); } private void hackComboVideo(String video, int duree) { SKIP.setDisable(true); START.setDisable(true); SELECT.setDisable(true); CANCEL.setDisable(true); File fichier = new File((String) "src/res/"+video); setVID_URL(fichier.toURI().toString()); initFX(); new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(duree); START.setDisable(false); SKIP.setDisable(false); } catch (InterruptedException e) { e.printStackTrace(); // TODO LOGGER } } }).start(); Combo.clear(); } private void hackComboPicture(String imgURL, int duree) { String path = "\\bin\\res\\"; MainAppFX.explorer(path); // TODO - Probleme affichage image /* mediaView.setVisible(false); imgAnim.toFront(); imgAnim.setVisible(true); System.out.println("IMAGE VIEW"); Image imgBG = new Image(imgURL, true); imgAnim.setImage(imgBG); */ if(!true) { SwingUtilities.invokeLater(new Runnable(){ public void run(){ //TODO - javax.imageio.IIOException: Can't read input file! ImagePanel lol = new ImagePanel(); lol.Init(lol.createImage(imgURL)); } }); } new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(duree); if (!imgURL.isEmpty()) { imgAnim.setVisible(false); mediaView.setVisible(true); } } catch (InterruptedException e) { e.printStackTrace(); // TODO LOGGER } } }).start(); Combo.clear(); } @FXML private void handleLEFT() { if (player.getString("sound").equals("ON")) { sound = new Sound(mainAppFX, "../../res/bitMOVE.wav"); sound.Play(); } Combo.add("LEFT"); // Permet de se deplacer vers la GAUCHE du ButtonBar switch (btnSelected) { case "START" : if (!SKIP.isDisable()) { SKIP.requestFocus(); btnSelected = "CANCEL"; } break; case "SKIP" : if (!CANCEL.isDisable()) { CANCEL.requestFocus(); btnSelected = "CANCEL"; } break; case "CANCEL" : if (!SELECT.isDisable()) { SELECT.requestFocus(); btnSelected = "SELECT"; } break; case "SELECT" : default : if (!START.isDisable()) { START.requestFocus(); btnSelected = "START"; } break; } } @FXML private void handleRIGHT() { if (player.getString("sound").equals("ON")) { sound = new Sound(mainAppFX, "../../res/bitMOVE.wav"); sound.Play(); } Combo.add("RIGHT"); // Permet de se deplacer vers la DROITE du ButtonBar switch (btnSelected) { case "START" : if (!SELECT.isDisable()) { SELECT.requestFocus(); btnSelected = "SELECT"; } break; case "SELECT" : if (!CANCEL.isDisable()) { CANCEL.requestFocus(); btnSelected = "CANCEL"; } break; case "CANCEL" : if (!SKIP.isDisable()) { SKIP.requestFocus(); btnSelected = "CANCEL"; } break; case "SKIP" : default : if (!START.isDisable()) { START.requestFocus(); btnSelected = "START"; } break; } } @FXML private void handleUP() { if (player.getString("sound").equals("ON")) { sound = new Sound(mainAppFX, "../../res/bitMOVE.wav"); sound.Play(); } Combo.add("UP"); } @FXML private void handleDOWN() { if (player.getString("sound").equals("ON")) { sound = new Sound(mainAppFX, "../../res/bitMOVE.wav"); sound.Play(); } Combo.add("DOWN"); } /** * Appellé par l'application principale pour avoir une référence de retour sur elle-même * * @param mainApp */ public void setMainAppFX(MainAppFX mainApp) { mainAppFX = mainApp; mainAppFX.Reflexivite(); } }
NeoRyu/GestionParcInfo
src/application/viewer/SplashController.java
Java
apache-2.0
15,918
package org.endeavourhealth.core.queueing; public class MessageFormat { //NOTE: These Strings correspond to the message format values in the SystemEditComponent.ts class public static final String EMIS_OPEN = "EMISOPEN"; public static final String EMIS_OPEN_HR = "OPENHR"; public static final String EMIS_CSV = "EMISCSV"; public static final String TPP_CSV = "TPPCSV"; public static final String TPP_XML = "TPPXML"; public static final String FHIR_JSON = "FHIRJSON"; public static final String FHIR_XML = "FHIRXML"; public static final String VITRUICARE_XML = "VITRUCARE"; public static final String EDW_XML = "EDWXML"; public static final String TABLEAU = "TABLEAU"; public static final String ENTERPRISE_CSV = "ENTERPRISE_CSV"; public static final String HL7V2 = "HL7V2"; public static final String ADASTRA_XML = "ADASTRA_XML"; public static final String BARTS_CSV = "BARTSCSV"; public static final String HOMERTON_CSV = "HOMERTONCSV"; public static final String VISION_CSV = "VISIONCSV"; public static final String ADASTRA_CSV = "ADASTRACSV"; public static final String JSON_API = "JSON_API"; public static final String PCR_CSV = "PCR_CSV"; public static final String SUBSCRIBER_CSV = "SUBSCRIBER_CSV"; public static final String BHRUT_CSV = "BHRUTCSV"; public static final String IMPERIAL_HL7_V2 = "IMPERIALHL7V2"; public static final String DUMMY_SENDER_SOFTWARE_FOR_BULK_DELETE = "BULK_DELETE_DATA"; //public static final String DUMMY_SENDER_SOFTWARE_FOR_BULK_SUBSCRIBER_TRANSFORM = "BULK_TRANSFORM_TO_SUBSCRIBER"; //superseded by below ones /*public static final String DUMMY_SENDER_SOFTWARE_FOR_BULK_SUBSCRIBER_DELETE = "BULK_DELETE_FROM_SUBSCRIBER"; public static final String DUMMY_SENDER_SOFTWARE_FOR_BULK_SUBSCRIBER_REFRESH = "BULK_REFRESH_OF_SUBSCRIBER"; public static final String DUMMY_SENDER_SOFTWARE_FOR_BULK_SUBSCRIBER_QUICK_REFRESH = "BULK_QUICK_REFRESH_OF_SUBSCRIBER";*/ }
endeavourhealth/EDS
src/eds-messaging-core/src/main/java/org/endeavourhealth/core/queueing/MessageFormat.java
Java
apache-2.0
2,010
# omnia-web This web project is my own blog/cms system.
AmyStorm/omnia-web
README.md
Markdown
apache-2.0
56
# Penicillium calidicanium J.L. Chen, 2002 SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in in Chen, Yen, Lin & Ku, Mycologia 94(5): 870 (2002) #### Original name Penicillium calidicanium J.L. Chen, 2002 ### Remarks null
mdoering/backbone
life/Fungi/Ascomycota/Eurotiomycetes/Eurotiales/Trichocomaceae/Penicillium/Penicillium calidicanium/README.md
Markdown
apache-2.0
281
/* * Copyright 2000-2022 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package jetbrains.buildserver.sonarplugin.manager; import jetbrains.buildServer.serverSide.ConfigActionFactory; import jetbrains.buildServer.serverSide.SProject; import jetbrains.buildServer.serverSide.settings.ProjectSettingsManager; import jetbrains.buildserver.sonarplugin.manager.projectfeatures.SQSManagerProjectFeatures; import jetbrains.buildserver.sonarplugin.manager.projectsettings.SQSManagerImpl; import jetbrains.buildserver.sonarplugin.sqrunner.manager.SQSManagerTest; import jetbrains.buildserver.sonarplugin.sqrunner.manager.TestUtil; import org.assertj.core.api.BDDAssertions; import org.jetbrains.annotations.NotNull; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.util.Arrays; import static org.mockito.Mockito.*; /** * Created by linfar on 03.10.16. * * Test for MigratingSQSManager */ @Test public class MigratingSQSManagerTest { private SProject myRoot; private SProject myProject; @NotNull private final String myProjectId = "projectId"; @NotNull private final String myRootProjectId = "_Root"; @BeforeMethod(alwaysRun = true) public void setUp() { final TestUtil.Projects projects = TestUtil.createProjects(myRootProjectId, myProjectId); myRoot = projects.myRoot; myProject = projects.myProject; } public void test() { ProjectSettingsManager settingsManager = mock(ProjectSettingsManager.class); String serverId = "serverId"; SQSInfo serverInfo = SQSManagerTest.mockSQSInfo(settingsManager, serverId, myProjectId); String rootServerId = "rootServerId"; SQSInfo rootServerInfo = SQSManagerTest.mockSQSInfo(settingsManager, rootServerId, myRootProjectId); SQSManagerImpl SQSManager = new SQSManagerImpl(settingsManager); final SQSManagerProjectFeatures sqsManagerProjectFeatures = mock(SQSManagerProjectFeatures.class); final MigratingSQSManager migratingSQSManager = new MigratingSQSManager(Arrays.asList(sqsManagerProjectFeatures, SQSManager), sqsManagerProjectFeatures, mock(ConfigActionFactory.class)); BDDAssertions.then(migratingSQSManager.getOwnServer(myRoot, serverId)).isNull(); BDDAssertions.then(migratingSQSManager.getOwnServer(myRoot, rootServerId)).isNotNull().isSameAs(rootServerInfo); BDDAssertions.then(migratingSQSManager.getOwnServer(myProject, serverId)).isNotNull().isSameAs(serverInfo); BDDAssertions.then(migratingSQSManager.getOwnServer(myProject, rootServerId)).isNull(); final BaseSQSInfo replacement = new BaseSQSInfo("newServer"); when(sqsManagerProjectFeatures.getOwnServer(myProject, serverId)).thenReturn(replacement); BDDAssertions.then(migratingSQSManager.getOwnServer(myProject, serverId)).isNotNull().isSameAs(replacement); } public void should_not_add_to_old() { final BaseSQSInfo any = new BaseSQSInfo("any"); final SQSManagerImpl sqsManager = mock(SQSManagerImpl.class); when(sqsManager.removeServer(any(), any())).thenReturn(new SQSManager.SQSActionResult(any, null, "")); final SQSManagerProjectFeatures sqsManagerProjectFeatures = mock(SQSManagerProjectFeatures.class); when(sqsManagerProjectFeatures.addServer(myProject, any)).thenReturn(new SQSManager.SQSActionResult(null, any, "")); final MigratingSQSManager migratingSQSManager = new MigratingSQSManager(Arrays.asList(sqsManagerProjectFeatures, sqsManager), sqsManagerProjectFeatures, mock(ConfigActionFactory.class)); migratingSQSManager.addServer(myProject, any); verify(sqsManagerProjectFeatures, times(1)).addServer(myProject, any); verify(sqsManager, never()).addServer(any(), any()); } public void should_remove_from_old_on_edit() { final BaseSQSInfo any = new BaseSQSInfo("any"); final SQSManagerProjectFeatures sqsManagerProjectFeatures = mock(SQSManagerProjectFeatures.class); when(sqsManagerProjectFeatures.getServer(myProject, "any")).thenReturn(null); when(sqsManagerProjectFeatures.editServer(myProject, any)).thenReturn(new SQSManager.SQSActionResult(any, any, "")); final SQSManagerImpl sqsManager = mock(SQSManagerImpl.class); when(sqsManager.removeServer(any(), any())).thenReturn(new SQSManager.SQSActionResult(any, null, "")); when(sqsManager.getServer(myProject, "any")).thenReturn(any); final MigratingSQSManager migratingSQSManager = new MigratingSQSManager(Arrays.asList(sqsManagerProjectFeatures, sqsManager), sqsManagerProjectFeatures, mock(ConfigActionFactory.class)); migratingSQSManager.editServer(myProject, any); verify(sqsManagerProjectFeatures, times(1)).addServer(myProject, any); verify(sqsManager, times(1)).removeServer(myProject, "any"); } public void should_add_to_new_when_edit() { final BaseSQSInfo any = new BaseSQSInfo("any"); final SQSManagerImpl sqsManager = mock(SQSManagerImpl.class); when(sqsManager.removeServer(any(), any())).thenReturn(new SQSManager.SQSActionResult(any, null, "")); when(sqsManager.getServer(myProject, "any")).thenReturn(any); final SQSManagerProjectFeatures sqsManagerProjectFeatures = mock(SQSManagerProjectFeatures.class); when(sqsManagerProjectFeatures.getServer(myProject, "any")).thenReturn(null); final MigratingSQSManager migratingSQSManager = new MigratingSQSManager(Arrays.asList(sqsManagerProjectFeatures, sqsManager), sqsManagerProjectFeatures, mock(ConfigActionFactory.class)); migratingSQSManager.editServer(myProject, any); verify(sqsManagerProjectFeatures, times(1)).addServer(myProject, any); verify(sqsManager, times(1)).removeServer(myProject, "any"); } public void should_remove_from_both() { final SQSManagerImpl sqsManager = mock(SQSManagerImpl.class); final SQSManagerProjectFeatures sqsManagerProjectFeatures = mock(SQSManagerProjectFeatures.class); final MigratingSQSManager migratingSQSManager = new MigratingSQSManager(Arrays.asList(sqsManagerProjectFeatures, sqsManager), sqsManagerProjectFeatures, mock(ConfigActionFactory.class)); final BaseSQSInfo any = new BaseSQSInfo("any"); when(sqsManagerProjectFeatures.removeServer(any(), any())).thenReturn(new SQSManager.SQSActionResult(any, null, "")); when(sqsManager.removeServer(any(), any())).thenReturn(new SQSManager.SQSActionResult(any, null, "")); final SQSManager.SQSActionResult result = migratingSQSManager.removeServer(myProject, "any"); verify(sqsManagerProjectFeatures, times(1)).removeServer(myProject, "any"); verify(sqsManager, times(1)).removeServer(myProject, "any"); BDDAssertions.then(result.getBeforeAction()).isNotNull(); BDDAssertions.then(result.isError()).isFalse(); reset(sqsManagerProjectFeatures, sqsManager); when(sqsManagerProjectFeatures.removeServer(any(), any())).thenReturn(new SQSManager.SQSActionResult(null, null, "", true)); when(sqsManager.removeServer(any(), any())).thenReturn(new SQSManager.SQSActionResult(null, null, "", true)); final SQSManager.SQSActionResult result2 = migratingSQSManager.removeServer(myProject, "any"); verify(sqsManagerProjectFeatures, times(1)).removeServer(myProject, "any"); verify(sqsManager, times(1)).removeServer(myProject, "any"); BDDAssertions.then(result2.getBeforeAction()).isNull(); BDDAssertions.then(result2.isError()).isTrue(); } public void should_get_from_both() { final SQSManagerImpl sqsManager = mock(SQSManagerImpl.class); final SQSManagerProjectFeatures sqsManagerProjectFeatures = mock(SQSManagerProjectFeatures.class); final MigratingSQSManager migratingSQSManager = new MigratingSQSManager(Arrays.asList(sqsManagerProjectFeatures, sqsManager), sqsManagerProjectFeatures, mock(ConfigActionFactory.class)); migratingSQSManager.getAvailableServers(myProject); verify(sqsManagerProjectFeatures, times(1)).getAvailableServers(myProject); verify(sqsManager, times(1)).getAvailableServers(myProject); migratingSQSManager.getOwnAvailableServers(myProject); verify(sqsManagerProjectFeatures, times(1)).getOwnAvailableServers(myProject); verify(sqsManager, times(1)).getOwnAvailableServers(myProject); migratingSQSManager.getServer(myProject, "any"); verify(sqsManagerProjectFeatures, times(1)).getServer(myProject, "any"); verify(sqsManager, times(1)).getServer(myProject, "any"); migratingSQSManager.getOwnServer(myProject, "any"); verify(sqsManagerProjectFeatures, times(1)).getOwnServer(myProject, "any"); verify(sqsManager, times(1)).getOwnServer(myProject, "any"); } public void should_get_from_new_when_available() { final SQSManagerImpl sqsManager = mock(SQSManagerImpl.class); final SQSManagerProjectFeatures sqsManagerProjectFeatures = mock(SQSManagerProjectFeatures.class); final MigratingSQSManager migratingSQSManager = new MigratingSQSManager(Arrays.asList(sqsManagerProjectFeatures, sqsManager), sqsManagerProjectFeatures, mock(ConfigActionFactory.class)); final BaseSQSInfo any = new BaseSQSInfo("any"); when(sqsManagerProjectFeatures.getServer(myProject, "any")).thenReturn(any); when(sqsManagerProjectFeatures.getOwnServer(myProject, "any")).thenReturn(any); migratingSQSManager.getServer(myProject, "any"); verify(sqsManagerProjectFeatures, times(1)).getServer(myProject, "any"); verify(sqsManager, never()).getServer(any(), any()); migratingSQSManager.getOwnServer(myProject, "any"); verify(sqsManagerProjectFeatures, times(1)).getOwnServer(myProject, "any"); verify(sqsManager, never()).getOwnServer(any(), any()); } }
JetBrains/TeamCity.SonarQubePlugin
sonar-plugin-server/src/test/java/jetbrains/buildserver/sonarplugin/manager/MigratingSQSManagerTest.java
Java
apache-2.0
10,520
# Pycnostachys sphaerocephala Baker SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Lamiaceae/Pycnostachys/Pycnostachys sphaerocephala/README.md
Markdown
apache-2.0
183
-- MySQL sql for KULRICE-5419: alter table krms_cntxt_t add column desc_txt varchar(255) default null; alter table krms_term_spec_t add column desc_txt varchar(255) default null; alter table krms_term_t add column desc_txt varchar(255) default null; alter table krms_attr_defn_t add column desc_txt varchar(255) default null;
sbower/kuali-rice-1
scripts/upgrades/1.0.3 to 2.0.0/db-updates/mysql-2011-07-22.sql
SQL
apache-2.0
326
// // OJNIArrayInfo.h // Zdravcity-iOS // // Created by Alexander Shitikov on 16.03.16. // Copyright © 2016 A. All rights reserved. // #import <Foundation/Foundation.h> #import "OJNIEnv.h" @interface OJNIArrayInfo : NSObject @property (nonatomic) BOOL isPrimitive; @property (nonatomic) Class componentType; @property (nonatomic) NSUInteger dimensions; + (instancetype)arrayInfoFromJavaArray:(jarray)array environment:(OJNIEnv *)env prefix:(NSString *)prefix; @end
ashitikov/Objective-JNI-Environment
OJNIArrayInfo.h
C
apache-2.0
475
package com.fengpy.myapp.gaodedemo; import android.content.Context; import com.fengpy.myapp.R; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; /** * @ description:图例设置 * @ time: 2017/8/29. * @ author: peiyun.feng * @ email: fengpy@aliyun.com */ public final class ConfigManager { private static ConfigManager instance; private List<BandSetting> _bandSettings; private Context _context; private ConfigManager(Context context){ _context = context; List<BandSetting> bands = loadBands(); /*List<BandSetting> bandSettings = loadSettings(); for(int i = 0; i < bands.size(); i++){ BandSetting band = bands.get(i); BandSetting setting = getBandSetting(bandSettings, band.getName()); if(setting != null){ band.setDisplay(setting.getDisplay()); band.setRange(setting.getRange()); } }*/ _bandSettings = bands; } public static ConfigManager getInstance(Context context){ if(instance == null){ instance = new ConfigManager(context); } return instance; } private List<BandSetting> loadBands(){ InputStream inputStream = null; List<BandSetting> bands = null; try { inputStream = _context.getResources().openRawResource(R.raw.legenddata); byte[] buffer = new byte[inputStream.available()]; inputStream.read(buffer); String json = new String(buffer); bands = com.alibaba.fastjson.JSON.parseArray(json, BandSetting.class); } catch (Exception e) { bands = new ArrayList<BandSetting>(); e.printStackTrace(); } finally { if(inputStream != null){ try { inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } } return bands; } /** * 加载当前对监测频段的设置 */ private List<BandSetting> loadSettings(){ FileInputStream inputStream = null; List<BandSetting> bands = null; try { inputStream = _context.openFileInput("legend"); // File file = new File(Constant.DEFAULT_SETTING_PATH, "Vehicular.json"); // inputStream = new FileInputStream(file); // inputStream = new FileInputStream(_context.openFileInput("legend")); //TODO== 执行此处时,没有该文件系统是否会创建?为什么没有呢? // inputStream = new FileInputStream(new File(Environment.getExternalStoragePublicDirectory("/"), "Vehicular.json")); byte[] buffer = new byte[inputStream.available()]; inputStream.read(buffer); String json = new String(buffer); bands = com.alibaba.fastjson.JSON.parseArray(json, BandSetting.class); } catch (Exception e) { bands = new ArrayList<BandSetting>(); e.printStackTrace(); }finally { if(inputStream != null){ try { inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } } return bands; } public List<BandSetting> getBandSettings(){ return _bandSettings; } public BandSetting getBandSetting(String name){ if(_bandSettings != null){ for(int i = 0; i < _bandSettings.size(); i++){ BandSetting setting = _bandSettings.get(i); if(setting.getName().equals(name)){ return setting; } } } return null; } private BandSetting getBandSetting(List<BandSetting> bandSettings, String name){ if(bandSettings == null) return null; for(int i = 0; i < bandSettings.size(); i++){ BandSetting setting = bandSettings.get(i); if(setting.getName().equals(name)){ return setting; } } return null; } }
androidfengpy/MyApp
app/src/main/java/com/fengpy/myapp/gaodedemo/ConfigManager.java
Java
apache-2.0
4,246
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ignite.internal.processors.cache; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.query.QueryCursor; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.PRIMARY; import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC; import static org.apache.ignite.cache.CacheMode.REPLICATED; import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; /** * */ public class IgniteCacheJoinPartitionedAndReplicatedTest extends GridCommonAbstractTest { /** */ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); /** */ private static final String PERSON_CACHE = "person"; /** */ private static final String ORG_CACHE = "org"; /** */ private boolean client; /** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); TcpDiscoverySpi spi = ((TcpDiscoverySpi)cfg.getDiscoverySpi()); spi.setIpFinder(IP_FINDER); List<CacheConfiguration> ccfgs = new ArrayList<>(); { CacheConfiguration ccfg = configuration(PERSON_CACHE); ccfg.setCacheMode(REPLICATED); QueryEntity entity = new QueryEntity(); entity.setKeyType(Integer.class.getName()); entity.setValueType(Person.class.getName()); entity.addQueryField("orgId", Integer.class.getName(), null); entity.addQueryField("name", String.class.getName(), null); ccfg.setQueryEntities(F.asList(entity)); ccfgs.add(ccfg); } { CacheConfiguration ccfg = configuration(ORG_CACHE); QueryEntity entity = new QueryEntity(); entity.setKeyType(Integer.class.getName()); entity.setValueType(Organization.class.getName()); entity.addQueryField("id", Integer.class.getName(), null); entity.addQueryField("name", String.class.getName(), null); ccfg.setQueryEntities(F.asList(entity)); ccfgs.add(ccfg); } cfg.setCacheConfiguration(ccfgs.toArray(new CacheConfiguration[ccfgs.size()])); cfg.setClientMode(client); return cfg; } /** * @param name Cache name. * @return Cache configuration. */ private CacheConfiguration configuration(String name) { CacheConfiguration ccfg = new CacheConfiguration(); ccfg.setName(name); ccfg.setWriteSynchronizationMode(FULL_SYNC); ccfg.setAtomicWriteOrderMode(PRIMARY); ccfg.setAtomicityMode(ATOMIC); ccfg.setBackups(1); return ccfg; } /** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); startGridsMultiThreaded(2); client = true; startGrid(2); } /** {@inheritDoc} */ @Override protected void afterTestsStopped() throws Exception { stopAllGrids(); super.afterTestsStopped(); } /** * @throws Exception If failed. */ public void testJoin() throws Exception { Ignite client = grid(2); IgniteCache<Object, Object> personCache = client.cache(PERSON_CACHE); IgniteCache<Object, Object> orgCache = client.cache(ORG_CACHE); List<Integer> keys = primaryKeys(ignite(0).cache(PERSON_CACHE), 3, 200_000); orgCache.put(keys.get(0), new Organization(0, "org1")); personCache.put(keys.get(1), new Person(0, "p1")); personCache.put(keys.get(2), new Person(0, "p2")); checkQuery("select o.name, p._key, p.name " + "from \"person\".Person p join \"org\".Organization o " + "on (p.orgId = o.id)", orgCache, 2); checkQuery("select o.name, p._key, p.name " + "from \"org\".Organization o join \"person\".Person p " + "on (p.orgId = o.id)", orgCache, 2); checkQuery("select o.name, p._key, p.name " + "from \"person\".Person p left join \"org\".Organization o " + "on (p.orgId = o.id)", orgCache, 2); checkQuery("select o.name, p._key, p.name " + "from \"org\".Organization o left join \"person\".Person p " + "on (p.orgId = o.id)", orgCache, 2); } /** * @param sql SQL. * @param cache Cache. * @param expSize Expected results size. * @param args Arguments. */ private void checkQuery(String sql, IgniteCache<Object, Object> cache, int expSize, Object... args) { String plan = (String)cache.query(new SqlFieldsQuery("explain " + sql)) .getAll().get(0).get(0); log.info("Plan: " + plan); SqlFieldsQuery qry = new SqlFieldsQuery(sql); qry.setArgs(args); QueryCursor<List<?>> cur = cache.query(qry); List<List<?>> res = cur.getAll(); if (expSize != res.size()) log.info("Results: " + res); assertEquals(expSize, res.size()); } /** * */ private static class Person implements Serializable { /** */ int orgId; /** */ String name; /** * @param orgId Organization ID. * @param name Name. */ public Person(int orgId, String name) { this.orgId = orgId; this.name = name; } /** {@inheritDoc} */ @Override public String toString() { return S.toString(Person.class, this); } } /** * */ private static class Organization implements Serializable { /** */ String name; /** */ int id; /** * @param name Name. */ public Organization(int id, String name) { this.id = id; this.name = name; } /** {@inheritDoc} */ @Override public String toString() { return S.toString(Organization.class, this); } } }
kromulan/ignite
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheJoinPartitionedAndReplicatedTest.java
Java
apache-2.0
7,647
#!/bin/bash # Source library source ../../../utils/helper.sh source ../../../utils/ccloud_library.sh check_jq || exit CONFIG_FILE=$HOME/.confluent/java.config ccloud::validate_ccloud_config $CONFIG_FILE || exit ./stop-docker.sh ccloud::generate_configs $CONFIG_FILE source ./delta_configs/env.delta docker-compose up -d echo "Sleeping 90 seconds" sleep 90 ./delete-topics.sh docker-compose exec connect bash -c 'kafka-topics --bootstrap-server `grep "^\s*bootstrap.server" /tmp/ak-tools-ccloud.delta | tail -1` --command-config /tmp/ak-tools-ccloud.delta --topic test2 --create --replication-factor 3 --partitions 6' source ./submit_datagen_orders_config_avro.sh #docker-compose exec connect bash -c 'kafka-avro-console-consumer --topic test2 --bootstrap-server $CONNECT_BOOTSTRAP_SERVERS --consumer.config /tmp/ak-tools-ccloud.delta --property basic.auth.credentials.source=$CONNECT_VALUE_CONVERTER_BASIC_AUTH_CREDENTIALS_SOURCE --property schema.registry.basic.auth.user.info=$CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_BASIC_AUTH_USER_INFO --property schema.registry.url=$CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL --max-messages 5' docker-compose exec connect bash -c 'kafka-avro-console-consumer --topic test2 --bootstrap-server $CONNECT_BOOTSTRAP_SERVERS --consumer-property sasl.mechanism=PLAIN --consumer-property security.protocol=SASL_SSL --consumer-property sasl.jaas.config="$SASL_JAAS_CONFIG_PROPERTY_FORMAT" --property basic.auth.credentials.source=$CONNECT_VALUE_CONVERTER_BASIC_AUTH_CREDENTIALS_SOURCE --property schema.registry.basic.auth.user.info=$CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_BASIC_AUTH_USER_INFO --property schema.registry.url=$CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL --max-messages 5'
confluentinc/examples
clients/cloud/kafka-connect-datagen/start-docker-avro.sh
Shell
apache-2.0
1,728
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ COHORTE configuration file parser: converts a parsed configuration file to beans :author: Thomas Calmant :license: Apache Software License 2.0 .. Copyright 2014 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ # Python standard library import collections import logging import uuid # iPOPO Decorators from pelix.ipopo.decorators import ComponentFactory, Provides, Instantiate, \ Requires # COHORTE constants import cohorte # ------------------------------------------------------------------------------ # Documentation strings format __docformat__ = "restructuredtext en" # Version __version_info__ = (1, 0, 1) __version__ = ".".join(str(x) for x in __version_info__) # ------------------------------------------------------------------------------ _logger = logging.getLogger(__name__) # ------------------------------------------------------------------------------ # Component to be instantiated Component = collections.namedtuple( 'Component', ('factory', 'name', 'properties')) # Bundle to be installed Bundle = collections.namedtuple( 'Bundle', ('name', 'filename', 'properties', 'version', 'optional')) # Simplest configuration possible BootConfiguration = collections.namedtuple( 'BootConfiguration', ('bundles', 'composition', 'properties', 'environment', 'boot_args')) # Boot configuration + Isolate basic description Isolate = collections.namedtuple( 'Isolate', BootConfiguration._fields + ('name', 'kind', 'node', 'level', 'sublevel')) def _recursive_namedtuple_convert(data): """ Recursively converts the named tuples in the given object to dictionaries :param data: An object in a named tuple or its children :return: The converted object """ if isinstance(data, list): # List return [_recursive_namedtuple_convert(item) for item in data] elif hasattr(data, '_asdict'): # Named tuple dict_value = dict(data._asdict()) for key, value in dict_value.items(): dict_value[key] = _recursive_namedtuple_convert(value) return dict_value else: # Standard object return data # ------------------------------------------------------------------------------ @ComponentFactory('cohorte-config-parser-factory') @Provides(cohorte.SERVICE_CONFIGURATION_READER) @Requires('_reader', cohorte.SERVICE_FILE_READER) @Instantiate('cohorte-config-parser') class BootConfigParser(object): """ Boot configuration parser """ def __init__(self): """ Sets up the members """ # File reader self._reader = None # Loaded isolates configurations self._isolates = None @staticmethod def _parse_bundle(json_object): """ Reads the given JSON object and returns its Bundle representation :param json_object: A parsed JSON object :return: A Bundle object :raise KeyError: A mandatory parameter is missing """ # Use a copy of the properties properties = {} json_properties = json_object.get('properties') if json_properties: properties.update(json_properties) return Bundle(name=json_object['name'], filename=json_object.get('file'), properties=properties, version=json_object.get('version'), optional=json_object.get('optional', False)) def _parse_bundles(self, bundles): """ Parses the bundles in the given list. Returns an empty list if the given one is None or empty. :param bundles: A list of bundles representations :return: A list of Bundle objects :raise KeyError: A mandatory parameter is missing """ if not bundles: return [] return [self._parse_bundle(bundle) for bundle in bundles] @staticmethod def _parse_component(json_object): """ Reads the given JSON object and returns its Component representation :param json_object: A parsed JSON object :return: A Component object :raise KeyError: A mandatory parameter is missing """ # Mandatory values factory = json_object['factory'] # Computed name (if needed) name = json_object.get('name', factory + '-instance') # Use a copy of the properties properties = {} json_properties = json_object.get('properties') if json_properties: properties.update(json_properties) return Component(factory=factory, name=name, properties=properties) def _parse_components(self, components): """ Parses the components in the given list. Returns an empty list if the given one is None or empty. :param components: A list of components representations :return: A list of Component objects :raise KeyError: A mandatory parameter is missing """ if not components: return [] return [self._parse_component(component) for component in components] def _parse_isolate(self, json_object): """ Reads the given JSON object and returns its Isolate representation :param json_object: A parsed JSON object :return: An Isolate object :raise KeyError: A mandatory parameter is missing """ # Reuse the boot parser boot_config = self.load_boot_dict(json_object) return Isolate(name=json_object['name'], kind=json_object['kind'], level=json_object['level'], sublevel=json_object['sublevel'], # Reuse boot configuration values **boot_config._asdict()) def _prepare_configuration(self, uid, name, kind, bundles=None, composition=None, base_configuration=None): """ Prepares and returns a configuration dictionary to be stored in the configuration broker, to start an isolate of the given kind. :param uid: The isolate UID :param name: The isolate name :param kind: The kind of isolate to boot :param bundles: Extra bundles to install :param composition: Extra components to instantiate :param base_configuration: Base configuration (to override) :return: A configuration dictionary (updated base_configuration if given) :raise IOError: Unknown/unaccessible kind of isolate :raise KeyError: A parameter is missing in the configuration files :raise ValueError: Error reading the configuration """ if isinstance(base_configuration, dict): configuration = base_configuration else: configuration = {} # Set up isolate properties configuration['uid'] = uid \ or configuration.get('custom_uid') or str(uuid.uuid4()) configuration['name'] = name configuration['kind'] = kind # Boot configuration for this kind new_boot = configuration.setdefault('boot', {}) new_boot.update(_recursive_namedtuple_convert(self.load_boot(kind))) # Add bundles (or an empty list) if bundles: new_bundles = configuration.setdefault('bundles', []) new_bundles.extend(_recursive_namedtuple_convert( [self.normalize_bundle(bundle) for bundle in bundles])) # Add components (or an empty list) if composition: new_compo = configuration.setdefault('composition', []) new_compo.extend(_recursive_namedtuple_convert(composition)) # Return the configuration dictionary return configuration @staticmethod def normalize_bundle(bundle): """ Make a Bundle object from the given Bundle-like object attributes, using default values when necessary. :param bundle: A Bundle-like object :return: A Bundle object :raise AttributeError: A mandatory attribute is missing :raise ValueError: Invalid attribute value """ if isinstance(bundle, Bundle): # Already a bundle return bundle # Bundle name is mandatory name = bundle.name if not name: raise ValueError("A bundle must have a name: {0}".format(bundle)) # Get the filename for fileattr in ('filename', 'file'): filename = getattr(bundle, fileattr, None) if filename: break # Normalize bundle properties properties = getattr(bundle, 'properties', {}) if not isinstance(properties, dict): properties = {} # Normalize bundle version version = getattr(bundle, 'version', None) if version is not None: version = str(version) return Bundle(name, filename, properties, version, getattr(bundle, 'optional', False)) def load_boot(self, kind): """ Loads the boot configuration for the given kind of isolate, or returns the one in the cache. :param kind: The kind of isolate to boot :return: The loaded BootConfiguration object :raise IOError: Unknown/unaccessible kind of isolate :raise KeyError: A parameter is missing in the configuration files :raise ValueError: Error reading the configuration """ # Prepare & store the bean representation return self.load_boot_dict(self.load_conf_raw('boot', kind)) def load_conf_raw(self, level, kind): """ Loads the boot configuration for the given kind of isolate, or returns the one in the cache. :param level: The level of configuration (boot, java, python) :param kind: The kind of isolate to boot :return: The loaded BootConfiguration object :raise IOError: Unknown/unaccessible kind of isolate :raise KeyError: A parameter is missing in the configuration files :raise ValueError: Error reading the configuration """ # Load the boot file return self.read('{0}-{1}.js'.format(level, kind)) def load_boot_dict(self, dict_config): """ Parses a boot configuration from the given dictionary :param dict_config: A configuration dictionary :return: The parsed BootConfiguration object :raise KeyError: A parameter is missing in the configuration files :raise ValueError: Error reading the configuration """ # Use a copy of environment environment = {} json_env = dict_config.get('environment') if json_env: environment.update(json_env) # Parse the properties properties = {} dict_properties = dict_config.get('properties') if dict_properties: properties.update(dict_properties) # Prepare the bean representation bundles = self._parse_bundles(dict_config.get('bundles')) composition = self._parse_components(dict_config.get('composition')) return BootConfiguration(bundles=bundles, composition=composition, boot_args=dict_config.get('boot_args'), environment=environment, properties=properties) def prepare_isolate(self, uid, name, kind, level, sublevel, bundles=None, composition=None): """ Prepares and returns a configuration dictionary to be stored in the configuration broker, to start an isolate of the given kind. :param uid: The isolate UID :param name: The isolate name :param kind: The kind of isolate to boot (pelix, osgi, ...) :param level: The level of configuration (boot, java, python, ...) :param sublevel: Category of configuration (monitor, isolate, ...) :param bundles: Extra bundles to install :param composition: Extra components to instantiate :return: A configuration dictionary :raise IOError: Unknown/unaccessible kind of isolate :raise KeyError: A parameter is missing in the configuration files :raise ValueError: Error reading the configuration """ # Load the isolate model file configuration = self.load_conf_raw(level, sublevel) try: # Try to load the isolate-specific configuration # without logging "file not found" errors isolate_conf = self.read(name + ".js", False) except IOError: # Ignore I/O errors (file not found) # Propagate ValueError (parsing errors) pass else: # Merge the configurations: this method considers that the first # parameter has priority on the second configuration = self._reader.merge_object(isolate_conf, configuration) # Extend with the boot configuration return self._prepare_configuration(uid, name, kind, bundles, composition, configuration) def read(self, filename, reader_log_error=True): """ Reads the content of the given file, without parsing it. :param filename: A configuration file name :param reader_log_error: If True, the reader will log I/O errors :return: The dictionary read from the file """ return self._reader.load_file(filename, 'conf', log_error=reader_log_error)
ahmadshahwan/cohorte-runtime
python/cohorte/config/parser.py
Python
apache-2.0
14,427
/* * Copyright 2001-2012 Remi Vankeisbelck * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package woko.persistence.faceted; import woko.persistence.ObjectStore; public interface StoreSave { Object save(ObjectStore store, Object obj); }
pojosontheweb/woko
core/src/main/java/woko/persistence/faceted/StoreSave.java
Java
apache-2.0
761
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_60-ea) on Tue Aug 16 17:15:33 EDT 2016 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Interface org.wildfly.swarm.config.undertow.server.host.LocationSupplier (Public javadocs 2016.8.1 API)</title> <meta name="date" content="2016-08-16"> <link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.wildfly.swarm.config.undertow.server.host.LocationSupplier (Public javadocs 2016.8.1 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/LocationSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2016.8.1</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?org/wildfly/swarm/config/undertow/server/host/class-use/LocationSupplier.html" target="_top">Frames</a></li> <li><a href="LocationSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface org.wildfly.swarm.config.undertow.server.host.LocationSupplier" class="title">Uses of Interface<br>org.wildfly.swarm.config.undertow.server.host.LocationSupplier</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/LocationSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">LocationSupplier</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.undertow.server">org.wildfly.swarm.config.undertow.server</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.wildfly.swarm.config.undertow.server"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/LocationSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">LocationSupplier</a> in <a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/package-summary.html">org.wildfly.swarm.config.undertow.server</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/package-summary.html">org.wildfly.swarm.config.undertow.server</a> with parameters of type <a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/LocationSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">LocationSupplier</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/Host.html" title="type parameter in Host">T</a></code></td> <td class="colLast"><span class="typeNameLabel">Host.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/Host.html#location-org.wildfly.swarm.config.undertow.server.host.LocationSupplier-">location</a></span>(<a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/LocationSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">LocationSupplier</a>&nbsp;supplier)</code> <div class="block">Install a supplied Location object to the list of subresources</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/LocationSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2016.8.1</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?org/wildfly/swarm/config/undertow/server/host/class-use/LocationSupplier.html" target="_top">Frames</a></li> <li><a href="LocationSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2016 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
wildfly-swarm/wildfly-swarm-javadocs
2016.8.1/apidocs/org/wildfly/swarm/config/undertow/server/host/class-use/LocationSupplier.html
HTML
apache-2.0
7,932
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_112) on Tue Sep 12 14:31:27 MST 2017 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Class org.wildfly.swarm.config.security.security_domain.ClassicACL.ClassicACLResources (BOM: * : All 2017.9.5 API)</title> <meta name="date" content="2017-09-12"> <link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.wildfly.swarm.config.security.security_domain.ClassicACL.ClassicACLResources (BOM: * : All 2017.9.5 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACL.ClassicACLResources.html" title="class in org.wildfly.swarm.config.security.security_domain">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2017.9.5</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/wildfly/swarm/config/security/security_domain/class-use/ClassicACL.ClassicACLResources.html" target="_top">Frames</a></li> <li><a href="ClassicACL.ClassicACLResources.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.wildfly.swarm.config.security.security_domain.ClassicACL.ClassicACLResources" class="title">Uses of Class<br>org.wildfly.swarm.config.security.security_domain.ClassicACL.ClassicACLResources</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACL.ClassicACLResources.html" title="class in org.wildfly.swarm.config.security.security_domain">ClassicACL.ClassicACLResources</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.security.security_domain">org.wildfly.swarm.config.security.security_domain</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.wildfly.swarm.config.security.security_domain"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACL.ClassicACLResources.html" title="class in org.wildfly.swarm.config.security.security_domain">ClassicACL.ClassicACLResources</a> in <a href="../../../../../../../org/wildfly/swarm/config/security/security_domain/package-summary.html">org.wildfly.swarm.config.security.security_domain</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/security/security_domain/package-summary.html">org.wildfly.swarm.config.security.security_domain</a> that return <a href="../../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACL.ClassicACLResources.html" title="class in org.wildfly.swarm.config.security.security_domain">ClassicACL.ClassicACLResources</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACL.ClassicACLResources.html" title="class in org.wildfly.swarm.config.security.security_domain">ClassicACL.ClassicACLResources</a></code></td> <td class="colLast"><span class="typeNameLabel">ClassicACL.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACL.html#subresources--">subresources</a></span>()</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACL.ClassicACLResources.html" title="class in org.wildfly.swarm.config.security.security_domain">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2017.9.5</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/wildfly/swarm/config/security/security_domain/class-use/ClassicACL.ClassicACLResources.html" target="_top">Frames</a></li> <li><a href="ClassicACL.ClassicACLResources.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2017 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
wildfly-swarm/wildfly-swarm-javadocs
2017.9.5/apidocs/org/wildfly/swarm/config/security/security_domain/class-use/ClassicACL.ClassicACLResources.html
HTML
apache-2.0
7,935
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Fri Mar 06 22:14:29 CST 2015 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Interface org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProtoOrBuilder (hadoop-yarn-api 2.3.0 API) </TITLE> <META NAME="date" CONTENT="2015-03-06"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProtoOrBuilder (hadoop-yarn-api 2.3.0 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/hadoop/yarn/proto/YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProtoOrBuilder.html" title="interface in org.apache.hadoop.yarn.proto"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/apache/hadoop/yarn/proto//class-useYarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProtoOrBuilder.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProtoOrBuilder.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Interface<br>org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProtoOrBuilder</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../../org/apache/hadoop/yarn/proto/YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProtoOrBuilder.html" title="interface in org.apache.hadoop.yarn.proto">YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProtoOrBuilder</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.apache.hadoop.yarn.proto"><B>org.apache.hadoop.yarn.proto</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.apache.hadoop.yarn.proto"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../org/apache/hadoop/yarn/proto/YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProtoOrBuilder.html" title="interface in org.apache.hadoop.yarn.proto">YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProtoOrBuilder</A> in <A HREF="../../../../../../org/apache/hadoop/yarn/proto/package-summary.html">org.apache.hadoop.yarn.proto</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Classes in <A HREF="../../../../../../org/apache/hadoop/yarn/proto/package-summary.html">org.apache.hadoop.yarn.proto</A> that implement <A HREF="../../../../../../org/apache/hadoop/yarn/proto/YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProtoOrBuilder.html" title="interface in org.apache.hadoop.yarn.proto">YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProtoOrBuilder</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/yarn/proto/YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProto.html" title="class in org.apache.hadoop.yarn.proto">YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProto</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Protobuf type <code>hadoop.yarn.GetGroupsForUserResponseProto</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/yarn/proto/YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProto.Builder.html" title="class in org.apache.hadoop.yarn.proto">YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProto.Builder</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Protobuf type <code>hadoop.yarn.GetGroupsForUserResponseProto</code></TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/hadoop/yarn/proto/YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProtoOrBuilder.html" title="interface in org.apache.hadoop.yarn.proto"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/apache/hadoop/yarn/proto//class-useYarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProtoOrBuilder.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProtoOrBuilder.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2015 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved. </BODY> </HTML>
jsrudani/HadoopHDFSProject
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/target/org/apache/hadoop/yarn/proto/class-use/YarnServerResourceManagerServiceProtos.GetGroupsForUserResponseProtoOrBuilder.html
HTML
apache-2.0
9,825
//*******************************************************************************************// // // // Download Free Evaluation Version From: https://bytescout.com/download/web-installer // // // // Also available as Web API! Get Your Free API Key: https://app.pdf.co/signup // // // // Copyright © 2017-2020 ByteScout, Inc. All rights reserved. // // https://www.bytescout.com // // https://pdf.co // // // //*******************************************************************************************// using System; using System.Diagnostics; using Bytescout.PDFExtractor; namespace SearchablePDFMakerProgressChangedEvent { class Program { static void Main(string[] args) { try { /* By default, "SearchablePDFMaker" uses one of the standard PDF fonts to apply recognized text over the scanned document. Such fonts contain only basic characters from ISO-8859-1 charset. If you run OCR for one of the languages with characters that are not present in the default encoding, you should explicitly specify the font that contains the required characters using ".LabelingFont" property. If you run the application in Windows with a selected locale that matches OCR language, it will be enough to specify the usual font "Arial". But if your app will run in an unknown environment (for example, in some virtual machine) you will need to install some full Unicode font (e.g. "Arial Unicode MS") and then use it with SearchablePDFMaker: //searchablePDFMaker.LabelingFont = "Arial Unicode MS"; */ using (var searchablePDFMaker = new SearchablePDFMaker("demo", "demo")) { // Load sample PDF document searchablePDFMaker.LoadDocumentFromFile("sample_ocr.pdf"); // Extractor Progress event Console.WriteLine("Searchable PDF making in progress: \n"); searchablePDFMaker.ProgressChanged += SearchablePDF_ProgressChanged; // Set the location of OCR language data files searchablePDFMaker.OCRLanguageDataFolder = @"c:\Program Files\Bytescout PDF Extractor SDK\ocrdata_best\"; // Set OCR language searchablePDFMaker.OCRLanguage = "eng"; // "eng" for english, "deu" for German, "fra" for French, "spa" for Spanish etc - according to files in "ocrdata" folder // Find more language files at https://github.com/bytescout/ocrdata // Set PDF document rendering resolution searchablePDFMaker.OCRResolution = 300; // Save extracted text to file searchablePDFMaker.MakePDFSearchable("output.pdf"); // Open result document in default associated application (for demo purpose) ProcessStartInfo processStartInfo = new ProcessStartInfo("output.pdf"); processStartInfo.UseShellExecute = true; Process.Start(processStartInfo); } } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.WriteLine("\n\n Press enter key to exit..."); Console.ReadLine(); } /// <summary> /// Handle progress change event /// </summary> private static void SearchablePDF_ProgressChanged(object sender, OngoingOperation ongoingOperation, double progress, ref bool cancel) { drawTextProgressBar(Convert.ToInt32(progress), 100); } /// <summary> /// Display progress bar /// </summary> private static void drawTextProgressBar(int progress, int total) { //draw empty progress bar Console.CursorLeft = 0; Console.Write("["); //start Console.CursorLeft = 32; Console.Write("]"); //end Console.CursorLeft = 1; float onechunk = 30.0f / total; //draw filled part int position = 1; for (int i = 0; i < onechunk * progress; i++) { Console.BackgroundColor = ConsoleColor.Green; Console.CursorLeft = position++; Console.Write(" "); } //draw unfilled part for (int i = position; i <= 31; i++) { Console.BackgroundColor = ConsoleColor.Gray; Console.CursorLeft = position++; Console.Write(" "); } //draw totals Console.CursorLeft = 35; Console.BackgroundColor = ConsoleColor.Black; Console.Write(progress.ToString() + " of " + total.ToString() + " "); //blanks at the end remove any excess } } }
bytescout/ByteScout-SDK-SourceCode
PDF Extractor SDK/C#/SearchablePDFMaker Progress Indication/Program.cs
C#
apache-2.0
5,731
# AUTOGENERATED FILE FROM balenalib/aarch64-debian:buster-build RUN apt-get update \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ \ # .NET Core dependencies libc6 \ libgcc1 \ libgssapi-krb5-2 \ libicu63 \ libssl1.1 \ libstdc++6 \ zlib1g \ && rm -rf /var/lib/apt/lists/* # Configure web servers to bind to port 80 when present ENV ASPNETCORE_URLS=http://+:80 \ # Enable detection of running in a container DOTNET_RUNNING_IN_CONTAINER=true # Install .NET Core SDK ENV DOTNET_SDK_VERSION 5.0.3 RUN curl -SL --output dotnet.tar.gz "https://dotnetcli.blob.core.windows.net/dotnet/Runtime/$DOTNET_VERSION/dotnet-runtime-$DOTNET_VERSION-linux-arm64.tar.gz" \ && dotnet_sha512='f4d176b48714121040470a25f76a1b3554edb358953c1bfb39bd111cf0dcc85cb8a5ebcd617efd207b3cfaef0a2d242f94e9f018a186828a750c5c0dc9bd7da5' \ && echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ && mkdir -p /usr/share/dotnet \ && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \ && rm dotnet.tar.gz \ && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet # Configure web servers to bind to port 80 when present # Enable correct mode for dotnet watch (only mode supported in a container) ENV DOTNET_USE_POLLING_FILE_WATCHER=true \ # Skip extraction of XML docs - generally not useful within an image/container - helps performance NUGET_XMLDOC_MODE=skip # Trigger first run experience by running arbitrary cmd to populate local package cache RUN dotnet help CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@dotnet.sh" \ && echo "Running test-stack@dotnet" \ && chmod +x test-stack@dotnet.sh \ && bash test-stack@dotnet.sh \ && rm -rf test-stack@dotnet.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Debian Buster \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \ndotnet 5.0-runtime \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
nghiant2710/base-images
balena-base-images/dotnet/aarch64/debian/buster/5.0-runtime/build/Dockerfile
Dockerfile
apache-2.0
2,944
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Wed Jan 16 11:48:17 MST 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>SimpleLoadProviderSupplier (BOM: * : All 2.3.0.Final API)</title> <meta name="date" content="2019-01-16"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="SimpleLoadProviderSupplier (BOM: * : All 2.3.0.Final API)"; } } catch(err) { } //--> var methods = {"i0":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/SimpleLoadProviderSupplier.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.3.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/wildfly/swarm/config/modcluster/proxy/SimpleLoadProviderConsumer.html" title="interface in org.wildfly.swarm.config.modcluster.proxy"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li>Next&nbsp;Class</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/modcluster/proxy/SimpleLoadProviderSupplier.html" target="_top">Frames</a></li> <li><a href="SimpleLoadProviderSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.wildfly.swarm.config.modcluster.proxy</div> <h2 title="Interface SimpleLoadProviderSupplier" class="title">Interface SimpleLoadProviderSupplier&lt;T extends <a href="../../../../../../org/wildfly/swarm/config/modcluster/proxy/SimpleLoadProvider.html" title="class in org.wildfly.swarm.config.modcluster.proxy">SimpleLoadProvider</a>&gt;</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Functional Interface:</dt> <dd>This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.</dd> </dl> <hr> <br> <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html?is-external=true" title="class or interface in java.lang">@FunctionalInterface</a> public interface <span class="typeNameLabel">SimpleLoadProviderSupplier&lt;T extends <a href="../../../../../../org/wildfly/swarm/config/modcluster/proxy/SimpleLoadProvider.html" title="class in org.wildfly.swarm.config.modcluster.proxy">SimpleLoadProvider</a>&gt;</span></pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/wildfly/swarm/config/modcluster/proxy/SimpleLoadProvider.html" title="class in org.wildfly.swarm.config.modcluster.proxy">SimpleLoadProvider</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/modcluster/proxy/SimpleLoadProviderSupplier.html#get--">get</a></span>()</code> <div class="block">Constructed instance of SimpleLoadProvider resource</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="get--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>get</h4> <pre><a href="../../../../../../org/wildfly/swarm/config/modcluster/proxy/SimpleLoadProvider.html" title="class in org.wildfly.swarm.config.modcluster.proxy">SimpleLoadProvider</a>&nbsp;get()</pre> <div class="block">Constructed instance of SimpleLoadProvider resource</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>The instance</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/SimpleLoadProviderSupplier.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.3.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/wildfly/swarm/config/modcluster/proxy/SimpleLoadProviderConsumer.html" title="interface in org.wildfly.swarm.config.modcluster.proxy"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li>Next&nbsp;Class</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/modcluster/proxy/SimpleLoadProviderSupplier.html" target="_top">Frames</a></li> <li><a href="SimpleLoadProviderSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
wildfly-swarm/wildfly-swarm-javadocs
2.3.0.Final/apidocs/org/wildfly/swarm/config/modcluster/proxy/SimpleLoadProviderSupplier.html
HTML
apache-2.0
9,264
package wb.app.seek.common.utils; /** * Created by W.b on 2017/1/9. */ public interface SPKey { String UI_MODE = "UI_MODE"; String IN_APP_BROWSER = "IN_APP_BROWSER"; String DAY_NIGHT_MODE = "DAY_NIGHT_MODE"; }
mawb23/Seek
app/src/main/java/wb/app/seek/common/utils/SPKey.java
Java
apache-2.0
228
<?php /** * DO NOT EDIT THIS FILE! * * This file was automatically generated from external sources. * * Any manual change here will be lost the next time the SDK * is updated. You've been warned! */ namespace DTS\eBaySDK\Feedback\Types; /** * * @property string $jobId */ class GetDSRSummaryRequest extends \DTS\eBaySDK\Feedback\Types\BaseServiceRequest { /** * @var array Properties belonging to objects of this class. */ private static $propertyTypes = [ 'jobId' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, 'elementName' => 'jobId' ] ]; /** * @param array $values Optional properties and values to assign to the object. */ public function __construct(array $values = []) { list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); parent::__construct($parentValues); if (!array_key_exists(__CLASS__, self::$properties)) { self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); } if (!array_key_exists(__CLASS__, self::$xmlNamespaces)) { self::$xmlNamespaces[__CLASS__] = 'xmlns="http://www.ebay.com/marketplace/services"'; } if (!array_key_exists(__CLASS__, self::$requestXmlRootElementNames)) { self::$requestXmlRootElementNames[__CLASS__] = 'getDSRSummaryRequest'; } $this->setValues(__CLASS__, $childValues); } }
davidtsadler/ebay-sdk-php
src/Feedback/Types/GetDSRSummaryRequest.php
PHP
apache-2.0
1,564
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_60-ea) on Mon Jun 27 14:13:36 EDT 2016 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSFConsumer (WildFly Swarm: Public javadocs 1.0.0.Final API)</title> <meta name="date" content="2016-06-27"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="JSFConsumer (WildFly Swarm: Public javadocs 1.0.0.Final API)"; } } catch(err) { } //--> var methods = {"i0":6,"i1":18}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/JSFConsumer.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 1.0.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/wildfly/swarm/config/JSF.html" title="class in org.wildfly.swarm.config"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../org/wildfly/swarm/config/JSFSupplier.html" title="interface in org.wildfly.swarm.config"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/wildfly/swarm/config/JSFConsumer.html" target="_top">Frames</a></li> <li><a href="JSFConsumer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.wildfly.swarm.config</div> <h2 title="Interface JSFConsumer" class="title">Interface JSFConsumer&lt;T extends <a href="../../../../org/wildfly/swarm/config/JSF.html" title="class in org.wildfly.swarm.config">JSF</a>&lt;T&gt;&gt;</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Functional Interface:</dt> <dd>This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.</dd> </dl> <hr> <br> <pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html?is-external=true" title="class or interface in java.lang">@FunctionalInterface</a> public interface <span class="typeNameLabel">JSFConsumer&lt;T extends <a href="../../../../org/wildfly/swarm/config/JSF.html" title="class in org.wildfly.swarm.config">JSF</a>&lt;T&gt;&gt;</span></pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/wildfly/swarm/config/JSFConsumer.html#accept-T-">accept</a></span>(<a href="../../../../org/wildfly/swarm/config/JSFConsumer.html" title="type parameter in JSFConsumer">T</a>&nbsp;value)</code> <div class="block">Configure a pre-constructed instance of JSF resource</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>default <a href="../../../../org/wildfly/swarm/config/JSFConsumer.html" title="interface in org.wildfly.swarm.config">JSFConsumer</a>&lt;<a href="../../../../org/wildfly/swarm/config/JSFConsumer.html" title="type parameter in JSFConsumer">T</a>&gt;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/wildfly/swarm/config/JSFConsumer.html#andThen-org.wildfly.swarm.config.JSFConsumer-">andThen</a></span>(<a href="../../../../org/wildfly/swarm/config/JSFConsumer.html" title="interface in org.wildfly.swarm.config">JSFConsumer</a>&lt;<a href="../../../../org/wildfly/swarm/config/JSFConsumer.html" title="type parameter in JSFConsumer">T</a>&gt;&nbsp;after)</code>&nbsp;</td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="accept-org.wildfly.swarm.config.JSF-"> <!-- --> </a><a name="accept-T-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>accept</h4> <pre>void&nbsp;accept(<a href="../../../../org/wildfly/swarm/config/JSFConsumer.html" title="type parameter in JSFConsumer">T</a>&nbsp;value)</pre> <div class="block">Configure a pre-constructed instance of JSF resource</div> </li> </ul> <a name="andThen-org.wildfly.swarm.config.JSFConsumer-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>andThen</h4> <pre>default&nbsp;<a href="../../../../org/wildfly/swarm/config/JSFConsumer.html" title="interface in org.wildfly.swarm.config">JSFConsumer</a>&lt;<a href="../../../../org/wildfly/swarm/config/JSFConsumer.html" title="type parameter in JSFConsumer">T</a>&gt;&nbsp;andThen(<a href="../../../../org/wildfly/swarm/config/JSFConsumer.html" title="interface in org.wildfly.swarm.config">JSFConsumer</a>&lt;<a href="../../../../org/wildfly/swarm/config/JSFConsumer.html" title="type parameter in JSFConsumer">T</a>&gt;&nbsp;after)</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/JSFConsumer.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 1.0.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/wildfly/swarm/config/JSF.html" title="class in org.wildfly.swarm.config"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../org/wildfly/swarm/config/JSFSupplier.html" title="interface in org.wildfly.swarm.config"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/wildfly/swarm/config/JSFConsumer.html" target="_top">Frames</a></li> <li><a href="JSFConsumer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2016 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
wildfly-swarm/wildfly-swarm-javadocs
1.0.0.Final/apidocs/org/wildfly/swarm/config/JSFConsumer.html
HTML
apache-2.0
10,530
<!DOCTYPE html> <html> {% include head.html %} <body class="page-{{ page.page_type }}"> {% include header.html %} <div class="container content"> {{ content }} </div> {% include footer.html %} {% include ga.html %} </body> </html>
oaeproject/oaeproject.github.io
_layouts/default.html
HTML
apache-2.0
303
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Mon Jun 22 05:15:27 MST 2020 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>org.wildfly.swarm.ejb.remote.detect (BOM: * : All 2.7.1.Final-SNAPSHOT API)</title> <meta name="date" content="2020-06-22"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="org.wildfly.swarm.ejb.remote.detect (BOM: * : All 2.7.1.Final-SNAPSHOT API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.7.1.Final-SNAPSHOT</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/wildfly/swarm/ejb/mdb/package-summary.html">Prev&nbsp;Package</a></li> <li><a href="../../../../../../org/wildfly/swarm/elytron/package-summary.html">Next&nbsp;Package</a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/ejb/remote/detect/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 title="Package" class="title">Package&nbsp;org.wildfly.swarm.ejb.remote.detect</h1> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation"> <caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Class</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../../../../../org/wildfly/swarm/ejb/remote/detect/EJBRemotePackageDetector.html" title="class in org.wildfly.swarm.ejb.remote.detect">EJBRemotePackageDetector</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.7.1.Final-SNAPSHOT</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/wildfly/swarm/ejb/mdb/package-summary.html">Prev&nbsp;Package</a></li> <li><a href="../../../../../../org/wildfly/swarm/elytron/package-summary.html">Next&nbsp;Package</a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/ejb/remote/detect/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2020 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
wildfly-swarm/wildfly-swarm-javadocs
2.7.1.Final-SNAPSHOT/apidocs/org/wildfly/swarm/ejb/remote/detect/package-summary.html
HTML
apache-2.0
5,505
@{ RootModule = 'PSModule.psm1' ModuleVersion = '2.0.0' GUID = '1d73a601-4a6c-43c5-ba3f-619b18bbb404' Author = 'Microsoft Corporation' CompanyName = 'Microsoft Corporation' Copyright = '(c) Microsoft Corporation. All rights reserved.' Description = 'PowerShell module with commands for discovering, installing, updating and publishing the PowerShell artifacts like Modules, DSC Resources, Role Capabilities and Scripts.' PowerShellVersion = '3.0' FormatsToProcess = 'PSGet.Format.ps1xml' FunctionsToExport = @( 'Find-Command', 'Find-DSCResource', 'Find-Module', 'Find-RoleCapability', 'Find-Script', 'Get-InstalledModule', 'Get-InstalledScript', 'Get-PSRepository', 'Install-Module', 'Install-Script', 'New-ScriptFileInfo', 'Publish-Module', 'Publish-Script', 'Register-PSRepository', 'Save-Module', 'Save-Script', 'Set-PSRepository', 'Test-ScriptFileInfo', 'Uninstall-Module', 'Uninstall-Script', 'Unregister-PSRepository', 'Update-Module', 'Update-ModuleManifest', 'Update-Script', 'Update-ScriptFileInfo') VariablesToExport = "*" AliasesToExport = @('inmo','fimo','upmo','pumo') FileList = @('PSModule.psm1', 'PSGet.Format.ps1xml', 'PSGet.Resource.psd1') RequiredModules = @(@{ModuleName='PackageManagement';ModuleVersion='1.1.7.0'}) PrivateData = @{ "PackageManagementProviders" = 'PSModule.psm1' "SupportedPowerShellGetFormatVersions" = @('1.x','2.x') PSData = @{ Tags = @('Packagemanagement', 'Provider', 'PSEdition_Desktop', 'PSEdition_Core', 'Linux', 'Mac') ProjectUri = 'https://go.microsoft.com/fwlink/?LinkId=828955' LicenseUri = 'https://go.microsoft.com/fwlink/?LinkId=829061' ReleaseNotes = @' ## 2.0.0 Breaking Change - Default installation scope for Install-Module, Install-Script, and Install-Package has changed. For Windows PowerShell (version 5.1 or below), the default scope is AllUsers when running in an elevated session, and CurrentUser at all other times. For PowerShell version 6.0.0 and above, the default installation scope is always CurrentUser. ## 1.6.7 Bug fixes - Resolved Install/Save-Module error in PSCore 6.1.0-preview.4 on Ubuntu 18.04 OS (WSL/Azure) (#313) - Updated error message in Save-Module cmdlet when the specified path is not accessible (#313) - Added few additional verbose messages (#313) ## 1.6.6 Dependency Updates * Add dependency on version 4.1.0 or newer of NuGet.exe * Update NuGet.exe bootstrap URL to https://aka.ms/psget-nugetexe Build and Code Cleanup Improvements * Improved error handling in network connectivity tests. Bug fixes - Change Update-ModuleManifest so that prefix is not added to CmdletsToExport. - Change Update-ModuleManifest so that parameters will not reset to default values. - Specify AllowPrereleseVersions provider option only when AllowPrerelease is specified on the PowerShellGet cmdlets. ## 1.6.5 New features * Allow Pester/PSReadline installation when signed by non-Microsoft certificate (#258) - Whitelist installation of non-Microsoft signed Pester and PSReadline over Microsoft signed Pester and PSReadline. Build and Code Cleanup Improvements * Splitting of functions (#229) (Thanks @Benny1007) - Moves private functions into respective private folder. - Moves public functions as defined in PSModule.psd1 into respective public folder. - Removes all functions from PSModule.psm1 file. - Dot sources the functions from PSModule.psm1 file. - Uses Export-ModuleMember to export the public functions from PSModule.psm1 file. * Add build step to construct a single .psm1 file (#242) (Thanks @Benny1007) - Merged public and private functions into one .psm1 file to increase load time performance. Bug fixes - Fix null parameter error caused by MinimumVersion in Publish-PackageUtility (#201) - Change .ExternalHelp link from PSGet.psm1-help.xml to PSModule-help.xml in PSModule.psm1 file (#215) - Change Publish-* to allow version comparison instead of string comparison (#219) - Ensure Get-InstalledScript -RequiredVersion works when versions have a leading 0 (#260) - Add positional path to Save-Module and Save-Script (#264, #266) - Ensure that Get-AuthenticodePublisher verifies publisher and that installing or updating a module checks for approprite catalog signature (#272) - Update HelpInfoURI to 'http://go.microsoft.com/fwlink/?linkid=855963' (#274) ## 1.6.0 New features * Prerelease Version Support (#185) - Implemented prerelease versions functionality in PowerShellGet cmdlets. - Enables publishing, discovering, and installing the prerelease versions of modules and scripts from the PowerShell Gallery. - [Documentation](https://docs.microsoft.com/en-us/powershell/gallery/psget/module/PrereleaseModule) * Enabled publish cmdlets on PWSH and Nano Server (#196) - Dotnet command version 2.0.0 or newer should be installed by the user prior to using the publish cmdlets on PWSH and Windows Nano Server. - Users can install the dotnet command by following the instructions specified at https://aka.ms/dotnet-install-script. - On Windows, users can install the dotnet command by running *Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -OutFile '.\dotnet-install.ps1'; & '.\dotnet-install.ps1' -Channel Current -Version '2.0.0'* - Publish cmdlets on Windows PowerShell supports using the dotnet command for publishing operations. Breaking Change - PWSH: Changed the installation location of AllUsers scope to the parent of $PSHOME instead of $PSHOME. It is the SHARED_MODULES folder on PWSH. Bug fixes - Update HelpInfoURI to 'https://go.microsoft.com/fwlink/?linkid=855963' (#195) - Ensure MyDocumentsPSPath path is correct (#179) (Thanks @lwsrbrts) ## 1.5.0.0 New features * Added support for modules requiring license acceptance (#150) - [Documentation](https://docs.microsoft.com/en-us/powershell/gallery/psget/module/RequireLicenseAcceptance) * Added version for REQUIREDSCRIPTS (#162) - Enabled following scenarios for REQUIREDSCRIPTS - [1.0] - RequiredVersion - [1.0,2.0] - Min and Max Version - (,1.0] - Max Version - 1.0 - Min Version Bug fixes * Fixed empty version value in nuspec (#157) ## 1.1.3.2 * Disabled PowerShellGet Telemetry on PS Core as PowerShell Telemetry APIs got removed in PowerShell Core beta builds. (#153) * Fixed for DateTime format serialization issue. (#141) * Update-ModuleManifest should add ExternalModuleDependencies value as a collection. (#129) ## 1.1.3.1 New features * Added `PrivateData` field to ScriptFileInfo. (#119) Bug fixes * Fixed Add-Type issue in v6.0.0-beta.1 release of PowerShellCore. (#125, #124) * Install-Script -Scope CurrentUser PATH changes should not require a reboot for new PS processes. (#124) - Made changes to broadcast the Environment variable changes, so that other processes pick changes to Environment variables without having to reboot or logoff/logon. * Changed `Get-EnvironmentVariable` to get the unexpanded version of `%path%`. (#117) * Refactor credential parameter propagation to sub-functions. (#104) * Added credential parameter to subsequent calls of `Publish-Module/Script`. (#93) - This is needed when a module is published that has the RequiredModules attribute in the manifest on a repository that does not have anonymous access because the required module lookups will fail. ## 1.1.2.0 Bug fixes * Renamed `PublishModuleIsNotSupportedOnNanoServer` errorid to `PublishModuleIsNotSupportedOnPowerShellCoreEdition`. (#44) - Also renamed `PublishScriptIsNotSupportedOnNanoServer` to `PublishScriptIsNotSupportedOnPowerShellCoreEdition`. * Fixed an issue in `Update-Module` and `Update-Script` cmdlets to show proper version of current item being updated in `Confirm`/`WhatIf` message. (#44) * Updated `Test-ModuleInstalled` function to return single module instead of multiple modules. (#44) * Updated `ModuleCommandAlreadyAvailable` error message to include all conflicting commands instead of one. (#44) - Corresponding changes to collect the complete set of conflicting commands from the being installed. - Also ensured that conflicting commands from PSModule.psm1 are ignored in the command collision analysis as Get-Command includes the commands from current local scope as well. * Fixed '[Test-ScriptFileInfo] Fails on *NIX newlines (LF vs. CRLF)' (#18) ## 1.1.1.0 Bug fixes * Fixed 'Update-Module fails with `ModuleAuthenticodeSignature` error for modules with signed PSD1'. (#12) (#8) * Fixed 'Properties of `AdditionalMetadata` are case-sensitive'. #7 * Changed `ErrorAction` to `Ignore` for few cmdlet usages as they should not show up in ErrorVariable. - For example, error returned by `Get-Command Test-FileCatalog` should be ignored. ## 1.1.0.0 * Initial release from GitHub. * PowerShellCore support. * Security enhancements including the enforcement of catalog-signed modules during installation. * Authenticated Repository support. * Proxy Authentication support. * Responses to a number of user requests and issues. '@ } } HelpInfoURI = 'http://go.microsoft.com/fwlink/?linkid=855963' } # SIG # Begin signature block # MIIdnAYJKoZIhvcNAQcCoIIdjTCCHYkCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR # AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQU/ezGKB/j4uukYnQ3mYc0Pvxp # olSgghhqMIIE2jCCA8KgAwIBAgITMwAAAPNnPYNhmA8cpgAAAAAA8zANBgkqhkiG # 9w0BAQUFADB3MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G # A1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSEw # HwYDVQQDExhNaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EwHhcNMTgwODIzMjAxOTU2 # WhcNMTkxMTIzMjAxOTU2WjCByjELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hp # bmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jw # b3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJpY2EgT3BlcmF0aW9uczEm # MCQGA1UECxMdVGhhbGVzIFRTUyBFU046RjZGRi0yREE3LUJCNzUxJTAjBgNVBAMT # HE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2UwggEiMA0GCSqGSIb3DQEBAQUA # A4IBDwAwggEKAoIBAQCum1v/6NysKcNZwQxKEIrpa4cW1fG9VgjInuWglPN9slvs # /xUw5hWjBeXIWNpPPfCgg8biPUIuMOTfTnUQHeHGCt3RJHnvkZnt1Sa9YG+qasp0 # Tfj3Ugo8zF4ByEaHquIgP6ps17kkDh7hXrysVjWFU0qBBTf+04dANvYXNNoTNyPh # udDx2O3MS9kINlmzjvOVMDH+j+y7bKkIKdvxhVGvTjPfAH7UjtYtYWe+IFnkBzdf # riO+UOrVLXtkVolXP6ytINIQD1G5dmB6h1Q5l9r6EJ5MWc1ifuOuhGxIEZXrHmer # 6C4VU84Gf16oBGmH7zAsencfYkBO3mtXQuuFeo4zAgMBAAGjggEJMIIBBTAdBgNV # HQ4EFgQUrMOQPcGQ7gcjCPw0JXGsOdef8hYwHwYDVR0jBBgwFoAUIzT42VJGcArt # QPt2+7MrsMM1sw8wVAYDVR0fBE0wSzBJoEegRYZDaHR0cDovL2NybC5taWNyb3Nv # ZnQuY29tL3BraS9jcmwvcHJvZHVjdHMvTWljcm9zb2Z0VGltZVN0YW1wUENBLmNy # bDBYBggrBgEFBQcBAQRMMEowSAYIKwYBBQUHMAKGPGh0dHA6Ly93d3cubWljcm9z # b2Z0LmNvbS9wa2kvY2VydHMvTWljcm9zb2Z0VGltZVN0YW1wUENBLmNydDATBgNV # HSUEDDAKBggrBgEFBQcDCDANBgkqhkiG9w0BAQUFAAOCAQEAZ8mAl+WwiGichsW2 # 7b42Swis3D6yaoCpJ2PPLzsydU8EoazOckFVZl2c5AOJNnzE6PEuAKQxZU0/B1XL # oIDcdSP4ErtqC1Pa7mIf7NHbVZDPCEaIu74f7iWpq/L3zEiEAhXmyUVzRim+ntmZ # hwaFCVmaGtu0c2HP/RoF9U1Pjk2UMmlTdELZjwwcLpOmgswAxz2su+iqyLH381L1 # 6QkaPHuQq9bzbZoE80wk5QpaGfRgxzV1sCDBRuRhHHlPedvmFMLZ/xwAzPmKrYRg # dG+mzu2EmFCjm+UGrJwoXJK3CM+9Wds3uln3hnftCWV5v6jlC1dGiDrlRigksgTm # J/YEFDCCBf8wggPnoAMCAQICEzMAAAEDXiUcmR+jHrgAAAAAAQMwDQYJKoZIhvcN # AQELBQAwfjELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNV # BAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYG # A1UEAxMfTWljcm9zb2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMTAeFw0xODA3MTIy # MDA4NDhaFw0xOTA3MjYyMDA4NDhaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpX # YXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQg # Q29ycG9yYXRpb24xHjAcBgNVBAMTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjCCASIw # DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANGUdjbmhqs2/mn5RnyLiFDLkHB/ # sFWpJB1+OecFnw+se5eyznMK+9SbJFwWtTndG34zbBH8OybzmKpdU2uqw+wTuNLv # z1d/zGXLr00uMrFWK040B4n+aSG9PkT73hKdhb98doZ9crF2m2HmimRMRs621TqM # d5N3ZyGctloGXkeG9TzRCcoNPc2y6aFQeNGEiOIBPCL8r5YIzF2ZwO3rpVqYkvXI # QE5qc6/e43R6019Gl7ziZyh3mazBDjEWjwAPAf5LXlQPysRlPwrjo0bb9iwDOhm+ # aAUWnOZ/NL+nh41lOSbJY9Tvxd29Jf79KPQ0hnmsKtVfMJE75BRq67HKBCMCAwEA # AaOCAX4wggF6MB8GA1UdJQQYMBYGCisGAQQBgjdMCAEGCCsGAQUFBwMDMB0GA1Ud # DgQWBBRHvsDL4aY//WXWOPIDXbevd/dA/zBQBgNVHREESTBHpEUwQzEpMCcGA1UE # CxMgTWljcm9zb2Z0IE9wZXJhdGlvbnMgUHVlcnRvIFJpY28xFjAUBgNVBAUTDTIz # MDAxMis0Mzc5NjUwHwYDVR0jBBgwFoAUSG5k5VAF04KqFzc3IrVtqMp1ApUwVAYD # VR0fBE0wSzBJoEegRYZDaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9j # cmwvTWljQ29kU2lnUENBMjAxMV8yMDExLTA3LTA4LmNybDBhBggrBgEFBQcBAQRV # MFMwUQYIKwYBBQUHMAKGRWh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMv # Y2VydHMvTWljQ29kU2lnUENBMjAxMV8yMDExLTA3LTA4LmNydDAMBgNVHRMBAf8E # AjAAMA0GCSqGSIb3DQEBCwUAA4ICAQCf9clTDT8NJuyiRNgN0Z9jlgZLPx5cxTOj # pMNsrx/AAbrrZeyeMxAPp6xb1L2QYRfnMefDJrSs9SfTSJOGiP4SNZFkItFrLTuo # LBWUKdI3luY1/wzOyAYWFp4kseI5+W4OeNgMG7YpYCd2NCSb3bmXdcsBO62CEhYi # gIkVhLuYUCCwFyaGSa/OfUUVQzSWz4FcGCzUk/Jnq+JzyD2jzfwyHmAc6bAbMPss # uwculoSTRShUXM2W/aDbgdi2MMpDsfNIwLJGHF1edipYn9Tu8vT6SEy1YYuwjEHp # qridkPT/akIPuT7pDuyU/I2Au3jjI6d4W7JtH/lZwX220TnJeeCDHGAK2j2w0e02 # v0UH6Rs2buU9OwUDp9SnJRKP5najE7NFWkMxgtrYhK65sB919fYdfVERNyfotTWE # cfdXqq76iXHJmNKeWmR2vozDfRVqkfEU9PLZNTG423L6tHXIiJtqv5hFx2ay1//O # kpB15OvmhtLIG9snwFuVb0lvWF1pKt5TS/joynv2bBX5AxkPEYWqT5q/qlfdYMb1 # cSD0UaiayunR6zRHPXX6IuxVP2oZOWsQ6Vo/jvQjeDCy8qY4yzWNqphZJEC4Omek # B1+g/tg7SRP7DOHtC22DUM7wfz7g2QjojCFKQcLe645b7gPDHW5u5lQ1ZmdyfBrq # UvYixHI/rjCCBgcwggPvoAMCAQICCmEWaDQAAAAAABwwDQYJKoZIhvcNAQEFBQAw # XzETMBEGCgmSJomT8ixkARkWA2NvbTEZMBcGCgmSJomT8ixkARkWCW1pY3Jvc29m # dDEtMCsGA1UEAxMkTWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 # MB4XDTA3MDQwMzEyNTMwOVoXDTIxMDQwMzEzMDMwOVowdzELMAkGA1UEBhMCVVMx # EzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoT # FU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFRpbWUt # U3RhbXAgUENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAn6Fssd/b # SJIqfGsuGeG94uPFmVEjUK3O3RhOJA/u0afRTK10MCAR6wfVVJUVSZQbQpKumFww # JtoAa+h7veyJBw/3DgSY8InMH8szJIed8vRnHCz8e+eIHernTqOhwSNTyo36Rc8J # 0F6v0LBCBKL5pmyTZ9co3EZTsIbQ5ShGLieshk9VUgzkAyz7apCQMG6H81kwnfp+ # 1pez6CGXfvjSE/MIt1NtUrRFkJ9IAEpHZhEnKWaol+TTBoFKovmEpxFHFAmCn4Tt # VXj+AZodUAiFABAwRu233iNGu8QtVJ+vHnhBMXfMm987g5OhYQK1HQ2x/PebsgHO # IktU//kFw8IgCwIDAQABo4IBqzCCAacwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E # FgQUIzT42VJGcArtQPt2+7MrsMM1sw8wCwYDVR0PBAQDAgGGMBAGCSsGAQQBgjcV # AQQDAgEAMIGYBgNVHSMEgZAwgY2AFA6sgmBAVieX5SUT/CrhClOVWeSkoWOkYTBf # MRMwEQYKCZImiZPyLGQBGRYDY29tMRkwFwYKCZImiZPyLGQBGRYJbWljcm9zb2Z0 # MS0wKwYDVQQDEyRNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmC # EHmtFqFKoKWtTHNY9AcTLmUwUAYDVR0fBEkwRzBFoEOgQYY/aHR0cDovL2NybC5t # aWNyb3NvZnQuY29tL3BraS9jcmwvcHJvZHVjdHMvbWljcm9zb2Z0cm9vdGNlcnQu # Y3JsMFQGCCsGAQUFBwEBBEgwRjBEBggrBgEFBQcwAoY4aHR0cDovL3d3dy5taWNy # b3NvZnQuY29tL3BraS9jZXJ0cy9NaWNyb3NvZnRSb290Q2VydC5jcnQwEwYDVR0l # BAwwCgYIKwYBBQUHAwgwDQYJKoZIhvcNAQEFBQADggIBABCXisNcA0Q23em0rXfb # znlRTQGxLnRxW20ME6vOvnuPuC7UEqKMbWK4VwLLTiATUJndekDiV7uvWJoc4R0B # hqy7ePKL0Ow7Ae7ivo8KBciNSOLwUxXdT6uS5OeNatWAweaU8gYvhQPpkSokInD7 # 9vzkeJkuDfcH4nC8GE6djmsKcpW4oTmcZy3FUQ7qYlw/FpiLID/iBxoy+cwxSnYx # PStyC8jqcD3/hQoT38IKYY7w17gX606Lf8U1K16jv+u8fQtCe9RTciHuMMq7eGVc # WwEXChQO0toUmPU8uWZYsy0v5/mFhsxRVuidcJRsrDlM1PZ5v6oYemIp76KbKTQG # dxpiyT0ebR+C8AvHLLvPQ7Pl+ex9teOkqHQ1uE7FcSMSJnYLPFKMcVpGQxS8s7Ow # TWfIn0L/gHkhgJ4VMGboQhJeGsieIiHQQ+kr6bv0SMws1NgygEwmKkgkX1rqVu+m # 3pmdyjpvvYEndAYR7nYhv5uCwSdUtrFqPYmhdmG0bqETpr+qR/ASb/2KMmyy/t9R # yIwjyWa9nR2HEmQCPS2vWY+45CHltbDKY7R4VAXUQS5QrJSwpXirs6CWdRrZkocT # dSIvMqgIbqBbjCW/oO+EyiHW6x5PyZruSeD3AWVviQt9yGnI5m7qp5fOMSn/DsVb # XNhNG6HY+i+ePy5VFmvJE6P9MIIHejCCBWKgAwIBAgIKYQ6Q0gAAAAAAAzANBgkq # hkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x # EDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlv # bjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 # IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEwOTA5WjB+MQswCQYDVQQG # EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG # A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYDVQQDEx9NaWNyb3NvZnQg # Q29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC # CgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+laUKq4BjgaBEm6f8MMHt03 # a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc6Whe0t+bU7IKLMOv2akr # rnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4Ddato88tt8zpcoRb0Rrrg # OGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+lD3v++MrWhAfTVYoonpy # 4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nkkDstrjNYxbc+/jLTswM9 # sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6A4aN91/w0FK/jJSHvMAh # dCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmdX4jiJV3TIUs+UsS1Vz8k # A/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL5zmhD+kjSbwYuER8ReTB # w3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zdsGbiwZeBe+3W7UvnSSmn # Eyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3T8HhhUSJxAlMxdSlQy90 # lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS4NaIjAsCAwEAAaOCAe0w # ggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRIbmTlUAXTgqoXNzcitW2o # ynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNVHQ8EBAMCAYYwDwYD # VR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBDuRQFTuHqp8cx0SOJNDBa # BgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpL2Ny # bC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFfMDNfMjIuY3JsMF4GCCsG # AQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3dy5taWNyb3NvZnQuY29t # L3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFfMDNfMjIuY3J0MIGfBgNV # HSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEFBQcCARYzaHR0cDovL3d3 # dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1hcnljcHMuaHRtMEAGCCsG # AQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkAYwB5AF8AcwB0AGEAdABl # AG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn8oalmOBUeRou09h0ZyKb # C5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7v0epo/Np22O/IjWll11l # hJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0bpdS1HXeUOeLpZMlEPXh6 # I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/KmtYSWMfCWluWpiW5IP0 # wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvyCInWH8MyGOLwxS3OW560 # STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBpmLJZiWhub6e3dMNABQam # ASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJihsMdYzaXht/a8/jyFqGa # J+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYbBL7fQccOKO7eZS/sl/ah # XJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbSoqKfenoi+kiVH6v7RyOA # 9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sLgOppO6/8MO0ETI7f33Vt # Y5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtXcVZOSEXAQsmbdlsKgEhr # /Xmfwb1tbWrJUnMTDXpQzTGCBJwwggSYAgEBMIGVMH4xCzAJBgNVBAYTAlVTMRMw # EQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVN # aWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNp # Z25pbmcgUENBIDIwMTECEzMAAAEDXiUcmR+jHrgAAAAAAQMwCQYFKw4DAhoFAKCB # sDAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgorBgEEAYI3AgELMQ4wDAYK # KwYBBAGCNwIBFTAjBgkqhkiG9w0BCQQxFgQUx59djpcN5IoEPDV9Yfbm7IdwI4sw # UAYKKwYBBAGCNwIBDDFCMECgFoAUAFAAbwB3AGUAcgBTAGgAZQBsAGyhJoAkaHR0 # cDovL3d3dy5taWNyb3NvZnQuY29tL1Bvd2VyU2hlbGwgMA0GCSqGSIb3DQEBAQUA # BIIBAGWOWjcRQsvrIr+JYW4eVPgJ5DmXa7i1ZmcsrAaMUgzhaNQwn/A2g1aqCFE7 # FIJ12D1p1tjQPLvJrWmda27OFPf7U6nb5k6jgA5isPMzzq1CLlTHGLbpgQ/6Le3m # dcWJlrNN8DCP2fAVaeM9xMb3BYXRFVKEQKaVc3vNJXa9JGFbuLy2O11FzbgRltIN # kw6/UUlw3gZnXxeEEyZTiWeBU1Q2mo5LmaMKKeRsNHsxevD1fGw6lUHYbCcCtoi0 # TgXySGJAZfgw8VaQm2bt/XatSz7bkitZX19uZfoxlS+JymvHIJrHxAqJ08zIQmLk # G4BUqZIyePIef1UUJUGEqjl6O4ahggIoMIICJAYJKoZIhvcNAQkGMYICFTCCAhEC # AQEwgY4wdzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNV # BAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8G # A1UEAxMYTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBAhMzAAAA82c9g2GYDxymAAAA # AADzMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqG # SIb3DQEJBTEPFw0xODA5MTMwMTUxMjFaMCMGCSqGSIb3DQEJBDEWBBSJiqbRrO1K # Vo85Fw8BfF8angWQqzANBgkqhkiG9w0BAQUFAASCAQA78PXVpKAnKCKB5C7SXBUX # IvA2a02fUwqwANalu/as/quJZCFrMyeSRucPTfQQVN3vE8ZeRpsNtoNp5k7fryud # Ez9Gs6x5BFkTgRl6CAyVp0HDAFwfwP7gFHnYPGQMNMwv7siXt/UiVs3R5vPh3h8l # 3MHktvtS6q5kJDaIbfuIWWsu414EJEQ8EAt8nxhan/kkzMzI9tieX/DpVpNHhtzS # 9DyGHve0ngB/ffUBLBqnN8Usk70Zoy5xBaxH5OSjX2af43HeGCjCqkkmP1kd4hhN # T7Z26vkbxS79+y4VHf6E8Bexhn5ywie5ctgfyAIF3dLpvaE3JekukpdRswwBxQ7Q # SIG # End signature block
pshdo/LibGit2.PowerShell
.whiskey/PowerShellGet/PowerShellGet.psd1
PowerShell
apache-2.0
20,216
using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; using JetBrains.Annotations; using JetBrains.ProjectModel; using JetBrains.ReSharper.Daemon.CSharp.Errors; using JetBrains.ReSharper.Psi.CodeAnnotations; namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { [SolutionComponent] internal sealed class CompareNonConstrainedGenericWithNullWarningEnhancer : CSharpHighlightingEnhancer<CompareNonConstrainedGenericWithNullWarning> { protected override void AppendTooltip(CompareNonConstrainedGenericWithNullWarning highlighting, CSharpColorizer colorizer) { colorizer.AppendPlainText("Possible compare of value type with '"); colorizer.AppendKeyword("null"); colorizer.AppendPlainText("'"); } public CompareNonConstrainedGenericWithNullWarningEnhancer( [NotNull] TextStyleHighlighterManager textStyleHighlighterManager, [NotNull] CodeAnnotationsCache codeAnnotationsCache, [NotNull] HighlighterIdProviderFactory highlighterIdProviderFactory) : base(textStyleHighlighterManager, codeAnnotationsCache, highlighterIdProviderFactory) { } } }
citizenmatt/ReSharper.EnhancedTooltip
GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CompareNonConstrainedGenericWithNullWarningEnhancer.cs
C#
apache-2.0
1,104
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CycleJs Problem 01</title> </head> <body> <div id="app"> </div> </body> <script src="./index_04.js"> </script> </html>
mertnuhoglu/study
js/ex/study_notes_cyclejs/src/problems/p01/index_04.html
HTML
apache-2.0
285
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Sun Mar 17 11:03:32 MST 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>RegexValidatingPrincipalTransformerConsumer (BOM: * : All 2.4.0.Final API)</title> <meta name="date" content="2019-03-17"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="RegexValidatingPrincipalTransformerConsumer (BOM: * : All 2.4.0.Final API)"; } } catch(err) { } //--> var methods = {"i0":6,"i1":18}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/RegexValidatingPrincipalTransformerConsumer.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.4.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformer.html" title="class in org.wildfly.swarm.config.elytron"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerSupplier.html" title="interface in org.wildfly.swarm.config.elytron"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerConsumer.html" target="_top">Frames</a></li> <li><a href="RegexValidatingPrincipalTransformerConsumer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.wildfly.swarm.config.elytron</div> <h2 title="Interface RegexValidatingPrincipalTransformerConsumer" class="title">Interface RegexValidatingPrincipalTransformerConsumer&lt;T extends <a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformer.html" title="class in org.wildfly.swarm.config.elytron">RegexValidatingPrincipalTransformer</a>&lt;T&gt;&gt;</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Functional Interface:</dt> <dd>This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.</dd> </dl> <hr> <br> <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html?is-external=true" title="class or interface in java.lang">@FunctionalInterface</a> public interface <span class="typeNameLabel">RegexValidatingPrincipalTransformerConsumer&lt;T extends <a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformer.html" title="class in org.wildfly.swarm.config.elytron">RegexValidatingPrincipalTransformer</a>&lt;T&gt;&gt;</span></pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerConsumer.html#accept-T-">accept</a></span>(<a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerConsumer.html" title="type parameter in RegexValidatingPrincipalTransformerConsumer">T</a>&nbsp;value)</code> <div class="block">Configure a pre-constructed instance of RegexValidatingPrincipalTransformer resource</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>default <a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerConsumer.html" title="interface in org.wildfly.swarm.config.elytron">RegexValidatingPrincipalTransformerConsumer</a>&lt;<a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerConsumer.html" title="type parameter in RegexValidatingPrincipalTransformerConsumer">T</a>&gt;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerConsumer.html#andThen-org.wildfly.swarm.config.elytron.RegexValidatingPrincipalTransformerConsumer-">andThen</a></span>(<a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerConsumer.html" title="interface in org.wildfly.swarm.config.elytron">RegexValidatingPrincipalTransformerConsumer</a>&lt;<a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerConsumer.html" title="type parameter in RegexValidatingPrincipalTransformerConsumer">T</a>&gt;&nbsp;after)</code>&nbsp;</td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="accept-org.wildfly.swarm.config.elytron.RegexValidatingPrincipalTransformer-"> <!-- --> </a><a name="accept-T-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>accept</h4> <pre>void&nbsp;accept(<a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerConsumer.html" title="type parameter in RegexValidatingPrincipalTransformerConsumer">T</a>&nbsp;value)</pre> <div class="block">Configure a pre-constructed instance of RegexValidatingPrincipalTransformer resource</div> </li> </ul> <a name="andThen-org.wildfly.swarm.config.elytron.RegexValidatingPrincipalTransformerConsumer-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>andThen</h4> <pre>default&nbsp;<a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerConsumer.html" title="interface in org.wildfly.swarm.config.elytron">RegexValidatingPrincipalTransformerConsumer</a>&lt;<a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerConsumer.html" title="type parameter in RegexValidatingPrincipalTransformerConsumer">T</a>&gt;&nbsp;andThen(<a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerConsumer.html" title="interface in org.wildfly.swarm.config.elytron">RegexValidatingPrincipalTransformerConsumer</a>&lt;<a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerConsumer.html" title="type parameter in RegexValidatingPrincipalTransformerConsumer">T</a>&gt;&nbsp;after)</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/RegexValidatingPrincipalTransformerConsumer.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.4.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformer.html" title="class in org.wildfly.swarm.config.elytron"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerSupplier.html" title="interface in org.wildfly.swarm.config.elytron"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerConsumer.html" target="_top">Frames</a></li> <li><a href="RegexValidatingPrincipalTransformerConsumer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
wildfly-swarm/wildfly-swarm-javadocs
2.4.0.Final/apidocs/org/wildfly/swarm/config/elytron/RegexValidatingPrincipalTransformerConsumer.html
HTML
apache-2.0
12,329