読者です 読者をやめる 読者になる 読者になる

VPSやクラウドでいろいろ遊ぼうのblog

地方でIT屋やってます。IT全般を勉強しつつ、いろいろ遊んでみます。 情報セキュリティスペシャリスト。twitterは @hogefuga123

クラウド勉強4

前回は、さくらのクラウドAPIでディスクプランを取得するサンプルを
作ってみた。

最後に結果をvar_dumpしているのだが、その部分を

print "<pre>";
print_r(json_decode($result,true));
print "</pre>";

とすれば、結果が↓

Array
(
    [From] => 0
    [Count] => 2
    [Total] => 2
    [DiskPlans] => Array
        (
            [0] => Array
                (
                    [Index] => 0
                    [ID] => 4
                    [StorageClass] => iscsi1204
                    [DisplayOrder] => 400
                    [Name] => SSDプラン
                    [Description] => 
                    [Availability] => available
                    [Size] => Array
                        (
                            [0] => Array
                                (
                                    [SizeMB] => 20480
                                    [DisplaySize] => 20
                                    [DisplaySuffix] => GB
                                    [Availability] => available
                                    [ServiceClass] => cloud/disk/ssd/20g
                                )

                            [1] => Array
                                (
                                    [SizeMB] => 102400
                                    [DisplaySize] => 100
                                    [DisplaySuffix] => GB
                                    [Availability] => available
                                    [ServiceClass] => cloud/disk/ssd/100g
                                )

                            [2] => Array
                                (
                                    [SizeMB] => 256000
                                    [DisplaySize] => 250
                                    [DisplaySuffix] => GB
                                    [Availability] => available
                                    [ServiceClass] => cloud/disk/ssd/250g
                                )

                            [3] => Array
                                (
                                    [SizeMB] => 512000
                                    [DisplaySize] => 500
                                    [DisplaySuffix] => GB
                                    [Availability] => available
                                    [ServiceClass] => cloud/disk/ssd/500g
                                )

                        )

                )

            [1] => Array
                (
                    [Index] => 1
                    [ID] => 2
                    [StorageClass] => iscsi1204
                    [DisplayOrder] => 500
                    [Name] => 標準プラン
                    [Description] => 
                    [Availability] => available
                    [Size] => Array
                        (
                            [0] => Array
                                (
                                    [SizeMB] => 40960
                                    [DisplaySize] => 40
                                    [DisplaySuffix] => GB
                                    [Availability] => available
                                    [ServiceClass] => cloud/disk/iscsi/40g
                                )

                            [1] => Array
                                (
                                    [SizeMB] => 61440
                                    [DisplaySize] => 60
                                    [DisplaySuffix] => GB
                                    [Availability] => available
                                    [ServiceClass] => cloud/disk/iscsi/60g
                                )

                            [2] => Array
                                (
                                    [SizeMB] => 81920
                                    [DisplaySize] => 80
                                    [DisplaySuffix] => GB
                                    [Availability] => available
                                    [ServiceClass] => cloud/disk/iscsi/80g
                                )

                            [3] => Array
                                (
                                    [SizeMB] => 102400
                                    [DisplaySize] => 100
                                    [DisplaySuffix] => GB
                                    [Availability] => available
                                    [ServiceClass] => cloud/disk/iscsi/100g
                                )

                            [4] => Array
                                (
                                    [SizeMB] => 256000
                                    [DisplaySize] => 250
                                    [DisplaySuffix] => GB
                                    [Availability] => available
                                    [ServiceClass] => cloud/disk/iscsi/250g
                                )

                            [5] => Array
                                (
                                    [SizeMB] => 512000
                                    [DisplaySize] => 500
                                    [DisplaySuffix] => GB
                                    [Availability] => available
                                    [ServiceClass] => cloud/disk/iscsi/500g
                                )

                            [6] => Array
                                (
                                    [SizeMB] => 768000
                                    [DisplaySize] => 750
                                    [DisplaySuffix] => GB
                                    [Availability] => available
                                    [ServiceClass] => cloud/disk/iscsi/750g
                                )

                            [7] => Array
                                (
                                    [SizeMB] => 1048576
                                    [DisplaySize] => 1
                                    [DisplaySuffix] => TB
                                    [Availability] => available
                                    [ServiceClass] => cloud/disk/iscsi/1t
                                )

                            [8] => Array
                                (
                                    [SizeMB] => 2097152
                                    [DisplaySize] => 2
                                    [DisplaySuffix] => TB
                                    [Availability] => available
                                    [ServiceClass] => cloud/disk/iscsi/2t
                                )

                            [9] => Array
                                (
                                    [SizeMB] => 4194304
                                    [DisplaySize] => 4
                                    [DisplaySuffix] => TB
                                    [Availability] => available
                                    [ServiceClass] => cloud/disk/iscsi/4t
                                )

                        )

                )

        )

    [is_ok] => 1
)

という形で表示される。これは分かりやすい。


おそらく、さくらインターネット側で提供内容が変更された場合、
こちらも変更になるということだな。


ではまた次回。