TOSCA 115 Capability Interfaces
description
Transcript of TOSCA 115 Capability Interfaces
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
TOSCA 115 Capability InterfacesKevin Wilson, Travis Tripp, Kishore JagannathNov4, 2013
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.2
TOSCA 115 – Issue DescriptionRequirements and capabilities should provide specific interface definitions. So that the designer of a app can depend on a contract set of public properties that are to be provided and a contracted set method/interfaces that are provided by the requirement.
For example: If I have a dependency on a DB Server, and need to run SQL on that server, at design time, I would like to know the methods supported by the DBServer requirement so that I can leverage that in my component scripting. On the implementation side providing the component, the script/method to execute the script may be different for each DBServer type. IE commands to run SQL on MySQL are not the same commands that would be used for Oracle. However, the SQL may the same in some cases.
Similar methods/use cases exist for J2EE server deploy methods etc.
By providing a interface on the Requirement/Capability we can leverage the workflows specific to the capability in a generic way. And the designer would be able to identify the contracted calls that are made available.
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.3 3
Highlights of ProposalCapability Types should have the ability to expose interfaces with one to many operations in addition to property definition.
Node Type possessing the capability will now inherit the interface operations defined in the capability. Node Type having multiple capabilities will now inherit the interface operations declared in each of the capability
NodeTypeImplementation will provide implementation for all the interface operations that the Node Type inherits from the capabilities + any interface operations that are define within Node Type.
TBD- Do we still need to have interface operations within Node Types.
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.4
User Profiles
Node Type
Capability
Type• properties• interfaces
Node Type Implementatio
n• Implementation
artifacts• Deployment artifacts
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.5
Reusable Interface Methods
Node Type<Oracle10g>
CapabilityType
<OracleDBContainer>
• properties• interfaces
Node Type<Oracle11g>
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.6
Design ExperienceNode Type
<ApacheWebServer>
Capability Type<ApacheWebServerCapability
>• properties• interfaces
Node Type<SugarCrmApp>
Requirement Type
<ApacheWebServeRequirement>
• properties• interfaces
Relationship Type
<hosted on>
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.7
Reuse via Composition
Software<<Node Type>>
ApacheWebServer
<<CapabilityType>>
• properties• operationsMySql Database
<<CapabilityType>>
• properties• operations
ApacheWebServer
<<CapabilityType>>
• properties• operationsMySql Database
<<CapabilityType>>
• properties• operations
ApacheWebServer
<<Node Type>>
MySql DB<<Node Type>>
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.8 8
Tosca Schema
<xs:complexType name="tCapabilityType"> <xs:complexContent> <xs:extension base="tEntityType"/> </xs:complexContent> <xs:element name="Interfaces" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element name="Interface" type="tInterface" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element></xs:complexType>
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.9 9
<CapabilityType name="xs:NCName" targetNamespace="xs:anyURI"? abstract="yes|no"? final="yes|no"?> <DerivedFrom typeRef="xs:QName"/> ? <PropertiesDefinition element="xs:QName"? type="xs:QName"?/> ? <Interfaces> <Interface name="xs:NCName | xs:anyURI"> <Operation name="xs:NCName"> <InputParameters> <InputParameter name="xs:string" type="xs:string" required="yes|no"?/> + </InputParameters> ? <OutputParameters> <OutputParameter name="xs:string" type="xs:string" required="yes|no"?/> + </OutputParameters> ? </Operation> + </Interface> + </Interfaces> ?