5ffb6555d29a602d3ef105ab815d6621d2094fdf
[sdc/sdc-distribution-client.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * sdc-distribution-client
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.sdc.impl.mock;
22
23 import org.onap.sdc.api.results.IDistributionClientDownloadResult;
24
25 /**
26  * Mock Implementation
27  */
28 public class DistributionClientDownloadResultStubImpl extends DistributionClientResultStubImpl implements IDistributionClientDownloadResult {
29
30     @Override
31     public byte[] getArtifactPayload() {
32         String mockPayload =
33                 "heat_template_version: 2013-05-23\r\n"
34                 + "\r\n"
35                 + "description: >\r\n"
36                 + "  HOT template that creates one COR network (direct).\r\n"
37                 + "\r\n"
38                 + "parameters:\r\n"
39                 + "  cor_direct_net_name:\r\n"
40                 + "    type: string\r\n"
41                 + "    description: Name of COR direct network\r\n"
42                 + "  cor_direct_net_cidr:\r\n"
43                 + "    type: string\r\n"
44                 + "    description: Direct network address (CIDR notation)\r\n"
45                 + "  cor_direct_net_gateway:\r\n"
46                 + "    type: string\r\n"
47                 + "    description: Direct network gateway address\r\n"
48                 + "  cor_direct_net_RT:\r\n"
49                 + "    type: string\r\n"
50                 + "    description: Direct network route-target (RT)\r\n"
51                 + "\r\n"
52                 + "resources:\r\n"
53                 + "  cor_direct_net:\r\n"
54                 + "    type: OS::Contrail::VirtualNetwork\r\n"
55                 + "    properties:\r\n"
56                 + "      name: { get_param: cor_direct_net_name }\r\n"
57                 + "      route_targets: [ get_param: cor_direct_net_RT ]\r\n"
58                 + "\r\n"
59                 + "  cor_direct_ip_subnet:\r\n"
60                 + "    type: OS::Neutron::Subnet\r\n"
61                 + "    properties:\r\n"
62                 + "      network_id: { get_resource: cor_direct_net }\r\n"
63                 + "      cidr: {get_param: cor_direct_net_cidr}\r\n"
64                 + "      gateway_ip: { get_param: cor_direct_net_gateway }\r\n";
65
66         return mockPayload.getBytes();
67     }
68
69     @Override
70     public String getArtifactName() {
71         // TODO Auto-generated method stub
72         return "MackArtifactName";
73     }
74
75     @Override
76     public String getArtifactFilename() {
77         // TODO Auto-generated method stub
78         return "MackArtifactName";
79     }
80
81 }