package org.zstack.header.zone;

import org.springframework.http.HttpMethod;
import org.zstack.header.query.APIQueryMessage;
import org.zstack.header.query.AutoQuery;
import org.zstack.header.rest.RestRequest;

import java.util.List;

import static java.util.Arrays.asList;

@AutoQuery(replyClass = APIQueryZoneReply.class, inventoryClass = ZoneInventory.class)
@RestRequest(
        path = "/zones",
        optionalPaths = {"/zones/{uuid}"},
        responseClass = APIQueryZoneReply.class,
        method = HttpMethod.GET
)
public class APIQueryZoneMsg extends APIQueryMessage {

    public static List<String> __example__() {
        return asList("name=TestZone", "state=Enabled");
    }
}

@@ -70,16 +70,58 @@
 Method;%0A
+import org.zstack.header.identity.Action;%0A
 import o
@@ -562,16 +562,61 @@
 d.GET%0A)%0A
+@Action(category = %22zone%22, names = %7B%22read%22%7D)%0A
 public c

allow normal accounts to query zone