@@ -1507,27 +1507,20 @@ func (p *Provider) activateKeySigningKey(req *http.Request) (*plugin.Response, e
15071507 }
15081508 return nil , err
15091509 }
1510- type xmlKeySigningKey struct {
1511- Name string `xml:"Name"`
1512- HostedZoneId string `xml:"HostedZoneId"`
1513- KeyId string `xml:"KeyId"`
1514- State string `xml:"State"`
1515- Algorithm string `xml:"Algorithm"`
1516- KeySpec string `xml:"KeySpec"`
1517- PublishTime string `xml:"PublishTime"`
1510+ type xmlChangeInfo struct {
1511+ Id string `xml:"Id"`
1512+ Status string `xml:"Status"`
1513+ SubmittedAt string `xml:"SubmittedAt"`
15181514 }
15191515 type response struct {
1520- XMLName xml.Name `xml:"ActivateKeySigningKeyResponse"`
1521- KeySigningKey xmlKeySigningKey `xml:"KeySigningKey "`
1516+ XMLName xml.Name `xml:"ActivateKeySigningKeyResponse"`
1517+ ChangeInfo xmlChangeInfo `xml:"ChangeInfo "`
15221518 }
15231519 return xmlResp (http .StatusOK , response {
1524- KeySigningKey : xmlKeySigningKey {
1525- Name : name ,
1526- HostedZoneId : zoneID ,
1527- KeyId : generateID (),
1528- State : "Signing" ,
1529- Algorithm : "ECDSA_P256_SHA256" ,
1530- KeySpec : "ECDSA_P256" ,
1520+ ChangeInfo : xmlChangeInfo {
1521+ Id : generateID (),
1522+ Status : "PENDING" ,
1523+ SubmittedAt : time .Now ().UTC ().Format (time .RFC3339 ),
15311524 },
15321525 })
15331526}
@@ -1543,10 +1536,22 @@ func (p *Provider) deactivateKeySigningKey(req *http.Request) (*plugin.Response,
15431536 }
15441537 return nil , err
15451538 }
1539+ type xmlChangeInfo struct {
1540+ Id string `xml:"Id"`
1541+ Status string `xml:"Status"`
1542+ SubmittedAt string `xml:"SubmittedAt"`
1543+ }
15461544 type response struct {
1547- XMLName xml.Name `xml:"DeactivateKeySigningKeyResponse"`
1545+ XMLName xml.Name `xml:"DeactivateKeySigningKeyResponse"`
1546+ ChangeInfo xmlChangeInfo `xml:"ChangeInfo"`
15481547 }
1549- return xmlResp (http .StatusOK , response {})
1548+ return xmlResp (http .StatusOK , response {
1549+ ChangeInfo : xmlChangeInfo {
1550+ Id : generateID (),
1551+ Status : "PENDING" ,
1552+ SubmittedAt : time .Now ().UTC ().Format (time .RFC3339 ),
1553+ },
1554+ })
15501555}
15511556
15521557// --- Traffic Policy Instance handlers ---
@@ -1804,21 +1809,20 @@ func (p *Provider) createCidrCollection(req *http.Request) (*plugin.Response, er
18041809 return nil , err
18051810 }
18061811 type xmlCidrCollection struct {
1807- XMLName xml.Name `xml:"CidrCollection"`
1808- CidrCollectionId string `xml:"CidrCollectionId"`
1809- Name string `xml:"Name"`
1810- State string `xml:"State"`
1812+ Id string `xml:"Id"`
1813+ Name string `xml:"Name"`
1814+ Version int `xml:"Version"`
18111815 }
18121816 type response struct {
1813- XMLName xml.Name `xml:"CreateCidrCollectionResponse"`
1814- CidrCollection xmlCidrCollection `xml:"CidrCollection "`
1815- Location string `xml:"Location"`
1817+ XMLName xml.Name `xml:"CreateCidrCollectionResponse"`
1818+ Collection xmlCidrCollection `xml:"Collection "`
1819+ Location string `xml:"Location"`
18161820 }
18171821 return xmlResp (http .StatusCreated , response {
1818- CidrCollection : xmlCidrCollection {
1819- CidrCollectionId : ccID ,
1820- Name : in .Name ,
1821- State : "Created" ,
1822+ Collection : xmlCidrCollection {
1823+ Id : ccID ,
1824+ Name : in .Name ,
1825+ Version : 1 ,
18221826 },
18231827 Location : fmt .Sprintf ("/2013-04-01/cidrcollection/%s" , ccID ),
18241828 })
@@ -1852,9 +1856,8 @@ func (p *Provider) listCidrCollections(_ *http.Request) (*plugin.Response, error
18521856 return nil , err
18531857 }
18541858 type xmlCidrCollection struct {
1855- CidrCollectionId string `xml:"CidrCollectionId"`
1856- Name string `xml:"Name"`
1857- State string `xml:"State"`
1859+ Id string `xml:"Id"`
1860+ Name string `xml:"Name"`
18581861 }
18591862 type response struct {
18601863 XMLName xml.Name `xml:"ListCidrCollectionsResponse"`
@@ -1866,9 +1869,8 @@ func (p *Provider) listCidrCollections(_ *http.Request) (*plugin.Response, error
18661869 resp := response {IsTruncated : false , MaxItems : 100 }
18671870 for _ , cc := range ccList {
18681871 resp .CidrCollections = append (resp .CidrCollections , xmlCidrCollection {
1869- CidrCollectionId : cc .CidrCollectionID ,
1870- Name : cc .Name ,
1871- State : cc .State ,
1872+ Id : cc .CidrCollectionID ,
1873+ Name : cc .Name ,
18721874 })
18731875 }
18741876 return xmlResp (http .StatusOK , resp )
@@ -1894,7 +1896,10 @@ func (p *Provider) listCidrBlocks(_ *http.Request) (*plugin.Response, error) {
18941896
18951897func (p * Provider ) listCidrLocations (_ * http.Request ) (* plugin.Response , error ) {
18961898 type response struct {
1897- XMLName xml.Name `xml:"ListCidrLocationsResponse"`
1899+ XMLName xml.Name `xml:"ListCidrLocationsResponse"`
1900+ CidrLocations []struct {
1901+ LocationName string `xml:"LocationName"`
1902+ } `xml:"CidrLocations>CidrLocation"`
18981903 }
18991904 return xmlResp (http .StatusOK , response {})
19001905}
@@ -1951,14 +1956,10 @@ func (p *Provider) createReusableDelegationSet(req *http.Request) (*plugin.Respo
19511956 if err := p .store .CreateReusableDelegationSet (ds ); err != nil {
19521957 return nil , err
19531958 }
1954- type xmlNameServer struct {
1955- NameServer string `xml:"NameServer"`
1956- }
19571959 type xmlDelegationSet struct {
1958- DelegationSetId string `xml:"DelegationSetId"`
1959- Name string `xml:"Name"`
1960- State string `xml:"State"`
1961- NameServers xmlNameServer `xml:"NameServers"`
1960+ Id string `xml:"Id"`
1961+ CallerReference string `xml:"CallerReference"`
1962+ NameServers []string `xml:"NameServers>NameServer"`
19621963 }
19631964 type response struct {
19641965 XMLName xml.Name `xml:"CreateReusableDelegationSetResponse"`
@@ -1967,10 +1968,9 @@ func (p *Provider) createReusableDelegationSet(req *http.Request) (*plugin.Respo
19671968 }
19681969 return xmlResp (http .StatusCreated , response {
19691970 DelegationSet : xmlDelegationSet {
1970- DelegationSetId : dsID ,
1971- Name : in .Name ,
1972- State : "Complete" ,
1973- NameServers : xmlNameServer {NameServer : "ns-1.devcloud.internal" },
1971+ Id : dsID ,
1972+ CallerReference : "rds-ref-1" ,
1973+ NameServers : []string {"ns-1.devcloud.internal" , "ns-2.devcloud.internal" },
19741974 },
19751975 Location : fmt .Sprintf ("/2013-04-01/delegationset/%s" , dsID ),
19761976 })
@@ -1988,28 +1988,20 @@ func (p *Provider) getReusableDelegationSet(req *http.Request) (*plugin.Response
19881988 }
19891989 return nil , err
19901990 }
1991- type xmlNameServer struct {
1992- NameServer string `xml:"NameServer"`
1993- }
19941991 type xmlDelegationSet struct {
1995- DelegationSetId string `xml:"DelegationSetId"`
1996- Name string `xml:"Name"`
1997- State string `xml:"State"`
1998- NameServers []xmlNameServer `xml:"NameServers>NameServer"`
1992+ Id string `xml:"Id"`
1993+ CallerReference string `xml:"CallerReference"`
1994+ NameServers []string `xml:"NameServers>NameServer"`
19991995 }
20001996 type response struct {
20011997 XMLName xml.Name `xml:"GetReusableDelegationSetResponse"`
20021998 DelegationSet xmlDelegationSet `xml:"DelegationSet"`
20031999 }
20042000 return xmlResp (http .StatusOK , response {
20052001 DelegationSet : xmlDelegationSet {
2006- DelegationSetId : ds .DelegationSetID ,
2007- Name : ds .Name ,
2008- State : ds .State ,
2009- NameServers : []xmlNameServer {
2010- {NameServer : "ns-1.devcloud.internal" },
2011- {NameServer : "ns-2.devcloud.internal" },
2012- },
2002+ Id : ds .DelegationSetID ,
2003+ CallerReference : "rds-ref-1" ,
2004+ NameServers : []string {"ns-1.devcloud.internal" , "ns-2.devcloud.internal" },
20132005 },
20142006 })
20152007}
@@ -2019,31 +2011,23 @@ func (p *Provider) listReusableDelegationSets(_ *http.Request) (*plugin.Response
20192011 if err != nil {
20202012 return nil , err
20212013 }
2022- type xmlNameServer struct {
2023- NameServer string `xml:"NameServer"`
2024- }
20252014 type xmlDelegationSet struct {
2026- DelegationSetId string `xml:"DelegationSetId"`
2027- Name string `xml:"Name"`
2028- State string `xml:"State"`
2029- NameServers []xmlNameServer `xml:"NameServers>NameServer"`
2015+ Id string `xml:"Id"`
2016+ CallerReference string `xml:"CallerReference"`
2017+ NameServers []string `xml:"NameServers>NameServer"`
20302018 }
20312019 type response struct {
20322020 XMLName xml.Name `xml:"ListReusableDelegationSetsResponse"`
2033- DelegationSets []xmlDelegationSet `xml:"ReusableDelegationSets>ReusableDelegationSet "`
2021+ DelegationSets []xmlDelegationSet `xml:"DelegationSets>DelegationSet "`
20342022 IsTruncated bool `xml:"IsTruncated"`
2035- MaxItems int `xml:"MaxItems"`
2036- NextId string `xml:"NextDelegationSetId"`
2023+ MaxItems string `xml:"MaxItems"`
20372024 }
2038- resp := response {IsTruncated : false , MaxItems : 100 }
2025+ resp := response {IsTruncated : false , MaxItems : " 100" }
20392026 for _ , ds := range dsList {
20402027 resp .DelegationSets = append (resp .DelegationSets , xmlDelegationSet {
2041- DelegationSetId : ds .DelegationSetID ,
2042- Name : ds .Name ,
2043- State : ds .State ,
2044- NameServers : []xmlNameServer {
2045- {NameServer : "ns-1.devcloud.internal" },
2046- },
2028+ Id : ds .DelegationSetID ,
2029+ CallerReference : "rds-ref-1" ,
2030+ NameServers : []string {"ns-1.devcloud.internal" , "ns-2.devcloud.internal" },
20472031 })
20482032 }
20492033 return xmlResp (http .StatusOK , resp )
0 commit comments