aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/yandex-cloud-api-protos/yandex/cloud/cdn/v1/rule_service.proto
blob: 5a9be61d096ae6e23040a78cc9fddf01bd50aedb (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
syntax = "proto3";

package yandex.cloud.cdn.v1;

import "google/api/annotations.proto";

import "yandex/cloud/api/operation.proto";
import "yandex/cloud/cdn/v1/resource.proto";
import "yandex/cloud/cdn/v1/rule.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";

//
// Rules management service.
//
// Used for Resources Rules management.
//
service ResourceRulesService {
    // List all rules for specified resource.
    rpc List(ListResourceRulesRequest) returns (ListResourceRulesResponse) {
        option (google.api.http) = {
            get: "/cdn/v1/rules"
        };
    }

    // Create new resource rule with specified unique name and rule patter.
    rpc Create(CreateResourceRuleRequest) returns (operation.Operation) {
        option (google.api.http) = {
            post: "/cdn/v1/rules"
            body: "*"
        };
        option (yandex.cloud.api.operation) = {
          metadata: "CreateResourceRuleMetadata"
          response: "Rule"
        };
    }

    // Get specified by id resource rule.
    rpc Get(GetResourceRuleRequest) returns (Rule) {
        option (google.api.http) = {
            get: "/cdn/v1/rules/{rule_id}"
        };
    }

    // Update specified by id resource rule.
    rpc Update(UpdateResourceRuleRequest) returns (operation.Operation) {
        option (google.api.http) = {
            patch: "/cdn/v1/rules/{rule_id}"
            body: "*"
        };
        option (yandex.cloud.api.operation) = {
          metadata: "UpdateResourceRuleMetadata"
          response: "Rule"
        };
    }

    // Delete specified by id resource rule.
    rpc Delete(DeleteResourceRuleRequest) returns (operation.Operation) {
        option (google.api.http) = {
            delete: "/cdn/v1/rules/{rule_id}"
        };
        option (yandex.cloud.api.operation) = {
          metadata: "DeleteResourceRuleMetadata"
          response: "google.protobuf.Empty"
        };
    }
}


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

message ListResourceRulesResponse {
    // List of the resource rules.
    repeated Rule rules = 1;
}

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

    // Name of created resource rule.
    string name = 2 [(required) = true, (length) = "<=50"];
    // Resource rule pattern.
    string rule_pattern = 3 [(required) = true, (length) = "<=100"];

    ResourceOptions options = 4;
}

message CreateResourceRuleMetadata {
    // ID of resource.
    string resource_id = 1 [(required) = true, (length) = "<=50"];
    // ID of created resource rule.
    int64 rule_id = 2 [(value) = ">0"];
}

message GetResourceRuleRequest {
    // ID of resource.
    string resource_id = 1 [(required) = true, (length) = "<=50"];
    // ID of the requested resource rule.
    int64 rule_id = 2 [(value) = ">0"];
}

message UpdateResourceRuleRequest {
    // ID of resource.
    string resource_id = 1 [(required) = true, (length) = "<=50"];
    // ID of updated resource rule.
    int64 rule_id = 2 [(value) = ">0"];

    // Name of updated resource rule.
    string name = 3 [(length) = "<=50"];
    // Resource rule pattern.
    string rule_pattern = 4 [(length) = "<=100"];

    ResourceOptions options = 5;
}

message UpdateResourceRuleMetadata {
    // ID of resource.
    string resource_id = 1 [(required) = true, (length) = "<=50"];
    // ID of updated resource rule.
    int64 rule_id = 2 [(value) = ">0"];
}

message DeleteResourceRuleRequest {
    // ID of resource.
    string resource_id = 1 [(required) = true, (length) = "<=50"];
    // ID of deleted resource rule.
    int64 rule_id = 2 [(value) = ">0"];
}

message DeleteResourceRuleMetadata {
    // ID of resource.
    string resource_id = 1 [(required) = true, (length) = "<=50"];
    // ID of deleted resource rule.
    int64 rule_id = 2 [(value) = ">0"];
}