aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/yandex-cloud-api-protos/yandex/cloud/cdn/v1/resource_service.proto
blob: c2fd865ab47e456663152826381ab322b9d0bef6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
syntax = "proto3";

package yandex.cloud.cdn.v1;

import "google/api/annotations.proto";
import "google/protobuf/wrappers.proto";

import "yandex/cloud/api/operation.proto";
import "yandex/cloud/cdn/v1/origin.proto";
import "yandex/cloud/cdn/v1/resource.proto";
import "yandex/cloud/operation/operation.proto";
import "yandex/cloud/validation.proto";

option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/cdn/v1;cdn";
option java_package = "yandex.cloud.api.cdn.v1";

// Provider's resources management service.
service ResourceService {
    // Get client's CDN resource by resource id.
    rpc Get(GetResourceRequest) returns (Resource) {
        option (google.api.http) = { get: "/cdn/v1/resources/{resource_id}" };
    }

    // Lists CDN resources.
    rpc List(ListResourcesRequest) returns (ListResourcesResponse) {
        option (google.api.http) = { get: "/cdn/v1/resources" };
    }

    // Creates a CDN resource in the specified folder.
    //
    // Creation may take up to 15 minutes.
    rpc Create(CreateResourceRequest) returns (operation.Operation) {
        option (google.api.http) = { post: "/cdn/v1/resources" body: "*" };
        option (yandex.cloud.api.operation) = {
          metadata: "CreateResourceMetadata"
          response: "Resource"
        };
    }

    // Updates the specified CDN resource.
    //
    // The method implements patch behaviour, i.e. only the fields specified in the request are updated in the resource.
    //
    // Changes may take up to 15 minutes to apply. Afterwards, it is recommended to purge the resource's cache via a
    // [CacheService.Purge] request.
    rpc Update(UpdateResourceRequest) returns (operation.Operation) {
        option (google.api.http) = { patch: "/cdn/v1/resources/{resource_id}" body: "*" };
        option (yandex.cloud.api.operation) = {
          metadata: "UpdateResourceMetadata"
          response: "Resource"
        };
    }

    // Deletes client's CDN resource.
    rpc Delete(DeleteResourceRequest) returns (operation.Operation) {
        option (google.api.http) = { delete: "/cdn/v1/resources/{resource_id}" };
        option (yandex.cloud.api.operation) = {
            metadata: "DeleteResourceMetadata"
            response: "google.protobuf.Empty"
        };
    }

    // Get Provider's CNAME (edge endpoint) bind to specified folder id.
    // Returns UNIMPLEMENTED error, if provider doesn't support CNAME request.
    rpc GetProviderCName(GetProviderCNameRequest) returns (GetProviderCNameResponse) {
        option (google.api.http) = { get: "/cdn/v1/cname/{folder_id}" };
    }
}

// A request to get a resource.
message GetResourceRequest {
    // ID of the requested resource.
    string resource_id = 1 [(required) = true, (length) = "<=50"];
}

message ListResourcesRequest {
    // ID of the folder to request listing for.
    string folder_id = 1 [(required) = true, (length) = "<=50"];

    // The maximum number of results per page to return. If the number of available
    // results is larger than [page_size],
    // the service returns a [ListResourcesResponse.next_page_token]
    // that can be used to get the next page of results in subsequent list requests.
    int64 page_size = 2 [(value) = "<=1000"];

    // Page token. To get the next page of results,
    // set [page_token] to the [ListResourcesResponse.next_page_token]
    // returned by a previous list request.
    string page_token = 3 [(length) = "<=100"];
}

message ListResourcesResponse {
    // List of the resources
    repeated Resource resources = 1;

    // [next_page_token] token allows you to get the next page of results for list requests.
    // If the number of results is larger than [ListResourcesRequest.page_size], use
    // the [next_page_token] as the value for the [ListResourcesRequest.page_token] query parameter
    // in the next list request. Each subsequent list request will have its own
    // [next_page_token] to continue paging through the results.
    string next_page_token = 2;
}

message CreateResourceRequest {
    message Origin {
        oneof origin_variant {
            // ID of pre-created origin group.
            int64 origin_group_id = 1;

            // Create new Origins group with single source, it's id will be
            // returned in result.
            string origin_source = 2;

            // Set up resource origin parameters.
            ResourceOriginParams origin_source_params = 3;
        }
    }

    // ID of the to bind with new resource.
    string folder_id = 1 [(required) = true, (length) = "<=50"];

    // CDN endpoint CNAME, must be unique among clients's resources.
    string cname = 2 [(required) = true];

    // Specify the origins to be used for CDN resources requests.
    Origin origin = 3 [(required) = true];

    // List of additional CNAMEs.
    SecondaryHostnames secondary_hostnames = 4;

    // Specify the protocol schema to be used in communication with origin.
    OriginProtocol origin_protocol = 5;

    // Flag to create Resource either in active or disabled state.
    // In active state Origins payload could be transmitted from CDN CNAME requests.
    // Default value: true
    google.protobuf.BoolValue active = 6;

    // Resource settings and options to tune CDN edge behavior. Most is unset.
    ResourceOptions options = 7;

    // SSL Certificate options.
    SSLTargetCertificate ssl_certificate = 8;
    
    // Labels of the resource.
    map<string, string> labels = 9;
}

// A set of resource origin parameters.
message ResourceOriginParams {
    // Source of the content.
    string source = 1;

    // Set up type of the origin.
    OriginMeta meta = 2;
}

message CreateResourceMetadata {
    // ID of created resource.
    string resource_id = 1 [(required) = true, (length) = "<=50"];
}

message UpdateResourceRequest {
    // ID of updated resource.
    string resource_id = 1 [(required) = true, (length) = "<=50"];

    // ID of updated origin group.
    google.protobuf.Int64Value origin_group_id = 2;

    // List of additional CNAMEs.
    SecondaryHostnames secondary_hostnames = 3;

    // Resource settings and options to tune CDN edge behavior.
    ResourceOptions options = 4;

    // Specify the protocol schema to be used in communication with origin.
    OriginProtocol origin_protocol = 5;

    // Flag to create Resource either in active or disabled state.
    // In active state Origins payload could be transmitted from CDN CNAME requests.
    // Default value: true
    google.protobuf.BoolValue active = 6;

    // SSL Certificate options.
    SSLTargetCertificate ssl_certificate = 7;
    
    // Resource labels. At some point will be needed for granular detailing.
    map<string, string> labels = 8;
}

message UpdateResourceMetadata {
    // ID of updated resource.
    string resource_id = 1 [(required) = true, (length) = "<=50"];
}


message DeleteResourceRequest {
    // ID of resource to delete.
    string resource_id = 1 [(required) = true, (length) = "<=50"];
}

message DeleteResourceMetadata {
    // ID of deleted resource.
    string resource_id = 1;
}

message GetProviderCNameRequest {
    // Folder ID to get provider's CNAME.
    string folder_id = 1 [(required) = true, (length) = "<=50"];
}

message GetProviderCNameResponse {
    // Provider's CNAME.
    string cname = 1;

    // ID of the folder that the provider belongs to.
    string folder_id = 2;
}