{"id":2483,"date":"2015-04-15T13:24:59","date_gmt":"2015-04-15T04:24:59","guid":{"rendered":"http:\/\/www.climb.co.jp\/blog_dbmoto\/?p=2483"},"modified":"2017-04-27T09:36:54","modified_gmt":"2017-04-27T00:36:54","slug":"dbmoto-api%e5%a4%96%e9%83%a8%e3%81%8b%e3%82%89%e3%83%ac%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%84%e3%82%b0%e3%83%ab%e3%83%bc%e3%83%97%e3%82%92%e9%96%8b%e5%a7%8b","status":"publish","type":"post","link":"https:\/\/www.climb.co.jp\/blog_dbmoto\/archives\/2483","title":{"rendered":"[DBMoto API]\u5916\u90e8\u304b\u3089\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3084\u30b0\u30eb\u30fc\u30d7\u3092\u958b\u59cb\u30fb\u505c\u6b62\u3059\u308b\u30b5\u30f3\u30d7\u30ebC#\u30d7\u30ed\u30b0\u30e9\u30e0"},"content":{"rendered":"<p>DBMoto API\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001GUI\u30c4\u30fc\u30eb\u3067\u3042\u308bDBMoto Management Center\u304b\u3089\u306e\u64cd\u4f5c\u3067\u306f\u306a\u304f\u3001\u30d0\u30c3\u30c1\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u5916\u90e8\u304b\u3089DBMoto\u306e\u64cd\u4f5c\u3092\u5236\u5fa1\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306fDBMoto\u306e\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b8\u30e7\u30d6\u3084\u30b0\u30eb\u30fc\u30d7\u30b8\u30e7\u30d6\u3092\u5916\u90e8\u304b\u3089\u5236\u5fa1\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<br \/>\n\u3053\u308c\u3089\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u4efb\u610f\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u30b8\u30e7\u30d6\u3092\u5b9f\u884c\u30fb\u505c\u6b62\u3057\u305f\u308a\u3001\u4ed6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u306e\u9023\u643a\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2><span style=\"text-decoration: underline;\"><strong>\u25cf\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u6709\u52b9\u5316\u30fb\u7121\u52b9\u5316\u3059\u308b\u30b5\u30f3\u30d7\u30ebC#\u30d7\u30ed\u30b0\u30e9\u30e0<\/strong><\/span><\/h2>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Text;\r\nusing HiTSoftware.DBMoto.Application;\r\nusing HiTSoftware.DBMoto.ObjectModel;\r\n\r\nnamespace APISamples\r\n{\r\n    public class SampleReplicationAsynch\r\n    {\r\n        public static void Main()\r\n        {\r\n            DBMotoApplication dbmApp = null;\r\n            IServer dbmServer = null;\r\n            IMetadata currentMetadata = null;\r\n\r\n            try\r\n            {\r\n                \/\/ \u521d\u671f\u8a2d\u5b9a\u3001\u30b5\u30fc\u30d0\u63a5\u7d9a\r\n                dbmApp = DBMotoApplication.Instance;\r\n                dbmServer = dbmApp.Servers&#x5B;&quot;local&quot;];\r\n                dbmServer.Connect();\r\n\r\n                \/\/ \u30ab\u30ec\u30f3\u30c8\u30e1\u30bf\u30c7\u30fc\u30bf\u306e\u30ed\u30fc\u30c9\r\n                currentMetadata = dbmServer.Metadatas.DefaultMetadata;\r\n                currentMetadata.Load(true);\r\n\r\n                \/\/ \u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u540d\r\n                IReplication repl = currentMetadata.Replications&#x5B;&quot;Replication&quot;];\r\n\r\n                \/\/ \u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u6709\u52b9\u5316\r\n                if (repl.ReplStatus == ReplStatus.Disabled)\r\n                    repl.AsynchEnable();\r\n\r\n                \/\/ \u5f85\u6a5f\r\n                System.Threading.Thread.Sleep(3000);\r\n\r\n                \/\/ \u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u7121\u52b9\u5316\r\n                if (repl.ReplStatus != ReplStatus.Disabled)\r\n                    repl.AsynchDisable();\r\n\r\n                \/\/ \u5f85\u6a5f\r\n                System.Threading.Thread.Sleep(3000);\r\n            }\r\n            catch (Exception e)\r\n            {\r\n                Console.WriteLine(e.Message);\r\n            }\r\n            finally\r\n            {\r\n                if (currentMetadata != null)\r\n                    currentMetadata.Unload();\r\n                if (dbmServer != null)\r\n                    dbmServer.Disconnect();\r\n                if (dbmApp != null)\r\n                    dbmApp.Dispose();\r\n            }\r\n        }\r\n\r\n    }\r\n}\r\n<\/pre>\n<h2><span style=\"text-decoration: underline;\"><strong>\u25cf\u30b0\u30eb\u30fc\u30d7\u3092\u6709\u52b9\u5316\u30fb\u7121\u52b9\u5316\u3059\u308b\u30b5\u30f3\u30d7\u30ebC#\u30d7\u30ed\u30b0\u30e9\u30e0<\/strong><\/span><\/h2>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Text;\r\nusing HiTSoftware.DBMoto.Application;\r\nusing HiTSoftware.DBMoto.ObjectModel;\r\n\r\nnamespace APISamples\r\n{\r\n    public class SampleGroupAsynch\r\n    {\r\n        public static void Main()\r\n        {\r\n            DBMotoApplication dbmApp = null;\r\n            IServer dbmServer = null;\r\n            IMetadata currentMetadata = null;\r\n\r\n            try\r\n            {\r\n                \/\/ \u521d\u671f\u8a2d\u5b9a\u3001\u30b5\u30fc\u30d0\u63a5\u7d9a\r\n                dbmApp = DBMotoApplication.Instance;\r\n                dbmServer = dbmApp.Servers&#x5B;&quot;local&quot;];\r\n                dbmServer.Connect();\r\n\r\n                \/\/ \u30ab\u30ec\u30f3\u30c8\u30e1\u30bf\u30c7\u30fc\u30bf\u306e\u30ed\u30fc\u30c9\r\n                currentMetadata = dbmServer.Metadatas.DefaultMetadata;\r\n                currentMetadata.Load(true);\r\n\r\n                \/\/ \u30b0\u30eb\u30fc\u30d7\u540d\r\n                IGroup group = currentMetadata.Groups&#x5B;&quot;Group&quot;];\r\n\r\n                \/\/ \u30b0\u30eb\u30fc\u30d7\u6709\u52b9\u5316\r\n                if (group.ReplStatus == ReplStatus.Disabled)\r\n                    group.AsynchEnable();\r\n\r\n                \/\/ \u5f85\u6a5f\r\n                System.Threading.Thread.Sleep(3000);\r\n\r\n                \/\/ \u30b0\u30eb\u30fc\u30d7\u7121\u52b9\u5316\r\n                if (group.ReplStatus != ReplStatus.Disabled)\r\n                    group.AsynchDisable();\r\n\r\n                \/\/ \u5f85\u6a5f\r\n                System.Threading.Thread.Sleep(3000);\r\n            }\r\n            catch (Exception e)\r\n            {\r\n                Console.WriteLine(e.Message);\r\n            }\r\n            finally\r\n            {\r\n                if (currentMetadata != null)\r\n                    currentMetadata.Unload();\r\n                if (dbmServer != null)\r\n                    dbmServer.Disconnect();\r\n                if (dbmApp != null)\r\n                    dbmApp.Dispose();\r\n            }\r\n        }\r\n\r\n    }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>DBMoto API\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001GUI\u30c4\u30fc\u30eb\u3067\u3042\u308bDBMoto Management Center\u304b\u3089\u306e\u64cd\u4f5c\u3067\u306f\u306a\u304f\u3001\u30d0\u30c3\u30c1\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u5916\u90e8\u304b\u3089DBMoto\u306e\u64cd\u4f5c\u3092\u5236\u5fa1\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002 \u3053\u3053\u3067\u306fDBMoto &hellip; <a href=\"https:\/\/www.climb.co.jp\/blog_dbmoto\/archives\/2483\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2483","post","type-post","status-publish","format-standard","hentry","category-syniti"],"_links":{"self":[{"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/posts\/2483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/comments?post=2483"}],"version-history":[{"count":3,"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/posts\/2483\/revisions"}],"predecessor-version":[{"id":3299,"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/posts\/2483\/revisions\/3299"}],"wp:attachment":[{"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/media?parent=2483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/categories?post=2483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/tags?post=2483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}