text:
# Basic usage

## Applying plugin

`axion-release-plugin` is published in both [Maven
Central](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22axion-release-plugin%22)
and [Gradle Plugin
Portal](http://plugins.gradle.org/plugin/pl.allegro.tech.build.axion-release).

### Gradle 2.1+

```
buildscript {
    repositories {
        mavenCentral()
    }
}

plugins {
    id 'pl.allegro.tech.build.axion-release' version ''
}
```

Maven Central needs to be imported in buildscript, as there are some
dependencies not published in *jCenter* repository.

### Maven Central

```
buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath group: 'pl.allegro.tech.build', name: 'axion-release-plugin', version: ''
    }
}

apply plugin: 'pl.allegro.tech.build.axion-release'
```

## Basic configuration

### Single module project

```
scmVersion {
    tag {
        prefix = 'my-project-name'
    }
}

project.version = scmVersion.version
```

> Order of definition does matter! First, you need to apply the plugin,
> then configure it using `scmVersion` extension and only then current
> version can be set for whole project via `scmVersion.version`.

### Multi-module project

For multi project builds the plugin has to be applied only on the root
project, but version has to be set also in submodules

```
plugins {
    id 'pl.allegro.tech.build.axion-release' version ''
}

scmVersion {
    // ...
}

allprojects {
    project.version = scmVersion.version
}
```

### Multi-module with multiple versions

Sometimes it might be desirable to release each module (or just some
modules) of multi-module project separately. If so, please make sure
that:

-   tag prefixes for each module do not overlap, i.e.
    `!tagA.startsWith(tagB)` for each permutation of all tag prefixes
-   keep in mind, that `scmVersion` must be initialized before
    `scmVersion.version` is accessed
-   apply plugin on each module that should be released on it\'s own

## Releasing

```
# ./gradlew currentVersion
0.1.0-SNAPSHOT

# ./gradlew release

# ./gradlew cV
0.1.0
```

repository: eddarmitage/axion-release-plugin

repo_name: eddarmitage/axion-release-plugin


text:
Common Schemas

TransactionBasic

```json
{
  "transactionId": "string",
  "isDetailAvailable": true,
  "status": "PENDING",
  "description": "string",
  "postDateTime": "2018-11-01T05:33:52Z",
  "executionDateTime": "2018-11-01T05:33:52Z",
  "amount": 300.56,
  "currency": "AUD",
  "reference": "string"
}

```

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|transactionId|[TransactionId](#schematransactionid)|false|none|A unique ID of the transaction adhering to the standards for ID permanence. This is mandatory (through hashing if necessary) unless there are specific and justifiable technical reasons why a transaction cannot be uniquely identified for a particular account type|
|isDetailAvailable|boolean|true|none|True if extended information is available using the transaction detail end point. False if extended data is not available|
|status|[TransactionStatus](#schematransactionstatus)|true|none|Status of the transaction.|
|description|string|true|none|The transaction description as applied by the financial institution.|
|postDateTime|[DateTimeString](#common-field-types)|false|none|The time the transaction was posted. This field is mandatory if the transaction has status POSTED. This is the time that appears on a standard statement.|
|executionDateTime|[DateTimeString](#common-field-types)|false|none|The time the transaction was executed by the originating customer, if available.|
|amount|[AmountString](#common-field-types)|false|none|The value of the transaction. Negative values mean money was outgoing.|
|currency|[CurrencyString](#common-field-types)|false|none|The currency for the transaction amount. AUD assumed if not present.|
|reference|string|true|none|The reference for the transaction provided by the originating institution.|

TransactionDetail

```json
{
  "transactionId": "string",
  "status": "PENDING",
  "description": "string",
  "postDateTime": "2018-11-01T05:33:52Z",
  "executionDateTime": "2018-11-01T05:33:52Z",
  "amount": 300.56,
  "currency": "AUD",
  "reference": "string",
  "extendedData": {
    "payer": "string",
    "payee": "string",
    "extensionType": "extendedDescription",
    "extendedDescription": "string",
    "service": "X2P1.01"
  }
}

```

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|transactionId|[TransactionId](#schematransactionid)|false|none|A unique ID of the transaction adhering to the standards for ID permanence. This is mandatory (through hashing if necessary) unless there are specific and justifiable technical reasons why a transaction cannot be uniquely identified for a particular account type|
|status|[TransactionStatus](#schematransactionstatus)|true|none|Status of the transaction.|
|description|string|true|none|The transaction description as applied by the financial institution.|
|postDateTime|[DateTimeString](#common-field-types)|false|none|The time the transaction was posted. This field is mandatory if the transaction has status POSTED. This is the time that appears on a standard statement.|
|executionDateTime|[DateTimeString](#common-field-types)|false|none|The time the transaction was executed by the originating customer, if available.|
|amount|[AmountString](#common-field-types)|false|none|The value of the transaction. Negative values mean money was outgoing.|
|currency|[CurrencyString](#common-field-types)|false|none|The currency for the transaction amount. AUD assumed if not present.|
|reference|string|true|none|The reference for the transaction provided by the originating institution.|
|extendedData|[ExtendedTransactionData](#schemaextendedtransactiondata)|false|none|Contains more detailed information specific to transactions originated via NPP.|

AccountTransaction

```json
{
  "accountId": "string",
  "transactionId": "string",
  "isDetailAvailable": true,
  "status": "PENDING",
  "description": "string",
  "postDateTime": "2018-11-01T05:33:52Z",
  "executionDateTime": "2018-11-01T05:33:52Z",
  "amount": 300.56,
  "currency": "AUD",
  "reference": "string"
}

```

### Properties

*allOf*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|object|false|none|none|
|» accountId|[AccountId](#schemaaccountid)|true|none|A unique ID of the account adhering to the standards for ID permanence.|

*and*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|[TransactionBasic](#schematransactionbasic)|false|none|none|

ExtendedTransactionData

```json
{
  "payer": "string",
  "payee": "string",
  "extension$type": "extendedDescription",
  "extendedDescription": "string",
  "service": "X2P1.01"
}

```

*Contains more detailed information specific to transactions originated via NPP.*

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|payer|string|false|none|Label of the originating payer. Mandatory for an inbound payment.|
|payee|string|false|none|Label of the target PayID. Mandatory for an outbound payment.|
|extension$type|string|false|none|Optional extended data provided specific to transaction originated via NPP.|
|extendedDescription|string|false|none|An extended string description.  Only present if specified by the extensionType field.|
|service|string|true|none|Identifier of the applicable overlay service.|

#### Enumerated Values

|Property|Value|
|---|---|
|extension$type|extendedDescription|
|service|X2P1.01|

TransactionStatus

```json
"PENDING"

```

*Status of the transaction.*

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|string|false|none|Status of the transaction.|

#### Enumerated Values

|Property|Value|
|---|---|
|*anonymous*|PENDING|
|*anonymous*|POSTED|

TransactionId

```json
"string"

```

*A unique ID of the transaction adhering to the standards for ID permanence. This field is mandatory in this payload as it is a reflection of the requested transaction in the path parameter.*

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|[ASCII String](#common-field-types)|false|none|A unique ID of the transaction adhering to the standards for ID permanence. This field is mandatory in this payload as it is a reflection of the requested transaction in the path parameter.|

AccountDirectDebit

```json
{
  "accountId": "string",
  "authorisedEntity": {
    "name": "string",
    "financialInsitution": "string",
    "abn": "string",
    "acn": "string"
  },
  "lastDebitDateTime": "2018-11-01T05:33:52Z",
  "lastDebitAmount": 300.56
}

```

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|accountId|[AccountId](#schemaaccountid)|true|none|A unique ID of the account adhering to the standards for ID permanence.|
|authorisedEntity|[AuthorisedEntity](#schemaauthorisedentity)|false|none|Information on the authorised entity that is able to perform a direct debit|
|lastDebitDateTime|[DateTimeString](#common-field-types)|false|none|The date and time of the last debit executed under this authorisation|
|lastDebitAmount|[AmountString](#common-field-types)|false|none|The amount of the last debit executed under this authorisation|

AuthorisedEntity

```json
{
  "name": "string",
  "financialInsitution": "string",
  "abn": "string",
  "acn": "string"
}

```

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|name|string|true|none|Name of the authorised entity.|
|financialInsitution|string|true|none|Name of the financial institution through which the direct debit will be executed.|
|abn|[ABN](#schemaabn)|false|none|Australian Business Number for the authorised entity.|
|acn|[ACN](#schemaacn)|false|none|Australian Company Number for the authorised entity.|

ABN

```json
"string"

```

*Australian Business Number.*

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|string|false|none|Australian Business Number.|

ACN

```json
"string"

```

*Australian Company Number.*

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|string|false|none|Australian Company Number.|

Account

```json
{
  "accountId": "string",
  "displayName": "string",
  "nickname": "string",
  "maskedNumber": "string",
  "productCategory": "PERS_AT_CALL_DEPOSITS",
  "providerType": "string",
  "balance$type": "deposits",
  "deposits": {
    "currentBalance": {
      "amount": 300.56,
      "currency": "AUD"
    },
    "availableBalance": {
      "amount": 300.56,
      "currency": "AUD"
    }
  }
}

```

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|accountId|[AccountId](#schemaaccountid)|true|none|A unique ID of the account adhering to the standards for ID permanence.|
|displayName|string|true|none|The display name of the account. If a customer provided nickname is available that value should be returned.|
|nickname|string|false|none|A customer supplied nick name for the account.|
|maskedNumber|[MaskedAccountNumber](#schemamaskedaccountnumber)|true|none|A masked version of the account. Whether BSB/Account Number, Credit Card PAN or another number this should be formatted with each digit masked and the last three digits unmasked.|
|productCategory|[ProductCategory](#schemaproductcategory)|false|none|The the product category an account aligns withs.|
|providerType|string|true|none|The unique type as defined by the account provider.|
|balance$type|string|true|none|The type of balance object provided for the account.|

*oneOf*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|deposits|[DepositBalanceType](#schemadepositbalancetype)|false|none|none|

*xor*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|lending|[LendingBalanceType](#schemalendingbalancetype)|false|none|none|

*xor*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|purses|[MultiCurrencyPursesType](#schemamulticurrencypursestype)|false|none|none|

#### Enumerated Values

|Property|Value|
|---|---|
|balance$type|deposits|
|balance$type|lending|
|balance$type|purses|

AccountDetail

### Properties

*allOf*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|[Account](#schemaaccount)|false|none|none|

*and*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|» bundleName|string|false|none|Indicates if this account is park of a bundle that is providing additional benefit to the customer.|
|» specificAccount$type|string|false|none|The type of structure to present account specific fields|

*oneOf*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|» termDeposit|[TermDepositAccountType](#schematermdepositaccounttype)|false|none|none|

*xor*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|» creditCard|[CreditCardAccountType](#schemacreditcardaccounttype)|false|none|none|

*xor*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|» loan|[LoanAccountType](#schemaloanaccounttype)|false|none|none|

*continued*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|» features|[[ProductFeature](#schemaproductfeature)]|false|none|Array of features on the account|
|» fees|[[ProductFee](#schemaproductfee)]|false|none|Fees and charges applicable to the account|
|» depositRates|[[ProductDepositRate](#schemaproductdepositrate)]|false|none|Interest rates available for deposits|
|» lendingRates|[[ProductLendingRate](#schemaproductlendingrate)]|false|none|Interest rates charged against lending balances|
|» address|object|false|none|The address for the account to be used for correspondence|
|»» address$type|string|true|none|The type of address object that is present|
|»» simple|[SimpleAddress](#schemasimpleaddress)|false|none|none|
|»» paf|[PAFAddress](#schemapafaddress)|false|none|none|

#### Enumerated Values

|Property|Value|
|---|---|
|specificAccount$type|termDeposit|
|specificAccount$type|creditCard|
|specificAccount$type|loan|
|address$type|simple|
|address$type|paf|

CountryCodeISO

```json
"AUS"

```

*A valid ISO 3166 Alph-3 country code.*

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|string|false|none|A valid ISO 3166 Alph-3 country code.|

Product

```json
{
  "productId": "string",
  "effectiveFrom": "2018-11-01T05:33:52Z",
  "effectiveTo": "2018-11-01T05:33:52Z",
  "lastUpdated": "2018-11-01T05:33:52Z",
  "productCategory": "PERS_AT_CALL_DEPOSITS",
  "name": "string",
  "description": "string",
  "brand": "string",
  "brandName": "string",
  "applicationUri": "http://example.com",
  "isNegotiable": true,
  "additionalInformation": {
    "overviewUri": "http://example.com",
    "termsUri": "http://example.com",
    "eligibilityUri": "http://example.com",
    "feesAndPricingUri": "http://example.com",
    "bundleUri": "http://example.com"
  }
}

```

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|productId|[ASCII String](#common-field-types)|true|none|A provider specific unique identifier for this product. This identifier must be unique to a product but does not otherwise need to adhere to ID permanence guidelines.|
|effectiveFrom|[DateTimeString](#common-field-types)|false|none|A description of the product.|
|effectiveTo|[DateTimeString](#common-field-types)|false|none|The date and time at which this product will be retired and will no longer be offered.|
|lastUpdated|[DateTimeString](#common-field-types)|true|none|A description of the product.|
|productCategory|[ProductCategory](#schemaproductcategory)|true|none|The the product category an account aligns withs.|
|name|string|true|none|The display name of the product.|
|description|string|true|none|The description of the product.|
|brand|string|true|none|A label of the brand for the product. Able to be used for filtering. For data providers with single brands this value is still required.|
|brandName|string|false|none|An optional display name of the brand|
|applicationUri|[URIString](#common-field-types)|false|none|A link to an application web page where this product can be applied for.|
|isNegotiable|boolean|true|none|Indicates whether the product is specifically designed so that fees and prices are negotiated depending on context. While all products are open to a degree of negotiation this flag indicates that negotiation is expected and thus that the provision of specific fees and rates is not applicable.|
|additionalInformation|object|false|none|Object that contains links to additional information on specific topics.|
|» overviewUri|[URIString](#common-field-types)|false|none|General overview of the product.|
|» termsUri|[URIString](#common-field-types)|false|none|Terms and conditions for the product.|
|» eligibilityUri|[URIString](#common-field-types)|false|none|Eligibility rules and criteria for the product.|
|» feesAndPricingUri|[URIString](#common-field-types)|false|none|Description of fees, pricing, discounts, exemptions and bonuses for the product.|
|» bundleUri|[URIString](#common-field-types)|false|none|Description of a bundle that this product can be part of.|

ProductDetail

### Properties

*allOf*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|[Product](#schemaproduct)|false|none|none|

*and*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|» bundles|[object]|false|none|An array of bundles that this product participates in. Each bundle is described by free form information but also by a list of product IDs of the other products that are included in the bundle. It is assumed that the current product is included in the bundle also|
|»» name|string|true|none|Name of the bundle|
|»» description|true|none|Description of the bundle|
|»» additionalInfoUri|[URIString](#common-field-types)|false|none|Link to a web page with more information on the bundle criteria and benefits|
|»» productIds|[string]|true|none|Array of product IDs for products included in the bundle|
|» features|[[ProductFeature](#schemaproductfeature)]|false|none|Array of features available for the product|
|» constraints|[[ProductConstraint](#schemaproductconstraint)]|false|none|Constraints on the application for or operation of the product such as minimum balances or limit thresholds|
|» eligibility|[[ProductEligibility](#schemaproducteligibility)]|false|none|Eligibility criteria for the product|
|» fees|[[ProductFee](#schemaproductfee)]|false|none|Fees and charges applicable for the product|
|» depositRates|[[ProductDepositRate](#schemaproductdepositrate)]|false|none|Interest rates available for deposits|
|» lendingRates|[[ProductLendingRate](#schemaproductlendingrate)]|false|none|Interest rates charged against lending balances|
|» repaymentType|string|false|none|For lending style products what are the options for repayments that are available. If absent (and relevant) defaults to PRINCIPAL_AND_INTEREST|

#### Enumerated Values

|Property|Value|
|---|---|
|repaymentType|INTEREST_ONLY|
|repaymentType|PRINCIPAL_AND_INTEREST|
|repaymentType|NEGOTIABLE|

ProductFeature

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|object|true|none|none|
|» featureType|string|true|none|The type of feature described. See the note below for valid values and their meaning|
|» additionalValue|string|false|none|Generic field containing additional information relevant to the featureType specified. Whether mandatory or not is dependent on the value of featureType|

For an explanation of the featureType values and their meanings refer to [Product Feature Types](#productfeaturetypedoc) or [Account Feature Types](#accountfeaturetypedoc)

ProductConstraint

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|object|true|none|none|
|» constraintType|string|true|none|The type of constraint described. See the note below for valid values and their meaning|
|» additionalValue|string|false|none|Generic field containing additional information relevant to the constraintType specified. Whether mandatory or not is dependent on the value of constraintType|

For an explanation of the constraintType values and their meanings refer to [Product Constraint Types](#productconstrainttypedoc)

ProductEligibility

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|object|true|none|none|
|» eligibilityType|string|true|none|The type of eligibility criteria described. See the note below for valid values and their meaning|
|» additionalValue|string|false|none|Generic field containing additional information relevant to the eligibilityType specified. Whether mandatory or not is dependent on the value of eligibilityType|
|» additionalInfo|string|false|none|Display text providing more information on the eligibility criteria. Mandatory if the eligibilityType field is set to OTHER|
|» additionalInfoUri|[URIString](#common-field-types)|false|none|Link to a web page with more information on this eligibility criteria|

For an explanation of the eligibilityType values and their meanings refer to [Product Eligibility Types](#producteligibilitytypedoc)

ProductFee

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|object|true|none|none|
|» name|string|true|none|Name of the fee|
|» feeType|string|true|none|The type of fee. See the note below for valid values and their meaning|
|» amount|[AmountString](#common-field-types)|false|none|The amount charged for the fee. Assumed to be in AUD. One of amount, balanceRate and transactionRate is mandatory.|
|» balanceRate|[RateString](#common-field-types)|false|none|A fee rate calculated based on a proportion of the balance. Assumed to be in AUD. One of amount, balanceRate and transactionRate is mandatory.|
|» transactionRate|[RateString](#common-field-types)|false|none|A fee rate calculated based on a proportion of a transaction. Assumed to be in AUD. One of amount, balanceRate and transactionRate is mandatory.|
|» currency|[CurrencyString](#common-field-types)|false|none|The currency the fee will be charged in. Assumes AUD if absent|
|» additionalValue|string|false|none|Generic field containing additional information relevant to the feeType specified. Whether mandatory or not is dependent on the value of feeType|
|» additionalInfo|string|false|none|Display text providing more information on the fee|
|» additionalInfoUri|[URIString](#common-field-types)|false|none|Optional Link to a web page with more information on this fee|
|» discounts|[[ProductDiscount](#schemaproductdiscount)]|false|none|An optional list of discounts to this fee that may be available|

For an explanation of the feeType values and their meanings refer to [Product Fee Types](#productfeetypedoc) or [Account Fee Types](#accountfeetypedoc)

ProductDiscount

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|object|true|none|none|
|» description|string|true|none|Description of the discount|
|» discountType|string|true|none|The type of discount. See the note below for valid values and their meaning|
|» amount|[AmountString](#common-field-types)|true|none|Value of the discount. Note that the currency of the fee discount is expected to be the same as the currency of the fee itself|
|» additionalValue|string|false|none|Generic field containing additional information relevant to the discountType specified. Whether mandatory or not is dependent on the value of discountType|

For an explanation of the discountType values and their meanings refer to [Product Discount Types](#productdiscounttypedoc) or [Account Discount Types](#accountdiscounttypedoc)

ProductDepositRate

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|object|true|none|none|
|» depositRateType|string|true|none|The type of rate (base, bonus, etc). See the next section for an overview of valid values and their meaning|
|» rate|[RateString](#common-field-types)|true|none|The rate to be applied|
|» additionalValue|string|false|none|Generic field containing additional information relevant to the depositRateType specified. Whether mandatory or not is dependent on the value of depositRateType|
|» additionalInfo|string|false|none|Display text providing more information on the rate|
|» additionalInfoUri|[URIString](#common-field-types)|false|none|Link to a web page with more information on this fee|

For an explanation of the depositRateType values and their meanings refer to [Product Deposit Rate Types](#productdepositratetypedoc) or [Account Deposit Rate Types](#accountdepositratetypedoc)

ProductLendingRate

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|object|true|none|none|
|» lendingRateType|string|true|none|The type of rate (base, bonus, etc). See the next section for an overview of valid values and their meaning|
|» rate|[RateString](#common-field-types)|true|none|The rate to be applied|
|» additionalValue|string|false|none|Generic field containing additional information relevant to the lendingRateType specified. Whether mandatory or not is dependent on the value of lendingRateType|
|» additionalInfo|string|false|none|Display text providing more information on the rate|
|» additionalInfoUri|[URIString](#common-field-types)|false|none|Link to a web page with more information on this fee|

For an explanation of the lendingRateType values and their meanings refer to [Product Lending Rate Types](#productlendingratetypedoc) or [Account Lending Rate Types](#accountlendingratetypedoc)

AccountType

```json
{
  "accountType": "termDeposit"
}

```

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|accountType|string|true|none|The specfic account type.|

#### Enumerated Values

|Property|Value|
|---|---|
|accountType|termDeposit|
|accountType|creditCard|
|accountType|loan|

TermDepositAccountType

```json
{
  "lodgementDate": "2018-11-01",
  "maturityDate": "2018-11-01",
  "maturityAmount": 380,
  "maturityCurrency": "AUD",
  "maturityInstructions": "ROLLED_OVER"
}

```

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|object|true|none|none|
|» lodgementDate|[DateString](#common-field-types)|true|none|The lodgement date of the original deposit.|
|» maturityDate|[DateString](#common-field-types)|true|none|Maturity date for the term deposit.|
|» maturityAmount|number|false|none|Amount to be paid upon maturity. If absent it implies the amount to paid is variable and cannot currently be calculated|
|» maturityCurrency|[CurrencyString](#common-field-types)|false|none|If absent assumes AUD.|
|» maturityInstructions|string|true|none|Current instructions on action to be taken at maturity.|

#### Enumerated Values

|Property|Value|
|---|---|
|maturityInstructions|ROLLED_OVER|
|maturityInstructions|PAID_OUT_AT_MATURITY|

CreditCardAccountType

```json
{
  "minPaymentAmount": 100,
  "paymentDueAmount": 200,
  "paymentCurrency": "AUD",
  "paymentDueDate": "2018-11-01"
}

```

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|object|true|none|none|
|» minPaymentAmount|[AmountString](#common-field-types)|true|none|The minimum payment amount due for the next card payment.|
|» paymentDueAmount|[AmountString](#common-field-types)|true|none|The amount due for the next card payment.|
|» paymentCurrency|[CurrencyString](#common-field-types)|false|none|If absent assumes AUD.|
|» paymentDueDate|[DateString](#common-field-types)|true|none|Date that the next payment for the card is due.|

LoanAccountType

```json
{
  "originalStartDate": "2018-11-01",
  "originalLoanAmount": 200,
  "originalLoanCurrency": "AUD",
  "loanEndDate": "2018-11-01",
  "nextInstalmentDate": "2018-11-01",
  "minInstalmentAmount": 0,
  "minInstalmentCurrency": "AUD",
  "maxRedraw": 0,
  "maxRedrawCurrency": "AUD",
  "minRedraw": 0,
  "minRedrawCurrency": "AUD",
  "offsetAccountEnabled": true,
  "offsetAccountIds": ["string"],
  "repaymentType": "INTEREST_ONLY",
  "repaymentFrequency": "P1M"
}

```

### Properties

*allOf*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|object|true|none|none|
|» originalStartDate|[DateString](#common-field-types)|false|none|Optional original start date for the loan.|
|» originalLoanAmount|[AmountString](#common-field-types)|false|none|Optional original loan value.|
|» originalLoanCurrency|[CurrencyString](#common-field-types)|false|none|If absent assumes AUD.|
|» loanEndDate|[DateString](#common-field-types)|true|none|Date that the loan is due to be repaid in full.|
|» nextInstalmentDate|[DateString](#common-field-types)|true|none|Next date that an installment is required.|
|» minInstalmentAmount|[AmountString](#common-field-types)|true|none|Minimum Amount of next instalment.|
|» minInstalmentCurrency|[CurrencyString](#common-field-types)|false|none|If absent assumes AUD.|
|» maxRedraw|number|false|none|Maximum amount of funds that can be redrawn. If not present redraw is not available even if the feature exists for the account.|
|» maxRedrawCurrency|[CurrencyString](#common-field-types)|false|none|If absent assumes AUD.|
|» minRedraw|number(date)|false|none|none|
|» minRedrawCurrency|[CurrencyString](#common-field-types)|false|none|If absent assumes AUD.|
|» offsetAccountEnabled|boolean|false|none|Set to true if one or more offset accounts are configured for this loan account|
|» offsetAccountId|[[AccountId](#schemaaccountid)]|false|none|The accountIDs of the configured offset accounts attached to this loan. Only offset accounts that can be accesses under the current authorisation should be included. It is expected behaviour that offsetAccountEnabled is set to true but the offsetAccountIds field is absent or empty. This represents a situation where an offset account exists but details can not be accessed under the current authorisation.|
|» repaymentType|string|false|none|Options in place for repayments. If absent defaults to PRINCIPAL_AND_INTEREST.|
|» repaymentFrequency|string|true|none|The expected or required repayment frequency. Formatted according to [ISO 8601 Durations](https://en.wikipedia.org/wiki/ISO_8601#Durations)|

#### Enumerated Values

|Property|Value|
|---|---|
|repaymentType|INTEREST_ONLY|
|repaymentType|PRINCIPAL_AND_INTEREST|

MaskedAccountNumber

```json
"string"

```

*A masked version of the account. Whether BSB/Account Number, Credit Card PAN or another number this should be formatted with each digit masked and the last three digits unmasked.*

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|string|false|none|A masked version of the account. Whether BSB/Account Number, Credit Card PAN or another number this should be formatted with each digit masked and the last three digits unmasked.|

AccountId

```json
"string"

```

*A unique ID of the account adhering to the standards for ID permanence.*

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|[ASCIIString](#common-field-types)|false|none|A unique ID of the account adhering to the standards for ID permanence.|

AccountBalance

```json
{
  "accountId": "string",
  "balance$type": "deposits",
  "deposits": {
    "currentBalance": {
      "amount": 300.56,
      "currency": "AUD"
    },
    "availableBalance": {
      "amount": 300.56,
      "currency": "AUD"
    }
  }
}

```

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|accountId|[AccountId](#schemaaccountid)|true|none|A unique ID of the account adhering to the standards for ID permanence.|
|balance$type|string|true|none|The type of balance object provided for the account.|

*oneOf*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|deposits|[DepositBalanceType](#schemadepositbalancetype)|false|none|none|

*xor*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|lending|[LendingBalanceType](#schemalendingbalancetype)|false|none|none|

*xor*

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|purses|[MultiCurrencyPursesType](#schemamulticurrencypursestype)|false|none|none|

#### Enumerated Values

|Property|Value|
|---|---|
|balance$type|deposits|
|balance$type|lending|
|balance$type|purses|

BalanceType

```json
{
  "balanceType": "deposits"
}

```

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|balanceType|string|true|none|The balance type object provided for the account.|

#### Enumerated Values

|Property|Value|
|---|---|
|balanceType|deposits|
|balanceType|lending|
|balanceType|purses|

DepositBalanceType

```json
{
  "currentBalance": {
    "amount": 300.56,
    "currency": "AUD"
  },
  "availableBalance": {
    "amount": 300.56,
    "currency": "AUD"
  }
}

```

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|object|false|none|none|
|» currentBalance|[CurrencyAmount](#schemacurrencyamount)|true|none|The current balance of the account at this time. Should align to the current balance available via other channels such as ATM balance enquiry or Internet Banking.|
|» availableBalance|[CurrencyAmount](#schemacurrencyamount)|true|none|Object represent the current balance for the account.  Assumed to be positive or zero.|

LendingBalanceType

```json
{
  "accountBalance": {
    "amount": 300.56,
    "currency": "AUD"
  },
  "availableBalance": {
    "amount": 300.56,
    "currency": "AUD"
  },
  "creditLimit": {
    "amount": 300.56,
    "currency": "AUD"
  },
  "amortisedLimit": {
    "amount": 300.56,
    "currency": "AUD"
  }
}

```

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|object|false|none|none|
|» accountBalance|[CurrencyAmount](#schemacurrencyamount)|true|none|Object represent the balance for the loan, line of credit or credit card.|
|» availableBalance|[CurrencyAmount](#schemacurrencyamount)|true|none|The available balance for the account. Assumed to be positive or zero.|
|» creditLimit|[CurrencyAmount](#schemacurrencyamount)|true|none|The maximum amount of credit that is avaible for this account. Assumed to be positive or zero.|
|» amortisedLimit|[CurrencyAmount](#schemacurrencyamount)|false|none|The available limit amortised according to payement schedule.|

MultiCurrencyPursesType

```json
{
  "purses": [
    {
      "amount": 300.56,
      "currency": "AUD"
    }
  ]
}

```

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|object|false|none|none|
|» purses|[[CurrencyAmount](#schemacurrencyamount)]|true|none|List of Purses.|

ProductCategory

*The product category an account aligns withs.*

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|string|false|none|The the product category an account aligns withs.|

#### Enumerated Values

|Property|Value|
|---|---|
|*anonymous*|PERS_AT_CALL_DEPOSITS|
|*anonymous*|BUS_AT_CALL_DEPOSITS|
|*anonymous*|TERM_DEPOSITS|
|*anonymous*|RESIDENTIAL_MORTGAGES|
|*anonymous*|PERS_CRED_AND_CHRG_CARDS|
|*anonymous*|BUS_CRED_AND_CHRG_CARDS|
|*anonymous*|PERS_LOANS|
|*anonymous*|PERS_LEASING|
|*anonymous*|BUS_LEASING|
|*anonymous*|TRADE_FINANCE|
|*anonymous*|PERS_OVERDRAFT|
|*anonymous*|BUS_OVERDRAFT|
|*anonymous*|BUS_LOANS|
|*anonymous*|FOREIGN_CURR_AT_CALL_DEPOSITS|
|*anonymous*|FOREIGN_CURR_TERM_DEPOSITS|
|*anonymous*|FOREIGN_CURR_LOAN|
|*anonymous*|FOREIGN_CURRRENCT_OVERDRAFT|
|*anonymous*|TRAVEL_CARD|

CurrencyAmount

```json
{
  "amount": 300.56,
  "currency": "AUD"
}

```

### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|amount|number|true|none|none|
|currency|string|false|none|none|

repository: jdcba/standards

branch_name: refs/heads/master

extension: md

gha_license_id: NOASSERTION

license_type: permissive

repo_name: jdcba/standards


text:
# Generating etcd certificates

You need certificates to properly talk to etcd with authentication and encryption.
Use the `gen-cert.sh` script to generate client and server certificates with `gen-cert.sh server <IP_ADDRESS>` to generate a `server.crt` and `server.key` for a server with IP address `<IP_ADDRESS>`.
You can use the same script to generate client certificates and peer certificates, it doesn't matter.
But please down delete the CA files.
pls.

license: MIT

branch_name: refs/heads/main

gha_license_id: MIT


text:
# boilerplate-react-starter

Boilerplate of React, Jest and Flow on Docker.

## Let's begin a new react project

```sh
git clone https://github.com/keidrun/boilerplate-react-starter.git
cd boilerplate-react-starter
docker-compose up -d
```

We don't need to use a bloated and non easy customizable`create-react-app` anymore.

repository: keidrun/boilerplate-react-starter

gha_language: JavaScript

repo_name: keidrun/boilerplate-react-starter


text:
Please Note, the Test User,Domain and Project is only configured in QA-DE-1

# Best Practice

https://docs.cypress.io/guides/references/best-practices

* write descriptions always in lowercase

# Usage

```bash
./run.sh --help
```

## run e2e tests against elektra running on remote host

```bash
./run.sh https://elektra.corp
```

## run e2e in workspaces with running elektra env localhost

```bash
./run.sh
```

run.sh will find out all information

## run e2e with debug mode

```bash
  run.sh --host http://localhost:3000 --debug 'cypress:network:*'
  # will show debug information about the networking"
```

Debugging options: https://docs.cypress.io/guides/references/troubleshooting#Log-sources"

- `cypress:cli` The top-level command line parsing problems
- `cypress:server:args` Incorrect parsed command line arguments
- `cypress:server:specs` Not finding the expected specs
- `cypress:server:project` Opening the project
- `cypress:server:browsers` Finding installed browsers
- `cypress:launcher` Launching the found browser
- `cypress:server:video` Video recording
- `cypress:network:*` Adding network interceptors
- `cypress:net-stubbing*` Network interception in the proxy layer
- `cypress:server:reporter` Problems with test reporters
- `cypress:server:preprocessor` Processing specs
- `cypress:server:plugins` Running the plugins file and bundling specs
- `cypress:server:socket-e2e` Watching spec files
- `cypress:server:task` Invoking the cy.task() command
- `cypress:server:socket-base` Debugging cy.request() command
- `cypress:server:fixture` Loading fixture files
- `cypress:server:record:ci-info` Git commit and CI information when recording to the Cypress Dashboard

## run e2e from darwin running elektra locally on port 3000

```bash
./run.sh --host http://host.docker.internal:3000
```

## env

you need to add the following env vars to your `.env`

```
TEST_DOMAIN="cc3test"
TEST_MEMBER_USER="TEST_D021500_TM"
TEST_MEMBER_PASSWORD="xxx"
TEST_ADMIN_USER="TEST_D021500_TA"
TEST_ADMIN_PASSWORD="xxd"
```

for password check `secrets/qa-de-1/values/domain-seeds.yaml`

## cypress.json

* https://docs.cypress.io/guides/references/configuration#Global

# Tips

* `cy.get().should('be.disabled')` works not with `a` or `div` tag instead use
```
  cy.get().should('have.attr', 'disabled');
  cy.get().should('not.have.attr', 'disabled');
```

* if you do not find a good identifier use data attribute like `data-test="search"` you can access it in cypress with `cy.get('[data-test=search]`')

# TODOs

* at the moment we cannot test keppel-ui and cloudops tools, because our test admin user has no permission
* we need our own project with a test member and admin user
* https://documentation.global.cloud.sap/docs/customer/access-management/identity-service/overview/identity-usage/#technical-users

repository: sapcc/elektra

repo_name: sapcc/elektra


text:
# Exercise-2

As described in [module-4](https://github.com/INFO-201/m4-git-intro), you should begin by forking this repository, then cloning it to your local machine (if you haven't already).

In the space below, you'll provide some information about a terminal command you've learned thus far in the class. In particular, you should include the following:

A `heading` with the name of the command
An example of how it can be used (with appropriate code highlighting)
A _nested list_ of information about the command (i.e., things that it does, or how it can be used)

See `complete` branch for answers.

-
#cd

`cd` can be used to _change_ the current **working directory** in operating systems. It can be used to change into a subdirectory, move back to the parent directory, or move all the way back to the **parent directory**.

Example:

```
cd Desktop
```
or

```
cd ../
```

here is some more info about the `cd` command:

* `cd ..` takes you up one directory.
* `cd /root` take you to the home directory of the root, or the account created at installation.


text:
An app that demonstrates parsing XML. The assets folder contains an XML weather forecast file that is parsed and displayed in a ListView.
  * A SAX Parser is used to parse the weather XML file.
  * Parsed results are copied into an ArrayList of HashMaps.
  * A SimpleAdapter is used with a ListView to display the weather data.

Note: This app is just one app in the class demo repository. To get the source code for this app you will need to clone or download the whole repository, https://github.com/UO-CIS/CIS399AndroidDemos.

This demo was written for CIS399, Android App Development, at the University of Oregon.

Read more about android programming on my blog, BirdsBits: https://birdsbits.wordpress.com

repository: georgegopro/android-stuff

repo_name: georgegopro/android-stuff


text:
---
layout: post
date:	2010-07-05 16:20:00
title:  Ayushya hOmam...and drishti parihAram....
tags: [archived-posts]
categories: archives
permalink: /:categories/:year/:month/:day/:title/
---
The

 Wiki entry about our community, the Iyers

says:

"On the child's birthday, a ritual is performed to ensure longevity. This ritual is known as Ayushya Homam. This ceremony is held on the child's birthday reckoned as per the Tamil calendar based on the position of the nakshatras  or stars and not the Gregorian calendar.[109]  The child's first birthday is the most important."

Here are a few snaps from KTB's Ayush hOmam (it was neither her birth-star date nor her date of birth, we just had it on a Sunday, that's all!)

 click here to see some pics ...if you have the time and inclination

The guests gather to bless us with sanctified rice being thrown as a form of benison:

<lj-embed id="353"/>

Then they gather for the "poorNa Ahuthi" or the making  of all sorts of offerings to agni, the Fire God, to bear as a messenger to the Gods in Heaven:

<lj-embed id="354"/>

After we came home, a friend insisted that the "evil eye" had to be averted from the little one, and she performed her version of this rite,the

 drishti dOsha parihAra

 which is very different from what my family would do:

<lj-embed id="355"/>

I simply cannot believe in this rite. If I have invited our friends for a celebration, I cannot understand how such an "evil eye" or negative energy will be brought around the child, and how doing this kind of ritual will "remove" it. I hate the very idea that someone (in this case, friends of ours!) will "cast an evil eye" upon the baby, and find it very distasteful. This is as if I am saying that my friends are capable of being envious and jealous! Yes, perhaps if we had taken the baby out in a public space, I *might* agree that she might have attracted negative or jealous thoughts...but I cannot admit the idea that my own friends will direct such thoughts at her at an occasion to celebrate her turning one. If I believe this, I might as well not have such a celebration at all, because then I believe something less than the best of my own friends.

And also, how will the act of "windmilling" fistfuls of salt around the child (which is what we do) or burning one's fingers over a flame, to get a little soot to mark the baby's forehead, take away this negativity, if it does exist?

And.... when we say that we do not believe in a certain ritual (especially when the father is from a very different culture) , some people insist on foisting their beliefs upon us, and insist on us doing  the ritual, or doing it themselves. Since it seemed so important to them, DnA agreed to let it be done, but I certainly wish that others would not insist on doing what they think fit, but let us stick to what we want to do... I am glad DnA are so accomodating!


text:
Texas 4000 Rider Management System
======

#### Background

Alright, here it goes again. This is the *second* iteration of the Texas 4000 Rider Management System. If you want to see the first failed attempt, check out the [amancio](https://github.com/ethanperez/amancio) repository.

#### Purpose

The purpose of this piece of software is to allow the Texas 4000 team to better manage its intellectual resources. Currently, information is extremely de-centralized in Google Docs, MS Word files, Dropbox accounts, and across the space-time continuum. This Python/Django project attempts to centralize all team information.

#### Is this in production? What's its working status?

1/22/14: No yet. It is just beginning its roots, and I expect it to be in limited use starting 1/27/14.

#### Alright, well what's up next?

Here is a list of features that are currently being worked on, based off of what I've seen and what has been requested. You can email me at [ethan@ethanperez.com](mailto:ethan@ethanperez.com).

- basic rider login/logout ability
- create a basic rider dashboard w/ Bootstrap 3
- ability to track miles biked
- ability to sign-in at meetings by logging into the T4K RMS
- ability to track fundraising data, and take snapshots
- ability to track community service hours
- ability to track attendence at all events


text:
# Football-Player-Tracking
Computer vision based and deep learning based framework for player tracking and analysis in football videos

## Description
In this project i aim is to do Computer Vision based analysis on a live football video stream or a recorded football match which can be used as a football analytics tool. My plan is primarily based on the ideas preseneted in this paper [[1]](https://openaccess.city.ac.uk/18380/8/paper319.pdf) with the end goal that the same system can be portable to be used in other sports too. Generally a video stream from a live match only gives view of a certain section of the pitch(shown in below gif), one of  things i aim to  is to be able to convert it to whole pitch representation i.e a panoramic view for easier interpration in terms of a global view.

![A general stream of a football match](clips/clip2.gif)

Along the with the panoramic view generator, i will also try to make 2d pitch representation of the pitch to map the live player positions on to it.The 2-d mappings will be used to calculate various foobtall metrics like player trajectories, team structures etc.

![2d-pitch-representation](clips/2d-pitch-representation.png)

I plan to read to more research papers on basis of the use-cases of which tools will be required to do the above mentioned stuff

Some of the topics covered in this project would be:

**Position mapping** - positions from the video are mapped to a physical reference frame, in our case the soccer pitch

**Detect and track objects of interest** - In case of team sport video analysis, these are typically the
teams’ players and the ball possibly using deep learning object tracking algorithms

Datasets that can be used:[Soccer video & Position dataset](https://datasets.simula.no/alfheim/)

## Aims
1. Using homography to

  1.1 Create panoramic views

  1.2 Projecting current video frame to panoramic view

  1.3 Projecting current video frame to to 2d pitch representation
3. Try out various player tracking approaches to identify player positions on the 2d homagraphic pitch view using CNN's and other such architectures
4. Calculate various football analysis metric possible,like

  4.1 Player trajectories

  4.2 Team structure

## Literature review
1. [Bring it to the Pitch: Combining Video and Movement Data to
Enhance Team Sport Analysis - 2018](https://openaccess.city.ac.uk/18380/8/paper319.pdf)


text:
---
layout: post
title: Ancestors
excerpt: Week 3
modified: January 20, 2022
tags: [genealogy, challenge 52ancestors, AJCrow]
comments: true
category: blog
---

## Week 3: Favourite Photograph

I think this photo is just charming.

![Hugh Burley](https://live.staticflickr.com/65535/51833331350_1a61350976_b_d.jpg  "Hugh Burley, 1850-1922")

BIRTH 25 JUN 1850 • Haldimand, Northumberland, Ontario, Canada
DEATH 8 JUL 1922 • Hastings, Ontario, Canada

Hugh Burley, my 2nd great-grandfather, son of Samuel Burley and Chloe Barnes, married Hannah Mattis 5 Jun 1871 at Northumberland and Durham, Ontario. Hugh was 21, Hannah 22. She is from the Township of Camden. William and James Mattis were witnesses. They were married by [Davis Crowther?] and both are listed as E. Methodist. It says that Hugh was a farmer, but in later documents his occupation is listed as a jewler (sic). Wouldn't it be wonderful to find a piece of his handiwork? as usual I need to find out more.

One line of research that I am  currently investigating is the connection from Hannah Mattis too the UEL Jessups Ranger, Jacob Gordanier.


text:
{% extends "source/md.html" %}
{% block md %}

## Git can
- Revert files back to a previous state
- Compare changes over time
- See who last modified something.
- Using a VCS also generally means that if you screw things up or lose files, you can easily recover.
- You get all this for very little overhead.

[GitPro Book](http://git-scm.com/book/en/v2/Getting-Started-About-Version-Control)

{% endblock %}

repository: bholladay/github-is-awesomeness

gha_language: HTML

repo_name: bholladay/github-is-awesomeness


text:
# value-for-key

When you want to get and set value for keys on objects without causing JSHint camel case errors.

If you also keep getting errors like this:

```js
  object.someField = json.some_json_key;
```

```js
  file.js: line 56, col 0, Identifier 'some_json_key' is not in camel case.
```

Then this module is for you!

Now just:

```js
  object.someField = valueForKey(json, 'some_json_key');
```

## Installation

`npm install value-for-key`

## Tests

`npm test`

## MIT Licensed

repository: robskillington/value-for-key

repo_name: robskillington/value-for-key


text:
## \{{center}}

> Centers a string using non-breaking spaces.

Parameters: spaces: `int`. The number of spaces. (Required)

```handlebars
\{{center "Bender should not be allowed on tv." 10}}
```
Renders to:

```
|              Bender should not be allowed on tv.              |
```

repository: jonschlinkert/markdown-links

repo_name: jonschlinkert/markdown-links


text:
Condi
=====

Condi is a gem that you use with Rails to make it easier to cleanly implement conditional elements in a view and offers a clean and simple approach to separate business logic from your views and models.

Condi allows you to define boolean-valued *predicates* in the controller that are callable in the view without relying on unneeded instance variables or business logic in the views.  Because the predicates are defined dynamically during a controller action, they are easy to find and easy to use without hopping around multiple files.

Condi also allows definition of *synonyms* that can return any value (not just booleans).

API Doc: {Condi}

Copyright (C) 2012 by Larry Kyrala. MIT Licensed.

Installation
------------

    gem install condi

A Simple Example
----------------

For example, say you have a User who has various roles and a shopping Cart that contains items. Your StoreController loads the current User and Cart objects, and your store view displays the User and Cart information.  But let's say that orders over a certain amount for new customers should show a "free ground shipping" option.  With Condi you can define a `predicate` that does the following:

`app/controllers/store_controller.rb:`

```ruby
class StoreController
  include Condi

  def checkout
    user = User.find(user_id)
    cart = Cart.find(cart_id)
    predicate(:show_free_shipping?) { user.new_customer? && cart.amount > 100 }
  end
end
```

`app/views/store/checkout.html.erb:`

```erb
<% form_for @cart do |f| %>
  <% if show_free_shipping? %>
    <%= f.radio_button("cart", "shipping", "free_ground") %>
  <% end %>
<% end %>
```

Predicates with Arguments
-------------------------

Say you would like to monitor your cart status and highlight items that are shipped but haven't arrived yet if there are three or more items in the cart.  You would like to hand the collection of items off to a partial, but how can you use
a predicate in this situation? You need a predicate with an argument!

`app/controllers/store_controller.rb:`

```ruby
class StoreController
  include Condi

  def items
    cart = Cart.find(cart_id)
    @items = cart.items
    predicate(:shipping?) { |item| @items.count >= 3 &&
      item.status == :shipped &&
      DeliveryService.status(item.tracking_number) !~ /arrived/ }
  end
end
```

`app/views/store/items.html.erb:`

```erb
<table>
  <%= render :partial => "item", :collection => @items %>
</table>
```

`app/views/store/_item.html.erb:`

```erb
<% if shipping?(item) %>
  <tr class="shipping">
<% else %>
  <tr>
<% end %>
  <td><%= item.to_s %></td>
</tr>
```

Synonyms: defining blocks that return non-boolean values
--------------------------------------------------------

Although the previous example works, wouldn't it be nicer if we could simply define a `synonym` that
returns the css class we need for a given item?

`app/controllers/store_controller.rb:`

```ruby
class StoreController
  include Condi

  def items
    cart = Cart.find(cart_id)
    @items = cart.items
    synonym(:css_for_item_status) do |item|
      if @items.count >= 3 && item.status == :shipped
        if DeliveryService.status(item.tracking_number) !~ /arrived/
          "shipping"
        else
          "shipped"
        end
      else
        "processing"
      end
    end
  end
end
```

`app/views/store/_item.html.erb:`

```erb
<tr class="<%= css_for_item_status(item) %>">
  <td><%= item.to_s %></td>
</tr>
```

The Problem
-----------

Sometimes, pieces of your UI need to be enabled or disabled depending on certain criteria.  Usually these criteria come from Models loaded during actions in your Controllers.

Here's a typical implementation of the above example without Condi:

```ruby
class StoreController
  def checkout
    @user = User.find(user_id)
    @cart = Cart.find(cart_id)
  end
end
```

```erb
<% form_for @cart do |f| %>
  <% if @user.new_customer? && @cart.amount > 100 %>
    <%= f.radio_button("cart", "shipping", "free_ground") %>
  <% end %>
<% end %>
```

Not the cleanest approach since business logic is in our views now.  What's another alternative?  Maybe we can stick a predicate for displaying ground shipping on the Cart model instead?

```ruby
class Cart
  def show_free_shipping?(new_customer)
    new_customer && amount > 100
  end
end
```

```erb
<% form_for @cart do |f| %>
  <% if @cart.show_free_shipping?(@user.new_customer?) %>
    <%= f.radio_button("cart", "shipping", "free_ground") %>
  <% end %>
<% end %>
```

We haven't gained much except shuffling arguments around and we're coupling Carts with Users unnecessarily.

Or, we could put the predicate in a helper and remove the args:

```ruby
class StoreHelper
  def show_free_shipping?
    @user.new_customer? && @cart.amount > 100
  end
end
```

```erb
<% form_for @cart do |f| %>
  <% if show_free_shipping? %>
    <%= f.radio_button("cart", "shipping", "free_ground") %>
  <% end %>
<% end %>
```

This is a little better, but now we have variables set up in the controller and business logic in the helper.  It would be nicer if we could define the predicate in the controller where it is used, in the context of what the action has loaded (either into instance variables or locals).  Also if we have a large data-driven UI, we may have many such conditional UI predicates.  Managing them all can become quite complex.

Solution
--------

The way Condi solves this problem is to allow you to define predicates in the controller that are accessible in the view.

```ruby
class StoreController
  include Condi

  def checkout
    user = User.find(user_id)
    cart = Cart.find(cart_id)
    predicate(:show_free_shipping?) { user.new_customer? && cart.amount > 100 }
  end
end
```

The `predicate` call creates a closure around the state we've loaded in the controller and makes it available to the view later without cluttering up the helper namespace or forcing the view to contain business logic.

```erb
<% form_for @cart do |f| %>
  <% if show_free_shipping? %>
    <%= f.radio_button("cart", "shipping", "free_ground") %>
  <% end %>
<% end %>
```

How does this work?  Behind the scenes, `predicate` defines an instance method on the controller and then marks it as a `helper_method` which allows Rails to call the predicate from the view.  Since the predicate is dynamically added, you don't have to worry about the controller instance containing any more predicates than you defined in that particular action, so it's easy to manage.

Advantages
----------

* Because predicates are closures, you only have to worry about setting context once in the controller action instead of coordinating context across multiple files. This keeps your views functional and makes them easier to refactor without breaking existing business logic.

* Placing predicates in the Controller allows them to orchestrate multiple Models without breaking encapsulation between Models.  The Controller is arguably a better place to define such predicates from an MVC perspective.

* Condi makes it simple to define predicates and synonyms in the Controller and call them from the view without cluttering the helper namespace and creating a maze of unique helper names that are coupled to some action contexts and not others.  Condi is more flexible.

* Another advantage of the predicate being defined dynamically on the Controller is that the predicate can never be inadvertently called as an action itself.  Condi offers better encapsulation of state.

* Condi works with Rails 2 and Rails 3 apps equally well.

Disadvantages
-------------

* Controllers may become "thicker" than you might like.

* It may be awkward to share predicates across multiple actions.  But if you think about it, it is awkward to share context as well.  Filters are a common solution for both problems.  You can define your predicates in a before_filter method to ensure that both the context and the predicates will be sharable.

* If you aren't using any context from the action (i.e. you pass all your parameters as arguments and don't take advantage of the closure) then you don't really need Condi... it may be simpler/cleaner to just use helpers.

"Kind Sir, This Offends Me And All People Who Truly Understand Rails MVC!"
--------------------------------------------------------------------------

* First, *relax*.

* Second, realize that at it's heart, Condi is little more than a dynamic invocation of `helper_method`. [Look up the example](http://api.rubyonrails.org/classes/AbstractController/Helpers/ClassMethods.html#method-i-helper_method) for `helper_method` in the official Rails documentation:

  _Declare a controller method as a helper. For example, the following makes the current_user controller method available to the view:_

```ruby
class ApplicationController < ActionController::Base
  helper_method :current_user, :logged_in?

  def current_user
    @current_user ||= User.find_by_id(session[:user])
  end

  def logged_in?
    current_user != nil
  end
end
```

  _In a view:_

```erb
<% if logged_in? -%>Welcome, <%= current_user.name %><% end -%>
```

  Does it look similar to the Condi examples above?  That's why.

* Three. Rethink your position as the 'one true protector' of pure MVC and realize that either Rails has encouraged bad MVC from the start (and Condi does no worse), or that Rails is balancing pure MVC with an easier to use *(read: pragmatic)* idiom (and Condi does no worse).  Either way, the novelty here *is NOT* the use of a helper... the novelty is making the `helper_method` dynamic through metaprogramming.  Would you like it better if I called it `dynamic_helper_method` instead of `predicate`?

* Four. Metaprogramming is not without its perils, but Condi is fully tested with extensive tests and you are free to look at the code, the issues and the tests and let me know if I've missed anything by submitting a pull request with failing test case or opening a new issue.  Thanks!

Background
----------

Condi is something I wanted to explore as a response to the general problem of implementing *business logic* and rules in Rails apps.

* Rules-engines exist (i.e. `rools`), but are heavier-weight than Condi and can be complex to use.

* Rails `cells` is a promising component framework, but is also on the heavy side and may not fit well with legacy apps.

* Render-partial locals are a decent lighter-weight alternative to `cells`, but can sometimes be tricky to keep consistent across multiple controller action contexts.

* Doing the "right thing" isn't always an option in business logic.  If a customer wants to pay you a ton of money but your business model doesn't support it, are you going to refuse the money or change your business model?

* If business logic turns into a mess, at least we can strive to contain the rules in one place/context so that we can identify which problems are due to inconsistency in the business rules and which are due to coding errors.

repository: coldnebo/condi

gha_language: Ruby

repo_name: coldnebo/condi


text:
---
title: Skins
page_title: Skins - RadTreeList
description: Check our Web Forms article about Skins.
slug: treelist/appearance-and-styling/skins
tags: skins
published: True
position: 0
---

# Skins

RadTreeList uses skins to control its overall look-and-feel. A skin is a set of images and a CSS stylesheet that can be applied to the control elements (items, images, etc.) and defines their look and feel. By default all controls in UI for ASP.NET AJAX suite have a polished look and feel which is consistent across the whole product line.

## Built-in skins

These are the skins provided by Telerik. They are embedded in the Telerik.Web.UI.dll assembly as web resources. To use a built-in skin the user only needs to set the **Skin** property of the control. Built-in skins are also provided in "C:\Program Files\Progress\UI for ASP.NET AJAX RX YYYY\Skins".

Below is a set of the Telerik RadTreeList skins:
![RadTreeList Skins](images/treelist-skins.png)

 @[template - Material skin is available only in Lightweight mode](/_templates/common/skins-notes.md#material-only-in-lightweight)

>note With Q2 2011 release of UI for ASP.NET AJAX RadTreeList has four new skins (Transparent + Office2010 variations). To use them you should add the Telerik.Web.UI.Skins assembly to your Bin folder. For more information refer to [this blog post](https://blogs.telerik.com/aspnet-ajax/posts/11-07-05/new-telerik-ajax-skins-assembly.aspx).
>Since Q3 2011 all the built-in skins (except the Default one) have been relocated to the Telerik.Web.UI.Skins.dll assembly.Also new Metro skin has been added for RadTreeList.
>Since Q1 2013 three new skins have been added for RadTreeList(BlackMetroTouch, Glow and Silk).
>

## Custom skins

These are skins created by the developer. They are not embedded so the control cannot register them automatically. If you use a custom skin you need to set the **Skin** property, and the **EnableEmbeddedSkins** property of the treelist control to **false**. If you do not do so, an exception will be thrown saying that there is no embedded skin matching the Skin property.

Examine the [Creating a custom skin]({%slug introduction/radcontrols-for-asp.net-ajax-fundamentals/controlling-visual-appearance/creating-a-custom-skin%}) help topic for additional information.

## See Also

 * [Telerik ThemeBuilder for ASP.NET AJAX](https://themebuilder.telerik.com/)

repository: telerik/ajax-docs

gha_language: C#

repo_name: telerik/ajax-docs


text:
# TODO

## Features

- Syntax-colouring of executions of actions: `<Enter self>`, `<<Look>>`…
- Snippets (routine, for, class, object).
- Language server (for autocompletion, linting…)
- Increase indentation after having typed the head of a routine.

## Bugs

- The colours go wrong in "Load-*" templates. (But that's not very serious).
- Make the syntax colouring of JavaScript better.

## Other considerations

- Should the scope of `action`, `actor`, `consult_from`, `consult_word`, `inp1`, `inp2`, `noun`, `second` `thedark` `location`, `real_location`, `etype` `deadflag`, `the_time`, `score` `notify_mode`, `lm_n`, `lm_o` `inventory_stage`, `c_style`, `parser_one`, `parser_two`, `parser_action`, `verb_word`, `action_to_be`, `scope_stage`, `scope_reason`, `vague_word`, `indef_mode`, `standard_interpreter`, `gg_mainwin`, `gg_statuswin`, `gg_statuswin_size`, `gg_arguments`, `wn` be "variable.language.inform6" or "support.variable.inform6"?
- Change the scope of dictionary words and their end sequence (such as `//p`), of printing variables in strings (such as `@14`)?
- `replace`, `first`, `last`, `only`, `alias` in the directives?
- Add all constant used by translations of Inform ("or" words, "undo" words and such) and functions like `LanguageContraction`?
- Add Z-machine V6 opcodes?
- Add a special case for the Glulx argument `_vararg_count`?
- Object and class declarations can only be on one line and at the start of the line for the moment.
- Put `Stub` directive in deprecated?
- Change the category of the `Order` and `NotUnderstood` actions?
- Change the category of the `REPARSE_CODE` constant?
- Do something with entry points routines (§A5 of DM4, `LibraryMessages`, `LanguageAnimateGender`, `LanguageInanimateGender`, `LanguageContractionForms`, `Epilogue`), constants used by the Library if defined (`NO_PLACES`, `Story`, `Headline`, `MAX_CARRIED`, `SACK_OBJECT`, `AMUSING_PROVIDED`, `DEATH_MENTION_UNDO`, `MAX_SCORE`, `OBJECT_SCORE`, `ROOM_SCORE`, `TASK_PROVIDED`, `NUMBER_TASK`, `USE_MODULES`, `COMMENT_CHARACTER`, `NO_SCORE`, `START_MOVE`, `NO_INITIAL_LOOK`, `TRADITIONAL_TAKE_ALL`, `COLOUR`, `COLOR`), `task_scores`, Glk entry points (`HandleGlkEvent`, `InitGlkWindow`, `IdentifyGlkObject`)?


text:
# http-statsd

A Go's net/http middleware to emit metrics to StasD.

## Stats

It automatically creates metric name, then send the following stats
* counter (increment of 1)
* timing (response time in ms)
* sample rate of 1.0 (configurable)

### Metric Name

The middleware uses http.Request info for building up the metric name.

```golang
// where r is *http.Request
fmt.Sprintf("%s.%s.%d", r.URL.Path, r.Method, mt.Code)
```

Additionally, it converts url path like "/" into "." to make it friendly with StatsD backend service like Graphite. For example, `users/345/address` would be converted to `users.345.address`.

## Usage

The following example how to use this middleware with standard net/http.

```golang
package main

import (
	"net/http"

	"github.com/cactus/go-statsd-client/v5/statsd"
	"github.com/gomwr/http-statsd/middleware"
)

func hello(w http.ResponseWriter, r *http.Request) {
	w.Write([]byte("hello world!"))
}

func main() {
	cfg := &statsd.ClientConfig{
		Address:     "<IP_ADDRESS>:8125",
		Prefix:      "http-statsd-example",
		UseBuffered: true,
	}
	cli, _ := statsd.NewClientWithConfig(cfg)

	mux := http.NewServeMux()
	mux.Handle("/", middleware.CaptureStats(cli)(http.HandlerFunc(hello)))

	http.ListenAndServe(":3000", mux)
}
```

repository: gomwr/http-statsd

repo_name: gomwr/http-statsd


text:
---
title: jMonkeyEngine SDK: Version Control
---

jMonkeyEngine SDK: Version Control

Whether you work in a development team or alone: File versioning is a handy method to keep your code consistent, compare files line-by-line, and even roll back unwanted changes. This documentation shows you how to make the most of the SDK's integrated version control features for Subversion, Mercurial, and Git.

For every team member, the file versioning workflow is as follows:

 Once: Download a working copy of the project from the repository (“checkout”).

 Regularly: Upload your own changes to the repository (“commit”).

 Regularly: Download updates by others from the repository (“update”).

Note: Since the jMonkeyEngine SDK is based on the NetBeans Platform framework, you can learn about certain jMonkeyEngine SDK features by reading the corresponding NetBeans IDE tutorials (in the “see also links”).

Version Control Systems

The jMonkeyEngine SDK supports various Version Control Systems such as Subversion, Mercurial, and Git. No matter which of them you use, they all share a common user interface.

You can use file versioning alone or in a team. The advantages are that you can keep track of changes (who did it, when, and why), you can compare versions line-by-line, you can revert changes to files and lines, merge multiple changes to one file, and you can even undelete files.

Creating a Repository (Upload)

Requirements:

 You must have a project that you want to version.

 You must have version control software installed (Subversion, Mercurial, or Git) and have initialized a repository.

 Tip: For Subversion, for example, the init command looks like this example: svnadmin create /home/joe/jMonkeyProjects/MyGame

 The computer where the repository is to be hosted must be available in your team's network, or you will only be able to use your repo locally.

 Tip: Hosts such as SourceForge, GoogleCode, dev.java.net offer free version control services for open-source projects.

Now you create a repository to store your project's files.

 In the jMonkeyEngine SDK, right-click the project in the Projects window and choose Versioning > Import Into Subversion Repository (or initialize Mercurial Project, etc, respectively).

 Tip: If you haven't evaluated yet which system to choose, start with Subversion for now.

 Go through the wizard and fill in the fields to set up the repository.

Checking Out a Repository (Download)

You and your team mates check out (download) the repository to their individual workstations.

 Go to the Team menu and choose Subversion > Checkout (or Git or Mercurial respectively)

 Fill in your repo data into the wizard and click Finish.

 A typical repository URL looks like this example: http://jmonkeyengine.googlecode.com/svn/trunk/engine

 If you want to be able to submit changes, you must have a username and password to this repository. Otherwise leave these fields blank.

 The repository is downloaded and stored in the location you chose.

 Use the File > Open Project menu to open the checkout as project and start working.

 If the checkout is not recognized you need to choose File > New Project from Existing Sources

Of course you can also check out existing repositories and access code from other open-source projects (e.g. SourceForge, GoogleCode, dev.java.net).

Updating and Committing Changes (Send and Receive)

Receiving the latest changes from the team's repository is referred to as updating. Sending your changes to the team's repository is refered to as commiting.

 Before making changes, right-click the project and select Subversion > Update to make sure you have the latest revision.

 Get in the habit of updating regularly, always before you edit a version controlled file. It will spare you much grief.

 After making changes to the project, make certain your change did not break anything.

 Update, build, run, test.

 Look at the red/green/blue marks in the editor to review what you have deleted/added/changed.  Never write redundant stuff like “I changed something”.

Comparing and Reverting Changes

 If you and another committer edited the same line, there is a conflict, and the jMonkeyEngine SDK will show an error message.

 Right-click a file Choose Subversion > Resolve Conflict

 Compare the conflicting versions. Press the buttons to accept or reject each change individually.

 After the resolver shows green, save the resolution.

 Build and test the resolution, update, and commit.

 Right-click a file and choose Subversion > Search History.

 You can inspect a file's history and see who changed what, why, and when.

 You can roll back a file to a historic version if necessary.

 In general, you can choose Subversion > Diff for any file to see two versions of a file next to each other.

No Version Control? Local History!

If you do not use any version control, you can still track changes in projects to a certain degree.

 Right-click a file or directory and choose Local History to show or revert changes, or undelete files.

 You can also select any two files in the Project window and choose Tools > Diff to compare them.

 Local History only works for files edited in jMonkeyEngine SDK Projects (It does not work for other files, e.g. in the Favorites window.)

See also:

 Source Code Management with Subversion

	documentation,
	sdk,
	editor,
	tool


text:
# ContainmentEvent

`from tdw.container_data.containment_event import ContainmentEvent`

Data describing a containment event i.e. when a container shape overlaps with one or more objects.

***

## Fields

- `container_id` The ID of the container.

- `object_ids` The IDs of the contained objects as a numpy array

- `tag` A semantic [`ContainerTag`](container_tag.md) describing the semantic nature of the event.

***

## Functions

#### \_\_init\_\_

**`ContainmentEvent(container_id, object_ids, tag)`**

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| container_id |  int |  | The ID of the container. |
| object_ids |  np.ndarray |  | The IDs of the contained objects as a numpy array. |
| tag |  ContainerTag |  | A semantic [`ContainerTag`](container_tag.md) describing the semantic nature of the event. |

repository: threedworld-mit/tdw

gha_language: Python

repo_name: threedworld-mit/tdw


text:
# Changelog

[//]: # (>>   The order of list items should be: Critical/Fixes, New, Update, Remove, Underpinnings   <<)
[//]: # (>>   ## [UNRELEASED]https://github.com/roydukkey/clean-package/compare/v2.1.0...master   <<)

## [2.1.0](https://github.com/roydukkey/clean-package/compare/v2.0.1...2.1.0)

* Add `onClean` and `onRestore` events
* Update README options for readability

## [2.0.1](https://github.com/roydukkey/clean-package/compare/v2.0.0...2.0.1)

* Fix documentation for changed default value of the `remove` option.
* Add documentation for function types of the `remove` and `replace` options.

## [2.0.0](https://github.com/roydukkey/clean-package/compare/v1.0.1...2.0.0)

* Complete rewrite in TypeScript, adding unit tests [#13](https://github.com/roydukkey/clean-package/pull/13)
* Add a second positional argument to allow changing the path to the source `package.json` [#7](https://github.com/roydukkey/clean-package/issues/7)
* Add `clean-package/common` shareable configuration with common settings which can be extended [#10](https://github.com/roydukkey/clean-package/issues/10)
* Add `--config` option to supply a custom config path [#1](https://github.com/roydukkey/clean-package/issues/1)
* Add `--extends` option for extending sharable configurations [#5](https://github.com/roydukkey/clean-package/issues/5)
* Add `--print-config` option to print the combine configuration without executing command
* Add `--version` option to print the version number [#10](https://github.com/roydukkey/clean-package/issues/10)
* Expose code interface: `load()`, `clean()`, `restore()`, `version()`

## [1.0.1](https://github.com/roydukkey/clean-package/compare/v1.0.0...v1.0.1)

* Fix CLI JSON primitive transformer
* Improve CLI key/value parser
* Suggest installing as development dependency
* Update spelling and grammar

## 1.0.0

* Initial release!

repository: xiaohaifengke/clean-package

repo_name: xiaohaifengke/clean-package


text:
# DateCalc

Some simple functions to calculate dates.
Supports non-gregorian calendars.

Includes some handy extensions.
For example, get the components of a date quickly:

```swift
print(Date().year) //example output: 2021
```

Get the next occurrence of a given date:

```swift
// if today is 2020-5-15
print(nextDay(of: Date()) //output: 2021-5-15
```

Of course, this supports 2-29, which appears every 4 years:

```swift
// if today is 2020-2-29
print(nextDay(of: Date()) //output: 2024-2-29
```

Another function `daysToNextDay(of date: Date)` is for calculating how many days is left before that next occurrence comes.

For example:

```swift
// if today is 2021-5-10 and a date variable called "someDay" is set to 2020-5-15
print(daysToNextDay(of: someDay)) // output: 5
```

# Implementation
To use this, just drag the DateCalc.swift file into your project, and you can use these extensions and functions anywhere.

# P.S.
I am using this in my app, Birthday Notes, which is aviailable on the App Store.

gha_language: Swift


text:
# CUPS Common Print Dialog Backend

This repository hosts the code for the CUPS **C**ommon **P**rint **D**ialog **B**ackend. This backend manages and provides information about CUPS and IPP printing destinations to the printing dialog.

## Background

The [Common Printing Dialog](https://wiki.ubuntu.com/CommonPrintingDialog) project aims to provide a uniform, GUI toolkit independent printing experience on Linux Desktop Environments.

## Dependencies

- [cpdb-libs](https://github.com/OpenPrinting/cpdb-libs) : Version >= 1.2.0
- [CUPS](https://github.com/apple/cups/releases) : Version >= 2.2
 Install bleeding edge release from [here](https://github.com/apple/cups/releases).
 OR
`sudo apt install cups libcups2-dev`

- GLIB 2.0 :
`sudo apt install libglib2.0-dev`

## Build and installation

    $ ./autogen.sh
    $ ./configure
    $ make
    $ sudo make install

## Following the development and updating

The current source code you find on the [OpenPrinting GitHub](https://github.com/OpenPrinting/cpdb-backend-cups).

## Running

The backend is auto-activated when a frontend runs; So no need to run it explicitly.
However, if you wish to see the debug statements at the backend, you can run  `/usr/lib/print-backends/cups`.

## More Info

[Nilanjana Lodh's Google Summer of Code 2017 Final Report](https://nilanjanalodh.github.io/common-print-dialog-gsoc17/)

repository: dryairship/cpdb-backend-cups

repo_name: dryairship/cpdb-backend-cups


text:
---
sidebar_current: "hivy-api"
---

# Hivy API

## Token

TODO

## Status and documentation

```console
$ curl http://<IP_ADDRESS>:5000
{
  "state": {
    "hivy": true,
    "sub-systems": {
      "consul": {
        "leader": "<IP_ADDRESS>:8300",
        "peers": [
          "<IP_ADDRESS>:8300"
        ]
      },
      "docker": true,
      "salt-master": false
    }
  },
  "version": {
    "consul_": "not implemented",
    "docker": {
      "ApiVersion": "1.10",
      "Arch": "amd64",
      "GitCommit": "dc9c28f",
      "GoVersion": "go1.2.1",
      "KernelVersion": "3.11.0-20-generic",
      "Os": "linux",
      "Version": "0.10.0"
    },
    "hivy": {
      "major": 0,
      "minor": 0,
      "patch": 9
    },
    "salt": {
      "Jinja2": "2.7.2",
      "M2Crypto": "0.22",
      "PyYAML": "3.11",
      "PyZMQ": "14.2.0",
      "Python": "2.7.5 (default, Nov 30 2013, 10:53:27)",
      "Salt": "2014.1.3",
      "ZMQ": "2.2.0",
      "msgpack-pure": null,
      "msgpack-python": "0.4.2",
      "pycrypto": "2.6.1"
    }
  }
}
```

```console
$ curl http://<IP_ADDRESS>:5000/v0/doc
{
    "api": {
        "GET /": " Expose Hivy services states and versions ",
        "GET /v0/docs": " Expose last api documentation ",
        "GET /v0/nodes?where=localhost": " User nodes organization ",
        "GET | POST | PUT | DELETE /v0/nodes/<string:image>?where=localhost&user=dockerfile": " Container High level management ",
        "GET | POST | PUT | DELETE /v0/proxy/<string:frontend>?node=ghost&reset=True&name=blog": " Hipache High level management ",
        "GET | PUT /v0/users/<string:username>": " Register new users and inspect them "
    }
}
```

## Node lifecycle

### Default creation

The following command spins up a `base` image.

```console
$ curl -X POST -H "Authorization:$TEST_API_KEY" "http://<IP_ADDRESS>:5000/v0/node/base"
{
  "Id": "7becce0b8dec80c3f80b378c2ae41f0d9da1ab113d99c4537de8a0cd6e9a50a6",
  "Warnings": null,
  "name": "hivetech-base"
}
```

### More control

In addition to standard services (ssh, consul, salt, ...), we can specify
custom elements for our environment :

* Environment variable
* Serice dependencies
* Exposed ports

```console
$ curl -X POST \
  -H "Authorization:$TEST_API_KEY" \
  --data '{\
    "ports": [5000],\
    "env": {"QUANDL_API_KEY":"vebrzrzzr"},\
    "links": ["rethinkdb"]\
  }' \
  "http://<IP_ADDRESS>:5000/v0/node/base"
```

`ports` field will expose to public a virtual container port, mapping it to a
random one of the host (we can check which one inspecting the image state, see
below).

`links` deserves further explanations. *Hivy* waits for an array of container
names, like the ones we provide on creation. Then it will inject into the new
container some consistent environment variables our app can use to connect to
services.

```console
$ # Say we create a database first
$ curl -X POST ... http://.../node/rethinkdb?user=dockerfile
$ # Then we post an app using this database
$ curl -X POST ... \
  --data '{"links": ["rethinkdb"]}' \
  http://.../node/our-app
$ # It will inject into <user>/our-app container :
$ #   - RETHINKDB_HOST (like <IP_ADDRESS>)
$ #   - RETHINKDB_PORTS_EXPOSED (like 28015,28014,8080)
$ #   - RETHINKDB_PORT_28015 (mapping of the official port)
$ #   - RETHINKDB_PORT_XXXXX (for each of exposed port)
```

By default, *Hivy* uses the username to complete the image name (like
`hivetech/base` above). However we can override this behavior to enjoy what
other talented developers packed into containers.

```console
$ curl -X POST ... http://<IP_ADDRESS>:5000/v0/node/base?user=dockerfile
```

We can also provide the docker server we want our image to be deploy to.

```console
$ curl -X POST ... http://<IP_ADDRESS>:5000/v0/node/base?where=tcp://<IP_ADDRESS>:4243
```

### Destruction

```console
curl -X DELETE http://<IP_ADDRESS>:5000/v0/node/base -H "Authorization:$TEST_API_KEY"
{
    "destroyed": true,
    "name": "hivetech-base",
    "unregistration": {
        "message": "not implemented",
        "success": false
    }
}
```

## Node interactions

### Image state

We can fetch some informations about a running node.

```console
$ # Again this is a protected resource
$ curl http://<IP_ADDRESS>:5000/v0/node/base
{
  "error": "Could not verify your access level for that URL. You have to login with proper credentials"
}
$ curl http://<IP_ADDRESS>:5000/v0/node/base -H "Authorization:$TEST_API_KEY"
{
    "acl": [],
    "ip": "http://api.unide.co:49155",
    "links": [],
    "name": "hivetech-base",
    "node": {
        "cpu": 0,
        "created": "2014-04-29T22:01:06.563456003Z",
        "env": [
            "CONSUL_MASTER=<IP_ADDRESS>",

        ...

        "virtual_ip": "<IP_ADDRESS>"
    },
    "state": {
        "ExitCode": 0,
        "FinishedAt": "0001-01-01T00:00:00Z",
        "Ghost": false,
        "Pid": 29048,
        "Running": true,
        "StartedAt": "2014-04-29T22:01:07.5853093Z"
    }
}
```

## Proxy

*Hivy* manipulates server's [Hipache](https://github.com/dotcloud/hipache)
instance to route http traffic.

The proxy is a protected resource, you must provide your api token to each request.

```console
$ curl -H "Authorization:122vezvzevz18ev4ev8ezv" ...
```

### Map 2 backends to intuition.io

```console
$ # Add as much nodes as necessary
$ # append `reset=true` to replace an existing config related to the frontend
$ curl -X POST "http://<IP_ADDRESS>:5000/v0/proxy/intuition.io?node=http://<IP_ADDRESS>&node=http://<IP_ADDRESS>:5000&name=intuition"
{'intuition.io':[
    'http://<IP_ADDRESS>',
    'http://<IP_ADDRESS>:5000'
]}
```

### Update this frontend with a new backend

```console
$ curl -X PUT "http://<IP_ADDRESS>:5000/v0/proxy/intuition.io?node=http://<IP_ADDRESS>:5000"
{'intuition.io':[
    'http://<IP_ADDRESS>',
    'http://<IP_ADDRESS>:5000',
    'http://<IP_ADDRESS>:5000'
]}
```

### Fetch the current proxy configuration

```console
$ # Replace the domain name with all to catch the whole mapping
$ curl "http://<IP_ADDRESS>:5000/v0/proxy/intuition.io"
[
    'http://<IP_ADDRESS>',
    'http://<IP_ADDRESS>:5000',
    'http://<IP_ADDRESS>:5000'
]
```

### Remove frontends

```console
$ # Replace the domain name with all to reset the proxy
$ curl -X DELETE "http://<IP_ADDRESS>:5000/v0/proxy/intuition.io"
{
    'removed': true
}
```

---
##### last modified on: May 2, 2014
---

repository: hivetech/doc

repo_name: hivetech/doc